Skip to content

Commit

Permalink
Remove JavaSourceParser
Browse files Browse the repository at this point in the history
This class is only used by the typemodel for reading parameter names,
but as written it can only ever return null - the parser is never
populated with resources, so must always return null.
  • Loading branch information
niloc132 committed Jan 12, 2025
1 parent b9d1d99 commit df37b83
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 531 deletions.
319 changes: 0 additions & 319 deletions dev/core/src/com/google/gwt/dev/javac/JavaSourceParser.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public abstract class JAbstractMethod implements

private List<JParameter> params = Lists.create();

private String[] realParameterNames = null;

private List<JClassType> thrownTypes = Lists.create();

private List<JTypeParameter> typeParams = Lists.create();
Expand Down Expand Up @@ -255,20 +253,11 @@ void addThrows(JClassType type) {

// Called only by a JParameter, passing itself as a reference for lookup.
String getRealParameterName(JParameter parameter) {
if (realParameterNames == null) {
fetchRealParameterNames();
}
int n = params.size();
for (int i = 0; i < n; ++i) {
// Identity tests are ok since identity is durable within an oracle.
if (params.get(i) == parameter) {
String realParameterName;
if (realParameterNames == null) {
realParameterName = StringInterner.get().intern("arg" + i);
} else {
realParameterName = StringInterner.get().intern(realParameterNames[i]);
}
return realParameterName;
return StringInterner.get().intern("arg" + i);
}
}
// TODO: report error if we are asked for an unknown JParameter?
Expand All @@ -294,9 +283,4 @@ boolean hasParamTypes(JType[] paramTypes) {
void setVarArgs() {
isVarArgs = true;
}

private void fetchRealParameterNames() {
realParameterNames = getEnclosingType().getOracle().getJavaSourceParser().getArguments(
this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.gwt.core.ext.typeinfo.NotFoundException;
import com.google.gwt.core.ext.typeinfo.ParseException;
import com.google.gwt.core.ext.typeinfo.TypeOracleException;
import com.google.gwt.dev.javac.JavaSourceParser;
import com.google.gwt.dev.jjs.InternalCompilerException;
import com.google.gwt.dev.util.Name;
import com.google.gwt.dev.util.collect.HashMap;
Expand Down Expand Up @@ -248,8 +247,6 @@ private static List<String> modifierBitsToNamesForMethodsAndFields(int bits) {
*/
private JClassType javaScriptObject;

private final JavaSourceParser javaSourceParser = new JavaSourceParser();

/**
* Maps SingleJsoImpl interfaces to the implementing JSO subtype.
*/
Expand Down Expand Up @@ -665,10 +662,6 @@ void finish() {
recentTypes.clear();
}

JavaSourceParser getJavaSourceParser() {
return javaSourceParser;
}

private List<JClassType> classChain(JClassType cls) {
LinkedList<JClassType> chain = new LinkedList<JClassType>();
while (cls != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public static Test suite() {
suite.addTestSuite(CompilationUnitFileReferenceTest.class);
suite.addTestSuite(CompiledClassTest.class);
suite.addTestSuite(GWTProblemTest.class);
suite.addTestSuite(JavaSourceParserTest.class);
suite.addTestSuite(JdtBehaviorTest.class);
suite.addTestSuite(JdtCompilerTest.class);
suite.addTestSuite(Java7JdtCompilerTest.class);
Expand Down
Loading

0 comments on commit df37b83

Please sign in to comment.