diff --git a/.travis.yml b/.travis.yml index 149d8e77e4..fc362c5360 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,9 @@ language: java matrix: include: - jdk: oraclejdk7 - script: mvn test deploy --settings .travis-settings.xml + script: + - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && mvn test deploy --settings .travis-settings.xml' + - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] || mvn test' - jdk: oraclejdk8 script: mvn test notifications: diff --git a/do-release.sh b/do-release.sh index 8723c0a5b1..f0e6cf8951 100755 --- a/do-release.sh +++ b/do-release.sh @@ -302,6 +302,7 @@ echo " * Set the title: PMD ${RELEASE_VERSION} ($(date -u +%d-%B-%Y))" echo " * copy/paste the changelog.md" echo " * Upload the binary zip file" echo " * Upload the doc zip file" +echo " * Upload the src zip file" echo echo "Press enter to continue..." read diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/optimizations/RedundantFieldInitializerRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/optimizations/RedundantFieldInitializerRule.java index 3fc599ffb6..f9d18882f5 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/optimizations/RedundantFieldInitializerRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/optimizations/RedundantFieldInitializerRule.java @@ -100,7 +100,7 @@ public class RedundantFieldInitializerRule extends AbstractJavaRule { value = (int) literal.getImage().charAt(1); } - if (value.intValue() == 0) { + if (value.longValue() == 0) { addViolation(data, variableDeclarator); } } diff --git a/pmd-java/src/main/resources/rulesets/java/controversial.xml b/pmd-java/src/main/resources/rulesets/java/controversial.xml index 822bdeed3d..7009d9f2a4 100644 --- a/pmd-java/src/main/resources/rulesets/java/controversial.xml +++ b/pmd-java/src/main/resources/rulesets/java/controversial.xml @@ -278,7 +278,8 @@ public class Foo { class="net.sourceforge.pmd.lang.rule.XPathRule" externalInfoUrl="${pmd.website.baseurl}/rules/java/controversial.html#DefaultPackage"> -Use explicit scoping instead of the default package private level. +Use explicit scoping instead of accidental usage of default package private level. +The rule allows methods and fields annotated with Guava's @VisibleForTesting. 3 diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/optimizations/xml/RedundantFieldInitializer.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/optimizations/xml/RedundantFieldInitializer.xml index 268dbab4f0..ad2450bc61 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/optimizations/xml/RedundantFieldInitializer.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/optimizations/xml/RedundantFieldInitializer.xml @@ -1292,4 +1292,14 @@ public class Bar { } + + + #1418 RedundantFieldInitializer false positive with large long value + 0 + + diff --git a/src/site/markdown/overview/changelog-old.md b/src/site/markdown/overview/changelog-old.md index b57c81f344..07a0782762 100644 --- a/src/site/markdown/overview/changelog-old.md +++ b/src/site/markdown/overview/changelog-old.md @@ -4,6 +4,34 @@ Previous versions of PMD can be downloaded here: http://sourceforge.net/projects/pmd/files/pmd/ +## 04-October-2015 - 5.3.5 + +**Modified Rules:** + +* java-design/CloseResource: New Property *closeAsDefaultTarget* which is *true* by default to stay + backwards compatible. If this property is *true*, the rule will make sure, that `close` itself is + always considered as a *closeTarget* - no matter whether it is configured with the *closeTargets* property + or not. + +**Pull Requests:** + +* [#71](https://github.com/pmd/pmd/pull/71): #1410 Improve description of DefaultPackage rule + +**Bugfixes:** + +* java-controversial/DefaultPackage: + * [#1410](https://sourceforge.net/p/pmd/bugs/1410/): DefaultPackage triggers on field annotated with @VisibleForTesting +* java-design/CloseResource: + * [#1387](https://sourceforge.net/p/pmd/bugs/1387/): CloseResource has false positive for ResultSet +* java-optimizations/RedundantFieldInitializer + * [#1418](https://sourceforge.net/p/pmd/bugs/1418/): RedundantFieldInitializer false positive with large long value +* java-strings/InsufficientStringBufferDeclaration: + * [#1409](https://sourceforge.net/p/pmd/bugs/1409/): NullPointerException in InsufficientStringBufferRule + * [#1413](https://sourceforge.net/p/pmd/bugs/1413/): False positive StringBuffer constructor with ?: int value +* java-unnecessary/UselessParentheses: + * [#1407](https://sourceforge.net/p/pmd/bugs/1407/): UselessParentheses "&" and "+" operator precedence + + ## 18-September-2015 - 5.3.4 **Bugfixes:**