Skip to content

Commit

Permalink
Various small cleanups, primarily removing methods and fields that ar…
Browse files Browse the repository at this point in the history
…e deprecated and unused.

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=61965318
  • Loading branch information
blickly committed Feb 26, 2014
1 parent a4ab4f2 commit ae5f1d7
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 211 deletions.
71 changes: 0 additions & 71 deletions src/com/google/javascript/jscomp/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,17 +363,6 @@ protected void reconcileOptionsWithGuards() {
}
}

/**
* Initializes the instance state needed for a compile job.
* @deprecated Convert your arrays to lists and use the list-based API.
*/
@Deprecated
public void init(JSSourceFile[] externs, JSSourceFile[] inputs,
CompilerOptions options) {
init(Lists.<JSSourceFile>newArrayList(externs),
Lists.<JSSourceFile>newArrayList(inputs), options);
}

/**
* Initializes the instance state needed for a compile job.
*/
Expand All @@ -389,18 +378,6 @@ public <T1 extends SourceFile, T2 extends SourceFile> void init(
initModules(externs, Lists.newArrayList(module), options);
}

/**
* Initializes the instance state needed for a compile job if the sources
* are in modules.
* @deprecated Convert your arrays to lists and use the list-based API.
*/
@Deprecated
public void init(JSSourceFile[] externs, JSModule[] modules,
CompilerOptions options) {
initModules(Lists.<SourceFile>newArrayList(externs),
Lists.<JSModule>newArrayList(modules), options);
}

/**
* Initializes the instance state needed for a compile job if the sources
* are in modules.
Expand Down Expand Up @@ -565,40 +542,6 @@ public Result compile(
return compile(Lists.newArrayList(extern), Lists.newArrayList(input), options);
}

/**
* @deprecated Convert your arrays to lists and use the list-based API.
*/
@Deprecated
public Result compile(
SourceFile extern, JSSourceFile[] input, CompilerOptions options) {
return compile(Lists.newArrayList(extern), Lists.newArrayList(input), options);
}

/**
* @deprecated Convert your arrays to lists and use the list-based
* compileModules method.
*/
@Deprecated
public Result compile(
JSSourceFile extern, JSModule[] modules, CompilerOptions options) {
return compileModules(
Lists.newArrayList(extern), Lists.newArrayList(modules), options);
}

/**
* Compiles a list of inputs.
* @deprecated Convert your arrays to lists and use the list-based compile
* method.
*/
@Deprecated
public Result compile(JSSourceFile[] externs,
JSSourceFile[] inputs,
CompilerOptions options) {
return compile(Lists.<SourceFile>newArrayList(externs),
Lists.<SourceFile>newArrayList(inputs),
options);
}

/**
* Compiles a list of inputs.
*/
Expand All @@ -620,20 +563,6 @@ public <T1 extends SourceFile, T2 extends SourceFile> Result compile(
}
}

/**
* Compiles a list of modules.
* @deprecated Convert your arrays to lists and use the list-based
* compileModules method.
*/
@Deprecated
public Result compile(JSSourceFile[] externs,
JSModule[] modules,
CompilerOptions options) {
return compileModules(Lists.<SourceFile>newArrayList(externs),
Lists.<JSModule>newArrayList(modules),
options);
}

/**
* Compiles a list of modules.
*/
Expand Down
25 changes: 0 additions & 25 deletions src/com/google/javascript/jscomp/CompilerOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

import java.io.Serializable;
import java.nio.charset.Charset;
import java.text.ParseException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -1375,14 +1374,6 @@ public void setInlineProperties(boolean enable) {
inlineProperties = enable;
}

/**
* Set the variable removal policy for the compiler.
*/
@Deprecated
public void setRemoveUnusedVariable(Reach reach) {
setRemoveUnusedVariables(reach);
}

/**
* Set the variable removal policy for the compiler.
*/
Expand Down Expand Up @@ -1415,10 +1406,6 @@ public void setReplaceStringsConfiguration(
Lists.newArrayList(functionDescriptors);
}

@Deprecated
public void setRewriteNewDateGoogNow(boolean rewrite) {
}

public void setRemoveAbstractMethods(boolean remove) {
this.removeAbstractMethods = remove;
}
Expand Down Expand Up @@ -1989,22 +1976,10 @@ public void setInputAnonymousFunctionNamingMap(VariableMap inputMap) {
this.inputAnonymousFunctionNamingMap = inputMap;
}

@Deprecated
public void setInputVariableMapSerialized(byte[] inputVariableMapSerialized)
throws ParseException {
this.inputVariableMap = VariableMap.fromBytes(inputVariableMapSerialized);
}

public void setInputVariableMap(VariableMap inputVariableMap) {
this.inputVariableMap = inputVariableMap;
}

@Deprecated
public void setInputPropertyMapSerialized(byte[] inputPropertyMapSerialized)
throws ParseException {
this.inputPropertyMap = VariableMap.fromBytes(inputPropertyMapSerialized);
}

public void setInputPropertyMap(VariableMap inputPropertyMap) {
this.inputPropertyMap = inputPropertyMap;
}
Expand Down
97 changes: 0 additions & 97 deletions src/com/google/javascript/jscomp/JSSourceFile.java

This file was deleted.

1 change: 0 additions & 1 deletion src/com/google/javascript/jscomp/NodeTraversal.java
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,6 @@ private void traverseFunction(Node n, Node parent) {
}

/** Examines the functions stack for the last instance of a function node. */
@SuppressWarnings("unchecked")
public Node getEnclosingFunction() {
if (scopes.size() + scopeRoots.size() < 2) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/ScopedAliases.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ private void findAliases(NodeTraversal t) {
} else if (v.isBleedingFunction()) {
// Bleeding functions already get a BAD_PARAMETERS error, so just
// do nothing.
} else if (parent.getType() == Token.LP) {
} else if (parent.getType() == Token.PARAM_LIST) {
// Parameters of the scope function also get a BAD_PARAMETERS
// error.
} else if (isVar || isFunctionDecl) {
Expand Down
6 changes: 0 additions & 6 deletions src/com/google/javascript/jscomp/WhitelistWarningsGuard.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ public WhitelistBuilder setNote(String note) {
return this;
}

/** We now always record the line number. */
@Deprecated
public WhitelistBuilder setWithLineNumber(boolean line) {
return this;
}

@Override
public void report(CheckLevel level, JSError error) {
warnings.add(error);
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/fuzzing/SwitchFuzzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected Node generate(int budget, Set<Type> types) {
if (numCases > 0) {
int defaultClauseIndex = context.random.nextInt(numCases);
fuzzers[defaultClauseIndex + 1] =
new CaseFuzzer(context, Token.DEFAULT);
new CaseFuzzer(context, Token.DEFAULT_CASE);
}
Scope localScope = context.scopeManager.localScope();
localScope.switchNesting++;
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/parsing/NewIRFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ private void validateTypeAnnotations(Node n) {
case Token.CATCH:
case Token.FUNCTION:
case Token.VAR:
case Token.LP:
case Token.PARAM_LIST:
valid = true;
break;
}
Expand Down
8 changes: 0 additions & 8 deletions src/com/google/javascript/rhino/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,6 @@ public class Token {
LC = 309, // left curly braces
COLON = 310;

// Transitional definitions
// TODO(johnlenz): remove these
public final static int
DEFAULT = DEFAULT_CASE,
GET = GETTER_DEF,
LP = PARAM_LIST,
SET = SETTER_DEF;

public static String name(int token) {
switch (token) {
case ERROR: return "ERROR";
Expand Down

0 comments on commit ae5f1d7

Please sign in to comment.