Commit Graph

558 Commits

Author SHA1 Message Date
ac2eedf4dd [java] Qualify references to inner classes of imports
- Given an import on `a.Foo`, references to `Foo.Inner` should be qualified
    as `a.Foo.Inner`.
 - This fixes a couple of wrong missing classes.
 - The test also brought to light another issue with resolvers that would fail
    to resolve even a qualified inner class if not explicitly imported under
    certain circumstances.
2017-02-11 10:12:13 +01:00
2e64907776 [java] Restrict type searches for inner classes
- There are certain cases where we know exactly what to look for, not needing
    to brute force our way to inner classes. For those, use a direct approach.
2017-02-10 23:49:21 +01:00
cc6cc2c6bc Merge branch 'issue-216' into pmd/5.5.x 2017-02-06 20:13:43 +01:00
03306df325 [doc] [java] Improve docs on NonThreadSafeSingleton 2017-02-06 20:11:30 +01:00
53b4884dc0 Merge branch 'issue-219' into pmd/5.5.x 2017-02-06 20:02:10 +01:00
1950aeb001 [java] Fix ClassCastException in UnnecessaryLocalBeforeReturn
- This fixes #219
2017-02-06 19:52:41 +01:00
8ba4335080 Merge branch 'issue-215' into pmd/5.5.x 2017-02-05 17:51:08 +01:00
630b92b64e [java] Treat annotation members as public static final
- This fixes #215
 - I created a new method so we didn't change public APIs
2017-02-05 17:44:55 +01:00
4dc0699788 [maven-release-plugin] prepare for next development iteration 2017-01-28 14:43:17 +01:00
847ea1c084 [maven-release-plugin] prepare release pmd_releases/5.5.3 2017-01-28 14:43:17 +01:00
e9149551b7 [maven-release-plugin] prepare for next development iteration 2017-01-28 13:15:11 +01:00
12758ef777 [maven-release-plugin] prepare release pmd_releases/5.4.4 2017-01-28 13:15:10 +01:00
c402c0b970 Merge branch 'issue-1495' into pmd/5.5.x 2017-01-28 11:50:43 +01:00
6899c63597 Fixes #1495 [java] UnnecessaryLocalBeforeReturn with assert 2017-01-28 11:45:59 +01:00
ebf088693a Merge branch 'issue-1448' into pmd/5.5.x 2017-01-28 10:48:21 +01:00
7fbb304c8f java: ImmutableFieldRule - use enum 2017-01-28 10:43:17 +01:00
fa3a9b0d66 java: ImmutableFieldRule - take usages inside lambdas into account
Fixes #1448 ImmutableField Rule: Private field in inner class gives false positive[java] ImmutableField: Private field in inner class gives false positive with lambdas
2017-01-28 10:38:49 +01:00
ca3e31fc21 Merge branch 'issue-208' into pmd/5.5.x
Closes #211 (rebased onto pmd/5.4.x)
2017-01-27 20:04:51 +01:00
c53e1790e1 [java] Allow more than 1 annotation in local classes
- This fixes #208
2017-01-27 20:00:08 +01:00
640fad0872 Merge branch 'issue-206' into pmd/5.5.x
Closes #210 (rebased onto pmd/5.4.x)
2017-01-27 19:44:32 +01:00
455b1c4ded Fix grammar for annotation members
- The lookahead (3 tokens) was too small, and without reaching the opening
    parenthesis assumed it was parsing a method and not a field.
 - Using a larger lookahead solves the issue.
 - Fixes #206
2017-01-27 19:38:48 +01:00
f179eeab5d Merge branch 'issue-207' into pmd/5.5.x
Closes #209 (rebased onto pmd/5.4.x)
2017-01-27 19:20:16 +01:00
33fd84d521 [java] Support generics in method references
- Fixes #207
 - Extend the Java grammar to support generics in
    method references: `Type::<Generic>method`
2017-01-27 19:10:42 +01:00
e0ecc2f27c Merge branch 'issue-202' into pmd/5.5.x
Closes #205 (rebased onto pmd/5.4.x)
2017-01-27 17:37:55 +01:00
47137e3789 Improve docs on ConsecutiveAppendsShouldReuse
- This should help with people having doubts for this rule such as #202
    and http://stackoverflow.com/questions/37672785/how-can-i-improve-performance-if-append-is-called-on-stringbuffer-or-stringb
 - Fixes #202
2017-01-27 17:30:13 +01:00
fbb305bd17 Merge branch 'issue-199' into pmd/5.5.x
Closes #203 (rebased onto pmd/5.4.x)
2017-01-27 17:00:33 +01:00
420c6d45a3 Fixes #199 - False positives with ternary operator
- I deected a couple of extra related issues with ternary operators which are now fixed.
2017-01-27 16:42:24 +01:00
36fcdd252c Fix NPE error in CPD reported under #185 2017-01-27 11:26:51 +01:00
12f2431bb4 Fix build 2017-01-21 13:43:04 +01:00
620fed2732 Merge branch 'unit-test-for-pr-170' into pmd/5.5.x 2017-01-21 12:13:47 +01:00
ba260e753c Adjust unit test to verify console encoding of XML formatter 2017-01-21 11:58:59 +01:00
4c1890d56c Add unit test to verify encoding of XML formatter 2017-01-21 11:58:59 +01:00
923aab8065 Merge branch 'bug-1556' into pmd/5.5.x 2017-01-08 13:58:13 +01:00
c0e1c3e731 Slightly improve performance of XPath Rule UseLocaleWithCaseConversions 2017-01-08 13:51:44 +01:00
af3ad2bc02 Fixes #1556 [java] UseLocaleWithCaseConversions does not works with ResultSet (false negative) 2017-01-08 12:12:56 +01:00
c9514e563a Merge branch 'bug-177' into pmd/5.5.x
Fixes #177
2017-01-06 10:35:45 +01:00
af9d78c01a Update changelog 2017-01-06 10:16:45 +01:00
767c9aae79 Bugfix singular field + lambda 2017-01-06 10:07:19 +01:00
a499711990 Fix compile error 2017-01-03 12:12:11 +01:00
932ad7dd2b Reduce memory allocations during symbol table 2017-01-03 12:07:30 +01:00
992e5547bb Merge branch 'pr-162' into pmd/5.5.x
Closes #162 (rebased onto pmd/5.4.x)
2017-01-03 11:45:47 +01:00
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
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
b6bc06d3d2 Avoid comparing strings all time 2017-01-03 11:21:13 +01:00
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
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
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
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
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
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