Juan Martín Sotuyo Dodero
6283316e51
Avoid redundant method calls and improve codebase
...
- Avoid making calls within for loops, specially costly ones
such as `getQualifiedTypeNames`
- Don't create lists when they are empty.
- Create lists of proper size to avoid resizing / oversizing
- I'm seeing a ~5% improvement. We are reaching the point were noise
makes it hard to detect improvements. We should attack GC cycles soon.
2017-01-03 11:41:33 +01:00
Andreas Dangel
c9ada390db
Merge branch 'pr-161'
...
Closes #161 (rebased onto pmd/5.5.x)
2017-01-03 11:33:24 +01:00
Juan Martín Sotuyo Dodero
b950929b7c
Improve symboltable codebase
...
- Move shared code to pmd-core
- Allow search methods to stop searching when they want to
- If we are looking for a variable declaration, just search among those and not all name declarations
- This is roughtly another 10% improvement on symbol table performance
2017-01-03 11:22:42 +01:00
Juan Martín Sotuyo Dodero
b6bc06d3d2
Avoid comparing strings all time
2017-01-03 11:21:13 +01:00
Andreas Dangel
5d9010672d
Merge branch 'pr-159'
...
Closes #159 (rebased onto pmd/5.4.x)
2017-01-03 10:34:42 +01:00
Andreas Dangel
55b4d81fbf
Merge branch 'pr-159' into pmd/5.5.x
...
Closes #159 (rebased onto pmd/5.4.x)
2017-01-03 10:27:39 +01:00
Juan Martín Sotuyo Dodero
54db0ffbd9
[java] UnnecessaryFullyQualifiedNameRule handles same file class conflicts
...
- This resolves [#1555 ](https://sourceforge.net/p/pmd/bugs/1555/ )
- If a class is defined in the same file that conflicts with an import,
it's not considered a violation
2017-01-03 10:18:29 +01:00
Andreas Dangel
68fd556c9c
Merge branch 'add-clone-test' of https://github.com/Monits/pmd into pr-157
2017-01-03 10:09:02 +01:00
Andreas Dangel
d6ef39f4d4
Recycle the test cases of AvoidConstantsInInterface
2017-01-03 09:59:29 +01:00
Andreas Dangel
7a46613043
Merge branch 'issue-1512' of https://github.com/Monits/pmd into pr-156
2017-01-03 09:29:56 +01:00
Andreas Dangel
544d22f9b8
Merge branch 'checksum-aware' of https://github.com/Monits/pmd into pr-145
2016-12-23 18:21:50 +01:00
Andreas Dangel
e280151987
pmd-cpp/pmd-java: checkstyle fixes
2016-12-16 15:48:53 +01:00
Andreas Dangel
eb2d942ed4
pmd-core: checkstyle fixes
2016-12-16 12:32:18 +01:00
Andreas Dangel
36c34eee81
Merge branch 'pr-141'
...
Closes #141 (rebased for pmd/5.4.x)
2016-12-10 10:29:56 +01:00
Andreas Dangel
5ded17c5b5
Merge branch 'pr-141' into pmd/5.5.x
...
Closes #141 (rebased for pmd/5.4.x)
2016-12-10 10:20:39 +01:00
Juan Martín Sotuyo Dodero
28a24dec2a
[java] Speedup PreserveStackTrace by over 7X
...
- By avoiding to look at all variable declarators we can greatly improve
analysis speed without loosing accurancy
2016-12-10 10:13:37 +01:00
Andreas Dangel
21a012484d
Merge branch 'pr-140'
...
Closes #140 (rebased onto pmd/5.4.x)
2016-12-09 09:59:06 +01:00
Andreas Dangel
bb8b604152
Merge branch 'pr-140' into pmd/5.5.x
...
Closes #140 (rebased onto pmd/5.4.x)
2016-12-09 09:50:36 +01:00
Juan Martín Sotuyo Dodero
f4e727d274
[java] Make CloneMethodMustImplementCloneable over 500x faster
...
- This was an excruciatingly slow rule, the slowest by far of all PMD
- We speed it up by:
* checking early if we are analyzing a `clone()` method to cut the AST tree
* making better use of type information available
* only performing additional checks when we know we can't rely on
available type information
2016-12-09 09:44:23 +01:00
Andreas Dangel
b5b9ed7bc7
Merge branch 'symboltable-tidyup' of https://github.com/Monits/pmd into pr-139
2016-12-09 09:29:55 +01:00
Juan Martín Sotuyo Dodero
df0b52fa62
Uncomment the test scenario for issue 681
...
- This asserts the issue has actually been fixed and makes sure it won't return
2016-12-08 18:37:29 -03:00
Juan Martín Sotuyo Dodero
efebb1ef6b
Unify AvoidConstantsInterface and ConstantsInInterface
...
- We stick to ConstantsInInterface since it covers all scenarios the other one did,
and allows greater configuration.
- The existing test cases were already covered, so we can safely drop them.
2016-12-08 18:04:37 -03:00
Juan Martín Sotuyo Dodero
a9a6859b34
Merge branch 'pr-154'
2016-12-07 14:34:07 -03:00
Juan Martín Sotuyo Dodero
aa7a1f42f5
Merge branch 'pr-154' into pmd/5.5.x
2016-12-07 14:32:30 -03:00
Sebastian Ratz
61e0fc5875
[java] Fix #1547 : UnusedImports: Adjust regex to support underscores
2016-12-07 14:14:07 -03:00
Juan Martín Sotuyo Dodero
f20a90bc3f
Merge branch 'pr-152' into pmd/5.5.x
2016-12-07 13:27:10 -03:00
Felix Otto
9f1f63ffe6
fixes #1552 [java] continue does not require break
...
Similar to RETURN after a CONTINUE statement break is not required in a
case section
2016-12-07 13:10:23 -03:00
Felix Otto
2ab57e339a
fixes #1552 [java] continue does not require break
...
Similar to RETURN after a CONTINUE statement break is not required in a
case section
2016-12-05 12:51:26 +01:00
Andreas Dangel
1c3a247163
Merge branch 'issue-1551'
2016-12-03 18:20:44 +01:00
Andreas Dangel
4c5daadca7
Fixes #1551 [java] InvalidSlf4jMessageFormat: fails with NPE
2016-12-03 18:13:13 +01:00
Andreas Dangel
cc065baaf9
Merge branch 'issue-1541'
2016-12-03 17:58:15 +01:00
Andreas Dangel
9afebbea18
Fixes #1541 [java] InvalidSlf4jMessageFormat: False positive with placeholder and exception
2016-12-03 17:52:10 +01:00
Andreas Dangel
d2bc0f3739
Checkstyle fixes
2016-12-03 11:31:01 +01:00
Andreas Dangel
617c6c622c
Merge remote-tracking branch 'origin/master' into codestyle
...
# Conflicts:
# pmd-core/src/main/java/net/sourceforge/pmd/RuleContext.java
# pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactory.java
# pmd-core/src/main/java/net/sourceforge/pmd/RuleSets.java
# pmd-core/src/main/java/net/sourceforge/pmd/RulesetsFactoryUtils.java
# pmd-core/src/main/java/net/sourceforge/pmd/SourceCodeProcessor.java
# pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/SourceCodePositioner.java
# pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/AttributeAxisIterator.java
# pmd-core/src/main/java/net/sourceforge/pmd/lang/symboltable/AbstractScope.java
# pmd-core/src/main/java/net/sourceforge/pmd/processor/MonoThreadProcessor.java
# pmd-core/src/main/java/net/sourceforge/pmd/processor/MultiThreadProcessor.java
# pmd-core/src/test/java/net/sourceforge/pmd/ConfigurationTest.java
# pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryTest.java
# pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/imports/UnnecessaryFullyQualifiedNameRule.java
# pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symboltable/TypeSet.java
# pmd-java/src/test/java/net/sourceforge/pmd/lang/java/symboltable/ClassScopeTest.java
# pmd-java/src/test/java/net/sourceforge/pmd/lang/java/symboltable/STBBaseTst.java
# pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/AbstractPLSQLRule.java
# pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/XmlParserTest.java
2016-12-02 15:42:31 +01:00
Andreas Dangel
9e2bade8c2
pmd-java: checkstyle fixes
2016-12-02 12:42:06 +01:00
Andreas Dangel
2680c33d84
pmd-java: checkstyle fixes
2016-12-02 11:32:06 +01:00
Andreas Dangel
c2349d4cfb
pmd-java: external sample code of JDKVersionTest
2016-12-02 10:21:50 +01:00
Andreas Dangel
0ebcac0705
pmd-java: checkstyle / formatting
2016-12-02 10:21:27 +01:00
Juan Martín Sotuyo Dodero
1d6c9327a0
Refactor RuleSet creation
...
- RuleSet is now immutable
- RuleSets are created through a RuleSetBuilder
- RuleSetBuilder is accessed solely from RuleSetFactory
- RuleSetFactory can now either parse XMLs for rule set creation,
or create single rule rulesets
2016-11-30 15:25:19 -03:00
Juan Martín Sotuyo Dodero
52ee5e9b0b
Tiny improvements and code tidy up
2016-11-28 02:23:24 -03:00
Andreas Dangel
a6e3a20d19
Merge branch 'issue-1545'
...
Closes #134
PR has been rebased for 5.5.x
2016-11-26 20:03:55 +01:00
Juan Martín Sotuyo Dodero
268c62e772
Symbol table can now handle inner classes
...
- Types are now attempted to be resolved as inner classes if public attempt fails
- ClassScope offers a `resolveType` method that qualifies the name as per local rules
before resolution
2016-11-26 19:53:53 +01:00
Andreas Dangel
70cd1e816d
Merge branch 'issue-1546'
...
Closes #133
PR has been rebased for 5.4.x/5.5.x/master
2016-11-26 18:27:45 +01:00
Andreas Dangel
ef98657965
Merge branch 'issue-1546' into pmd/5.5.x
2016-11-26 18:20:43 +01:00
Juan Martín Sotuyo Dodero
7e3546c130
UnnecessaryFullyQualifiedName can detect conflicts
...
- Fixes https://sourceforge.net/p/pmd/bugs/1546/
2016-11-26 18:13:10 +01:00
Andreas Dangel
adcd402dd9
Merge branch 'pr-128'
...
Closes #128
Note, PR has been rebased for pmd/5.4.x, pmd/5.5.x and master
2016-11-26 11:17:21 +01:00
Andreas Dangel
390cbd1ffc
Merge branch 'pr-128' into pmd/5.5.x
2016-11-26 11:10:13 +01:00
Juan Martín Sotuyo Dodero
b5ca7baa9a
Ensure className is never null
2016-11-26 11:04:29 +01:00
Juan Martín Sotuyo Dodero
19a8d0d060
Minor optimizations to type resolution
2016-11-26 11:04:00 +01:00
Andreas Dangel
8ff9773945
Merge branch 'pr-127'
...
Closes #127
Cherry-Picked the commits
2016-11-26 10:41:50 +01:00