Skip to content

Commit 575b180

Browse files
committed
Remove NameOccurrence::isRoutineReference
1 parent 5d8054e commit 575b180

File tree

4 files changed

+4
-41
lines changed

4 files changed

+4
-41
lines changed

delphi-frontend/src/main/java/au/com/integradev/delphi/symbol/occurrence/NameOccurrenceImpl.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public class NameOccurrenceImpl implements NameOccurrence {
3232
private NameDeclaration declaration;
3333
private String image;
3434
private boolean isExplicitInvocation;
35-
private boolean isRoutineReference;
3635
private boolean isGeneric;
3736
private List<Type> typeParameters = Collections.emptyList();
3837

@@ -80,15 +79,6 @@ public boolean isExplicitInvocation() {
8079
return isExplicitInvocation;
8180
}
8281

83-
public void setIsRoutineReference() {
84-
this.isRoutineReference = true;
85-
}
86-
87-
@Override
88-
public boolean isRoutineReference() {
89-
return isRoutineReference;
90-
}
91-
9282
public void setIsGeneric() {
9383
this.isGeneric = true;
9484
}
@@ -123,7 +113,6 @@ public boolean equals(Object o) {
123113
}
124114
NameOccurrenceImpl that = (NameOccurrenceImpl) o;
125115
return isExplicitInvocation == that.isExplicitInvocation
126-
&& isRoutineReference == that.isRoutineReference
127116
&& isGeneric == that.isGeneric
128117
&& location.equals(that.location)
129118
&& Objects.equals(declaration, that.declaration)
@@ -133,13 +122,7 @@ public boolean equals(Object o) {
133122
@Override
134123
public int hashCode() {
135124
return Objects.hash(
136-
location,
137-
declaration,
138-
image,
139-
isExplicitInvocation,
140-
isRoutineReference,
141-
isGeneric,
142-
typeParameters);
125+
location, declaration, image, isExplicitInvocation, isGeneric, typeParameters);
143126
}
144127

145128
@Override

delphi-frontend/src/main/java/au/com/integradev/delphi/symbol/resolve/NameResolver.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,6 @@ void disambiguateRoutineReference(ProceduralType procedure) {
10251025

10261026
if (bestDeclaration != null) {
10271027
declarations.add(bestDeclaration);
1028-
Iterables.getLast(names).setIsRoutineReference();
10291028
}
10301029
}
10311030

@@ -1037,7 +1036,6 @@ void disambiguateAddressOfRoutineReference() {
10371036
if (first != null) {
10381037
declarations.clear();
10391038
declarations.add(first);
1040-
Iterables.getLast(names).setIsRoutineReference();
10411039
}
10421040
}
10431041

delphi-frontend/src/main/java/org/sonar/plugins/communitydelphi/api/symbol/NameOccurrence.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public interface NameOccurrence {
3333

3434
boolean isExplicitInvocation();
3535

36-
boolean isRoutineReference();
37-
3836
boolean isAttributeReference();
3937

4038
boolean isGeneric();

delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/occurrence/NameOccurrenceImplTest.java

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@
3030
import org.sonar.plugins.communitydelphi.api.type.TypeFactory;
3131

3232
class NameOccurrenceImplTest {
33-
@Test
34-
void testIsRoutineReference() {
35-
SymbolicNode symbolicNode = SymbolicNode.imaginary("Foo", DelphiScope.unknownScope());
36-
NameOccurrenceImpl occurrence = new NameOccurrenceImpl(symbolicNode);
37-
38-
assertThat(occurrence.isRoutineReference()).isFalse();
39-
40-
occurrence.setIsRoutineReference();
41-
42-
assertThat(occurrence.isRoutineReference()).isTrue();
43-
}
44-
4533
@Test
4634
void testIsGeneric() {
4735
SymbolicNode symbolicNode = SymbolicNode.imaginary("Foo", DelphiScope.unknownScope());
@@ -81,20 +69,16 @@ void testEquals() {
8169
assertThat(occurrenceA).isNotEqualTo(occurrenceD);
8270

8371
NameOccurrenceImpl occurrenceE = new NameOccurrenceImpl(foo);
84-
occurrenceE.setIsRoutineReference();
72+
occurrenceE.setIsGeneric();
8573
assertThat(occurrenceA).isNotEqualTo(occurrenceE);
8674

8775
NameOccurrenceImpl occurrenceF = new NameOccurrenceImpl(foo);
88-
occurrenceF.setIsGeneric();
76+
occurrenceF.setNameDeclaration(mock(NameDeclaration.class));
8977
assertThat(occurrenceA).isNotEqualTo(occurrenceF);
9078

9179
NameOccurrenceImpl occurrenceG = new NameOccurrenceImpl(foo);
92-
occurrenceG.setNameDeclaration(mock(NameDeclaration.class));
80+
occurrenceG.setTypeArguments(List.of(TypeFactory.unknownType()));
9381
assertThat(occurrenceA).isNotEqualTo(occurrenceG);
94-
95-
NameOccurrenceImpl occurrenceI = new NameOccurrenceImpl(foo);
96-
occurrenceI.setTypeArguments(List.of(TypeFactory.unknownType()));
97-
assertThat(occurrenceA).isNotEqualTo(occurrenceI);
9882
}
9983

10084
@Test

0 commit comments

Comments
 (0)