Remove unnecessary method calls by direct access to the field
Change-Id: If4420b9667ef30ec6a341124a8672b45f315cfb1
Showing
2 changed files
with
5 additions
and
5 deletions
... | @@ -97,7 +97,7 @@ public final class ContinuousResource implements Resource { | ... | @@ -97,7 +97,7 @@ public final class ContinuousResource implements Resource { |
97 | 97 | ||
98 | @Override | 98 | @Override |
99 | public int hashCode() { | 99 | public int hashCode() { |
100 | - return Objects.hash(id(), value); | 100 | + return Objects.hash(id, value); |
101 | } | 101 | } |
102 | 102 | ||
103 | @Override | 103 | @Override |
... | @@ -109,7 +109,7 @@ public final class ContinuousResource implements Resource { | ... | @@ -109,7 +109,7 @@ public final class ContinuousResource implements Resource { |
109 | return false; | 109 | return false; |
110 | } | 110 | } |
111 | final ContinuousResource other = (ContinuousResource) obj; | 111 | final ContinuousResource other = (ContinuousResource) obj; |
112 | - return Objects.equals(this.id(), other.id()) | 112 | + return Objects.equals(this.id, other.id) |
113 | && Objects.equals(this.value, other.value); | 113 | && Objects.equals(this.value, other.value); |
114 | } | 114 | } |
115 | 115 | ... | ... |
... | @@ -80,7 +80,7 @@ public final class DiscreteResource implements Resource { | ... | @@ -80,7 +80,7 @@ public final class DiscreteResource implements Resource { |
80 | public DiscreteResource child(Object child) { | 80 | public DiscreteResource child(Object child) { |
81 | checkArgument(!(child instanceof Class<?>)); | 81 | checkArgument(!(child instanceof Class<?>)); |
82 | 82 | ||
83 | - return new DiscreteResource(id().child(child)); | 83 | + return new DiscreteResource(id.child(child)); |
84 | } | 84 | } |
85 | 85 | ||
86 | @Override | 86 | @Override |
... | @@ -96,7 +96,7 @@ public final class DiscreteResource implements Resource { | ... | @@ -96,7 +96,7 @@ public final class DiscreteResource implements Resource { |
96 | @Override | 96 | @Override |
97 | public int hashCode() { | 97 | public int hashCode() { |
98 | // the value returing from volume() is excluded due to optimization | 98 | // the value returing from volume() is excluded due to optimization |
99 | - return id().hashCode(); | 99 | + return id.hashCode(); |
100 | } | 100 | } |
101 | 101 | ||
102 | @Override | 102 | @Override |
... | @@ -109,7 +109,7 @@ public final class DiscreteResource implements Resource { | ... | @@ -109,7 +109,7 @@ public final class DiscreteResource implements Resource { |
109 | } | 109 | } |
110 | final DiscreteResource other = (DiscreteResource) obj; | 110 | final DiscreteResource other = (DiscreteResource) obj; |
111 | // the value returing from volume() is excluded due to optimization | 111 | // the value returing from volume() is excluded due to optimization |
112 | - return Objects.equals(this.id(), other.id()); | 112 | + return Objects.equals(this.id, other.id); |
113 | } | 113 | } |
114 | 114 | ||
115 | @Override | 115 | @Override | ... | ... |
-
Please register or login to post a comment