Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.40.x] [incubator-kie-issues#814] Fix NPE on BaseKnowledgeBuilderResultImpl hashCode() #3379

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,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 @@ -23,22 +23,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 @@ -209,14 +209,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