Skip to content

Commit

Permalink
remove FieldDeclaration.replaceType
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomassetti committed Oct 13, 2016
1 parent 0918342 commit 2a42ad3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Expand Up @@ -239,7 +239,8 @@ public FieldDeclaration getField(String name) {
}
for (ReferenceTypeUsage ancestor : getAllAncestors()) {
if (ancestor.getTypeDeclaration().hasField(name)) {
return ancestor.getTypeDeclaration().getField(name).replaceType(ancestor.getFieldType(name).get());
ReflectionFieldDeclaration reflectionFieldDeclaration = (ReflectionFieldDeclaration)ancestor.getTypeDeclaration().getField(name);
return reflectionFieldDeclaration.replaceType(ancestor.getFieldType(name).get());
}
}
throw new UnsolvedSymbolException("Field in " + this, name);
Expand Down
Expand Up @@ -44,7 +44,6 @@ public boolean isField() {
return true;
}

@Override
public FieldDeclaration replaceType(TypeUsage fieldType) {
return new ReflectionFieldDeclaration(field, typeSolver, fieldType);
}
Expand Down
@@ -1,7 +1,5 @@
package me.tomassetti.symbolsolver.model.declarations;

import me.tomassetti.symbolsolver.model.typesystem.TypeUsage;

/**
* Declaration of a field.
*
Expand All @@ -19,8 +17,4 @@ default FieldDeclaration asField() {
return this;
}

@Deprecated
default FieldDeclaration replaceType(TypeUsage fieldType) {
throw new UnsupportedOperationException(this.getClass().getCanonicalName());
}
}

0 comments on commit 2a42ad3

Please sign in to comment.