-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #9523: Update MissingOverrideCheckTest to use unique input file…
…s in each test method
- Loading branch information
Showing
15 changed files
with
476 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
.../checkstyle/checks/annotation/missingoverride/InputMissingOverrideBadAnnotationJava5.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.puppycrawl.tools.checkstyle.checks.annotation.missingoverride; | ||
|
||
/* Config: | ||
* javaFiveCompatibility = "true" | ||
*/ | ||
public class InputMissingOverrideBadAnnotationJava5 | ||
{ | ||
Runnable r = new Runnable() { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public void run() { // ok | ||
Throwable t = new Throwable() { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public String toString() { // ok | ||
return "junk"; | ||
} | ||
}; | ||
} | ||
}; | ||
|
||
void doFoo(Runnable r) { | ||
doFoo(new Runnable() { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public void run() { // ok | ||
Throwable t = new Throwable() { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public String toString() { // ok | ||
return "junk"; | ||
} | ||
}; | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...yle/checks/annotation/missingoverride/InputMissingOverrideBadOverrideFromObjectJava5.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.puppycrawl.tools.checkstyle.checks.annotation.missingoverride; | ||
|
||
/* Config: | ||
* javaFiveCompatibility = "true" | ||
*/ | ||
public class InputMissingOverrideBadOverrideFromObjectJava5 | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public boolean equals(Object obj) { // violation | ||
return false; | ||
} | ||
|
||
/** | ||
* {@inheritDoc no violation} | ||
* | ||
* @inheritDocs} | ||
* | ||
* {@inheritDoc | ||
*/ | ||
public int hashCode() { | ||
return 1; | ||
} | ||
|
||
class Junk { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected void finalize() throws Throwable {} // violation | ||
} | ||
} | ||
|
||
interface HashEq2Java5 { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public int hashCode(); // violation | ||
} | ||
|
||
enum enum3Java5 { | ||
B; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public String toString() { // violation | ||
return "B"; | ||
} | ||
|
||
private static void test() {} | ||
} |
Oops, something went wrong.