Skip to content
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
4 changes: 1 addition & 3 deletions jena-core/src/main/java/org/apache/jena/graph/Node_ANY.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ public int hashCode() {
@Override
public boolean equals(Object other) {
// There is only one such object.
if ( this == other )
return true;
return false;
return this == other;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@ public int hashCode() {
public boolean equals(Object obj) {
if ( this == obj )
return true;
if ( obj == null )
if ( !(obj instanceof Node_Blank other) )
return false;
if ( getClass() != obj.getClass() )
return false;
Node_Blank other = (Node_Blank)obj;
return Objects.equals(label, other.label);
}

Expand Down
5 changes: 1 addition & 4 deletions jena-core/src/main/java/org/apache/jena/graph/Node_Ext.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,8 @@ public int hashCode() {
public boolean equals(Object obj) {
if ( this == obj )
return true;
if ( obj == null )
if ( !( obj instanceof Node_Ext<?> other ) )
return false;
if ( getClass() != obj.getClass() )
return false;
Node_Ext<?> other = (Node_Ext<?>)obj;
return Objects.equals(object, other.object);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ public int hashCode() {
public boolean equals(Object o) {
if ( o == this )
return true;
if ( !(o instanceof Node_Graph) )
if ( !(o instanceof Node_Graph other) )
return false;
Node_Graph other = (Node_Graph)o;
return this.getGraph() == other.getGraph();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,8 @@ public int hashCode()
public boolean equals(Object obj) {
if ( this == obj )
return true;
if ( obj == null )
if ( !( obj instanceof Node_Literal other ) )
return false;
if ( getClass() != obj.getClass() )
return false;
Node_Literal other = (Node_Literal)obj;
return label.equals(other.label);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,8 @@ public int hashCode() {
public boolean equals(Object obj) {
if ( this == obj )
return true;
if ( obj == null )
if ( !( obj instanceof Node_Triple other ) )
return false;
if ( getClass() != obj.getClass() )
return false;
Node_Triple other = (Node_Triple)obj;
return triple.equals(other.triple);
}

Expand Down
5 changes: 1 addition & 4 deletions jena-core/src/main/java/org/apache/jena/graph/Node_URI.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,8 @@ public int hashCode() {
public boolean equals(Object obj) {
if ( this == obj )
return true;
if ( obj == null )
if ( !( obj instanceof Node_URI other ) )
return false;
if ( getClass() != obj.getClass() )
return false;
Node_URI other = (Node_URI)obj;
return uriStr.equals(other.uriStr);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,9 @@ public int hashCode() {
public boolean equals(Object obj) {
if ( this == obj )
return true;
if ( obj == null )
return false;
// For jena-arq Var
if ( ! (obj instanceof Node_Variable) )
if ( ! (obj instanceof Node_Variable other) )
return false;
Node_Variable other = (Node_Variable)obj;
return Objects.equals(varName, other.varName);
}

Expand Down
2 changes: 1 addition & 1 deletion jena-core/src/main/java/org/apache/jena/graph/Triple.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public boolean isConcrete()
*/
@Override
public boolean equals(Object o)
{ return o instanceof Triple && ((Triple) o).sameAs( subj, pred, obj ); }
{ return o instanceof Triple t && t.sameAs( subj, pred, obj ); }

/**
Answer true iff this triple has subject s, predicate p, and object o.
Expand Down