Commit Graph

589 Commits

Author SHA1 Message Date
b05d42de48 [java] Revamp AccessorClassGeneration
- Fixes #291
 - Complete rewrite. Simpler and faster, using the RuleChain and SymbolTable.
2017-03-18 10:38:19 +01:00
16f2094401 Merge branch 'issue-275' into pmd/5.5.x 2017-03-03 19:12:51 +01:00
19114a7030 Simplify XPath expression 2017-03-03 19:03:26 +01:00
fb405fef08 [java] fields in annotations are public static
- Fixes #275
2017-03-03 19:03:26 +01:00
7a1eb4f26e [java] Fix class scopes for anon inner classes
- A new ClassScope was being created for each annon inner class method / field,
    which is incorrect.
 - I reworked the AccessorMethodGeneration to compare scopes directly, since
    I was missing anonymous classes completely.
 - Fixes #274
2017-03-03 18:42:36 +01:00
12fb1c2d7f [maven-release-plugin] prepare for next development iteration 2017-02-25 20:44:32 +01:00
765a542604 [maven-release-plugin] prepare release pmd_releases/5.5.4 2017-02-25 20:44:24 +01:00
4c7774ebf0 [maven-release-plugin] prepare for next development iteration 2017-02-25 19:03:45 +01:00
0eec906467 [maven-release-plugin] prepare release pmd_releases/5.4.5 2017-02-25 19:03:37 +01:00
58b863e204 Merge branch 'pr-266' into pmd/5.5.x 2017-02-21 23:20:08 -03:00
227060e5f8 corrected invalid reporting of LoD violation 2017-02-21 23:07:51 -03:00
a1299c5b9b Merge branch 'issue-257' into pmd/5.5.x 2017-02-20 16:06:26 +01:00
8f22e69560 Ugly workaround that don't need to change AST 2017-02-20 16:00:39 +01:00
907972f0ca [java] Improve grammar for CastExpression
- Provide a definite fix for casts. This allowed to remove a bunch of hacks.
 - I had to change the grammar a bit... `(int)` is now a cast with a
    PrimitiveType as child, not a Type with a nested PrimitiveType. This is due
    to JavaCC completely ignoring whatever you place in the LOOKAHEAD in favor
    of just looking the follow-up expression completely.
 - Removing the hacks raised an issue with expression orders, caused also by JavaCC's
    disregard to LOOKAHEAD contents
2017-02-20 16:00:39 +01:00
a5089b27da [java] syboltable resolves inner class methods
- This fixes the last known false negative for `AccessorMethodGeneration`
2017-02-20 15:42:10 +01:00
9264fda777 Merge branch 'pr-262' into pmd/5.5.x 2017-02-17 15:54:39 -03:00
282a803a83 Allow annotations for UnnecessaryLocalBeforeReturnRule
- Fixes #933
2017-02-17 15:54:08 -03:00
a92adc4bdf Merge branch 'pr-249' into pmd/5.5.x 2017-02-15 19:58:14 +01:00
756e9a713a Update docs to reflect on changes 2017-02-15 19:47:08 +01:00
b4d05e5f14 Checkstyle fixes 2017-02-15 19:47:08 +01:00
1fb05d995f [java] Revamp UnusedModifier
- This covers a ton of missing cases
 - Fixes #246
 - Fixes #247
 - Fixes #248
 - Notice `isNested` has been improved on `ASTClassOrInterfaceDeclaration`
    to cover being nested in an annotation definition
2017-02-15 19:47:08 +01:00
4137df4309 [java] UnnecessaryLocalBeforeReturn checks usages
- We now check symbol table usages to detect violations.
 - We drop the consecutive lines requirement.
 - Resolves #240
2017-02-14 21:57:47 +01:00
983a0dc9b8 Remove the to be ignored test from the regressionTests 2017-02-13 21:04:12 +01:00
e027871f2a [java] Add AccessorMethodGeneration rule
- This resolves #1496
 - There is still an outstanding false negative, which is down to a bug in
    symbol table analysis, I'm leaving that out for the moment, and address it
    on a separate PR.
2017-02-13 19:54:20 +01:00
4ee4f5983e [java] Fix classscope references
- A bunch of closely related issues fixed:
   - References to `this`, `super` and `Classname` were very badly resolved
      (pointed to variables, methods, or nothing at all on empty classes)
   - Annotations would not be registered by their parent scopes.
2017-02-13 19:20:31 +01:00
04a4145b1c [doc] Improve docs on InvalidSlf4jMessageFormatRule 2017-02-12 11:03:36 +01:00
294dd3e6af Merge branch 'issue-232' into pmd/5.5.x 2017-02-12 09:42:26 +01:00
ed7714391a [java] Fix FP in SimplifiedTernary with null value
- Fixes #232
 - Alo improve the docs formatting, it's getting garbled on the web..
2017-02-12 09:35:08 +01:00
067c2e9a22 Merge branch 'pr-230' into pmd/5.5.x 2017-02-11 15:29:46 +01:00
c5d4951728 [java] Tidy up ClassScope code
- Sibling node search cn be easier
 - Remove dead code in generic resolution
 - Make sure generics resolution goes up through nested classes
2017-02-11 15:25:26 +01:00
357b10952d [java] Fix same package import from default package
- If the package was passed as an empty string rather than a `null`, we
    would attempt to load classes such as `.Foo` rather than `Foo`.
2017-02-11 15:07:18 +01:00
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