Andreas Dangel
1211e88363
[java] Fix null pointer with local vars in type resolution
2018-05-19 13:25:08 +02:00
Andreas Dangel
17fc7fae5a
[java] Fix NPE with ForLoopCanBeForeachRule when using this
2018-05-19 12:02:11 +02:00
Andreas Dangel
0b90fd0154
[java] Fix processing error with Cast + MethodReference
...
Occurred in https://github.com/spring-projects/spring-framework/blob/master/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java#L746
2018-05-19 10:29:20 +02:00
Clément Fournier
059b0f15c0
Abstract functionality of naming conventions rules
2018-05-19 00:19:14 +02:00
Clément Fournier
c10d920248
Fix implementation of isFindBoundary, add some doc
2018-05-18 21:00:35 +02:00
Clément Fournier
3062397c95
Add test case for premature decl inside lambda
2018-05-17 23:34:14 +02:00
Clément Fournier
69c8af287a
Fix a random false negative
2018-05-17 23:21:00 +02:00
Clément Fournier
7fb2641153
Simplify rule
2018-05-17 23:20:58 +02:00
Clément Fournier
eb4610c0fc
Add regression test case, refs #1108
2018-05-17 23:08:25 +02:00
Andreas Dangel
69fc648edd
[java] JUnit4TestShouldUseTestAnnotation
...
* use xpath 2.0
* add new regex parameter
* use typeof
2018-05-17 20:35:58 +02:00
Andreas Dangel
dcf73bf91a
[java] False Alarm of JUnit4TestShouldUseTestAnnotation on Predicates
...
Fixes #572
2018-05-17 16:32:47 +02:00
Clément Fournier
cb6b8277e4
Merge branch 'pr-1101'
2018-05-17 13:48:49 +02:00
Clément Fournier
b93320f723
Update release notes, refs #1101
...
Closes #1021
2018-05-17 13:47:24 +02:00
Akshat Bahety and GitHub
6d1d5e5963
Code Style Changes
2018-05-17 12:44:33 +05:30
Akshat Bahety and GitHub
dd3f20956f
Changes
2018-05-16 23:04:42 +05:30
Juan Martín Sotuyo Dodero and GitHub
d2dcbd4f1c
Merge branch 'master' into issue-1051
2018-05-15 10:25:50 -03:00
Akshat Bahety and GitHub
efc4644b93
Checkstyle Update
2018-05-15 17:57:18 +05:30
Andreas Dangel
03354aa92a
Merge branch 'pr-1097'
2018-05-15 09:17:30 +02:00
Andreas Dangel
393cac8930
[java] Use typeResolution for AvoidThrowingRawExceptionTypes
2018-05-15 09:16:04 +02:00
Andreas Dangel
a5207b017c
Merge branch 'pr-1098'
2018-05-15 09:09:51 +02:00
Andreas Dangel
bc31d9ac63
[java] Simplify ByteInstantiation and ShortInstantiation, too
...
refs #1098
2018-05-15 09:07:52 +02:00
Akshat Bahety
80d87aab0f
Fixes #1021
...
adding the error file for typeres
2018-05-14 20:03:35 +05:30
Akshat Bahety
8fb843626c
Merge branch 'master' of https://github.com/pmd/pmd
2018-05-14 19:52:28 +05:30
Akshat Bahety and Akshat Bahety
958fd34c0f
Fixes #1021
2018-05-14 19:45:41 +05:30
Juan Martín Sotuyo Dodero
13f0c8000a
[java] Don't report UseUtilityClass when extending
...
- Since the parent class is not a utility, we are neither (the parent
class may have non-static methods and fields).
- Since this is more general than the original check for exception
types, we remove that
- Fixes #824
- Take the chance to have the rule use the rulechain
2018-05-12 02:06:42 -03:00
Juan Martín Sotuyo Dodero
9b3fcc2608
[java] Simplify LongInstantiation and IntegerInstantiation
...
- Narrow down both rule's search space (therefore making better usage
of the rulechain and reducing number of checks performed)
- Use type resolution to simplify the rules and avoid FPs when
declaring classes with the same names
2018-05-12 01:37:59 -03:00
Juan Martín Sotuyo Dodero
a378299978
Use type resolution for AvoidThrowingRawExceptionTypes
...
- Fixes the false negatives
- Is actually 100X faster as we avoid all those `//ImportDeclaration`
2018-05-12 01:06:38 -03:00
Juan Martín Sotuyo Dodero
43839bd772
Failing test case for AvoidThrowingRawExceptionTypes
2018-05-12 01:03:33 -03:00
Andreas Dangel
70cbfd028e
Merge remote-tracking branch 'origin/master' into java10-basic-support
2018-05-11 16:21:08 +02:00
Andreas Dangel
93347719b3
[java] Rename ASTType.isVarType to ASTType.isTypeInferred
2018-05-11 16:17:00 +02:00
Andreas Dangel
b0266e3e77
[java] Populate types for VariableDeclarator and VariableDeclaratorId
...
when using local-var type inference
2018-05-11 16:16:52 +02:00
Andreas Dangel
a1b2d59fc2
[java] infer type for method arguments, too
2018-05-11 16:16:38 +02:00
Andreas Dangel
fd3c425d0a
[java] Resolve var type in enhanced for loop
2018-05-11 14:36:16 +02:00
Andreas Dangel
e2815a62d7
[java] var type in for loops and try-with-resources
...
Note: for loop enhanced doesn't support the type resolution yet
2018-05-11 09:43:05 +02:00
Clément Fournier
329e092e00
Make ClassNamingConventions' utility class definition more precise
...
Classes which have a superclass or implement an interface are not flagged
as utility classes anymore.
2018-05-08 19:41:17 +02:00
Clément Fournier
a8bd283545
Fix lambda qname infix in enum constants
2018-05-08 01:31:08 +02:00
Andreas Dangel
f0b847a7ad
[java] Determine type for Local Variable using the initializer's expression
2018-05-07 19:47:25 +02:00
Juan Martín Sotuyo Dodero
bcb3f65edb
Avoid NPE
2018-05-07 02:43:34 -03:00
Juan Martín Sotuyo Dodero
fb55ca703e
Also keep lambdas in a single scope
2018-05-06 20:42:51 -03:00
Juan Martín Sotuyo Dodero
c8b34b0dec
Simplify test
2018-05-06 20:42:51 -03:00
Juan Martín Sotuyo Dodero
980c72a10a
Simplify constructor scopes
2018-05-06 20:42:51 -03:00
Juan Martín Sotuyo Dodero
5de405d23f
[java] Fix scoping inconsistencies
...
- Reduce LocalScope creations. Method parameters and method locals have
the same visibility / reachability, so they should be in the same scope.
- Fix the grammar `assert` lookahead. There is no need to use `(`
- Fix illegal test code (shadowing of parameters is illegal)
- Update Scope tests to deal with changes
- Fixes #1051
2018-05-06 20:42:33 -03:00
Clément Fournier
dd2dcf6357
Merge branch 'pr-1071'
2018-05-03 23:43:59 +02:00
Juan Martín Sotuyo Dodero
863083d1a8
Merge branch 'pr-1072'
2018-05-01 14:55:40 -03:00
Andreas Dangel
d3d2fc2b9a
[java] Fix rule error due to new AST structure
2018-05-01 17:14:06 +02:00
Andreas Dangel
4af3a52356
[java] Fix unit test - default language is now java10
2018-05-01 17:14:06 +02:00
Andreas Dangel
18dfba939c
[java] First step for java10 local variable type inference
2018-05-01 17:14:06 +02:00
Andreas Dangel
8201ec984a
[java] Use multiple threads for PMDCoverageTest
2018-05-01 16:48:29 +02:00
Andreas Dangel
60ac38cd71
[java] Update PMDCoverageTest to verify stderr now
2018-05-01 16:48:29 +02:00
Juan Martín Sotuyo Dodero
7a5ff4fcfc
[java] Fix false-positives on PrematureDeclaration
...
- The code failed to detect closures once we enforced find boundaries,
so we now explicitely ask to cross them
2018-04-30 19:02:53 -03:00