-
Bug
-
Resolution: Done
-
Trivial
-
None
-
None
-
None
The Drools example project contains code snippets that yield warnings: while I absolutely understand that resources are limited and examples might not be the priority and the core code of the engine is of good quality, I do think it is important to display dedication to high quality products.
Having an example project full of code quality issues just gives a very bad first impression of the whole Drools project...
Examples:
public class CashFlowMain { public static void main(String[] args) throws Exception { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
yields WARNING: The value of the local variable sdf is not used
/** * Nice printout of the grid. */ public void dumpGrid() { Formatter fmt = new Formatter(System.out);
yields WARNING: Resource leak: 'fmt' is never closed
import java.awt.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.font.FontRenderContext; import java.awt.font.TextLayout; import java.awt.image.BufferedImage; import javax.swing.*; import org.drools.games.GameConfiguration; import org.drools.games.GameUI; import org.kie.api.runtime.KieSession; import org.kie.internal.runtime.StatefulKnowledgeSession; import org.kie.api.runtime.rule.FactHandle; import org.kie.api.runtime.rule.EntryPoint; public class PongUI extends GameUI {
yields WARNING: The import java.awt.event.KeyEvent is never used
WARNING: The import java.awt.event.KeyListener is never used
WARNING: The import java.awt.event.MouseEvent is never used
WARNING: The import java.awt.event.MouseListener is never used
WARNING: The import java.awt.image.BufferedImage is never used
WARNING: The import javax.swing.* is never used
WARNING: The import org.kie.internal.runtime.StatefulKnowledgeSession is never used
WARNING: The import org.kie.api.runtime.rule.FactHandle is never used
WARNING: The import org.kie.api.runtime.rule.EntryPoint is never used
etc