-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from adangel:update-pmd-7.0.0-SNAPSHOT
Update to PMD 7.0.0-rc4 #182
- Loading branch information
Showing
39 changed files
with
418 additions
and
509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...src/main/java/net/sourceforge/pmd/eclipse/runtime/cmd/internal/CpdMarkWithSourceCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html | ||
*/ | ||
|
||
|
||
package net.sourceforge.pmd.eclipse.runtime.cmd.internal; | ||
|
||
import net.sourceforge.pmd.cpd.Mark; | ||
|
||
public class CpdMarkWithSourceCode { | ||
private final Mark mark; | ||
private final CharSequence sourceCode; | ||
|
||
public CpdMarkWithSourceCode(CpdResult result, Mark mark) { | ||
this.mark = mark; | ||
sourceCode = result.getSourceCodeSlices().get(this.mark); | ||
} | ||
|
||
public Mark getMark() { | ||
return mark; | ||
} | ||
|
||
public CharSequence getSourceCode() { | ||
return sourceCode; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...rc/main/java/net/sourceforge/pmd/eclipse/runtime/cmd/internal/CpdMatchWithSourceCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html | ||
*/ | ||
|
||
|
||
package net.sourceforge.pmd.eclipse.runtime.cmd.internal; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import net.sourceforge.pmd.cpd.Mark; | ||
import net.sourceforge.pmd.cpd.Match; | ||
|
||
public class CpdMatchWithSourceCode { | ||
private final Match match; | ||
private final Map<Mark, CharSequence> sourceCodeSlices = new HashMap<>(); | ||
|
||
public CpdMatchWithSourceCode(CpdResult result, Match match) { | ||
this.match = match; | ||
for (Mark mark : this.match.getMarkSet()) { | ||
sourceCodeSlices.put(mark, result.getSourceCodeSlices().get(mark)); | ||
} | ||
} | ||
|
||
public Match getMatch() { | ||
return match; | ||
} | ||
|
||
public Map<Mark, CharSequence> getSourceCodeSlices() { | ||
return sourceCodeSlices; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...ipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/runtime/cmd/internal/CpdResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html | ||
*/ | ||
|
||
|
||
package net.sourceforge.pmd.eclipse.runtime.cmd.internal; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import net.sourceforge.pmd.cpd.CPDReport; | ||
import net.sourceforge.pmd.cpd.Mark; | ||
import net.sourceforge.pmd.cpd.Match; | ||
|
||
public class CpdResult { | ||
private List<Match> matches = new ArrayList<>(); | ||
private Map<Mark, CharSequence> sourceCodeSlices = new HashMap<>(); | ||
|
||
public CpdResult(CPDReport report) { | ||
matches.addAll(report.getMatches()); | ||
for (Match match : matches) { | ||
for (Mark mark : match.getMarkSet()) { | ||
sourceCodeSlices.put(mark, report.getSourceCodeSlice(mark)); | ||
} | ||
} | ||
} | ||
|
||
public List<Match> getMatches() { | ||
return matches; | ||
} | ||
|
||
public Map<Mark, CharSequence> getSourceCodeSlices() { | ||
return sourceCodeSlices; | ||
} | ||
} |
Oops, something went wrong.