Merge branch 'master' into issue1092-vf-escape-false-positives
This commit is contained in:
103 files changed
+881
-228
No files matched your search
@@ -27,4 +27,4 @@ jobs:
|
||||
java-version: ${{ matrix.java }}
|
||||
- name: Build with mvnw
|
||||
run: |
|
||||
./mvnw clean install
|
||||
./mvnw -V clean install
|
||||
+1
-8
@@ -34,13 +34,6 @@ jobs:
|
||||
dist: bionic
|
||||
env: BUILD=coveralls
|
||||
if: "type = push && repo = pmd/pmd && fork = false"
|
||||
- name: "macosx - mvn verify"
|
||||
os: osx
|
||||
env: BUILD=deploy
|
||||
- name: "windows - mvn verify"
|
||||
os: windows
|
||||
env: BUILD=deploy
|
||||
language: shell
|
||||
- stage: publish
|
||||
name: "Release Build - Publish"
|
||||
os: linux
|
||||
@@ -49,7 +42,7 @@ jobs:
|
||||
env: BUILD=publish
|
||||
|
||||
before_install:
|
||||
- bash .travis/before_install.sh "11.0.8+10"
|
||||
- bash .travis/before_install.sh "11"
|
||||
- source ${HOME}/java.env
|
||||
install: true
|
||||
before_script: true
|
||||
|
||||
+25
-16
@@ -13,30 +13,39 @@ bash .travis/configure-maven.sh
|
||||
bash .travis/install-openjdk.sh $OPENJDK_VERSION
|
||||
|
||||
|
||||
function install_jdk() {
|
||||
LOCAL_DIR=$1
|
||||
TARGET_DIR=$2
|
||||
DOWNLOAD_URL=$3
|
||||
ARCHIVE=$(basename $DOWNLOAD_URL)
|
||||
|
||||
mkdir -p ${LOCAL_DIR}
|
||||
mkdir -p ${TARGET_DIR}
|
||||
if [ ! -e ${LOCAL_DIR}/${ARCHIVE} ]; then
|
||||
log_info "Downloading from ${DOWNLOAD_URL} to ${LOCAL_DIR}"
|
||||
wget --directory-prefix ${LOCAL_DIR} --timestamping --continue ${DOWNLOAD_URL}
|
||||
else
|
||||
log_info "Skipped download, file ${LOCAL_DIR}/${ARCHIVE} already exists"
|
||||
fi
|
||||
log_info "Extracting to ${TARGET_DIR}"
|
||||
tar --extract --file ${LOCAL_DIR}/${ARCHIVE} -C ${TARGET_DIR} --strip-components=1
|
||||
}
|
||||
|
||||
if travis_isLinux; then
|
||||
change_ruby_version
|
||||
gem install bundler
|
||||
bundle config set --local path vendor/bundle
|
||||
bundle config set --local with release_notes_preprocessing
|
||||
bundle install
|
||||
|
||||
# install jdk7 for integration test
|
||||
LOCAL_DIR=${HOME}/.cache/jdk7
|
||||
TARGET_DIR=${HOME}/oraclejdk7
|
||||
JDK7_ARCHIVE=jdk-7u80-linux-x64.tar.gz
|
||||
DOWNLOAD_URL=https://pmd-code.org/oraclejdk/${JDK7_ARCHIVE}
|
||||
mkdir -p ${LOCAL_DIR}
|
||||
mkdir -p ${TARGET_DIR}
|
||||
if [ ! -e ${LOCAL_DIR}/${JDK7_ARCHIVE} ]; then
|
||||
log_info "Downloading from ${DOWNLOAD_URL} to ${LOCAL_DIR}"
|
||||
wget --directory-prefix ${LOCAL_DIR} --timestamping --continue ${DOWNLOAD_URL}
|
||||
else
|
||||
log_info "Skipped download, file ${LOCAL_DIR}/${JDK7_ARCHIVE} already exists"
|
||||
fi
|
||||
log_info "Extracting to ${TARGET_DIR}"
|
||||
tar --extract --file ${LOCAL_DIR}/${JDK7_ARCHIVE} -C ${TARGET_DIR} --strip-components=1
|
||||
log_info "OracleJDK7 can be used via -Djava7.home=${TARGET_DIR}"
|
||||
install_jdk "${HOME}/.cache/jdk7" "${HOME}/oraclejdk7" "https://pmd-code.org/oraclejdk/jdk-7u80-linux-x64.tar.gz"
|
||||
log_info "OracleJDK7 can be used via -Djava7.home=${HOME}/oraclejdk7"
|
||||
|
||||
# install openjdk8 for pmd-regression-tests
|
||||
install_jdk "${HOME}/.cache/openjdk" "${HOME}/openjdk8" "https://pmd-code.org/openjdk/latest/jdk-8-linux64.tar.gz"
|
||||
log_info "OpenJDK8 can be used from ${HOME}/openjdk8"
|
||||
else
|
||||
log_info "Not setting up ruby for ${TRAVIS_OS_NAME}."
|
||||
log_info "Not setting up ruby and additional jvms for ${TRAVIS_OS_NAME}."
|
||||
exit 0
|
||||
fi
|
||||
@@ -57,3 +57,8 @@ function travis_isWindows() {
|
||||
function get_pom_version() {
|
||||
echo $(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec)
|
||||
}
|
||||
|
||||
function change_ruby_version() {
|
||||
source "$HOME/.rvm/scripts/rvm"
|
||||
rvm use ruby-2.7
|
||||
}
|
||||
+15
-13
@@ -2,36 +2,38 @@
|
||||
set -e
|
||||
|
||||
#
|
||||
# AdoptOpenJDK Builds from:
|
||||
# https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/tag/jdk-11.0.4%2B11
|
||||
# Downloads AdoptOpenJDK Builds from
|
||||
# https://pmd-code.org/openjdk/latest/jdk-11-linux64.tar.gz
|
||||
# https://pmd-code.org/openjdk/latest/jdk-11-windows64.zip
|
||||
# https://pmd-code.org/openjdk/latest/jdk-11-mac64.tar.gz
|
||||
#
|
||||
# The Build are originally from:
|
||||
# https://github.com/AdoptOpenJDK/openjdk11-binaries/releases
|
||||
#
|
||||
|
||||
source .travis/logger.sh
|
||||
source .travis/common-functions.sh
|
||||
|
||||
# VERSION_TAG e.g. "11.0.4+11" or "13+33"
|
||||
VERSION_TAG=$1
|
||||
OPENJDK_MAJOR=${VERSION_TAG/.*/}
|
||||
OPENJDK_MAJOR=${OPENJDK_MAJOR/+*/}
|
||||
#BASE_URL=https://github.com/AdoptOpenJDK/openjdk${OPENJDK_MAJOR}-binaries/releases/download
|
||||
BASE_URL=https://pmd-code.org/openjdk
|
||||
# OPENJDK_VERSION e.g. "11"
|
||||
OPENJDK_VERSION=$1
|
||||
BASE_URL=https://pmd-code.org/openjdk/latest/jdk-${OPENJDK_VERSION}-
|
||||
|
||||
log_info "Installing OpenJDK${OPENJDK_MAJOR}U ${VERSION_TAG} for ${TRAVIS_OS_NAME}"
|
||||
log_info "Installing OpenJDK${OPENJDK_VERSION} for ${TRAVIS_OS_NAME}"
|
||||
|
||||
if travis_isOSX; then
|
||||
DOWNLOAD_URL=${BASE_URL}/jdk-${VERSION_TAG/+/%2B}/OpenJDK${OPENJDK_MAJOR}U-jdk_x64_mac_hotspot_${VERSION_TAG/+/_}.tar.gz
|
||||
DOWNLOAD_URL=${BASE_URL}mac64.tar.gz
|
||||
COMPONENTS_TO_STRIP=3 # e.g. jdk-11.0.3+7/Contents/Home/bin/java
|
||||
elif travis_isWindows; then
|
||||
DOWNLOAD_URL=${BASE_URL}/jdk-${VERSION_TAG/+/%2B}/OpenJDK${OPENJDK_MAJOR}U-jdk_x64_windows_hotspot_${VERSION_TAG/+/_}.zip
|
||||
DOWNLOAD_URL=${BASE_URL}windows64.zip
|
||||
else
|
||||
DOWNLOAD_URL=${BASE_URL}/jdk-${VERSION_TAG/+/%2B}/OpenJDK${OPENJDK_MAJOR}U-jdk_x64_linux_hotspot_${VERSION_TAG/+/_}.tar.gz
|
||||
DOWNLOAD_URL=${BASE_URL}linux64.tar.gz
|
||||
COMPONENTS_TO_STRIP=1 # e.g. openjdk-11.0.3+7/bin/java
|
||||
fi
|
||||
|
||||
OPENJDK_ARCHIVE=$(basename $DOWNLOAD_URL)
|
||||
|
||||
LOCAL_DIR=${HOME}/.cache/openjdk
|
||||
TARGET_DIR=${HOME}/openjdk${OPENJDK_MAJOR}
|
||||
TARGET_DIR=${HOME}/openjdk${OPENJDK_VERSION}
|
||||
|
||||
mkdir -p ${LOCAL_DIR}
|
||||
mkdir -p ${TARGET_DIR}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<projectlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="projectlist_1_0_0.xsd">
|
||||
xsi:noNamespaceSchemaLocation="projectlist_1_1_0.xsd">
|
||||
<description>Standard Projects</description>
|
||||
|
||||
<project>
|
||||
@@ -9,6 +9,19 @@ xsi:noNamespaceSchemaLocation="projectlist_1_0_0.xsd">
|
||||
<type>git</type>
|
||||
<connection>https://github.com/checkstyle/checkstyle</connection>
|
||||
<tag>checkstyle-8.10</tag>
|
||||
|
||||
<exclude-pattern>.*/target/test-classes/com/puppycrawl/tools/checkstyle/.*</exclude-pattern>
|
||||
<exclude-pattern>.*/target/generated-sources/.*</exclude-pattern>
|
||||
|
||||
<build-command><![CDATA[#!/usr/bin/env bash
|
||||
if test -e classpath.txt; then
|
||||
exit
|
||||
fi
|
||||
|
||||
mvn test-compile
|
||||
mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=classpath.txt
|
||||
]]></build-command>
|
||||
<auxclasspath-command>echo -n "$(pwd)/target/classes:$(pwd)/target/test-classes:"; cat classpath.txt</auxclasspath-command>
|
||||
</project>
|
||||
|
||||
<project>
|
||||
@@ -16,6 +29,39 @@ xsi:noNamespaceSchemaLocation="projectlist_1_0_0.xsd">
|
||||
<type>git</type>
|
||||
<connection>https://github.com/spring-projects/spring-framework</connection>
|
||||
<tag>v5.0.6.RELEASE</tag>
|
||||
|
||||
<build-command><![CDATA[#!/usr/bin/env bash
|
||||
if test -e classpath.txt; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# Note: openjdk8 will be installed by "before_install.sh"
|
||||
JAVA_HOME=${HOME}/openjdk8
|
||||
PATH=$JAVA_HOME/bin:$PATH
|
||||
|
||||
./gradlew build -x javadoc -x dokka -x asciidoctor -x test -x testNG -x api -x distZip
|
||||
cat >> build.gradle <<EOF
|
||||
task createSquishClasspath {
|
||||
doLast {
|
||||
def dependencies = new HashSet()
|
||||
dependencies.addAll(subprojects.configurations.compile.resolvedConfiguration.resolvedArtifacts.file.flatten())
|
||||
dependencies.addAll(subprojects.configurations.optional.resolvedConfiguration.resolvedArtifacts.file.flatten())
|
||||
dependencies.addAll(subprojects.configurations.testCompile.resolvedConfiguration.resolvedArtifacts.file.flatten())
|
||||
dependencies.addAll(subprojects.configurations.testRuntime.resolvedConfiguration.resolvedArtifacts.file.flatten())
|
||||
|
||||
def paths = new ArrayList()
|
||||
paths.addAll(subprojects.jar.outputs.files.asPath)
|
||||
paths.addAll(subprojects.sourceSets.test.output.resourcesDir)
|
||||
paths.addAll(subprojects.sourceSets.test.output.classesDirs.files.flatten())
|
||||
paths.addAll(dependencies)
|
||||
println paths.join(File.pathSeparator)
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
./gradlew createSquishClasspath -q > classpath.txt
|
||||
]]></build-command>
|
||||
<auxclasspath-command>cat classpath.txt</auxclasspath-command>
|
||||
</project>
|
||||
|
||||
<!---<project>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#
|
||||
# The functions here require the following scripts:
|
||||
# .travis/logger.sh
|
||||
# .travis/common-functions.sh
|
||||
#
|
||||
# The functions here require the following environment variables:
|
||||
# PMD_SF_USER
|
||||
@@ -12,6 +13,7 @@
|
||||
# In that case, just a error logging is provided.
|
||||
#
|
||||
function regression-tester_uploadBaseline() {
|
||||
change_ruby_version
|
||||
log_debug "$FUNCNAME branch=${TRAVIS_BRANCH}"
|
||||
local targetUrl="https://sourceforge.net/projects/pmd/files/pmd-regression-tester/"
|
||||
|
||||
@@ -49,6 +51,7 @@ function regression-tester_uploadBaseline() {
|
||||
# In that case, just a error logging is provided.
|
||||
#
|
||||
function regression-tester_executeDanger() {
|
||||
change_ruby_version
|
||||
log_debug "$FUNCNAME"
|
||||
|
||||
local errexitstate="$(shopt -po errexit)"
|
||||
|
||||
Binary file not shown.
@@ -19,7 +19,7 @@ echo "Setting up secrets..."
|
||||
# * id_rsa
|
||||
# * release-signing-key-D0BF1D737C9A1C22.gpg
|
||||
|
||||
openssl aes-256-cbc -K ${encrypted_a5724fade5c6_key} -iv ${encrypted_a5724fade5c6_iv} -in .travis/secrets.tar.enc -out .travis/secrets.tar -d
|
||||
openssl aes-256-cbc -K ${encrypted_3b9f0b9d36d1_key} -iv ${encrypted_3b9f0b9d36d1_iv} -in .travis/secrets.tar.enc -out .travis/secrets.tar -d
|
||||
pushd .travis && tar xfv secrets.tar && popd
|
||||
mkdir -p "$HOME/.ssh"
|
||||
chmod 700 "$HOME/.ssh"
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ limitations apply:
|
||||
* Generally give **different results on Windows and Unix** because of different newlines.
|
||||
(carriage return linefeed on Windows, linefeed on Unixes).
|
||||
|
||||
We build our releases under **Linux** on [Travis CI](https://travis-ci.org/pmd/pmd).
|
||||
We build our releases under **Linux** on [Travis CI](https://travis-ci.com/pmd/pmd).
|
||||
|
||||
* Generally depend on the **major version of the JDK** used to compile. (Even with source/target defined,
|
||||
each major JDK version changes the generated bytecode.).
|
||||
|
||||
@@ -7,6 +7,7 @@ require 'logger'
|
||||
def run_pmdtester
|
||||
Dir.chdir('..') do
|
||||
argv = ['--local-git-repo', './pmd',
|
||||
'--list-of-project', './pmd/.travis/project-list.xml',
|
||||
'--base-branch', "#{ENV['TRAVIS_BRANCH']}",
|
||||
'--patch-branch', 'HEAD',
|
||||
'--patch-config', './pmd/.travis/all-java.xml',
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
source 'https://rubygems.org/'
|
||||
|
||||
# bleeding edge from git
|
||||
#gem 'pmdtester', :git => 'https://github.com/pmd/pmd-regression-tester.git'
|
||||
gem 'pmdtester', :git => 'https://github.com/pmd/pmd-regression-tester.git'
|
||||
|
||||
gem 'pmdtester', '~> 1.0'
|
||||
#gem 'pmdtester', '~> 1.0'
|
||||
gem 'danger', '~> 5.6', '>= 5.6'
|
||||
|
||||
# This group is only needed for rendering release notes
|
||||
|
||||
+17
-12
@@ -1,3 +1,13 @@
|
||||
GIT
|
||||
remote: https://github.com/pmd/pmd-regression-tester.git
|
||||
revision: 6875868e8be772807498ab46411e44d163633d64
|
||||
specs:
|
||||
pmdtester (1.1.0.pre.SNAPSHOT)
|
||||
differ (~> 0.1)
|
||||
nokogiri (~> 1.8)
|
||||
rufus-scheduler (~> 3.5)
|
||||
slop (~> 4.6)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
@@ -31,9 +41,9 @@ GEM
|
||||
multipart-post (>= 1.2, < 3)
|
||||
faraday-http-cache (1.3.1)
|
||||
faraday (~> 0.8)
|
||||
fugit (1.3.8)
|
||||
fugit (1.4.0)
|
||||
et-orbi (~> 1.1, >= 1.1.8)
|
||||
raabro (~> 1.3)
|
||||
raabro (~> 1.4)
|
||||
git (1.7.0)
|
||||
rchardet (~> 1.8)
|
||||
kramdown (1.17.0)
|
||||
@@ -44,19 +54,14 @@ GEM
|
||||
no_proxy_fix (0.1.2)
|
||||
nokogiri (1.10.10)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
octokit (4.18.0)
|
||||
octokit (4.19.0)
|
||||
faraday (>= 0.9)
|
||||
sawyer (~> 0.8.0, >= 0.5.3)
|
||||
open4 (1.3.4)
|
||||
pmdtester (1.0.1)
|
||||
differ (~> 0.1)
|
||||
nokogiri (~> 1.8)
|
||||
rufus-scheduler (~> 3.5)
|
||||
slop (~> 4.6)
|
||||
public_suffix (4.0.5)
|
||||
raabro (1.3.1)
|
||||
public_suffix (4.0.6)
|
||||
raabro (1.4.0)
|
||||
rchardet (1.8.0)
|
||||
rouge (3.22.0)
|
||||
rouge (3.24.0)
|
||||
rufus-scheduler (3.6.0)
|
||||
fugit (~> 1.1, >= 1.1.6)
|
||||
safe_yaml (1.0.5)
|
||||
@@ -76,7 +81,7 @@ PLATFORMS
|
||||
DEPENDENCIES
|
||||
danger (~> 5.6, >= 5.6)
|
||||
liquid (>= 4.0.0)
|
||||
pmdtester (~> 1.0)
|
||||
pmdtester!
|
||||
rouge (>= 1.7, < 4)
|
||||
safe_yaml (>= 1.0)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# PMD
|
||||
|
||||
[](https://gitter.im/pmd/pmd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://travis-ci.org/pmd/pmd)
|
||||
[](https://travis-ci.com/pmd/pmd)
|
||||
[](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd)
|
||||
[](https://github.com/jvm-repo-rebuild/reproducible-central#net.sourceforge.pmd:pmd)
|
||||
[](https://coveralls.io/github/pmd/pmd)
|
||||
|
||||
+1
-1
@@ -163,7 +163,7 @@ git commit -a -m "Prepare pmd release ${RELEASE_VERSION}"
|
||||
|
||||
|
||||
echo
|
||||
echo "Tag has been pushed.... now check travis build: <https://travis-ci.org/pmd/pmd>"
|
||||
echo "Tag has been pushed.... now check travis build: <https://travis-ci.com/pmd/pmd>"
|
||||
echo
|
||||
echo
|
||||
echo "Press enter to continue..."
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
repository: pmd/pmd
|
||||
|
||||
pmd:
|
||||
version: 6.29.0-SNAPSHOT
|
||||
previous_version: 6.28.0
|
||||
date: ??-?????-2020
|
||||
version: 6.30.0-SNAPSHOT
|
||||
previous_version: 6.29.0
|
||||
date: ??-November-2020
|
||||
release_type: minor
|
||||
|
||||
# release types: major, minor, bugfix
|
||||
|
||||
@@ -125,6 +125,10 @@ the breaking API changes will be performed in 7.0.0.
|
||||
an API is tagged as `@Deprecated` or not in the latest minor release. During the development of 7.0.0,
|
||||
we may decide to remove some APIs that were not tagged as deprecated, though we'll try to avoid it." %}
|
||||
|
||||
#### 6.29.0
|
||||
|
||||
No changes.
|
||||
|
||||
#### 6.28.0
|
||||
|
||||
##### Deprecated API
|
||||
|
||||
@@ -18,7 +18,7 @@ The complete source code can be found on github:
|
||||
|
||||
## Continuous Integration
|
||||
|
||||
We use [Travis CI](https://travis-ci.org/pmd) as our ci service. The main repo and the eclipse plugin are built for
|
||||
We use [Travis CI](https://travis-ci.com/pmd) as our ci service. The main repo and the eclipse plugin are built for
|
||||
every push. Each pull request is built as well.
|
||||
|
||||
The maven snapshot artifacts are deployed at [Sonatypes OSS snapshot repository](https://oss.sonatype.org/content/repositories/snapshots/net/sourceforge/pmd/pmd/).
|
||||
|
||||
@@ -6,7 +6,7 @@ author: Romain Pelisse <rpelisse@users.sourceforge.net>, Andreas Dangel <adangel
|
||||
|
||||
This page describes the current status of the release process.
|
||||
|
||||
Since versions 5.4.5 / 5.5.4 there is an automated release process using [travis-ci](https://travis-ci.org)
|
||||
Since versions 5.4.5 / 5.5.4 there is an automated release process using [travis-ci](https://travis-ci.com)
|
||||
in place. However, there are still a few steps, that need manual examination.
|
||||
|
||||
Note: You can find a small shell script in the root of the repo: `do-release.sh`. This script guides you
|
||||
|
||||
@@ -127,6 +127,18 @@ represented by our 1.0 implementation as strings, meaning that `@BeginLine > "1"
|
||||
worked ---that's not the case in 2.0 mode.
|
||||
* <code>@ArgumentCount > <b style="color:red">'</b>1<b style="color:red">'</b></code> → `@ArgumentCount > 1`
|
||||
|
||||
* In XPath 1.0, the expression `/Foo` matches the *children* of the root named `Foo`.
|
||||
In XPath 2.0, that expression matches the root, if it is named `Foo`. Consider the following tree:
|
||||
```java
|
||||
Foo
|
||||
└─ Foo
|
||||
└─ Foo
|
||||
```
|
||||
Then `/Foo` will match the root in XPath 2, and the other nodes (but not the root) in XPath 1.
|
||||
See eg [an issue caused by this](https://github.com/pmd/pmd/issues/1919#issuecomment-512865434) in Apex,
|
||||
with nested classes.
|
||||
|
||||
|
||||
## Rule properties
|
||||
|
||||
**See [Defining rule properties](pmd_userdocs_extending_defining_properties.html#for-xpath-rules)**
|
||||
|
||||
+27
-44
@@ -14,55 +14,38 @@ This is a {{ site.pmd.release_type }} release.
|
||||
|
||||
### New and noteworthy
|
||||
|
||||
#### New Rules
|
||||
|
||||
* The new Apex rule {% rule "apex/performance/OperationWithLimitsInLoop" %} (`apex-performance`)
|
||||
finds operations in loops that may hit governor limits such as DML operations, SOQL
|
||||
queries and more. The rule replaces the three rules "AvoidDmlStatementsInLoops", "AvoidSoqlInLoops",
|
||||
and "AvoidSoslInLoops".
|
||||
|
||||
#### Renamed Rules
|
||||
|
||||
* The Java rule {% rule "java/errorprone/DoNotCallSystemExit" %} has been renamed to
|
||||
{% rule "java/errorprone/DoNotTerminateVM" %}, since it checks for all the following calls:
|
||||
`System.exit(int)`, `Runtime.exit(int)`, `Runtime.halt(int)`. All these calls terminate
|
||||
the Java VM, which is bad, if the VM runs an application server which many independent applications.
|
||||
|
||||
#### Deprecated Rules
|
||||
|
||||
* The Apex rules {% rule "apex/performance/AvoidDmlStatementsInLoops" %},
|
||||
{% rule "apex/performance/AvoidSoqlInLoops" %} and {% rule "apex/performance/AvoidSoslInLoops" %}
|
||||
(`apex-performance`) are deprecated in favour of the new rule
|
||||
{% rule "apex/performance/OperationWithLimitsInLoop" %}. The deprecated rules will be removed
|
||||
with PMD 7.0.0.
|
||||
|
||||
### Fixed Issues
|
||||
|
||||
* apex-performance
|
||||
* [#1713](https://github.com/pmd/pmd/issues/1713): \[apex] Mark Database DML statements in For Loop
|
||||
* core
|
||||
* [#2831](https://github.com/pmd/pmd/pull/2831): \[core] Fix XMLRenderer newlines when running under IBM Java
|
||||
* java-errorprone
|
||||
* [#2157](https://github.com/pmd/pmd/issues/2157): \[java] Improve DoNotCallSystemExit: permit call in main(), flag System.halt
|
||||
* [#2764](https://github.com/pmd/pmd/issues/2764): \[java] CloseResourceRule does not recognize multiple assignment done to resource
|
||||
* miscellaneous
|
||||
* [#2823](https://github.com/pmd/pmd/issues/2823): \[doc] Renamed/Moved rules are missing in documentation
|
||||
* vf (Salesforce VisualForce)
|
||||
* [#2765](https://github.com/pmd/pmd/issues/2765): \[vf] Attributes with dot cause a VfParseException
|
||||
* pmd-core
|
||||
* [#1939](https://github.com/pmd/pmd/issues/1939): \[core] XPath expressions return handling
|
||||
|
||||
|
||||
### API Changes
|
||||
|
||||
#### Deprecated API
|
||||
|
||||
* {% jdoc !!java::lang.java.ast.ASTPackageDeclaration#getPackageNameImage() %},
|
||||
{% jdoc !!java::lang.java.ast.ASTTypeParameter#getParameterName() %}
|
||||
and the corresponding XPath attributes. In both cases they're replaced with a new method `getName`,
|
||||
the attribute is `@Name`.
|
||||
* {% jdoc !!java::lang.java.ast.ASTClassOrInterfaceBody#isAnonymousInnerClass() %},
|
||||
and {% jdoc !!java::lang.java.ast.ASTClassOrInterfaceBody#isEnumChild() %},
|
||||
refs [#905](https://github.com/pmd/pmd/issues/905)
|
||||
|
||||
#### Internal API
|
||||
|
||||
Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
|
||||
You can identify them with the `@InternalApi` annotation. You'll also get a deprecation warning.
|
||||
|
||||
* {% jdoc !!javascript::lang.ecmascript.Ecmascript3Handler %}
|
||||
* {% jdoc !!javascript::lang.ecmascript.Ecmascript3Parser %}
|
||||
* {% jdoc !!javascript::lang.ecmascript.ast.EcmascriptParser#parserOptions %}
|
||||
* {% jdoc !!javascript::lang.ecmascript.ast.EcmascriptParser#getSuppressMap() %}
|
||||
* {% jdoc !!core::lang.rule.ParametricRuleViolation %}
|
||||
* {% jdoc !!core::lang.ParserOptions#suppressMarker %}
|
||||
* {% jdoc !!modelica::lang.modelica.rule.ModelicaRuleViolationFactory %}
|
||||
|
||||
|
||||
### External Contributions
|
||||
|
||||
* [#2803](https://github.com/pmd/pmd/pull/2803): \[java] Improve DoNotCallSystemExit (Fixes #2157) - [Vitaly Polonetsky](https://github.com/mvitaly)
|
||||
* [#2809](https://github.com/pmd/pmd/pull/2809): \[java] Move test config from file to test class - [Stefan Birkner](https://github.com/stefanbirkner)
|
||||
* [#2810](https://github.com/pmd/pmd/pull/2810): \[core] Move method "renderTempFile" to XMLRendererTest - [Stefan Birkner](https://github.com/stefanbirkner)
|
||||
* [#2811](https://github.com/pmd/pmd/pull/2811): \[java] CloseResource - Fix #2764: False-negative when re-assigning variable - [Andi Pabst](https://github.com/andipabst)
|
||||
* [#2813](https://github.com/pmd/pmd/pull/2813): \[core] Use JUnit's TemporaryFolder rule - [Stefan Birkner](https://github.com/stefanbirkner)
|
||||
* [#2816](https://github.com/pmd/pmd/pull/2816): \[apex] Detect 'Database' method invocations inside loops - [Jeff Bartolotta](https://github.com/jbartolotta-sfdc)
|
||||
* [#2829](https://github.com/pmd/pmd/pull/2829): \[doc] Small correction in pmd\_report\_formats.md - [Gustavo Krieger](https://github.com/gustavopcassol)
|
||||
* [#2834](https://github.com/pmd/pmd/pull/2834): \[vf] Allow attributes with dot in Visualforce - [rmohan20](https://github.com/rmohan20)
|
||||
* [#2842](https://github.com/pmd/pmd/pull/2842): \[core] Bump antlr4 from 4.7 to 4.7.2 - [Adrien Lecharpentier](https://github.com/alecharp)
|
||||
|
||||
{% endtocmaker %}
|
||||
|
||||
@@ -5,6 +5,88 @@ permalink: pmd_release_notes_old.html
|
||||
|
||||
Previous versions of PMD can be downloaded here: https://github.com/pmd/pmd/releases
|
||||
|
||||
## 24-October-2020 - 6.29.0
|
||||
|
||||
The PMD team is pleased to announce PMD 6.29.0.
|
||||
|
||||
This is a minor release.
|
||||
|
||||
### Table Of Contents
|
||||
|
||||
* [New and noteworthy](#new-and-noteworthy)
|
||||
* [Updated Apex Support](#updated-apex-support)
|
||||
* [New Rules](#new-rules)
|
||||
* [Renamed Rules](#renamed-rules)
|
||||
* [Deprecated Rules](#deprecated-rules)
|
||||
* [Fixed Issues](#fixed-issues)
|
||||
* [External Contributions](#external-contributions)
|
||||
* [Stats](#stats)
|
||||
|
||||
### New and noteworthy
|
||||
|
||||
#### Updated Apex Support
|
||||
|
||||
* The Apex language support has been bumped to version 50 (Winter '21). All new language features are now properly
|
||||
parsed and processed. Especially the [Safe Navigation Operator](https://releasenotes.docs.salesforce.com/en-us/winter21/release-notes/rn_apex_SafeNavigationOperator.htm) is now supported.
|
||||
See also [Salesforce Winter '21 Release Notes](https://releasenotes.docs.salesforce.com/en-us/winter21/release-notes/rn_apex.htm)
|
||||
|
||||
#### New Rules
|
||||
|
||||
* The new Apex rule [`OperationWithLimitsInLoop`](https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_performance.html#operationwithlimitsinloop) (`apex-performance`)
|
||||
finds operations in loops that may hit governor limits such as DML operations, SOQL
|
||||
queries and more. The rule replaces the three rules "AvoidDmlStatementsInLoops", "AvoidSoqlInLoops",
|
||||
and "AvoidSoslInLoops".
|
||||
|
||||
#### Renamed Rules
|
||||
|
||||
* The Java rule [`DoNotCallSystemExit`](https://pmd.github.io/pmd-6.29.0/pmd_rules_java_errorprone.html#donotcallsystemexit) has been renamed to
|
||||
[`DoNotTerminateVM`](https://pmd.github.io/pmd-6.29.0/pmd_rules_java_errorprone.html#donotterminatevm), since it checks for all the following calls:
|
||||
`System.exit(int)`, `Runtime.exit(int)`, `Runtime.halt(int)`. All these calls terminate
|
||||
the Java VM, which is bad, if the VM runs an application server which many independent applications.
|
||||
|
||||
#### Deprecated Rules
|
||||
|
||||
* The Apex rules [`AvoidDmlStatementsInLoops`](https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_performance.html#avoiddmlstatementsinloops),
|
||||
[`AvoidSoqlInLoops`](https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_performance.html#avoidsoqlinloops) and [`AvoidSoslInLoops`](https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_performance.html#avoidsoslinloops)
|
||||
(`apex-performance`) are deprecated in favour of the new rule
|
||||
[`OperationWithLimitsInLoop`](https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_performance.html#operationwithlimitsinloop). The deprecated rules will be removed
|
||||
with PMD 7.0.0.
|
||||
|
||||
### Fixed Issues
|
||||
|
||||
* apex
|
||||
* [#2839](https://github.com/pmd/pmd/issues/2839): \[apex] Apex classes with safe navigation operator from Winter 21 (50.0) are skipped
|
||||
* apex-performance
|
||||
* [#1713](https://github.com/pmd/pmd/issues/1713): \[apex] Mark Database DML statements in For Loop
|
||||
* core
|
||||
* [#2831](https://github.com/pmd/pmd/pull/2831): \[core] Fix XMLRenderer newlines when running under IBM Java
|
||||
* java-errorprone
|
||||
* [#2157](https://github.com/pmd/pmd/issues/2157): \[java] Improve DoNotCallSystemExit: permit call in main(), flag System.halt
|
||||
* [#2764](https://github.com/pmd/pmd/issues/2764): \[java] CloseResourceRule does not recognize multiple assignment done to resource
|
||||
* miscellaneous
|
||||
* [#2823](https://github.com/pmd/pmd/issues/2823): \[doc] Renamed/Moved rules are missing in documentation
|
||||
* vf (Salesforce VisualForce)
|
||||
* [#2765](https://github.com/pmd/pmd/issues/2765): \[vf] Attributes with dot cause a VfParseException
|
||||
|
||||
### External Contributions
|
||||
|
||||
* [#2803](https://github.com/pmd/pmd/pull/2803): \[java] Improve DoNotCallSystemExit (Fixes #2157) - [Vitaly Polonetsky](https://github.com/mvitaly)
|
||||
* [#2809](https://github.com/pmd/pmd/pull/2809): \[java] Move test config from file to test class - [Stefan Birkner](https://github.com/stefanbirkner)
|
||||
* [#2810](https://github.com/pmd/pmd/pull/2810): \[core] Move method "renderTempFile" to XMLRendererTest - [Stefan Birkner](https://github.com/stefanbirkner)
|
||||
* [#2811](https://github.com/pmd/pmd/pull/2811): \[java] CloseResource - Fix #2764: False-negative when re-assigning variable - [Andi Pabst](https://github.com/andipabst)
|
||||
* [#2813](https://github.com/pmd/pmd/pull/2813): \[core] Use JUnit's TemporaryFolder rule - [Stefan Birkner](https://github.com/stefanbirkner)
|
||||
* [#2816](https://github.com/pmd/pmd/pull/2816): \[apex] Detect 'Database' method invocations inside loops - [Jeff Bartolotta](https://github.com/jbartolotta-sfdc)
|
||||
* [#2829](https://github.com/pmd/pmd/pull/2829): \[doc] Small correction in pmd\_report\_formats.md - [Gustavo Krieger](https://github.com/gustavopcassol)
|
||||
* [#2834](https://github.com/pmd/pmd/pull/2834): \[vf] Allow attributes with dot in Visualforce - [rmohan20](https://github.com/rmohan20)
|
||||
* [#2842](https://github.com/pmd/pmd/pull/2842): \[core] Bump antlr4 from 4.7 to 4.7.2 - [Adrien Lecharpentier](https://github.com/alecharp)
|
||||
* [#2865](https://github.com/pmd/pmd/pull/2865): \[java] (doc) Update ExcessiveImports example code for clarity - [Gustavo Krieger](https://github.com/gustavopcassol)
|
||||
* [#2866](https://github.com/pmd/pmd/pull/2866): \[java] (doc) Fix example for CouplingBetweenObjects - [Gustavo Krieger](https://github.com/gustavopcassol)
|
||||
|
||||
### Stats
|
||||
* 50 commits
|
||||
* 23 closed tickets & PRs
|
||||
* Days since last release: 27
|
||||
|
||||
## 26-September-2020 - 6.28.0
|
||||
|
||||
The PMD team is pleased to announce PMD 6.28.0.
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
<parent>
|
||||
<groupId>net.sourceforge.pmd</groupId>
|
||||
<artifactId>pmd</artifactId>
|
||||
<version>6.29.0-SNAPSHOT</version>
|
||||
<version>6.30.0-SNAPSHOT</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>8</java.version>
|
||||
<apex.jorje.version>2020-06-04-ba31c0</apex.jorje.version>
|
||||
<apex.jorje.version>2020-09-10-5a5192</apex.jorje.version>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
|
||||
BIN
Binary file not shown.
+1
-1
@@ -4,6 +4,6 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>apex</groupId>
|
||||
<artifactId>apex-jorje-lsp-minimized</artifactId>
|
||||
<version>2020-06-04-ba31c0</version>
|
||||
<version>2020-09-10-5a5192</version>
|
||||
<description>POM was created from install:install-file</description>
|
||||
</project>
|
||||
@@ -3,10 +3,10 @@
|
||||
<groupId>apex</groupId>
|
||||
<artifactId>apex-jorje-lsp-minimized</artifactId>
|
||||
<versioning>
|
||||
<release>2020-06-04-ba31c0</release>
|
||||
<release>2020-09-10-5a5192</release>
|
||||
<versions>
|
||||
<version>2020-06-04-ba31c0</version>
|
||||
<version>2020-09-10-5a5192</version>
|
||||
</versions>
|
||||
<lastUpdated>20200724082242</lastUpdated>
|
||||
<lastUpdated>20201022163714</lastUpdated>
|
||||
</versioning>
|
||||
</metadata>
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>net.sourceforge.pmd</groupId>
|
||||
<artifactId>pmd</artifactId>
|
||||
<version>6.29.0-SNAPSHOT</version>
|
||||
<version>6.30.0-SNAPSHOT</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.apex.ast;
|
||||
|
||||
import apex.jorje.semantic.ast.compilation.InvalidDependentCompilation;
|
||||
|
||||
public final class ASTInvalidDependentCompilation extends ApexRootNode<InvalidDependentCompilation> {
|
||||
|
||||
ASTInvalidDependentCompilation(InvalidDependentCompilation userClass) {
|
||||
super(userClass);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object jjtAccept(ApexParserVisitor visitor, Object data) {
|
||||
return visitor.visit(this, data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getImage() {
|
||||
String apexName = getDefiningType();
|
||||
return apexName.substring(apexName.lastIndexOf('.') + 1);
|
||||
}
|
||||
}
|
||||
@@ -55,4 +55,8 @@ public class ASTReferenceExpression extends AbstractApexNode<ReferenceExpression
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public boolean isSafeNav() {
|
||||
return node.isSafeNav();
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import apex.jorje.data.Location;
|
||||
import apex.jorje.data.Locations;
|
||||
import apex.jorje.semantic.ast.AstNode;
|
||||
import apex.jorje.semantic.exception.UnexpectedCodePathException;
|
||||
import apex.jorje.semantic.symbol.type.TypeInfo;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ApexNode}
|
||||
@@ -82,18 +83,28 @@ public abstract class AbstractApexNode<T extends AstNode> extends AbstractApexNo
|
||||
}
|
||||
}
|
||||
|
||||
private TypeInfo getDefiningTypeOrNull() {
|
||||
try {
|
||||
return node.getDefiningType();
|
||||
} catch (UnsupportedOperationException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefiningType() {
|
||||
if (node.getDefiningType() != null) {
|
||||
return node.getDefiningType().getApexName();
|
||||
TypeInfo definingType = getDefiningTypeOrNull();
|
||||
if (definingType != null) {
|
||||
return definingType.getApexName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
if (node.getDefiningType() != null) {
|
||||
return node.getDefiningType().getNamespace().toString();
|
||||
TypeInfo definingType = getDefiningTypeOrNull();
|
||||
if (definingType != null) {
|
||||
return definingType.getNamespace().toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Loaded 30 of 103 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user