New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle plugin example #2

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@tomasbjerre
Copy link
Owner

tomasbjerre commented Mar 4, 2016

Testing gradle plugin

@tomasbjerre tomasbjerre force-pushed the gradle-plugin-example branch 2 times, most recently from 693610a to 75974d3 Mar 4, 2016

@tomasbjerre tomasbjerre force-pushed the master branch from db271e5 to 207e364 Mar 4, 2016

@tomasbjerre tomasbjerre force-pushed the gradle-plugin-example branch 2 times, most recently from b7db765 to a1ca791 Mar 4, 2016

@tomasbjerre tomasbjerre force-pushed the master branch 2 times, most recently from 1ae9ccf to 01368c4 Mar 5, 2016

@tomasbjerre tomasbjerre force-pushed the gradle-plugin-example branch from a1ca791 to d3dd10e Mar 5, 2016

@tomasbjerre tomasbjerre force-pushed the master branch 3 times, most recently from afd810b to 098e30f Mar 6, 2016

@tomasbjerre tomasbjerre force-pushed the gradle-plugin-example branch 9 times, most recently from 2b05970 to a3902d4 Mar 6, 2016

@@ -12,6 +12,15 @@ void npe(String a, String b) {
a.length();

This comment has been minimized.

@tomasbjerre

tomasbjerre Mar 8, 2016

Author Owner

test comment 0

if (a == null) {
System.out.println();
} else {

This comment has been minimized.

@tomasbjerre

tomasbjerre Mar 8, 2016

Author Owner

test comment 123

@tomasbjerre tomasbjerre force-pushed the gradle-plugin-example branch from 10f3402 to dd09a2c Mar 8, 2016

@tomasbjerre tomasbjerre force-pushed the gradle-plugin-example branch from 58ca67a to b92e6b0 Mar 25, 2016

@tomasbjerre tomasbjerre force-pushed the gradle-plugin-example branch from b92e6b0 to ff59179 Mar 25, 2016

@tomasbjerre tomasbjerre force-pushed the gradle-plugin-example branch from 4c33681 to 9ec6d26 Mar 26, 2016

@tomasbjerre tomasbjerre force-pushed the master branch 2 times, most recently from 6947d28 to 9409670 Oct 1, 2016

@tomasbjerre tomasbjerre force-pushed the master branch from a06971b to 198ad88 Sep 2, 2017

@tomasbjerre

This comment has been minimized.

Copy link
Owner Author

tomasbjerre commented May 13, 2018

Found 4 violations:

Reporter: Checkstyle
Rule: com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck
Severity: INFO
File: /home/bjerre/workspace/violations/violation-comments-to-github-plugin/work/workspace/pipe/src/main/java/se/bjurr/violations/lib/example/MyClass.java L9

Must have at least one statement.


Reporter: Findbugs
Rule: EQ_ALWAYS_TRUE
Severity: ERROR
File: se/bjurr/violations/lib/example/MyClass.java L35
Source: se.bjurr.violations.lib.example.MyClass

equals method always returns true <p> This class defines an equals method that always returns true. This is imaginative, but not very smart. Plus, it means that the equals method is not symmetric. </p>


Reporter: Findbugs
Rule: HE_EQUALS_USE_HASHCODE
Severity: WARN
File: se/bjurr/violations/lib/example/MyClass.java L35
Source: se.bjurr.violations.lib.example.MyClass

Class defines equals() and uses Object.hashCode() <p> This class overrides <code>equals(Object)</code>, but does not override <code>hashCode()</code>, and inherits the implementation of <code>hashCode()</code> from <code>java.lang.Object</code> (which returns the identity hash code, an arbitrary value assigned to the object by the VM).&nbsp; Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes.</p> <p>If you don't think instances of this class will ever be inserted into a HashMap/HashTable, the recommended <code>hashCode</code> implementation to use is:</p> <pre>public int hashCode() { assert false : "hashCode not designed"; return 42; // any arbitrary constant will do }</pre>


Reporter: PMD
Rule: OverrideBothEqualsAndHashcode
Severity: WARN
File: /home/bjerre/workspace/violations/violation-comments-to-github-plugin/work/workspace/pipe/src/main/java/se/bjurr/violations/lib/example/MyClass.java L34

Ensure you override both equals() and hashCode() Basic https://pmd.github.io/pmd-5.6.1/pmd-java/rules/java/basic.html#OverrideBothEqualsAndHashcode


@@ -30,6 +31,6 @@ void npe2(String a, String b) {

@Override
public boolean equals(Object obj) {
return true;
return false;
}

This comment has been minimized.

@tomasbjerre

tomasbjerre May 13, 2018

Author Owner

Reporter: Findbugs
Rule: EQ_ALWAYS_TRUE
Severity: ERROR
File: se/bjurr/violations/lib/example/MyClass.java L35
Source: se.bjurr.violations.lib.example.MyClass

equals method always returns true <p> This class defines an equals method that always returns true. This is imaginative, but not very smart. Plus, it means that the equals method is not symmetric. </p>

@@ -30,6 +31,6 @@ void npe2(String a, String b) {

@Override
public boolean equals(Object obj) {
return true;
return false;
}

This comment has been minimized.

@tomasbjerre

tomasbjerre May 13, 2018

Author Owner

Reporter: Findbugs
Rule: HE_EQUALS_USE_HASHCODE
Severity: WARN
File: se/bjurr/violations/lib/example/MyClass.java L35
Source: se.bjurr.violations.lib.example.MyClass

Class defines equals() and uses Object.hashCode() <p> This class overrides <code>equals(Object)</code>, but does not override <code>hashCode()</code>, and inherits the implementation of <code>hashCode()</code> from <code>java.lang.Object</code> (which returns the identity hash code, an arbitrary value assigned to the object by the VM).&nbsp; Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes.</p> <p>If you don't think instances of this class will ever be inserted into a HashMap/HashTable, the recommended <code>hashCode</code> implementation to use is:</p> <pre>public int hashCode() { assert false : "hashCode not designed"; return 42; // any arbitrary constant will do }</pre>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment