1291 Commits

Author SHA1 Message Date
gonzalo
91b8a22b42 Update GenericToken specialToken method to obtain only comment tokens 2017-10-28 14:42:44 -03:00
gonzalo
e8fdbdbca4 Update GenericToken interface to expose directly region methods 2017-10-28 14:42:44 -03:00
gonzalo
26461e59c1 Simplify method name in GenericToken && improve ant task replacetoken 2017-10-28 14:42:44 -03:00
gonzalo
95835b8134 Update getter in GenericToken 2017-10-28 14:42:44 -03:00
gonzalo
490b34fea3 Change ant tasks over (Java) Token class 2017-10-28 14:42:44 -03:00
gonzalo
c00400ef77 Fix try with final resource 2017-10-18 08:50:06 -03:00
Juan Martín Sotuyo Dodero
fc3da283bd Merge branch 'pr-666' 2017-10-17 13:43:52 -03:00
Robert Painsi
82b219428b [java] Add DoNotExtendJavaLangThrowable rule
Copy and pasted code from DoNotExtendJavaLangError rule.

Resolves #367
https://github.com/pmd/pmd/issues/367
2017-10-14 18:19:55 +02:00
Andreas Dangel
77968550ef [java] Fix unit tests 2017-10-13 14:09:47 +02:00
Andreas Dangel
944b2f448b [java] Move rule SignatureDeclareThrowsException from typeresolution to strictexception
Replace existing rule with the typeresolution-based implementation.
2017-10-13 14:04:27 +02:00
Andreas Dangel
8470d32322 [java] Move rule UnusedImports from typeresolution to imports
Replace existing rule with the typeresolution-based implementation.
2017-10-13 12:54:26 +02:00
Andreas Dangel
a89d449169 [java] Move rule CloneMethodMustImplementCloneable from typeresolution to clone
Replace existing rule with the typeresolution-based implementation.
2017-10-13 12:37:04 +02:00
Andreas Dangel
2ef082ae19 [java] Move rule LooseCoupling from typeresolution to coupling
Replace existing rule with the typeresolution-based implementation.
2017-10-13 12:36:36 +02:00
Juan Martín Sotuyo Dodero
dbe0168865 [java] Avoid errors upon resolving invalid classes
- Resolves #328
 - Take the chance to simplify some error handling
(`NoClassDefFoundError` extends `LinkageError`)
2017-10-10 12:08:52 -03:00
Andreas Dangel
1af49cdca9 Fix checkstyle 2017-10-06 20:25:01 +02:00
Andreas Dangel
af4ddfbbcf [java] Fix rule StringToString after arrays are arrays 2017-10-06 20:17:09 +02:00
Andreas Dangel
e84866aa8d [java] typeresolution: don't throw if the type variables couldn't be resolved 2017-10-06 20:09:26 +02:00
Andreas Dangel
ece871c2f7 [java] typeresolution: when we couldn't resolve a method in
the first two phases, we assumed, that it would be varargs method.
This is not always the case.
2017-10-06 19:48:55 +02:00
Andreas Dangel
afae1385aa [java] typeresolution: support varags with generics 2017-10-06 18:05:30 +02:00
Andreas Dangel
acc05d4c9c [java] typeresolution: resolve arrays in some cases correctly 2017-10-06 18:05:27 +02:00
Andreas Dangel
04e65cd20c [java] typeresolution: avoid NPE if no type is known for a method argument 2017-10-06 18:05:27 +02:00
Andreas Dangel
231956c47e [java] typeresolution: simple inheritance/override check 2017-10-06 18:05:24 +02:00
Andreas Dangel
c0302cd314 [java] check for parsing/processing errors in unit test 2017-10-05 22:40:37 +02:00
Andreas Dangel
1582e40055 [java] typeresolution - add unit test for abstract return type case 2017-10-05 22:31:55 +02:00
Andreas Dangel
716e21221c [java] typeresolution: add test for generic wildcard method parameters 2017-10-05 22:28:00 +02:00
Andreas Dangel
efb78e9f79 [java] TypeResolution - support basic method overriding 2017-10-05 21:39:16 +02:00
Andreas Dangel
2e5dcf9a95 [java] Fix NPE in NcssCount rule
Parent could also be a enum or an annotation and not just a class/interface.
2017-10-05 21:04:25 +02:00
Andreas Dangel
dd596f0aef [java] Typeresolution: Return empty set instead of null for erased cadidate set 2017-10-05 20:56:46 +02:00
Andreas Dangel
b517838fbb [java] Fix ClassTypeResolver when using annotated types 2017-10-04 21:09:49 +02:00
Andreas Dangel
1ecf87c2b5 [java] Fix RedundantFieldInitializerRule not able to parse java7 literals with underscore 2017-10-04 20:54:42 +02:00
Juan Martín Sotuyo Dodero
d192c5668b Merge branch 'pr-646' 2017-09-30 19:16:57 -03:00
Juan Martín Sotuyo Dodero
e055416aaa Merge branch 'pr-645' 2017-09-30 18:54:03 -03:00
Andreas Dangel
3f2610ea21 Merge branch 'pr-602' 2017-09-29 11:21:26 +02:00
Andreas Dangel
f7d67df442 Remove ruleset schema 3.0.0 2017-09-29 11:20:37 +02:00
Andreas Dangel
8113696941 Update ASM library to support java9 2017-09-27 21:11:37 +02:00
Andreas Dangel
577ef1ff71 Declaring used dependencies explicitly
as determined by dependency:analyze
2017-09-24 10:39:49 +02:00
Andreas Dangel
8fc518c814 Using java9 as default version 2017-09-23 18:48:37 +02:00
Andreas Dangel
6590a358e6 Support concise try-with-resources with java9 2017-09-23 00:15:08 +02:00
Andreas Dangel
280a656f87 Checkstyle 2017-09-22 23:51:56 +02:00
Andreas Dangel
f30eb4b5ff Use semantic lookahead for the module productions
The new keyword are only "restricted keywords" and can still be used
as identifiers.
2017-09-22 23:43:43 +02:00
Andreas Dangel
07eede38db Fix unit test after changing return type to String (for XPath attributes) 2017-09-22 23:39:38 +02:00
Andreas Dangel
1020bf73db Enhance grammar to parse Java 9 module-info.java 2017-09-22 21:35:24 +02:00
Andreas Dangel
cb772167bb Simplify Java Language Module 2017-09-22 15:37:23 +02:00
Andreas Dangel
fa44c405bd Interface methods can be private now 2017-09-22 15:32:24 +02:00
Andreas Dangel
672f9216dd Simplify grammar: TypeArguments is not used here, it's resolved
as a child by ClassOrInterfaceType already
2017-09-22 15:32:24 +02:00
Andreas Dangel
77222904de Check for diamond operator for anonymous classes 2017-09-22 15:32:19 +02:00
Andreas Dangel
722b2b1657 Allow nested private methods 2017-09-22 13:33:08 +02:00
Andreas Dangel
cfa4b5b85c Add Java9 Language Module, Update grammar
* Java8 mode now rejects private methods in interfaces
* Java9 mode now rejects "_" as identifier
2017-09-22 12:19:38 +02:00
Clément Fournier
60d40aee6b Checkstyle 2017-09-17 23:17:32 +02:00
Clément Fournier
4f25c1feb3 Add test case for operations 2017-09-17 22:54:40 +02:00