Skip to content

Commit

Permalink
[incubator-kie-issues#814] Fix NPE on BaseKnowledgeBuilderResultImpl.…
Browse files Browse the repository at this point in the history
…hashCode() (apache#3346)

Co-authored-by: BAMOE CI <[email protected]>
  • Loading branch information
2 people authored and rgdoliveira committed Jan 17, 2024
1 parent 5269d13 commit 2b4563c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,8 @@ public class DuplicateProcess extends ConfigurableSeverityResult {
public static final String KEY = "duplicateProcess";
private static final int[] line = new int[0];

private String processId;

public DuplicateProcess(Process process, KnowledgeBuilderConfiguration config) {
super(process.getResource(), config);
processId = process.getId();
}

@Override
public String getMessage() {
return "Process with same id already exists: " + processId;
super(process.getResource(), config, "Process with same id already exists: " + process.getId());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,18 @@
* This is used for reporting errors with loading a ruleflow.
*/
public class ProcessLoadError extends DroolsError {

private String message;
private Exception exception;
private static final int[] lines = new int[0];

public ProcessLoadError(Resource resource, String message, Exception nested) {
super(resource);
this.message = message;
this.exception = nested;
super(resource, getSpecificMessage(message, nested));
}

@Override
public int[] getLines() {
return this.lines;
}

public String getMessage() {
private static String getSpecificMessage(String message, Exception exception) {
if (exception != null) {
return message + " : Exception " + exception.getClass() + " : " + exception.getMessage();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,10 @@ public static class NoBindingQuery extends DroolsError {
private final QueryModel query;

public NoBindingQuery(QueryModel query) {
super("Query " + query.getName() + " has no bound variable. At least one binding is required to determine the value returned by this query");
this.query = query;
}

@Override
public String getMessage() {
return "Query " + query.getName() + " has no bound variable. At least one binding is required to determine the value returned by this query";
}

@Override
public int[] getLines() {
return ERROR_LINES;
Expand Down

0 comments on commit 2b4563c

Please sign in to comment.