Suppress/disable some Eclipse unnecessary-code warnings in test code
Often the easiest way to create a desired test scenario is to write code that would make no sense in a complete, realistic application. So we generally want to let test code do oddball things.
This commit is contained in:
parent
5f23949d9f
commit
91b9c9e28b
|
@ -104,7 +104,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.source=1.7
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
public class CastFromNull {
|
public class CastFromNull {
|
||||||
|
@SuppressWarnings({ "cast", "unused" })
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
new CastFromNull();
|
new CastFromNull();
|
||||||
Object x = (Object) null;
|
Object x = (Object) null;
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
package foo.bar.hello.world;
|
package foo.bar.hello.world;
|
||||||
|
|
||||||
public class LoopsAndLabels {
|
public class LoopsAndLabels {
|
||||||
|
@SuppressWarnings({ "cast", "unused" })
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
|
|
||||||
aaa: do {
|
aaa: do {
|
||||||
|
|
|
@ -39,6 +39,7 @@ package foo.bar.hello.world;
|
||||||
|
|
||||||
public class Misc {
|
public class Misc {
|
||||||
|
|
||||||
|
@SuppressWarnings({ "cast", "unused" })
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
if ( "hello" instanceof Object ) {
|
if ( "hello" instanceof Object ) {
|
||||||
System.out.println("strings are objects in java");
|
System.out.println("strings are objects in java");
|
||||||
|
|
|
@ -86,6 +86,7 @@ class Outer {
|
||||||
}
|
}
|
||||||
|
|
||||||
class Outer2 {
|
class Outer2 {
|
||||||
|
@SuppressWarnings("unused")
|
||||||
class Middle<S> {
|
class Middle<S> {
|
||||||
class Inner<T> {
|
class Inner<T> {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue