Skip to content

Commit

Permalink
BZ-1031306: fixing NPE for puzzle HARD 1
Browse files Browse the repository at this point in the history
  • Loading branch information
etirelli committed Nov 16, 2013
1 parent cbd15c9 commit 4684c4a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 56 deletions.
Expand Up @@ -263,7 +263,7 @@ public void innerEval(LeftInputAdapterNode liaNode,
for ( int i = ++smemIndex, length = smems.length; i < length; i++ ) {
if (log.isTraceEnabled()) {
int offset = getOffset(node);
log.trace("{} Skip Segment {}", indent(offset), smemIndex-1);
log.trace("{} Skip Segment {}", indent(offset), i-1);
}

// this is needed for subnetworks that feed into a parent network that has no right inputs,
Expand All @@ -281,7 +281,9 @@ public void innerEval(LeftInputAdapterNode liaNode,
if ( !emptySrcTuples ||
smem.getDirtyNodeMask() != 0 ||
(NodeTypeEnums.isBetaNode(node) && ((BetaNode)node).isRightInputIsRiaNode() )) {
// break if dirty or if we reach a subnetwork. It must break for subnetworks, so they can be searched.
foundDirty = true;
smemIndex = i;
break;
}
}
Expand Down
Expand Up @@ -135,7 +135,8 @@ public String valueAsString() {
}

public String posAsString(){
return "[" + cellRow.getNumber() + "," + cellCol.getNumber() + "]";
return "[" + ( cellRow != null ? cellRow.getNumber() : "null" ) + "," +
( cellCol != null ? cellCol.getNumber() : "null" ) + "]";
}

}
Expand Up @@ -297,7 +297,7 @@ public void setCellValues(Integer[][] cellValues) {
this.counter = new Counter(initial);
this.session.insert(counter);
this.session.delete(fh000);
this.session.fireUntilHalt();
this.session.fireAllRules();
}

/*
Expand Down
Expand Up @@ -210,7 +210,8 @@ public void actionPerformed(ActionEvent ev){

} else if (ev.getSource() instanceof JMenuItem) {
JMenuItem menuItem = (JMenuItem) ev.getSource();
sudoku.setCellValues(SudokuGridSamples.getInstance().getSample(menuItem.getText()));
Integer[][] sample = SudokuGridSamples.getInstance().getSample(menuItem.getText());
sudoku.setCellValues(sample);
sudoku.validate();
buttonsActive(true);
} else {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion drools-examples/src/main/resources/logback.xml
Expand Up @@ -9,7 +9,7 @@
</encoder>
</appender>

<logger name="org.drools" level="debug"/>
<logger name="org.drools" level="trace"/>

<root level="warn">
<appender-ref ref="consoleAppender" />
Expand Down

0 comments on commit 4684c4a

Please sign in to comment.