[jboss-jira] [JBoss JIRA] (DROOLS-506) Example project: massive number of code quality / correctness warnings

Peter Horvath (JIRA) issues at jboss.org
Tue May 27 04:41:56 EDT 2014


     [ https://issues.jboss.org/browse/DROOLS-506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Horvath updated DROOLS-506:
---------------------------------

    Attachment: eclipse_warnings.png


Screenshot of Eclipse displaying warnings found in Drools example projects

> Example project: massive number of code quality / correctness warnings
> ----------------------------------------------------------------------
>
>                 Key: DROOLS-506
>                 URL: https://issues.jboss.org/browse/DROOLS-506
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>            Reporter: Peter Horvath
>            Assignee: Mark Proctor
>         Attachments: eclipse_warnings.png
>
>
> 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: 
> {code:title=org.drools.examples.cashflow.CashFlowMain|borderStyle=solid}
> public class CashFlowMain {
>     public static void main(String[] args) throws Exception {
>         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
> {code}
> yields {color:red}WARNING: The value of the local variable sdf is not used {color}
> {code:title=org.drools.examples.sudoku.Sudoku.dumpGrid()|borderStyle=solid}
>     /**
>      * Nice printout of the grid.
>      */
>     public void dumpGrid() {
>         Formatter fmt = new Formatter(System.out);
> {code}
> yields {color:red}WARNING: Resource leak: 'fmt' is never closed {color} 
> {code:title=org.drools.games.pong.PongUI|borderStyle=solid}
> 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 {
> {code}
> yields {color:red}WARNING: The import java.awt.event.KeyEvent is never used {color} \\
> {color:red}WARNING: The import java.awt.event.KeyListener is never used {color} \\
> {color:red}WARNING: The import java.awt.event.MouseEvent is never used {color} \\
> {color:red}WARNING: The import java.awt.event.MouseListener is never used {color} \\
> {color:red}WARNING: The import java.awt.image.BufferedImage is never used {color} \\
> {color:red}WARNING: The import javax.swing.* is never used {color} \\
> {color:red}WARNING: The import org.kie.internal.runtime.StatefulKnowledgeSession is never used {color} \\
> {color:red}WARNING: The import org.kie.api.runtime.rule.FactHandle is never used {color} \\
> {color:red}WARNING: The import org.kie.api.runtime.rule.EntryPoint is never used {color} \\
> etc



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the jboss-jira mailing list