Merge pull request #16063 from nik9000/xlint_plan_a

Fix warnings in lang-plan-a
This commit is contained in:
Nik Everett 2016-01-18 16:21:13 -05:00
commit cf166b54aa
4 changed files with 41 additions and 42 deletions

View File

@ -35,9 +35,6 @@ dependencyLicenses {
mapping from: /asm-.*/, to: 'asm'
}
compileJava.options.compilerArgs << '-Xlint:-cast,-rawtypes'
compileTestJava.options.compilerArgs << '-Xlint:-unchecked'
// regeneration logic, comes in via ant right now
// don't port it to gradle, it works fine.

View File

@ -1255,7 +1255,7 @@ class Definition {
" [" + name + "] within the same struct [" + owner.name + "].");
}
final Class[] classes = new Class[args.length];
final Class<?>[] classes = new Class<?>[args.length];
for (int count = 0; count < classes.length; ++count) {
if (genargs != null) {
@ -1343,7 +1343,7 @@ class Definition {
" [" + args.length + "] within the struct [" + owner.name + "].");
}
final Class[] classes = new Class[args.length];
final Class<?>[] classes = new Class<?>[args.length];
for (int count = 0; count < classes.length; ++count) {
if (genargs != null) {

View File

@ -157,7 +157,7 @@ public class Utility {
}
public static Character byteToCharacter(final byte value) {
return (char)(byte)value;
return (char)value;
}
public static Integer byteToInteger(final byte value) {
@ -193,7 +193,7 @@ public class Utility {
}
public static Character shortToCharacter(final short value) {
return (char)(short)value;
return (char)value;
}
public static Integer shortToInteger(final short value) {
@ -261,19 +261,19 @@ public class Utility {
}
public static int CharacterToint(final Character value) {
return (int)value;
return value;
}
public static long CharacterTolong(final Character value) {
return (long)value;
return value;
}
public static float CharacterTofloat(final Character value) {
return (float)value;
return value;
}
public static double CharacterTodouble(final Character value) {
return (double)value;
return value;
}
public static Boolean CharacterToBoolean(final Character value) {
@ -317,7 +317,7 @@ public class Utility {
}
public static Character intToCharacter(final int value) {
return (char)(int)value;
return (char)value;
}
public static Long intToLong(final int value) {
@ -353,7 +353,7 @@ public class Utility {
}
public static Character longToCharacter(final long value) {
return (char)(long)value;
return (char)value;
}
public static Integer longToInteger(final long value) {
@ -389,7 +389,7 @@ public class Utility {
}
public static Character floatToCharacter(final float value) {
return (char)(float)value;
return (char)value;
}
public static Integer floatToInteger(final float value) {
@ -425,7 +425,7 @@ public class Utility {
}
public static Character doubleToCharacter(final double value) {
return (char)(double)value;
return (char)value;
}
public static Integer doubleToInteger(final double value) {

View File

@ -35,6 +35,7 @@ public class ScriptEngineTests extends ScriptTestCase {
assertEquals(3, ((Number)value).intValue());
}
@SuppressWarnings("unchecked") // We know its Map<String, Object> because we put them there in the test
public void testMapAccess() {
Map<String, Object> vars = new HashMap<>();
Map<String, Object> obj2 = new HashMap<>();
@ -54,6 +55,7 @@ public class ScriptEngineTests extends ScriptTestCase {
assertEquals("2", value);
}
@SuppressWarnings("unchecked") // We know its Map<String, Object> because we put them there ourselves
public void testAccessListInScript() {
Map<String, Object> vars = new HashMap<>();
Map<String, Object> obj2 = new HashMap<>();