Genericese screwed my code

It converted

public static Boolean not(Object o) {
if (o instanceof Boolean) {
Boolean b = (Boolean)o;
return b.booleanValue() ? Boolean.FALSE : Boolean.TRUE;
} else {
return o == null ? Boolean.TRUE : Boolean.FALSE;
}
}

to

public static Boolean not(Boolean o) {
if (o instanceof Boolean) {
Boolean b = o;
return b.booleanValue() ? Boolean.FALSE : Boolean.TRUE;
} else {
return o == null ? Boolean.TRUE : Boolean.FALSE;
}
}




1 comment
Comment actions Permalink

There are also bunch of other cases where Genericized changed method
signatures (parameters and return types) so erased signature does not match
origibal one

e.g

public Object activate(String name) throws IOException {
return activate(getAbsoluteFile(name));
}

public Object activate(String className, String fileExt) throws
IOException {
return activate(getRelativePath(className, fileExt));
}

has been changed to

public Key activate(String name) throws IOException {
return activate(getAbsoluteFile(name));
}

public Key activate(String className, String fileExt) throws IOException {
return activate(getRelativePath(className, fileExt));
}

where ke is actually a private nested class

"Alex Roytman" <nospam@hello.world> wrote in message
news:dbmpae$21v$1@is.intellij.net...

It converted

>

public static Boolean not(Object o) {
if (o instanceof Boolean) {
Boolean b = (Boolean)o;
return b.booleanValue() ? Boolean.FALSE : Boolean.TRUE;
} else {
return o == null ? Boolean.TRUE : Boolean.FALSE;
}
}

>

to

>

public static Boolean not(Boolean o) {
if (o instanceof Boolean) {
Boolean b = o;
return b.booleanValue() ? Boolean.FALSE : Boolean.TRUE;
} else {
return o == null ? Boolean.TRUE : Boolean.FALSE;
}
}

>
>
>



0

Please sign in to leave a comment.