aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcushon <cushon@google.com>2019-07-10 10:50:39 -0700
committerRon Shapiro <shapiro.rd@gmail.com>2019-07-11 14:45:24 -0400
commit7154f7d5463c76fc93ac163733e20f843e2dc1e7 (patch)
tree0f5c49906e0410c75391f9515154a4f06802231e
parentd8ab5c829ea3b232b49571a9761604fe8d617eff (diff)
downloadturbine-7154f7d5463c76fc93ac163733e20f843e2dc1e7.tar.gz
Fix MethodCanBeStatic findings
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=257436949
-rw-r--r--java/com/google/turbine/binder/ConstEvaluator.java8
-rw-r--r--java/com/google/turbine/binder/ModuleBinder.java4
-rw-r--r--java/com/google/turbine/binder/bytecode/BytecodeBoundClass.java2
-rw-r--r--java/com/google/turbine/parse/Parser.java4
-rw-r--r--java/com/google/turbine/parse/StreamLexer.java2
-rw-r--r--java/com/google/turbine/types/Canonicalize.java8
6 files changed, 14 insertions, 14 deletions
diff --git a/java/com/google/turbine/binder/ConstEvaluator.java b/java/com/google/turbine/binder/ConstEvaluator.java
index 4496e49..0caa958 100644
--- a/java/com/google/turbine/binder/ConstEvaluator.java
+++ b/java/com/google/turbine/binder/ConstEvaluator.java
@@ -383,7 +383,7 @@ public strictfp class ConstEvaluator {
}
}
- private Value unaryNegate(Value expr) {
+ private static Value unaryNegate(Value expr) {
switch (expr.constantTypeKind()) {
case BOOLEAN:
return new Const.BooleanValue(!expr.asBoolean().value());
@@ -392,7 +392,7 @@ public strictfp class ConstEvaluator {
}
}
- private Value bitwiseComp(Value expr) {
+ private static Value bitwiseComp(Value expr) {
expr = promoteUnary(expr);
switch (expr.constantTypeKind()) {
case INT:
@@ -404,7 +404,7 @@ public strictfp class ConstEvaluator {
}
}
- private Value unaryPlus(Value expr) {
+ private static Value unaryPlus(Value expr) {
expr = promoteUnary(expr);
switch (expr.constantTypeKind()) {
case INT:
@@ -420,7 +420,7 @@ public strictfp class ConstEvaluator {
}
}
- private Value unaryMinus(Value expr) {
+ private static Value unaryMinus(Value expr) {
expr = promoteUnary(expr);
switch (expr.constantTypeKind()) {
case INT:
diff --git a/java/com/google/turbine/binder/ModuleBinder.java b/java/com/google/turbine/binder/ModuleBinder.java
index ed2d496..565ad68 100644
--- a/java/com/google/turbine/binder/ModuleBinder.java
+++ b/java/com/google/turbine/binder/ModuleBinder.java
@@ -179,11 +179,11 @@ public class ModuleBinder {
return new RequireInfo(moduleName, flags, requires != null ? requires.version() : null);
}
- private ExportInfo bindExports(ModExports directive) {
+ private static ExportInfo bindExports(ModExports directive) {
return new ExportInfo(directive.packageName(), directive.moduleNames());
}
- private OpenInfo bindOpens(ModOpens directive) {
+ private static OpenInfo bindOpens(ModOpens directive) {
return new OpenInfo(directive.packageName(), directive.moduleNames());
}
diff --git a/java/com/google/turbine/binder/bytecode/BytecodeBoundClass.java b/java/com/google/turbine/binder/bytecode/BytecodeBoundClass.java
index cc20267..4ce5bd5 100644
--- a/java/com/google/turbine/binder/bytecode/BytecodeBoundClass.java
+++ b/java/com/google/turbine/binder/bytecode/BytecodeBoundClass.java
@@ -500,7 +500,7 @@ public class BytecodeBoundClass implements BoundClass, HeaderBoundClass, TypeBou
}
});
- private RetentionPolicy bindRetention(AnnotationInfo annotation) {
+ private static RetentionPolicy bindRetention(AnnotationInfo annotation) {
ElementValue val = annotation.elementValuePairs().get("value");
if (val.kind() != Kind.ENUM) {
return null;
diff --git a/java/com/google/turbine/parse/Parser.java b/java/com/google/turbine/parse/Parser.java
index 6b4fb8f..4e56e83 100644
--- a/java/com/google/turbine/parse/Parser.java
+++ b/java/com/google/turbine/parse/Parser.java
@@ -348,7 +348,7 @@ public class Parser {
return new ModDecl(pos, annos, open, moduleName, directives.build());
}
- private String flatname(char join, ImmutableList<Ident> idents) {
+ private static String flatname(char join, ImmutableList<Ident> idents) {
StringBuilder sb = new StringBuilder();
boolean first = true;
for (Ident ident : idents) {
@@ -938,7 +938,7 @@ public class Parser {
return ty;
}
- private Type extraDims(Type type, Deque<ImmutableList<Anno>> extra) {
+ private static Type extraDims(Type type, Deque<ImmutableList<Anno>> extra) {
if (extra.isEmpty()) {
return type;
}
diff --git a/java/com/google/turbine/parse/StreamLexer.java b/java/com/google/turbine/parse/StreamLexer.java
index 5e26373..3b8c7dc 100644
--- a/java/com/google/turbine/parse/StreamLexer.java
+++ b/java/com/google/turbine/parse/StreamLexer.java
@@ -1024,7 +1024,7 @@ public class StreamLexer implements Lexer {
return makeIdent(stringValue());
}
- private Token makeIdent(String s) {
+ private static Token makeIdent(String s) {
switch (s) {
case "abstract":
return Token.ABSTRACT;
diff --git a/java/com/google/turbine/types/Canonicalize.java b/java/com/google/turbine/types/Canonicalize.java
index a58ccab..277aa13 100644
--- a/java/com/google/turbine/types/Canonicalize.java
+++ b/java/com/google/turbine/types/Canonicalize.java
@@ -277,7 +277,7 @@ public class Canonicalize {
}
/** Instantiates a type argument using the given mapping. */
- private Type instantiate(Map<TyVarSymbol, Type> mapping, Type type) {
+ private static Type instantiate(Map<TyVarSymbol, Type> mapping, Type type) {
if (type == null) {
return null;
}
@@ -304,7 +304,7 @@ public class Canonicalize {
}
}
- private Type instantiateWildTy(Map<TyVarSymbol, Type> mapping, WildTy type) {
+ private static Type instantiateWildTy(Map<TyVarSymbol, Type> mapping, WildTy type) {
switch (type.boundKind()) {
case NONE:
return type;
@@ -318,7 +318,7 @@ public class Canonicalize {
throw new AssertionError(type.boundKind());
}
- private Type instantiateClassTy(Map<TyVarSymbol, Type> mapping, ClassTy type) {
+ private static Type instantiateClassTy(Map<TyVarSymbol, Type> mapping, ClassTy type) {
ImmutableList.Builder<SimpleClassTy> simples = ImmutableList.builder();
for (SimpleClassTy simple : type.classes()) {
ImmutableList.Builder<Type> args = ImmutableList.builder();
@@ -335,7 +335,7 @@ public class Canonicalize {
* reference, or else {@code null}.
*/
@Nullable
- private TyVarSymbol tyVarSym(Type type) {
+ private static TyVarSymbol tyVarSym(Type type) {
if (type.tyKind() == TyKind.TY_VAR) {
return ((TyVar) type).sym();
}