Skip to content

Commit

Permalink
[refactor] Suppress unchecked warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed Oct 15, 2018
1 parent db0243a commit b1f078e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ final class Static {
private Static() {
}

@SafeVarargs
public static <Element_Type extends ImmediateArgument, Argument_Type> List<Element_Type> createSequence(Class<Element_Type> elementType,
final Class<Argument_Type> argumentType, @SuppressWarnings("unchecked") Argument_Type... values) throws NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException {
final List<Element_Type> result = new ArrayList<Element_Type>();
final Class<Argument_Type> argumentType,
Argument_Type... values) throws NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException {
final List<Element_Type> result = new ArrayList<>();
final Constructor<Element_Type> elementConstructor = elementType.getConstructor(argumentType);
for (Argument_Type value : values) {
result.add(elementConstructor.newInstance(value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ protected String asIdentifier(EnumerableArgument argument) {
return argument.getClass().getSimpleName() + "." + argument.name();
}

protected <Argument_Type extends Enum<Argument_Type> & EnumerableArgument<Argument_Type>> void printModVariant(IndentWriter writer, final Template_Type template, @SuppressWarnings("unchecked") Argument_Type... arguments) {
@SafeVarargs
protected final <Argument_Type extends Enum<Argument_Type> & EnumerableArgument<Argument_Type>> void printModVariant(IndentWriter writer, final Template_Type template, Argument_Type... arguments) {
final Class argumentType = arguments[0].getClass();
final X86Parameter parameter = getParameter(template, argumentType);
writer.print("if (");
Expand Down Expand Up @@ -227,7 +228,8 @@ private void printSibByte(IndentWriter writer, Template_Type template) {
writer.println();
}

protected <Argument_Type extends Enum<Argument_Type> & EnumerableArgument<Argument_Type>> void printSibVariant(IndentWriter writer, Template_Type template, @SuppressWarnings("unchecked") Argument_Type... arguments) {
@SafeVarargs
protected final <Argument_Type extends Enum<Argument_Type> & EnumerableArgument<Argument_Type>> void printSibVariant(IndentWriter writer, Template_Type template, Argument_Type... arguments) {
final Class argumentType = arguments[0].getClass();
final X86Parameter parameter = getParameter(template, argumentType);
writer.print("if (");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public final class InspectionViews extends AbstractInspectionHolder {
* The kinds of VM inspection views that can be activated (made visible).
*
*/
@SuppressWarnings("unchecked")
public enum ViewKind {
ALLOCATIONS(true, false, "Regions of memory allocated by the VM") {

Expand Down
4 changes: 2 additions & 2 deletions mx.maxine/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"write": "git@github.com:beehive-lab/Maxine-VM.git",
},
"outputRoot": "./",
"javac.lint.overrides": "-rawtypes,-serial,-fallthrough,-unchecked",
"javac.lint.overrides": "-rawtypes,-serial,-fallthrough",

"imports": {
"suites": [
Expand Down Expand Up @@ -286,7 +286,7 @@
"checkstyle": "com.sun.max",
"TestProject": True,
"javaCompliance": "1.8",
"javac.lint.overrides": "-rawtypes,-serial,-fallthrough,-unchecked,-finally",
"javac.lint.overrides": "-rawtypes,-serial,-fallthrough,-finally",
},

"com.oracle.max.vma.tools": {
Expand Down

0 comments on commit b1f078e

Please sign in to comment.