forked from phoedos/pmd
http://www.netbeans.org/issues/show_bug.cgi?id=72215 - NPE when a rule has no example
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4192 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
- fixed NPE when scanning is on (http://www.netbeans.org/issues/show_bug.cgi?id=72017)
|
||||
- fixed some bugs
|
||||
http://www.netbeans.org/issues/show_bug.cgi?id=72017
|
||||
http://www.netbeans.org/issues/show_bug.cgi?id=72215
|
||||
|
||||
Version 1.5
|
||||
- Updated pmd to version 3.5
|
||||
|
@ -432,24 +432,26 @@ public class RuleEnabler extends JPanel implements TableModelListener {
|
||||
}
|
||||
}//GEN-LAST:event_availableListMouseClicked
|
||||
|
||||
/**
|
||||
* Update text of example and information fields, and rule properties.
|
||||
*/
|
||||
private void updateTexts(Rule rule) {
|
||||
if( rule != null ) {
|
||||
String exampleText = REGEX.substitute( REGEX_EXAMPLE, rule.getExample() );
|
||||
if (exampleText.startsWith( "\n" )) {
|
||||
// Probably REGEX_EXAMPLE should have taken care of this, but it did not?!
|
||||
exampleText = exampleText.substring( 1 );
|
||||
}
|
||||
example.setText( exampleText );
|
||||
example.setCaretPosition( 0 );
|
||||
information.setText( REGEX.substitute( REGEX_INFORMATION, rule.getDescription().trim() ) );
|
||||
information.setCaretPosition( 0 );
|
||||
updatePropertiesModel( rule );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update text of example and information fields, and rule properties.
|
||||
*/
|
||||
private void updateTexts(Rule rule) {
|
||||
if( rule != null ) {
|
||||
String exampleText = rule.getExample() != null?
|
||||
REGEX.substitute( REGEX_EXAMPLE, rule.getExample() ):
|
||||
"";
|
||||
if (exampleText.startsWith( "\n" )) {
|
||||
// Probably REGEX_EXAMPLE should have taken care of this, but it did not?!
|
||||
exampleText = exampleText.substring( 1 );
|
||||
}
|
||||
example.setText( exampleText );
|
||||
example.setCaretPosition( 0 );
|
||||
information.setText( REGEX.substitute( REGEX_INFORMATION, rule.getDescription().trim() ) );
|
||||
information.setCaretPosition( 0 );
|
||||
updatePropertiesModel( rule );
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when the user selects a value in the chosenList
|
||||
* @param evt the event fired
|
||||
*/
|
||||
|
Reference in New Issue
Block a user