Merge branch 'master' into docs-metrics

This commit is contained in:
oowekyala
2017-07-25 10:11:15 +02:00
470 changed files with 22298 additions and 7016 deletions

View File

@ -1,5 +1,6 @@
sudo: false
sudo: required
services:
- docker
addons:
apt:
packages:
@ -23,15 +24,19 @@ env:
- secure: "JIhuqaI0i+zvuqqXiQBHpuKr7AQ8jfk6Gbr8Qgiq4yJtdEWXZGxnAT9BmlbjkgT7ABXvLgxf2CIdUOMo1yYfBlxQL/y5+e89jaVpYF3tvNAzYQ1e12VzQRsd/jDb7qvm7tw3rDHEn3dSEot7Q6KbPcL6WzWJINVMCCmOgvq9gKHgE6Y5q5EgZ5rxiXyuO27ndzcbxaor4PIaiSzHO9+AJQ7p2zDLP+kG4nKVTBX0l9VoKiYFhIpIhpbigi3jyLDMDRiWpwTWZC6P8/RXfZg/lc5ADOuM2DM8oXPpZuqOa/g31LWQOSCuEnQ1G16vbLgipSPpgAc7jYWD5cywhG9dLkiKaZDh5x0meLM2RoAgz6eAnQfTTqJ68OM9o9yXjubEedsNpNRAr9/DXMd+fbh10W2vbvL5HCNB3lic3anehhR9le7PLuEKxg654wXt3KM2PZGVWbotIyBK0CvGzqGkppvwT23QdDDqSdkWuGQIhGQ0xBOdYkwebycxP5wwPUmObG+mymQ1Be2BXvmghttsiJdKlt4CVSYOJUMus6kU32G95hdTgKblsX4J1Of2i1nYsjyMKh3k945tqXwQrIsxOOQug0oIkz24zlLaOaQcorWtJ6Y1HPaZKpVIFUEF0y8Uq/O4oB2bOYC6WDUQfpj7nRG6xbi+BeBS84m1ttCEk4g="
matrix:
- BUILD=deploy
- BUILD=site
- BUILD=doc
- BUILD=sonar
- BUILD=coveralls
matrix:
fast_finish: true
before_install:
- bash .travis/setup-secrets.sh
- bash .travis/configure-maven.sh
install: true
before_script: true
script: bash .travis/build-$BUILD.sh
script: source .travis/build-$BUILD.sh
after_success: true

View File

@ -1,43 +0,0 @@
#
# Helper functions to run a chatty, long task in the background,
# redirecting the output to file and keep travis happy by regularly
# writing to the log.
#
# This is to workaround the travis log length limit of 4MB
# Solution from http://stackoverflow.com/questions/26082444/how-to-work-around-travis-cis-4mb-output-limit/26082445#26082445
#
# Source this file into the shell script, that needs it.
#
# expected variables
# Name | Example Value
# PING_SLEEP | 30s
# BUILD_OUTPUT | /tmp/build-step-logfile.out
# PING_PID_FILE | /tmp/build-step-ping.pid
touch $BUILD_OUTPUT
dump_output() {
echo Tailing the last 100 lines of output:
tail -100 $BUILD_OUTPUT
}
kill_ping() {
if [ -e $PING_PID_FILE ]; then
PING_LOOP_PID=$(cat $PING_PID_FILE)
kill $PING_LOOP_PID
rm $PING_PID_FILE
fi
}
error_handler() {
kill_ping
echo ERROR: An error was encountered with the build.
dump_output
exit 1
}
# If an error occurs, run our error handler to output a tail of the build
trap 'error_handler' ERR
# Set up a repeating loop to send some output to Travis.
bash -c "while true; do echo \$(date) - building ...; sleep $PING_SLEEP; done" &
PING_LOOP_PID=$!
echo "$PING_LOOP_PID" > $PING_PID_FILE

View File

@ -0,0 +1,16 @@
#!/bin/bash
set -e
source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
echo "Building PMD Coveralls.io report ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then
echo "Not proceeding, since this is not a push!"
exit 0
fi
travis_wait ./mvnw -q clean test jacoco:report coveralls:report -Pcoveralls

40
.travis/build-doc.sh Normal file
View File

@ -0,0 +1,40 @@
#!/bin/bash
set -e
source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
echo "Building PMD Documentation ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then
echo "Not building site, since this is not a push!"
exit 0
fi
cd docs
# run jekyll
echo -e "\n\nBuilding documentation using jekyll...\n\n"
export JEKYLL_VERSION=3.5
docker run --rm \
--volume=$PWD:/srv/jekyll \
-it jekyll/jekyll:$JEKYLL_VERSION \
jekyll build
# create pmd-doc archive
echo -e "\n\nCreating pmd-doc archive...\n\n"
mv _site pmd-doc-${VERSION}
zip -qr pmd-doc-${VERSION}.zip pmd-doc-${VERSION}/
# Uploading pmd doc distribution to sourceforge
if [[ "$TRAVIS_TAG" != "" || "$VERSION" == *-SNAPSHOT ]]; then
echo -e "\n\nUploading pmd-doc archive to sourceforge...\n\n"
rsync -avh target/pmd-doc-${VERSION}.zip ${PMD_SF_USER}@web.sourceforge.net:/home/frs/project/pmd/pmd/${VERSION}/
fi
# rsync site to pmd.sourceforge.net/snapshot
if [[ "$VERSION" == *-SNAPSHOT && "$TRAVIS_BRANCH" == "master" ]]; then
echo -e "\n\nUploading snapshot site...\n\n"
travis_wait rsync -ah --stats --delete target/pmd-doc-${VERSION}/ ${PMD_SF_USER}@web.sourceforge.net:/home/project-web/pmd/htdocs/snapshot/
fi

View File

@ -12,25 +12,19 @@ if ! travis_isPush; then
fi
(
# Run the build, truncate output due to Travis log limits
export PING_SLEEP=30s
export BUILD_OUTPUT=/tmp/build-site.out
export PING_PID_FILE=/tmp/build-site-ping.pid
echo -e "\n\nExecuting ./mvnw install..."
travis_wait ./mvnw install -DskipTests=true -B -V -q
echo "Finished executing ./mvnw install"
source .travis/background-job-funcs.sh
echo -e "\n\nExecuting ./mvnw site site:stage...
travis_wait 40 ./mvnw site site:stage -DskipTests=true -Psite -B -V -q
echo "Finished executing ./mvnw site site:stage..."
)
# Run the build, redirect output into the file
./mvnw install -DskipTests=true -B -V >> $BUILD_OUTPUT 2>&1
./mvnw site site:stage -Psite -B -V >> $BUILD_OUTPUT 2>&1
# The build finished without returning an error so dump a tail of the output
dump_output
# nicely terminate the ping output loop
kill_ping
# create pmd-doc archive
echo -e "\n\nCreating pmd-doc archive...\n\n"
(
cd target
mv staging pmd-doc-${VERSION}
@ -42,8 +36,9 @@ if [[ "$TRAVIS_TAG" != "" || "$VERSION" == *-SNAPSHOT ]]; then
rsync -avh target/pmd-doc-${VERSION}.zip ${PMD_SF_USER}@web.sourceforge.net:/home/frs/project/pmd/pmd/${VERSION}/
fi
if [[ "$VERSION" == *-SNAPSHOT && "$TRAVIS_BRANCH" == "master" ]]; then
# Uploading snapshot site...
rsync -ah --stats --delete target/pmd-doc-${VERSION}/ ${PMD_SF_USER}@web.sourceforge.net:/home/project-web/pmd/htdocs/snapshot/
fi
(
if [[ "$VERSION" == *-SNAPSHOT && "$TRAVIS_BRANCH" == "master" ]]; then
echo -e "\n\nUploading snapshot site...\n\n"
travis_wait rsync -ah --stats --delete target/pmd-doc-${VERSION}/ ${PMD_SF_USER}@web.sourceforge.net:/home/project-web/pmd/htdocs/snapshot/
fi
)

View File

@ -12,18 +12,6 @@ if ! travis_isPush; then
fi
export PING_SLEEP=30s
export BUILD_OUTPUT=/tmp/build-sonar.out
export PING_PID_FILE=/tmp/build-sonar-ping.pid
source .travis/background-job-funcs.sh
# Run the build, redirect output into the file
./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=${SONAR_TOKEN} -B -V >> $BUILD_OUTPUT 2>&1
# The build finished without returning an error so dump a tail of the output
dump_output
# nicely terminate the ping output loop
kill_ping
# Run the build, truncate output due to Travis log limits
travis_wait ./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=${SONAR_TOKEN} -B -V -q

View File

@ -2,6 +2,6 @@
set -e
echo "MAVEN_OPTS='-Xms1g -Xmx1g'" > $HOME/.mavenrc
mkdir -p .m2
mkdir -p $HOME/.m2
cp .travis/travis-toolchains.xml $HOME/.m2/toolchains.xml
cp .travis/travis-settings.xml $HOME/.m2/settings.xml

View File

@ -2,11 +2,11 @@
set -e
echo "BUILD: $BUILD"
RELEASE_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
echo "RELEASE_VERSION: $RELEASE_VERSION"
if [ "${BUILD}" = "deploy" ]; then
RELEASE_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
# Deploy to ossrh has already been done with the usual build. See build-deploy.sh
# The site has been built before, the files have already been uploaded to sourceforge.

View File

@ -2,6 +2,7 @@
[![Build Status](https://travis-ci.org/pmd/pmd.svg?branch=master)](https://travis-ci.org/pmd/pmd)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd)
[![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg)](https://coveralls.io/github/pmd/pmd)
## About

View File

@ -1,5 +1,8 @@
#!/bin/bash
# Make sure, everything is English...
export LANG=C.UTF8
# verify the current directory
if [ ! -f pom.xml -o ! -d ../pmd.github.io ]; then
echo "You seem to be in the wrong working directory or you don't have pmd.github.io checked out..."
@ -26,8 +29,15 @@ RELEASE_VERSION=${CURRENT_VERSION%-SNAPSHOT}
MAJOR=$(echo $RELEASE_VERSION | cut -d . -f 1)
MINOR=$(echo $RELEASE_VERSION | cut -d . -f 2)
PATCH=$(echo $RELEASE_VERSION | cut -d . -f 3)
NEXT_MINOR=$(expr ${MINOR} + 1)
DEVELOPMENT_VERSION="$MAJOR.$NEXT_MINOR.0"
if [ "$PATCH" == "0" ]; then
NEXT_MINOR=$(expr ${MINOR} + 1)
NEXT_PATCH="0"
else
# this is a bugfixing release
NEXT_MINOR="${MINOR}"
NEXT_PATCH=$(expr ${PATCH} + 1)
fi
DEVELOPMENT_VERSION="$MAJOR.$NEXT_MINOR.$NEXT_PATCH"
DEVELOPMENT_VERSION="${DEVELOPMENT_VERSION}-SNAPSHOT"
# http://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch

View File

@ -1,5 +1,8 @@
repository: pmd/pmd
pmd:
version: 6.0.0
output: web
# this property is useful for conditional filtering of content that is separate from the PDF.
@ -12,7 +15,7 @@ site_title: PMD Source Code Analyzer
company_name: PMD Open Source Project
# this appears in the footer
github_editme_path: adangel/pmd/blob/docs-ghpages/docs/
github_editme_path: pmd/pmd/blob/master/docs/
# if you're using Github, provide the basepath to the branch you've created for reviews, following the sample here. if not, leave this value blank.
disqus_shortname:
@ -34,7 +37,7 @@ feedback_subject_line: PMD Source Code Analyzer
feedback_email:
# used as a contact email for the Feedback link in the top navigation bar
# feedback_disable: true
feedback_disable: true
# if you uncomment the previous line, the Feedback link gets removed
# feedback_text: "Need help?"

View File

@ -4,7 +4,7 @@
entries:
- title: sidebar
product: PMD Project
version: 5.7.0
version: "!PMD_VERSION!"
folders:
- title:
@ -28,19 +28,46 @@ entries:
output: web, pdf
type: homepage
- title: Getting Started
url: /pmd_getting_started.html
url: /pmd_userdocs_getting_started.html
output: web, pdf
- title: Understanding Rulesets
url: /pmd_understanding_rulesets.html
url: /pmd_userdocs_understanding_rulesets.html
output: web, pdf
- title: Best Pratices
url: /pmd_best_practices.html
url: /pmd_userdocs_best_practices.html
output: web, pdf
- title: Copy-Paste Detection
url: /pmd_userdocs_cpd.html
output: web, pdf
- title: Suppressing
url: /pmd_userdocs_suppressing.html
output: web, pdf
- title: Tools / Integrations
url: /pmd_tools.html
url: /pmd_userdocs_tools.html
output: web, pdf
- title: FAQ
url: /pmd_userdocs_faq.html
output: web, pdf
- title: Getting Help
url: /pmd_help.html
url: /pmd_userdocs_help.html
output: web, pdf
- title: PMD in the press
url: /pmd_userdocs_news.html
output: web, pdf
- title: Products/books related to PMD
url: /pmd_userdocs_products.html
output: web, pdf
- title: Similar Projects
url: /pmd_userdocs_similarprojects.html
output: web, pdf
- title: License
url: /license.html
output: web, pdf
- title: Credits
url: /pmd_userdocs_credits.html
output: web, pdf
- title: What does 'PMD' mean?
url: /pmd_userdocs_meaning.html
output: web, pdf
- title: Rule Reference
output: web, pdf
@ -51,6 +78,27 @@ entries:
- title: Java Rules
url: /pmd_rules_java.html
output: web, pdf
- title: JavaScript Rules
url: /pmd_rules_javascript.html
output: web, pdf
- title: JSP Rules
url: /pmd_rules_jsp.html
output: web, pdf
- title: PLSQL Rules
url: /pmd_rules_plsql.html
output: web, pdf
- title: Apache Velocity Rules
url: /pmd_rules_vm.html
output: web, pdf
- title: XML and XSL Rules
url: /pmd_rules_xml.html
output: web, pdf
- title: Language Specific Documentation
output: web, pdf
folderitems:
- title: JSP Support
url: /pmd_languages_jsp.html
output: web, pdf
- title: Developer Documentation
output: web, pdf
folderitems:
@ -108,35 +156,3 @@ entries:
- title: Adding a New CPD Language
url: /pmd_devdocs_adding_new_cpd_language.html
output: web, pdf
- title: Release Notes
output: web, pdf
folderitems:
- title: 5.7.0 Release Notes
url: /2017-05-20-release-notes-5-7-0.html
output: web, pdf
- title: 5.6.1 Release Notes
url: /2017-04-29-release-notes-5-6-1.html
output: web, pdf
- title: 5.6.0 Release Notes
url: /2017-04-22-release-notes-5-6-0.html
output: web, pdf
- title: 5.5.7 Release Notes
url: /2017-04-29-release-notes-5-5-7.html
output: web, pdf
- title: 5.5.6 Release Notes
url: /2017-04-19-release-notes-5-5-6.html
output: web, pdf
- title: 5.5.5 Release Notes
url: /2017-03-27-release-notes-5-5-5.html
output: web, pdf
- title: 5.5.0 Release Notes
url: /2016-06-25-release-notes-5-5-0.html
output: web, pdf
- title: 5.4.2 Release Notes
url: /2016-05-29-release-notes-5-4-2.html
output: web, pdf
- title: 5.4.1 Release Notes
url: /2015-12-04-release-notes-5-4-1.html
output: web, pdf

View File

@ -3,8 +3,6 @@
topnav:
- title: Topnav
items:
- title: News
url: /news
- title: Download
external_url: https://github.com/pmd/pmd/releases/latest
- title: Fork us on github

View File

@ -24,7 +24,8 @@
<script src="{{ "js/toc.js" }}"></script>
<script src="{{ "js/customscripts.js" }}"></script>
<link rel="shortcut icon" href="{{ "images/favicon.ico" }}">
<link rel="shortcut icon" href="{{ "images/favicon.ico" }}" type="image/x-icon">
<link rel="icon" href="{{ "images/favicon.ico" }}" type="image/x-icon">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

View File

@ -1,7 +1,7 @@
{% include custom/sidebarconfigs.html %}
<ul id="mysidebar" class="nav">
<li class="sidebarTitle">{{sidebar[0].product}} {{sidebar[0].version}}</li>
<li class="sidebarTitle">{{sidebar[0].product}} {{sidebar[0].version | replace: '!PMD_VERSION!', site.pmd.version}}</li>
{% for entry in sidebar %}
{% for folder in entry.folders %}
{% if folder.output contains "web" %}

View File

@ -41,7 +41,7 @@ layout: default
{% if site.github_editme_path %}
<a target="_blank" href="https://github.com/{{site.github_editme_path}}{% unless page.url contains "index.html" %}pages/{% endunless %}{{page.folder}}{{page.url | remove: ".html" | append: ".md"}}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
<a target="_blank" href="https://github.com/{{site.github_editme_path}}{{page.path}}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
{% endif %}

View File

@ -1,71 +0,0 @@
---
title: Release Notes 5.3.7
tags: [release_notes]
keywords: release notes, announcements, what's new, new features
last_updated: April 30, 2015
summary: "Version 5.3.7 of the PMD Open Source Project, released April 30, 2015."
sidebar: pmd_sidebar
permalink: 2015-03-30-release-notes-5-3-7.html
---
## New Supported Languages
* CPD supports now Swift (see [PR#33](https://github.com/adangel/pmd/pull/33)).
## Feature Request and Improvements
* A JSON-renderer for PMD which is compatible with CodeClimate. See [PR#83](https://github.com/pmd/pmd/pull/83).
## Modified Rules
* java-design/UseVargs: public static void main method is ignored now and so are methods, that are annotated with Override. See [PR#79](https://github.com/pmd/pmd/pull/79).
## Pull Requests
* [#27](https://github.com/adangel/pmd/pull/27): Added support for Raw String Literals (C++11).
* [#29](https://github.com/adangel/pmd/pull/29): Added support for files with UTF-8 BOM to JSP tokenizer.
* [#30](https://github.com/adangel/pmd/pull/30): Removed file filter for files that are explicitly specified on the CPD command line using the files command line option.
* [#31](https://github.com/adangel/pmd/pull/31): Added file encoding detection to CPD.
* [#32](https://github.com/adangel/pmd/pull/32): Extended Objective-C grammar to accept UTF-8 escapes (\uXXXX) in string literals.
* [#33](https://github.com/adangel/pmd/pull/33): Added support for Swift to CPD.
* [#79](https://github.com/pmd/pmd/pull/79): do not flag public static void main(String[]) as UseVarargs; ignore @Override for UseVarargs
* [#80](https://github.com/pmd/pmd/pull/80): Update mvn-plugin.md
* [#83](https://github.com/pmd/pmd/pull/83): Adds new Code Climate-compliant JSON renderer
* [#85](https://github.com/pmd/pmd/pull/85): #1340 UseStringBufferForStringAppends False Positive with Ternary Operator
## Bugfixes
* java-basic/DoubleCheckedLocking:
* [#1471](https://sourceforge.net/p/pmd/bugs/1471/): False positives for DoubleCheckedLocking
* java-codesize/TooManyMethods:
* [#1457](https://sourceforge.net/p/pmd/bugs/1457/): TooManyMethods counts inner class methods
* java-controversial/AvoidUsingShortType:
* [#1449](https://sourceforge.net/p/pmd/bugs/1449/): false positive when casting a variable to short
* java-design/AccessorClassGeneration:
* [#1452](https://sourceforge.net/p/pmd/bugs/1452/): ArrayIndexOutOfBoundsException with Annotations for AccessorClassGenerationRule
* java-design/UseUtilityClass:
* [#1467](https://sourceforge.net/p/pmd/bugs/1467/): UseUtilityClass cant correctly check functions with multiple annotations
* java-imports/UnusedImports:
* [#1465](https://sourceforge.net/p/pmd/bugs/1465/): False Positve UnusedImports with javadoc @link
* java-junit/TestClassWithoutTestCases:
* [#1453](https://sourceforge.net/p/pmd/bugs/1453/): Test Class Without Test Cases gives false positive
* java-optimizations/UseStringBufferForStringAppends:
* [#1340](https://sourceforge.net/p/pmd/bugs/1340/): UseStringBufferForStringAppends False Positive with ternary operator
* java-sunsecure/ArrayIsStoredDirectly:
* [#1475](https://sourceforge.net/p/pmd/bugs/1475/): False positive of MethodReturnsInternalArray
* [#1476](https://sourceforge.net/p/pmd/bugs/1476/): False positive of ArrayIsStoredDirectly
* java-unnecessary/UnnecessaryFinalModifier:
* [#1464](https://sourceforge.net/p/pmd/bugs/1464/): UnnecessaryFinalModifier false positive on a @SafeVarargs method
* java-unusedcode/UnusedFormalParameter:
* [#1456](https://sourceforge.net/p/pmd/bugs/1456/): UnusedFormalParameter should ignore overriding methods
* General
* [#1455](https://sourceforge.net/p/pmd/bugs/1455/): PMD doesnt handle Java 8 explicit receiver parameters
* [#1458](https://sourceforge.net/p/pmd/bugs/1458/): Performance degradation scanning large XML files with XPath custom rules
* [#1461](https://sourceforge.net/p/pmd/bugs/1461/): Possible threading issue due to PR#75
* [#1470](https://sourceforge.net/p/pmd/bugs/1470/): Error with type-bound lambda
## CLI Changes
* CPD: If a complete filename is specified, the language dependent filename filter is not applied. This allows to scan files, that are not using the standard file extension. If a directory is specified, the filename filter is still applied and only those files with the correct file extension of the language are scanned.
{% include links.html %}

View File

@ -1,140 +0,0 @@
---
title: Release Notes 5.4.0
tags: [release_notes]
keywords: release notes, announcements, what's new, new features
last_updated: December 4, 2015
summary: "Version 5.4.0 of the PMD Open Source Project, released October 4, 2015."
sidebar: pmd_sidebar
permalink: 2015-10-04-release-notes-5-4-0.html
---
## Note
PMD 5.4.0 requires JDK 1.7 or above.
**Summary:**
* 9 new rules
* 4 features requests
* 18 pull requests
## Feature Request and Improvements
* [#1344](https://sourceforge.net/p/pmd/bugs/1344/): AbstractNaming should check reverse
* [#1361](https://sourceforge.net/p/pmd/bugs/1361/): ShortVariable and ShortMethodName configuration
* [#1414](https://sourceforge.net/p/pmd/bugs/1414/): Command line parameter to disable “failOnViolation” behavior PMD and CPD Command Line Interfaces have a new optional parameter: <tt>failOnViolation</tt>. Executing PMD with the option <tt>-failOnViolation false</tt> will perform the PMD checks but wont fail the build and still exit with status 0\. This is useful if you only want to generate the report with violations but dont want to fail your build.
* [#1420](https://sourceforge.net/p/pmd/bugs/1420/): UnusedPrivateField: Ignore fields if using lombok
## New Rules
* Java:
* Basic: **SimplifiedTernary** (rulesets/java/basic.xml/SimplifiedTernary)
Ternary operator with a boolean literal can be simplified with a boolean expression.
* Clone: **CloneMethodMustBePublic** (rulesets/java/clone.xml/CloneMethodMustBePublic)
The java manual says “By convention, classes that implement the <tt>Cloneable</tt> interface should override <tt>Object.clone</tt> (which is protected) with a public method.”
* Clone: **CloneMethodReturnTypeMustMatchClassName** (rulesets/java/clone.xml/CloneMethodReturnTypeMustMatchClassName)
If a class implements <tt>Cloneable</tt> the return type of the method <tt>clone()</tt> must be the class name.
* Comments: **CommentDefaultAccessModifier** (rulesets/java/comments.xml/CommentDefaultAccessModifier)
In order to avoid mistakes with forgotten access modifiers for methods, this rule ensures, that you explicitly mark the usage of the default access modifier by placing a comment.
* Design: **SingletonClassReturningNewInstance** (rulesets/java/design.xml/SingletonClassReturningNewInstance)
Verifies that the method called <tt>getInstance</tt> returns a cached instance and not always a fresh, new instance.
* Design: **SingleMethodRule** (rulesets/java/design.xml/SingleMethodSingletonRule)
Verifies that there is only one method called <tt>getInstance</tt>. If there are more methods that return the singleton, then it can easily happen, that these are not the same instances - and thus no singleton.
* Unnecessary: **UselessQualifiedThis** (rulesets/java/unnecessary.xml/UselessQualifiedThis)
Flags unnecessary qualified usages of this, when <tt>this</tt> alone would be unique. E.g. use just <tt>this</tt> instead of <tt>Foo.this</tt>.
* Maven POM: (The rules can be found in the _pmd-xml_ module)
* Basic: **ProjectVersionAsDependencyVersion** (rulesets/pom/basic.xml/ProjectVersionAsDependencyVersion)
Checks the usage of <tt>${project.version}</tt> in Maven POM files.
* Basic: **InvalidDependencyTypes** (rulesets/pom/basic.xml/InvalidDependencyTypes)
Verifies that only the default types (jar, war, …) for dependencies are used.
Ruleset snippet to activate the new rules:
<pre class="prettyprint linenums"><rule ref="rulesets/java/basic.xml/SimplifiedTernary"/>
<rule ref="rulesets/java/clone.xml/CloneMethodReturnTypeMustMatchClassName"/>
<rule ref="rulesets/java/clone.xml/CloneMethodMustBePublic"/>
<rule ref="rulesets/java/comments.xml/CommentDefaultAccessModifier"/>
<rule ref="rulesets/java/design.xml/SingleMethodSingleton"/>
<rule ref="rulesets/java/design.xml/SingletonClassReturningNewInstance"/>
<rule ref="rulesets/java/unnecessary.xml/UselessQualifiedThis"/>
<rule ref="rulesets/pom/basic.xml/ProjectVersionAsDependencyVersion"/>
<rule ref="rulesets/pom/basic.xml/InvalidDependencyTypes"/>
## Modified Rules
* Java
* Basic: **CheckResultSet** (rulesets/java/basic.xml/CheckResultSet)
Do not require to check the result of a navigation method, if it is returned.
* JUnit: **UseAssertTrueInsteadOfAssertEquals** (rulesets/java/junit.xml/UseAssertTrueInsteadOfAssertEquals)
This rule also flags assertEquals, that use Boolean.TRUE/FALSE constants.
* Naming: **AbstractNaming** (rulesets/java/naming.xml/AbstractNaming)
By default, this rule flags now classes, that are named “Abstract” but are not abstract. This behavior can be disabled by setting the new property <tt>strict</tt> to false.
* Naming: **ShortMethodName** (rulesets/java/naming.xml/ShortMethodName)
Additional property <tt>minimum</tt> to configure the minimum required length of a method name.
* Naming: **ShortVariable** (rulesets/java/naming.xml/ShortVariable)
Additional property <tt>minimum</tt> to configure the minimum required length of a variable name.
* UnusedCode: **UnusedPrivateField** (rulesets/java/unusedcode.xml/UnusedPrivateField)
This rule wont trigger anymore if [Lombok](https://projectlombok.org) is in use. See [#1420](https://sourceforge.net/p/pmd/bugs/1420/).
Renamed Rules
* Java
* Design: **<s>UseSingleton</s>** - **UseUtilityClass** (rulesets/java/design.xml/UseUtilityClass)
The rule “UseSingleton” _has been renamed_ to “UseUtilityClass”. See also bugs [#1059](https://sourceforge.net/p/pmd/bugs/1059) and [#1339](https://sourceforge.net/p/pmd/bugs/1339/).
## Removed Rules
* Java
* Basic: The following rules of ruleset “Basic” were marked as deprecated and are removed with this release now:
EmptyCatchBlock, EmptyIfStatement, EmptyWhileStmt, EmptyTryBlock, EmptyFinallyBlock, EmptySwitchStatements, EmptySynchronizedBlock, EmptyStatementNotInLoop, EmptyInitializer, EmptyStatementBlock, EmptyStaticInitializer
UnnecessaryConversionTemporary, UnnecessaryReturn, UnnecessaryFinalModifier, UselessOverridingMethod, UselessOperationOnImmutable, UnusedNullCheckInEquals, UselessParentheses
These rules are still available in the rulesets “Empty” (rulesets/java/empty.xml) and “Unnecessary” (rulesets/java/unnecessary.xml) respectively.
* Design: The rule “UncommentedEmptyMethod” has been renamed last release to “UncommentedEmptyMethodBody”. The old rule name reference has been removed with this release now.
* Controversial: The rule “BooleanInversion” has been deprecated last release and has been removed with this release completely.
## Pull Requests
* [#21](https://github.com/adangel/pmd/pull/21): Added PMD Rules for Singleton pattern violations.
* [#23](https://github.com/adangel/pmd/pull/23): Extended Objective-C grammar to accept Unicode characters in identifiers
* [#54](https://github.com/pmd/pmd/pull/54): Add a new rulesets for Mavens POM rules
* [#55](https://github.com/pmd/pmd/pull/55): Fix run.sh for paths with spaces
* [#56](https://github.com/pmd/pmd/pull/56): Adding support for WSDL rules
* [#57](https://github.com/pmd/pmd/pull/57): Add default access modifier as comment rule
* [#58](https://github.com/pmd/pmd/pull/58): Add rule for unnecessary literal boolean in ternary operators
* [#59](https://github.com/pmd/pmd/pull/59): Add check to Boxed booleans in UseAssertTrueInsteadOfAssertEquals rule
* [#60](https://github.com/pmd/pmd/pull/60): Add UselessQualifiedThisRule
* [#61](https://github.com/pmd/pmd/pull/61): Add CloneMethodReturnTypeMustMatchClassName rule
* [#62](https://github.com/pmd/pmd/pull/62): Add CloneMethodMustBePublic rule
* [#63](https://github.com/pmd/pmd/pull/63): Change CheckResultSet to allow for the result of the navigation methods to be returned
* [#65](https://github.com/pmd/pmd/pull/65): Fix ClassCastException in UselessOverridingMethodRule.
* [#66](https://github.com/pmd/pmd/pull/66): #1370 ConsecutiveAppendsShouldReuse not detected properly on StringBuffer
* [#67](https://github.com/pmd/pmd/pull/67): Use Path instead of string to check file exclusions to fix windows-only bug
* [#68](https://github.com/pmd/pmd/pull/68): #1370 ConsecutiveAppendsShouldReuse not detected properly on StringBuffer
* [#69](https://github.com/pmd/pmd/pull/69): #1371 InsufficientStringBufferDeclaration not detected properly on StringBuffer
* [#70](https://github.com/pmd/pmd/pull/70): Fix code example
## Bugfixes
* java-unusedcode/UnusedPrivateMethod:
* [#1412](https://sourceforge.net/p/pmd/bugs/1412/): UnusedPrivateMethod false positive: Issue #1403 not completely solved
## API Changes
* pmd requires now JDK 1.7 or above.
* pmd-core: <tt>net.sourceforge.pmd.lang.symboltable.Scope</tt>:
The method <tt>addNameOccurrence</tt> returns now a Set of NameDeclarations to which the given occurrence has been added. This is useful in case there are ambiguous declarations of methods.
* pmd-core: <tt>net.sourceforge.pmd.lang.symboltable.AbstractScope</tt>:
The method <tt>findVariableHere</tt> returns now a Set of NameDeclarations which match the given occurrence. This is useful in case there are ambiguous declarations of methods.
{% include links.html %}

View File

@ -1,55 +0,0 @@
---
title: Release Notes 5.4.1
tags: [release_notes]
keywords: release notes, announcements, what's new, new features
last_updated: December 4, 2015
summary: "Version 5.4.1 of the PMD Open Source Project, released December 4, 2015."
sidebar: pmd_sidebar
permalink: 2015-12-04-release-notes-5-4-1.html
---
## Feature Request and Improvements
* CPD: New command line parameter <tt>--ignore-usings</tt>: Ignore using directives in C# when comparing text.
## Modified Rules
* java-comments/CommentRequired: New property <tt>serialVersionUIDCommentRequired</tt> which controls the comment requirements for _serialVersionUID_ fields. By default, no comment is required for this field.
## Pull Requests
* [#25](https://github.com/adangel/pmd/pull/25): Added option to exclude C# using directives from CPD analysis
* [#72](https://github.com/pmd/pmd/pull/72): Added capability in Java and JSP parser for tracking tokens.
* [#74](https://github.com/pmd/pmd/pull/74): Fix rendering CommentDefaultAccessModifier description as code
* [#75](https://github.com/pmd/pmd/pull/75): RuleSetFactory Performance Enhancement
## Bugfixes
* java-comments/CommentDefaultAccessModifier
* [#1430](https://sourceforge.net/p/pmd/bugs/1430/): CommentDefaultAccessModifier triggers on field annotated with @VisibleForTesting
* java-comments/CommentRequired
* [#1434](https://sourceforge.net/p/pmd/bugs/1434/): CommentRequired raises violation on serialVersionUID field
* java-design/UseNotifyAllInsteadOfNotify
* [#1438](https://sourceforge.net/p/pmd/bugs/1438/): UseNotifyAllInsteadOfNotify gives false positive
* java-finalizers/AvoidCallingFinalize
* [#1440](https://sourceforge.net/p/pmd/bugs/1440/): NPE in AvoidCallingFinalize
* java-imports/UnnecessaryFullyQualifiedName
* [#1436](https://sourceforge.net/p/pmd/bugs/1436/): UnnecessaryFullyQualifiedName false positive on clashing static imports with enums
* java-junit/JUnitAssertionsShouldIncludeMessage
* [#1373](https://sourceforge.net/p/pmd/bugs/1373/): JUnitAssertionsShouldIncludeMessage is no longer compatible with TestNG
* java-migrating/JUnit4TestShouldUseBeforeAnnotation
* [#1446](https://sourceforge.net/p/pmd/bugs/1446/): False positive with JUnit4TestShouldUseBeforeAnnotation when TestNG is used
* java-naming/SuspiciousEqualsMethodName
* [#1431](https://sourceforge.net/p/pmd/bugs/1431/): SuspiciousEqualsMethodName false positive
* java-optimizations/RedundantFieldInitializer
* [#1443](https://sourceforge.net/p/pmd/bugs/1443/): RedundantFieldInitializer: False positive for small floats
* java-unnecessary/UselessQualifiedThis
* [#1422](https://sourceforge.net/p/pmd/bugs/1422/): UselessQualifiedThis: False positive with Java 8 Function
* java-unusedcode/UnusedPrivateField
* [#1428](https://sourceforge.net/p/pmd/bugs/1428/): False positive in UnusedPrivateField when local variable hides member variable
* General
* [#1425](https://sourceforge.net/p/pmd/bugs/1425/): Invalid XML Characters in Output
* [#1429](https://sourceforge.net/p/pmd/bugs/1429/): Java - Parse Error: Cast in return expression
* [#1441](https://sourceforge.net/p/pmd/bugs/1441/): PMD: Update documentation how to compile after modularization
{% include links.html %}

View File

@ -1,83 +0,0 @@
---
title: Release Notes 5.4.2
tags: [release_notes]
keywords: release notes, announcements, what's new, new features
last_updated: May 29, 2016
summary: "Version 5.4.2 of the PMD Open Source Project, released May 29, 2016."
sidebar: pmd_sidebar
permalink: 2016-05-29-release-notes-5-4-2.html
---
## New Supported Languages
* CPD supports now Swift (see [PR#33](https://github.com/adangel/pmd/pull/33)).
## Feature Request and Improvements
* A JSON-renderer for PMD which is compatible with CodeClimate. See [PR#83](https://github.com/pmd/pmd/pull/83).
* [#1360](https://sourceforge.net/p/pmd/bugs/1360/): Provide backwards compatibility for PMD configuration file
## Modified Rules
* java-design/UseVargs: public static void main method is ignored now and so are methods, that are annotated with Override. See [PR#79](https://github.com/pmd/pmd/pull/79).
## Pull Requests
* [#27](https://github.com/adangel/pmd/pull/27): Added support for Raw String Literals (C++11).
* [#29](https://github.com/adangel/pmd/pull/29): Added support for files with UTF-8 BOM to JSP tokenizer.
* [#30](https://github.com/adangel/pmd/pull/30): Removed file filter for files that are explicitly specified on the CPD command line using the files command line option.
* [#31](https://github.com/adangel/pmd/pull/31): Added file encoding detection to CPD.
* [#32](https://github.com/adangel/pmd/pull/32): Extended Objective-C grammar to accept UTF-8 escapes (\uXXXX) in string literals.
* [#33](https://github.com/adangel/pmd/pull/33): Added support for Swift to CPD.
* [#79](https://github.com/pmd/pmd/pull/79): do not flag public static void main(String[]) as UseVarargs; ignore @Override for UseVarargs
* [#80](https://github.com/pmd/pmd/pull/80): Update mvn-plugin.md
* [#83](https://github.com/pmd/pmd/pull/83): Adds new Code Climate-compliant JSON renderer
* [#85](https://github.com/pmd/pmd/pull/85): #1340 UseStringBufferForStringAppends False Positive with Ternary Operator
## Bugfixes
* java-basic/DoubleCheckedLocking:
* [#1471](https://sourceforge.net/p/pmd/bugs/1471/): False positives for DoubleCheckedLocking
* java-basic/SimplifiedTernary:
* [#1424](https://sourceforge.net/p/pmd/bugs/1424/): False positive with ternary operator
* java-codesize/TooManyMethods:
* [#1457](https://sourceforge.net/p/pmd/bugs/1457/): TooManyMethods counts inner class methods
* java-controversial/AvoidUsingShortType:
* [#1449](https://sourceforge.net/p/pmd/bugs/1449/): false positive when casting a variable to short
* java-design/AccessorClassGeneration:
* [#1452](https://sourceforge.net/p/pmd/bugs/1452/): ArrayIndexOutOfBoundsException with Annotations for AccessorClassGenerationRule
* java-design/CloseResource
* [#1479](https://sourceforge.net/p/pmd/bugs/1479/): CloseResource false positive on Statement
* java-design/UseUtilityClass:
* [#1467](https://sourceforge.net/p/pmd/bugs/1467/): UseUtilityClass cant correctly check functions with multiple annotations
* java-imports/UnusedImports:
* [#1465](https://sourceforge.net/p/pmd/bugs/1465/): False Positve UnusedImports with javadoc @link
* java-junit/TestClassWithoutTestCases:
* [#1453](https://sourceforge.net/p/pmd/bugs/1453/): Test Class Without Test Cases gives false positive
* java-optimizations/UseStringBufferForStringAppends:
* [#1340](https://sourceforge.net/p/pmd/bugs/1340/): UseStringBufferForStringAppends False Positive with ternary operator
* java-sunsecure/ArrayIsStoredDirectly:
* [#1475](https://sourceforge.net/p/pmd/bugs/1475/): False positive of MethodReturnsInternalArray
* [#1476](https://sourceforge.net/p/pmd/bugs/1476/): False positive of ArrayIsStoredDirectly
* java-unnecessary/UnnecessaryFinalModifier:
* [#1464](https://sourceforge.net/p/pmd/bugs/1464/): UnnecessaryFinalModifier false positive on a @SafeVarargs method
* java-unusedcode/UnusedFormalParameter:
* [#1456](https://sourceforge.net/p/pmd/bugs/1456/): UnusedFormalParameter should ignore overriding methods
* java-unusedcode/UnusedLocalVariable
* [#1484](https://sourceforge.net/p/pmd/bugs/1484/): UnusedLocalVariable - false positive - parenthesis
* java-unusedcode/UnusedModifier
* [#1480](https://sourceforge.net/p/pmd/bugs/1480/): false positive on public modifier used with inner interface in enum
* General
* [#1455](https://sourceforge.net/p/pmd/bugs/1455/): PMD doesnt handle Java 8 explicit receiver parameters
* [#1458](https://sourceforge.net/p/pmd/bugs/1458/): Performance degradation scanning large XML files with XPath custom rules
* [#1461](https://sourceforge.net/p/pmd/bugs/1461/): Possible threading issue due to PR#75
* [#1470](https://sourceforge.net/p/pmd/bugs/1470/): Error with type-bound lambda
* [#1481](https://sourceforge.net/p/pmd/bugs/1481/): no problems found results in blank file instead of empty xml
## CLI Changes
* CPD: If a complete filename is specified, the language dependent filename filter is not applied. This allows to scan files, that are not using the standard file extension. If a directory is specified, the filename filter is still applied and only those files with the correct file extension of the language are scanned.
* CPD: If no problems found, an empty report will be output instead of nothing. See also [#1481](https://sourceforge.net/p/pmd/bugs/1481/)
* New command line parameter for PMD: <tt>-norulesetcompatibility</tt> - this disables the ruleset factory compatibility filter and fails, if e.g. an old rule name is used in the ruleset. See also [#1360](https://sourceforge.net/p/pmd/bugs/1360/). This option is also available for the ant task: <tt><noRuleSetCompatibility>true</noRuleSetCompatibility></tt>.
{% include links.html %}

View File

@ -1,149 +0,0 @@
---
title: Release Notes 5.5.0
tags: [release_notes]
keywords: release notes, announcements, what's new, new features
last_updated: June 25, 2016
summary: "Version 5.5.0 of the PMD Open Source Project, released June 25, 2016."
sidebar: pmd_sidebar
permalink: 2016-06-25-release-notes-5-5-0.html
---
## System requirements
{% include note.html content="PMD and CPD need at least a java7 runtime environment. For analyzing Salesforce.com Apex source code, youll need a java8 runtime environment." %}
## New Supported Languages
* Salesforce.com Apex is now supported by PMD and CPD. See [PR#86](https://github.com/pmd/pmd/pull/86).
* CPD now supports Perl. See [PR#82](https://github.com/pmd/pmd/pull/82).
* CPD now supports Swift. See [PR#33](https://github.com/adangel/pmd/pull/33).
## New and Modified Rules
* New rules in Java:
* java-logging-java/InvalidSlf4jMessageFormat: Check for invalid message format in slf4j loggers. See [PR#73](https://github.com/pmd/pmd/pull/73).
* java-design/ConstantsInInterface: Avoid constants in interfaces. Interfaces should define types, constants are implementation details better placed in classes or enums. See Effective Java, item 19\. See [PR#93](https://github.com/pmd/pmd/pull/93).
* Modified rules in Java:
* java-comments/CommentRequired: New property <tt>serialVersionUIDCommentRequired</tt> which controls the comment requirements for _serialVersionUID_ fields. By default, no comment is required for this field.
* java-design/UseVargs: public static void main method is ignored now and so are methods, that are annotated with Override. See [PR#79](https://github.com/pmd/pmd/pull/79).
* New rules for Salesforce.com Apex:
* apex-complexity: AvoidDeeplyNestedIfStmts, ExcessiveParameterList, ExcessiveClassLength, NcssMethodCount, NcssTypeCount, NcssConstructorCount, StdCyclomaticComplexity, TooManyFields, ExcessivePublicCount
* apex-performance: AvoidDmlStatementsInLoops, AvoidSoqlInLoops
* apex-style: VariableNamingConventions, MethodNamingConventions, ClassNamingConventions, MethodWithSameNameAsEnclosingClass, AvoidLogicInTrigger, AvoidGlobalModifier
* Javascript
* New Rule: ecmascript-unnecessary/NoElseReturn: The else block in a if-else-construct is unnecessary if the <tt>if</tt> block contains a return. Then the content of the else block can be put outside. See [#1486](https://sourceforge.net/p/pmd/bugs/1486/).
## Improvements and CLI Changes
* A JSON-renderer for PMD which is compatible with CodeClimate. See [PR#83](https://github.com/pmd/pmd/pull/83).
* [#1360](https://sourceforge.net/p/pmd/bugs/1360/): [core] [java] Provide backwards compatibility for PMD configuration file
* CPD: If a complete filename is specified, the language dependent filename filter is not applied. This allows to scan files, that are not using the standard file extension. If a directory is specified, the filename filter is still applied and only those files with the correct file extension of the language are scanned.
* CPD: If no problems found, an empty report will be output instead of nothing. See also [#1481](https://sourceforge.net/p/pmd/bugs/1481/)
* CPD: New command line parameter <tt>--ignore-usings</tt>: Ignore using directives in C# when comparing text.
* PMD: New command line parameter: <tt>-norulesetcompatibility</tt> - this disables the ruleset factory compatibility filter and fails, if e.g. an old rule name is used in the ruleset. See also [#1360](https://sourceforge.net/p/pmd/bugs/1360/). This option is also available for the ant task: <tt><noRuleSetCompatibility>true</noRuleSetCompatibility></tt>.
* PMD: New command line parameter: <tt>-filelist</tt>- this provides an alternative way to define, which files should be process by PMD. With this option, you can provide the path to a single file containing a comma delimited list of files to analyze. If this is given, then you dont need to provide <tt>-dir</tt>. See [PR#98](https://github.com/pmd/pmd/pull/98).
## Pull Requests
* [#25](https://github.com/adangel/pmd/pull/25): [cs] Added option to exclude C# using directives from CPD analysis
* [#27](https://github.com/adangel/pmd/pull/27): [cpp] Added support for Raw String Literals (C++11).
* [#29)(https://github.com/adangel/pmd/pull/29): [jsp] Added support for files with UTF-8 BOM to JSP tokenizer.
* [#30](https://github.com/adangel/pmd/pull/30): [core] CPD: Removed file filter for files that are explicitly specified on the CPD command line using the files command line option.
* [#31](https://github.com/adangel/pmd/pull/31): [core] CPD: Added file encoding detection to CPD.
* [#32](https://github.com/adangel/pmd/pull/32): [objectivec] Extended Objective-C grammar to accept UTF-8 escapes (\uXXXX) in string literals.
* [#33](https://github.com/adangel/pmd/pull/33): [swift] Added support for Swift to CPD.
* [#34](https://github.com/adangel/pmd/pull/34): multiple code improvements: squid:S1192, squid:S1118, squid:S1066, squid:S1854, squid:S2864
* [#35](https://github.com/adangel/pmd/pull/35): [javascript] Javascript tokenizer now ignores comment tokens.
* [#72](https://github.com/pmd/pmd/pull/72): [java] [jsp] Added capability in Java and JSP parser for tracking tokens.
* [#73](https://github.com/pmd/pmd/pull/73): [java] InvalidSlf4jMessageFormat: Add rule to look for invalid message format in slf4j loggers
* [#74](https://github.com/pmd/pmd/pull/74): [java] CommentDefaultAccessModifier: Fix rendering CommentDefaultAccessModifier description as code
* [#75](https://github.com/pmd/pmd/pull/75): [core] RuleSetFactory Performance Enhancement
* [#76](https://github.com/pmd/pmd/pull/76): [java] DoNotCallGarbageCollectionExplicitly: fix formatting typos in an example
* [#77](https://github.com/pmd/pmd/pull/77): [java] [plsql] Fix various typos
* [#78](https://github.com/pmd/pmd/pull/78): [java] MissingStaticMethodInNonInstantiatableClass: Add Builder pattern check
* [#79](https://github.com/pmd/pmd/pull/79): [java] UseVarargs: do not flag public static void main(String[]), ignore @Override
* [#80](https://github.com/pmd/pmd/pull/80): [site] Update mvn-plugin.md
* [#82](https://github.com/pmd/pmd/pull/82): [perl] Add Perl support to CPD.
* [#83](https://github.com/pmd/pmd/pull/83): [core] CodeClimateRenderer: Adds new Code Climate-compliant JSON renderer
* [#84](https://github.com/pmd/pmd/pull/84): [java] EmptyMethodInAbstractClassShouldBeAbstract: Change rules description.
* [#85](https://github.com/pmd/pmd/pull/85): [java] UseStringBufferForStringAppends: False Positive with Ternary Operator (#1340)
* [#86](https://github.com/pmd/pmd/pull/86): [apex] Added language module for Salesforce.com Apex incl. rules ported from Java and new ones.
* [#87](https://github.com/pmd/pmd/pull/87): [core] [apex] Customize Code Climate Json “categories” + “remediation_points” as PMD rule properties
* [#88](https://github.com/pmd/pmd/pull/88): [core] [apex] Fixed typo in ruleset.xml and problems with the CodeClimate renderer
* [#89](https://github.com/pmd/pmd/pull/89): [core] Some code enhancements
* [#90](https://github.com/pmd/pmd/pull/90): [core] Refactored two test to stop using the deprecated ant class BuildFileTest
* [#91](https://github.com/pmd/pmd/pull/91): [core] [java] [jsp] [plsql] [test] [vm] Small code enhancements, basically reordering variable declarations, constructors and variable modifiers
* [#92](https://github.com/pmd/pmd/pull/92): [core] [apex] Improved Code Climate Renderer Output and a Bugfix for Apex StdCyclomaticComplexityRule on triggers
* [#93](https://github.com/pmd/pmd/pull/93): [java] ConstantsInInterface: Add ConstantsInInterface rule. Effective Java, 19
* [#94](https://github.com/pmd/pmd/pull/94): [core] [apex] Added property, fixed code climate renderer output and deleted unused rulessets
* [#95](https://github.com/pmd/pmd/pull/95): [apex] AvoidDmlStatementsInLoops: New apex rule AvoidDmlStatementsInLoops
* [#96](https://github.com/pmd/pmd/pull/96): [core] CodeClimateRenderer: Clean up Code Climate renderer
* [#97](https://github.com/pmd/pmd/pull/97): [java] BooleanGetMethodName: Dont report bad method names on @Override
* [#98](https://github.com/pmd/pmd/pull/98): [core] PMD: Input filelist parameter
* [#99](https://github.com/pmd/pmd/pull/99): [apex] Fixed Trigger name is reported incorrectly
* [#100](https://github.com/pmd/pmd/pull/100): [core] CSVRenderer: escape filenames with commas in csvrenderer
## Bugfixes
* java-basic
* [#1471](https://sourceforge.net/p/pmd/bugs/1471/): [java] DoubleCheckedLocking: False positives
* [#1424](https://sourceforge.net/p/pmd/bugs/1424/): [java] SimplifiedTernary: False positive with ternary operator
* java-codesize
* [#1457](https://sourceforge.net/p/pmd/bugs/1457/): [java] TooManyMethods: counts inner class methods
* java-comments
* [#1430](https://sourceforge.net/p/pmd/bugs/1430/): [java] CommentDefaultAccessModifier: triggers on field annotated with @VisibleForTesting
* [#1434](https://sourceforge.net/p/pmd/bugs/1434/): [java] CommentRequired: raises violation on serialVersionUID field
* java-controversial
* [#1449](https://sourceforge.net/p/pmd/bugs/1449/): [java] AvoidUsingShortType: false positive when casting a variable to short
* java-design
* [#1452](https://sourceforge.net/p/pmd/bugs/1452/): [java] AccessorClassGenerationRule: ArrayIndexOutOfBoundsException with Annotations
* [#1479](https://sourceforge.net/p/pmd/bugs/1479/): [java] CloseResource: false positive on Statement
* [#1438](https://sourceforge.net/p/pmd/bugs/1438/): [java] UseNotifyAllInsteadOfNotify: false positive
* [#1467](https://sourceforge.net/p/pmd/bugs/1467/): [java] UseUtilityClass: cant correctly check functions with multiple annotations
* java-finalizers
* [#1440](https://sourceforge.net/p/pmd/bugs/1440/): [java] AvoidCallingFinalize: NPE
* java-imports
* [#1436](https://sourceforge.net/p/pmd/bugs/1436/): [java] UnnecessaryFullyQualifiedName: false positive on clashing static imports with enums
* [#1465](https://sourceforge.net/p/pmd/bugs/1465/): [java] UnusedImports: False Positve with javadoc @link
* java-junit
* [#1373](https://sourceforge.net/p/pmd/bugs/1373/): [java] JUnitAssertionsShouldIncludeMessage: is no longer compatible with TestNG
* [#1453](https://sourceforge.net/p/pmd/bugs/1453/): [java] TestClassWithoutTestCases: false positive
* java-migrating
* [#1446](https://sourceforge.net/p/pmd/bugs/1446/): [java] JUnit4TestShouldUseBeforeAnnotation: False positive when TestNG is used
* java-naming
* [#1431](https://sourceforge.net/p/pmd/bugs/1431/): [java] SuspiciousEqualsMethodName: false positive
* java-optimizations
* [#1443](https://sourceforge.net/p/pmd/bugs/1443/): [java] RedundantFieldInitializer: False positive for small floats
* [#1340](https://sourceforge.net/p/pmd/bugs/1340/): [java] UseStringBufferForStringAppends: False Positive with ternary operator
* java-sunsecure
* [#1476](https://sourceforge.net/p/pmd/bugs/1476/): [java] ArrayIsStoredDirectly: False positive
* [#1475](https://sourceforge.net/p/pmd/bugs/1475/): [java] MethodReturnsInternalArray: False positive
* java-unnecessary
* [#1464](https://sourceforge.net/p/pmd/bugs/1464/): [java] UnnecessaryFinalModifier: false positive on a @SafeVarargs method
* [#1422](https://sourceforge.net/p/pmd/bugs/1422/): [java] UselessQualifiedThis: False positive with Java 8 Function
* java-unusedcode
* [#1456](https://sourceforge.net/p/pmd/bugs/1456/): [java] UnusedFormalParameter: should ignore overriding methods
* [#1484](https://sourceforge.net/p/pmd/bugs/1484/): [java] UnusedLocalVariable: false positive - parenthesis
* [#1480](https://sourceforge.net/p/pmd/bugs/1480/): [java] UnusedModifier: false positive on public modifier used with inner interface in enum
* [#1428](https://sourceforge.net/p/pmd/bugs/1428/): [java] UnusedPrivateField: False positive when local variable hides member variable hides member variable
* General
* [#1425](https://sourceforge.net/p/pmd/bugs/1425/): [core] XMLRenderer: Invalid XML Characters in Output
* [#1429](https://sourceforge.net/p/pmd/bugs/1429/): [java] Parser Error: Cast in return expression
* [#1441](https://sourceforge.net/p/pmd/bugs/1441/): [site] PMD: Update documentation how to compile after modularization
* [#1442](https://sourceforge.net/p/pmd/bugs/1442/): [java] PDMASMClassLoader: Java 9 Jigsaw readiness
* [#1455](https://sourceforge.net/p/pmd/bugs/1455/): [java] Parser: PMD doesnt handle Java 8 explicit receiver parameters
* [#1458](https://sourceforge.net/p/pmd/bugs/1458/): [xml] Performance degradation scanning large XML files with XPath custom rules
* [#1461](https://sourceforge.net/p/pmd/bugs/1461/): [core] RuleSetFactory: Possible threading issue due to PR#75
* [#1470](https://sourceforge.net/p/pmd/bugs/1470/): [java] Parser: Error with type-bound lambda
* [#1478](https://sourceforge.net/p/pmd/bugs/1478/): [core] PMD CLI: Use first language as default if Java is not available
* [#1481](https://sourceforge.net/p/pmd/bugs/1481/): [core] CPD: no problems found results in blank file instead of empty xml
* [#1485](https://sourceforge.net/p/pmd/bugs/1485/): [apex] Analysis of some apex classes cause a stackoverflow error
* [#1488](https://sourceforge.net/p/pmd/bugs/1488/): [apex] Windows line endings falsify the location of issues
* [#1491](https://sourceforge.net/p/pmd/bugs/1491/): [core] CodeClimateRenderer: corrupt JSON output with real line breaks
* [#1492](https://sourceforge.net/p/pmd/bugs/1492/): [core] PMD CLI: IncompatibleClassChangeError when running PMD
{% include links.html %}

View File

@ -1,43 +0,0 @@
---
title: Release Notes 5.5.5
tags: [release_notes]
keywords: release notes, announcements, what's new, new features
last_updated: March 27, 2017
summary: "Version 5.5.5 of the PMD Open Source Project, released March 27, 2017."
sidebar: pmd_sidebar
permalink: 2017-03-27-release-notes-5-5-5.html
---
The PMD team is pleased to announce PMD 5.5.5.
### Table Of Contents
* [Fixed Issues](#Fixed_Issues)
* [External Contributions](#External_Contributions)
### Fixed Issues
* general:
* [#305](https://github.com/pmd/pmd/issues/305): \[core] PMD not executing under git bash
* java:
* [#309](https://github.com/pmd/pmd/issues/309): \[java] Parse error on method reference
* java-design
* [#274](https://github.com/pmd/pmd/issues/274): \[java] AccessorMethodGeneration: Method inside static inner class incorrectly reported
* [#275](https://github.com/pmd/pmd/issues/275): \[java] FinalFieldCouldBeStatic: Constant in @interface incorrectly reported as "could be made static"
* [#282](https://github.com/pmd/pmd/issues/282): \[java] UnnecessaryLocalBeforeReturn false positive when cloning Maps
* [#291](https://github.com/pmd/pmd/issues/291): \[java] Improve quality of AccessorClassGeneration
* java-junit:
* [#285](https://github.com/pmd/pmd/issues/285): \[java] JUnitTestsShouldIncludeAssertRule should support @Rule as well as @Test(expected = ...)
* java-optimizations:
* [#222](https://github.com/pmd/pmd/issues/222): \[java] UseStringBufferForStringAppends: False Positive with ternary operator
* java-strings:
* [#290](https://github.com/pmd/pmd/issues/290): \[java] InefficientEmptyStringCheck misses String.trim().isEmpty()
### External Contributions
* [#280](https://github.com/pmd/pmd/pull/280): \[apex] Support for Aggregate Result in CRUD rules
* [#289](https://github.com/pmd/pmd/pull/289): \[apex] Complex SOQL Crud check bug fixes
* [#296](https://github.com/pmd/pmd/pull/296): \[apex] Adding String.IsNotBlank to the whitelist to prevent False positives
* [#303](https://github.com/pmd/pmd/pull/303): \[java] InefficientEmptyStringCheckRule now reports String.trim().isEmpty()
* [#307](https://github.com/pmd/pmd/pull/307): \[java] Fix false positive with UseStringBufferForStringAppendsRule
* [#308](https://github.com/pmd/pmd/pull/308): \[java] JUnitTestsShouldIncludeAssertRule supports @Rule annotated ExpectedExceptions

View File

@ -1,19 +0,0 @@
---
title: Release Notes 5.5.6
tags: [release_notes]
keywords: release notes, announcements, what's new, new features
last_updated: April 19, 2017
summary: "Version 5.5.6 of the PMD Open Source Project, released April 19, 2017."
sidebar: pmd_sidebar
permalink: 2017-04-19-release-notes-5-5-6.html
---
The PMD team is pleased to announce PMD 5.5.6.
This is a bug fixing release.
### Fixed Issues
* General
* [#324](https://github.com/pmd/pmd/issues/324): \[core] Automated release - github release notes missing
* [#337](https://github.com/pmd/pmd/issues/337): \[core] Version 5.5.4 seems to hold file lock on rules JAR (affects Windows only)

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +0,0 @@
---
title: Release Notes 5.5.7
tags: [release_notes]
keywords: release notes, announcements, what's new, new features
last_updated: April 29, 2017
summary: "Version 5.5.7 of the PMD Open Source Project, released April 29, 2017."
sidebar: pmd_sidebar
permalink: 2017-04-29-release-notes-5-5-7.html
---
The PMD team is pleased to announce PMD 5.5.7.
This is a bug fixing release.
### Fixed Issues
* General
* [#364](https://github.com/pmd/pmd/issues/364): \[core] Stream closed exception when running through maven

View File

@ -1,19 +0,0 @@
---
title: Release Notes 5.6.1
tags: [release_notes]
keywords: release notes, announcements, what's new, new features
last_updated: April 29, 2017
summary: "Version 5.6.1 of the PMD Open Source Project, released April 29, 2017."
sidebar: pmd_sidebar
permalink: 2017-04-29-release-notes-5-6-1.html
---
The PMD team is pleased to announce PMD 5.6.1.
This is a bug fixing release.
### Fixed Issues
* General
* [#363](https://github.com/pmd/pmd/issues/363): \[core] Rule documentation pages are missing
* [#364](https://github.com/pmd/pmd/issues/364): \[core] Stream closed exception when running through maven
* [#373](https://github.com/pmd/pmd/issues/373): \[core] RuleSetFactory - add more helper methods

View File

@ -1,77 +0,0 @@
---
title: Release Notes 5.7.0
tags: [release_notes]
keywords: release notes, announcements, what's new, new features
last_updated: May 20, 2017
summary: "Version 5.7.0 of the PMD Open Source Project, released May 20, 2017."
sidebar: pmd_sidebar
permalink: 2017-05-20-release-notes-5-7-0.html
---
The PMD team is pleased to announce PMD 5.7.0.
This is a minor release.
### Table Of Contents
* [New and noteworthy](#New_and_noteworthy)
* [Fixed Issues](#Fixed_Issues)
* [API Changes](#API_Changes)
* [External Contributions](#External_Contributions)
### New and noteworthy
#### Modified Rules
* The rule "FieldDeclarationsShouldBeAtStartOfClass" of the java-design ruleset has a new property `ignoreInterfaceDeclarations`.
Setting this property to `true` ignores interface declarations, that precede fields.
Example usage:
<rule ref="rulesets/java/design.xml/FieldDeclarationsShouldBeAtStartOfClass">
<properties>
<property name="ignoreInterfaceDeclarations" value="true"/>
</properties>
</rule>
#### Renderers
* Added the 'empty' renderer which will write nothing. Does not affect other behaviors, for example the command line PMD exit status
will still indicate whether violations were found.
### Fixed Issues
* General
* [#377](https://github.com/pmd/pmd/issues/377): \[core] Use maven wrapper and upgrade to maven 3.5.0
* [#376](https://github.com/pmd/pmd/issues/376): \[core] Improve build time on travis
* java
* [#378](https://github.com/pmd/pmd/issues/378): \[java] Parser Error for empty statements
* java-coupling
* [#1427](https://sourceforge.net/p/pmd/bugs/1427/): \[java] Law of Demeter violations for the Builder pattern
* java-design
* [#345](https://github.com/pmd/pmd/issues/345): \[java] FieldDeclarationsShouldBeAtStartOfClass: Add ability to ignore interfaces
* [#389](https://github.com/pmd/pmd/issues/389): \[java] RuleSetCompatibility - not taking rename of UnusedModifier into account
* java-junit
* [#358](https://github.com/pmd/pmd/issues/358): \[java] Mockito verify method is not taken into account in JUnitTestsShouldIncludeAssert rule
* java-strings
* [#334](https://github.com/pmd/pmd/issues/334): \[java] \[doc] Add suggestion to use StringUtils#isBlank for InefficientEmptyStringCheck
* jsp-basic
* [#369](https://github.com/pmd/pmd/issues/369): \[jsp] Wrong issue "JSP file should use UTF-8 encoding"
### API Changes
* The method `net.sourceforge.pmd.util.StringUtil#htmlEncode(String)` is deprecated.
`org.apache.commons.lang3.StringEscapeUtils#escapeHtml4(String)` should be used instead.
### External Contributions
* [#368](https://github.com/pmd/pmd/pull/368): \[vf] Adding proper AST support for negation expressions
* [#372](https://github.com/pmd/pmd/pull/372): \[core] Fix XSS in HTML renderer
* [#374](https://github.com/pmd/pmd/pull/374): \[java] Add property to ignore interfaces in FieldDeclarationsShouldBeAtStartOfClassRule
* [#381](https://github.com/pmd/pmd/pull/381): \[core] Fix broken link in the site's doc
* [#382](https://github.com/pmd/pmd/pull/382): \[java] Added documentation details on InefficientEmptyStringCheck
* [#383](https://github.com/pmd/pmd/pull/383): \[jsp] Fixed JspEncoding false positive
* [#390](https://github.com/pmd/pmd/pull/390): \[java] Remove trailing whitespaces in design.xml
* [#391](https://github.com/pmd/pmd/pull/391): \[apex] Fix documentation typo
* [#392](https://github.com/pmd/pmd/pull/392): \[java] False positive for Law Of Demeter (Builder pattern)
* [#395](https://github.com/pmd/pmd/pull/395): \[java] Mockito verify method is not taken into account in JUnitTestsShouldIncludeAssert rule

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Some files were not shown because too many files have changed in this diff Show More