A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/185 below:

[java] CPD runs into NPE when analyzing Lucene · Issue #185 · pmd/pmd · GitHub

I use pmd-4.2.6.jar to detect clones with "net.sourceforge.pmd.cpd.GUI" (java -Xmx4g -XX:-UseGCOverheadLimit -cp pmd-4.2.6.jar net.sourceforge.pmd.cpd.GUI). To this version, I run with parameters -Xmx4g -XX:-UseGCOverheadLimit (I use Linux 64bits with 28GB of RAM). To detect clones I use "Ignore Literals and Identifiers=true" and "Scan subdiretories=true". This version is OK.

Today, I updated to latest version PMD-5.5.2 (5th November 2016). I runned this version with script "run.sh" (./run.sh cpdgui) in folder "bind". However this version show some erros:

Error 1: When the flag "Ignore identifiers" is true, the tool show the follow message:
java.lang.NullPointerException
at net.sourceforge.pmd.cpd.JavaTokenizer$ConstructorDetector.processToken(JavaTokenizer.java:235)
at net.sourceforge.pmd.cpd.JavaTokenizer.processToken(JavaTokenizer.java:76)
at net.sourceforge.pmd.cpd.JavaTokenizer.tokenize(JavaTokenizer.java:54)
at net.sourceforge.pmd.cpd.CPD.addAndThrowLexicalError(CPD.java:143)
at net.sourceforge.pmd.cpd.CPD.add(CPD.java:138)
at net.sourceforge.pmd.cpd.CPD.add(CPD.java:103)
at net.sourceforge.pmd.cpd.CPD.add(CPD.java:67)
at net.sourceforge.pmd.cpd.CPD.addDirectory(CPD.java:77)
at net.sourceforge.pmd.cpd.CPD.addRecursively(CPD.java:62)
at net.sourceforge.pmd.cpd.GUI.go(GUI.java:624)
at net.sourceforge.pmd.cpd.GUI.access$500(GUI.java:70)
at net.sourceforge.pmd.cpd.GUI$GoListener$1.run(GUI.java:198)
at java.lang.Thread.run(Unknown Source)

Error 2: Quando o sinalizador "Ignorar identificadores" for FALSE, "Ignorar literais" é VERDADEIRO e "Ignorar Anotações" é VERDADEIRO, a ferramenta mostrar a seguinte mensagem:
Exception in thread "Thread-1" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source)
at java.lang.AbstractStringBuilder.append(Unknown Source)
at java.lang.StringBuilder.append(Unknown Source)
at net.sourceforge.pmd.cpd.SourceCode.getSlice(SourceCode.java:173)
at net.sourceforge.pmd.cpd.MatchAlgorithm.findMatches(MatchAlgorithm.java:83)
at net.sourceforge.pmd.cpd.CPD.go(CPD.java:50)
at net.sourceforge.pmd.cpd.GUI.go(GUI.java:631)
at net.sourceforge.pmd.cpd.GUI.access$500(GUI.java:70)
at net.sourceforge.pmd.cpd.GUI$GoListener$1.run(GUI.java:198)
at java.lang.Thread.run(Unknown Source)

To try fix this last error, I also runned the version 5.5.2 with this parameters: "-Xmx4g -XX:-UseGCOverheadLimit", "-Xmx6g -XX:-UseGCOverheadLimit". But this not works.

In all executions, I used "Scan Subdirectories=TRUE" and "Duplicate chunks=75" and "File Encoding=UTF-8".

My Java version:
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

The source code that I analysed is Lucene (http://lucene.apache.org/solr/)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4