419 Commits

Author SHA1 Message Date
Clément Fournier
c7b4ec962c Checkstyle 2020-12-11 08:37:23 +01:00
Clément Fournier
90c123621a Make NPath return BigInteger 2020-12-11 08:37:23 +01:00
Clément Fournier
83389f7d47 Update tests 2020-12-11 08:37:23 +01:00
Clément Fournier
aee9c1792c Changes to js 2020-11-15 17:07:08 +01:00
Clément Fournier
95587416cf Merge branch 'java-new-xpath-functions' into core-parser-tasks 2020-11-15 16:54:08 +01:00
Clément Fournier
2fad9bf507 Changes to DataSource and test modules 2020-11-15 16:42:30 +01:00
Clément Fournier
67d3b8a4f4 Extract changes to lang-test 2020-11-13 14:43:02 +01:00
Clément Fournier
014ba90c88 Merge branch 'analysis-listener' into text-utils-simple 2020-10-30 20:45:57 +01:00
Clément Fournier
9c0ea3a992 Merge branch '7.0.x' into analysis-listener 2020-10-30 20:39:52 +01:00
Andreas Dangel
bc0d26eeb5 Fix tests compilation 2020-10-29 11:38:54 +01:00
Andreas Dangel
1862f4fe05 Merge branch 'master' into pmd/7.0.x 2020-10-29 10:52:38 +01:00
Andreas Dangel
01f1e8dede Add back pom.parent.relativePath for pmd-lang-test 2020-10-28 16:53:45 +01:00
Clément Fournier
a95c67c31e Upgrade to kotlin 1.4.1 and kotest 4.3.0 2020-10-26 17:08:08 +01:00
Andreas Dangel
4837c8dbc8 [maven-release-plugin] prepare for next development iteration 2020-10-24 10:17:24 +02:00
Andreas Dangel
81f12d3e5d [maven-release-plugin] prepare release pmd_releases/6.29.0 2020-10-24 10:17:15 +02:00
Clément Fournier
fb137b6484 Merge branch 'pmd7-test-cleanups' into analysis-listener 2020-10-17 17:56:46 +02:00
Clément Fournier
1089da7da2 Hide most methods of RuleTst
The supported API is now just the junit integration
2020-09-30 13:21:02 +02:00
Clément Fournier
5c59de5d52 Checkout changes to test utils 2020-09-28 19:46:34 +02:00
Andreas Dangel
aa245c6e1b [maven-release-plugin] prepare for next development iteration 2020-09-26 10:25:16 +02:00
Andreas Dangel
722f3ca997 [maven-release-plugin] prepare release pmd_releases/6.28.0 2020-09-26 10:25:05 +02:00
Clément Fournier
d690b50c07 Move text file stuff into the main document package 2020-09-17 22:37:23 +02:00
Clément Fournier
5d436fb7e1 Move factory methods to the interface 2020-09-17 22:37:12 +02:00
Clément Fournier
1254015334 Doc 2020-09-17 22:37:12 +02:00
Clément Fournier
dd4eac1ddb Doc for FileSystemCloseable 2020-09-17 22:35:06 +02:00
Clément Fournier
266ad0ddb2 Adapt to analysis listeners after rebase 2020-09-17 22:34:48 +02:00
Clément Fournier
9b735e75df Cleanup kotlin utils 2020-09-17 22:32:37 +02:00
Clément Fournier
81b8fd5e06 Fix text tests 2020-09-17 22:31:11 +02:00
Clément Fournier
1312fb739b Add line range region 2020-09-17 22:30:00 +02:00
Clément Fournier
dfe5710aee Fix tests of SCPositioner 2020-09-17 22:30:00 +02:00
Clément Fournier
69a067e9ad Merge branch 'java-grammar' into analysis-listener 2020-09-14 18:03:50 +02:00
Andreas Dangel
c59af0aee6 [maven-release-plugin] prepare for next development iteration 2020-08-31 18:30:18 +02:00
Andreas Dangel
856950f0d2 [maven-release-plugin] prepare release pmd_releases/6.27.0 2020-08-31 18:30:09 +02:00
Clément Fournier
d3d7495655 Fix tests 2020-08-31 09:21:58 +02:00
Clément Fournier
c331226022 Fix rebase 2020-08-31 08:37:41 +02:00
Clément Fournier
76d81e6979 Identify things to move to reporting package 2020-08-31 08:37:03 +02:00
Clément Fournier
f0f51ab720 Some tests 2020-08-31 08:37:02 +02:00
Clément Fournier
2979754fbd Cleanup 2020-08-31 08:35:21 +02:00
Clément Fournier
6e36a20dd1 Better error handling
Checkstyle + pmd
2020-08-31 08:35:07 +02:00
Clément Fournier
df9f53afa9 Cleanup 2020-08-31 08:34:25 +02:00
Clément Fournier
0a5c0bc015 Doc 2020-08-31 08:34:25 +02:00
Clément Fournier
c7d88ec506 Some sugar 2020-08-31 08:34:25 +02:00
Clément Fournier
e7e6793eb3 Make nodes have access to their language version 2020-08-31 08:34:14 +02:00
Clément Fournier
c66b3e8fa9 Remove report listeners 2020-08-31 08:34:14 +02:00
Clément Fournier
08b19dbcdd Simplify source code processor, change Parser
Remove some stuff with parser options

Get rid of SourceCodeProcessor

Seal processor hierarchy
2020-08-31 08:34:13 +02:00
Clément Fournier
0efba4ce18 Make test file not depend on internal api of core 2020-08-24 03:37:33 +02:00
Clément Fournier
d5445d7ea5 Normalize captures in tree dump 2020-08-23 20:37:53 +02:00
Clément Fournier
77f8c554ad Merge branch 'java-grammar' into typeres-jtypes 2020-08-23 20:05:43 +02:00
Clément Fournier
30466cd793 Use fillAttributes instead
More easily extensible
2020-08-23 20:05:16 +02:00
Clément Fournier
1f7c3373d6 Merge branch 'java-grammar' into typeres-jtypes 2020-08-23 18:48:00 +02:00
Clément Fournier
e5bf0b3f82 Turn ParserCornerTest into a tree dump test 2020-08-23 18:33:17 +02:00
Clément Fournier
ae1332ac29 Merge branch '7.0.x' into java-grammar 2020-08-23 17:51:19 +02:00
Clément Fournier
d5f48c4741 Merge branch '7.0.x' into update-saxon-version 2020-08-23 17:45:21 +02:00
Clément Fournier
58794b08af Update tree dump references
I tweaked the printer so that the
modifiers are printed not as separate
attributes. Eventually I think this
is how it should be done: no separate
attributes, but instead a function
 in XPath
2020-08-23 16:35:46 +02:00
Clément Fournier
8fd4cf274e Merge branch '7.0.x' into java-grammar 2020-08-22 21:22:41 +02:00
Clément Fournier
05727ace87 Merge branch 'master' into 7.0.x 2020-08-22 19:48:49 +02:00
Clément Fournier
7eed422f43 Refactor tests 2020-08-19 19:45:28 +02:00
Andreas Dangel
04850c69bc [java] Rework tests for Java 15 and Java 15 Preview 2020-08-19 18:54:00 +02:00
Clément Fournier
f740bb115b Try to fix bug with capture
Spot a bug with nested expressions. Skipping
instantiation is disabled until later
2020-08-11 19:30:56 +02:00
Clément Fournier
1e85519045 Merge branch '7.0.x' into update-saxon-version 2020-08-08 02:54:04 +02:00
Clément Fournier
2aa16b7c8a Merge branch 'java-grammar' into typeres-jtypes 2020-08-03 23:08:02 +02:00
Clément Fournier
766ab453b8 Merge branch '7.0.x' into java-grammar 2020-08-03 23:07:16 +02:00
Clément Fournier
c554aceba6 Merge branch 'master' into 7.0.x 2020-08-03 23:06:21 +02:00
Andreas Dangel
acf58f1887 Check for license headers in kotlin source files 2020-07-31 20:26:27 +02:00
Clément Fournier
78b6d6d684 Refactor not to use anon classes
Kotlin reflect doesn't like it
2020-07-31 13:25:56 +02:00
Clément Fournier
7620d46b89 Port tests to kotest 2020-07-31 01:10:00 +02:00
Clément Fournier
7188f50f49 Merge branch 'java-grammar' into typeres-jtypes 2020-07-31 00:22:41 +02:00
Andreas Dangel
5a58139d79 Fix compilation 2020-07-30 14:07:40 +02:00
Andreas Dangel
d26cc240fe Merge branch 'pmd/7.0.x' into java-grammar 2020-07-30 13:14:17 +02:00
Andreas Dangel
c8bc39a96c Fix compilation 2020-07-30 12:48:29 +02:00
Andreas Dangel
384dd20319 Merge branch 'master' into pmd/7.0.x 2020-07-30 11:51:53 +02:00
Andreas Dangel
5bff6ac52e Merge branch 'pr-2657'
[lang-test] Upgrade kotlintest to Kotest #2657
2020-07-30 10:31:43 +02:00
Clément Fournier
2449f6404e New typeres framework
Ceci est la combinaison de 338+ commits.

    Make set of classes to mirror types

    Implement capture conversion

    Document

    Doc

    Implement contains for targs

    Implement toString

    Fully implement subtyping

    Check for reifiability

    Implement unchecked, fix array subtyping

    Test rec typevar building

    Test primitive subtyping

    Test array subtyping

    Test wildcards subtyping

    Doc

    Rename primitiveType

    Reify conversions

    Test boxing

    Make constants for common types

    Test type param mutual recursion

    More defensive validation

    Implement numeric promotion

    Checkstyle

    Implement supertype set

    Implement lub

    Fix infinite recursion

    Fix lub bugs

    Use linkedhashset for stable ordering

    Add primitives to common types

    Move common types into type factory

    Try a lazy class resolver, needs a symbol table

    Improve lazy resolver

    Implement conditional expr typing

    remove poly impl

    Represent primitive wrappers differently

    Better compromise for primitive wrappers

    Extract wildcard interface

    Extract array type interface

    Refactor to extract interfaces

    Don't depend on initialization of jprimitiveType

    Finish pretty printer

    Remove dependency on reflection

    Fix class initialization trouble

    Move to type constants

    Use regular impl for OBJECT

    Encapsulate ops into TypeOps

    Add inference var to model

    Impl some ops

    Add some type inference algos

    Invocation context compatibility

    Add incorporation

    Generify bound set with ExprOps

    Add applicability tests

    Fix compil

    Add incorporation actions

    Implement incorporation

    Add inference steps

    Implement brute force walk strategy

    Remove some type params

    Wire in everything

    Implement methodtype

    Access methods from JClassType

    Represent enclosing types

    Work on overriding

    Implement expr ops

    Catch easy cases

    Diamond inference

    Fix pretty printer

    Fix concurrent mod

    Test

    Add reflect info to JModifier

    Add symbolic type declaration

    Most specific check

    Test with nested invocation

    Test lub

    Add constraints for lambdas and all subexpressions

    Resolve full call chain with lambdas

    Set partial results on nodes

    Test chain

    Doc

    Generalise expr mirrors

    Fix context

    Add invocation mirror

    Add support for method references

    make infer static

    Cleanup interface

    Fix constructor access

    Test method reference

    Cleanup method ref types

    Test constructor reference

    Test overload resolution, fix TODO

    Fix ctdecl of mref on non-ground target type

    Add graph walk strategy

    Document

    Use toposort

    Make enum constant implement ctor invoc mirror

    Work on context

    Test conditional expr type

    Handle switch exprs uniformly

    Fix bugs

    Add type inference performance test case

    Add overload resolution tests

    Cache result of overload selection, only recompute invocation

    Optimise common case in graph building

    Optimise propagation by merging variables

    Fix some tests, cleanup

    Preserve applicability phase

    Improve jsinglechildnode

    Add way to get a field's type

    Make more complex stress test

    Cache bound check results

    Type projection for inference

    Simplify lazy type inference of var ids

    Improve memory usage

    - reuse constant enum sets (by far the biggest leak, given the number of PropagateBounds created)
    - implement substitution without a visitor

    Optimise imports

    Cache hash of classes

    Cleanup

    Add overloads test

    Fix context fetching

    Fix lub bug

    Test switch expr

    Fix rebase

    Remove useless type

    Factorise poly check

    Remove base poly expr

    Fix array initializer

    Remove duplicated numeric literal typing

    Fix inferred iterable type

    Move method resolution phase to upper level

    Delete useless var

    Commit pr plan

    Remove useless method

    Fix enclosing type comb rule

    REVERT ME Remove partial enclosing type support

    Add package info

    Put task list in branch description

    Fix old rebases

    Fix rebase

    Simplify for left recursive ops

    Fix comments

    Fix rebase

    Revert "REVERT ME Remove partial enclosing type support"

    This reverts commit 8080ff1585b3a760fafc957282771baf716f3c7f.

    WIP base type mirrors on symbols

    Make JMethodType not a JTypeMirror

    Figure out getSymbol & type vars

    make type factory non-static

    Add a parameter to visitors

    Fix compilation

    Use symbol table in lazy type resolver

    Move package

    Fix most tests

    Move internal api around

    Specify some stuff

    Split reflect impl from API

    Make AST impl

    Equality routines

    Fix tests

    Move internal symtable doc

    Improve symtableResolver ergonomics

    Poly res tests

    Make AST type factory

    Update

    Make lambda expressions not a MethodlikeNode

    Build local var sym

    Update for switches

    Make Infer not static, fix logging

    Don't expose visitor nature of SymbolResolver

    Cleanup

    Improve type error handling

    Don't throw away CTdecls for an arg mismatch

    Fix more tests

    Local symbol tables

    Symbol table looks in interfaces

    Incompatible changes that should stay on this branch and not be squashed

    ResolveResult

    Explicitly typed lambdas

    Fix some static bugs

    Fix a lot of bugs

    Use FQCN symtable

    Move parsing contexts to upper level

    Cleanup

    DSL to test types

    test subst

    Dont create an exception for each failure

    Stack trace creation takes a significant amount of time

    Remove laziness for fetching method streams

    Streams obfuscate performance analysis by
    delaying the computation until the last
    moment.

    Fix some bugs with unresolved classes

    Also measure performance: full typeres
    is around same time as parsing. This is
    great. At this point 80% of all types
    are resolved (though some type inference
    results are probably incorrect). Mostly
    this comes from the fact that there are
    still AmbiguousNames in the tree.

    Fix problem with varargs

    Handle enclosing types

    Enclosing types

    Fix compil

    Add another stress test

    Refactor primitive subtyping

    Fix rebase

    Fix rebase: tests

    Figure out type factories WIP

    Move type ops into TypeOps

    Move AsSuper

    Figure out type factories WIP

    Make TypeSystem object

    wip

    WIP

    WIP

    Make typeops static

Fix grounding routine

Fix bug with return type

Start fixing tests

Cleanup primitive types

Fix some tests

Add todo

Remove JDK test dependency

Test cases lubbing String and
StringBuilder produce different
outputs on JDK [8, 11[ and 11+, because
StringBuilder was made a Comparable<StringBuilder>
in JDK 11

Implement most specific method selection

Drop JVariableSig from symbol table

Use asOuterSuper instead

Fix local var type inference with foreach.

Fix a lot of stuff based on jdk 12 run

Make type system own symbol factories

Fix intersection with bound

Fix standalone ternary types

Capture field access type

Eg class Foo<T> { T[] field; }
Foo<? extends T>.field : capture(T)[]

Add tests

Delete lexical substs

Fix reflected owner type

Add graph viz

Fix bug with graph reduction

Optimise ivar dependency reduction
by a lot. The previous 60s stress
test now takes 600ms.

Btw at this point type res for the
whole JDK 12 codebase takes 25 secs,
down from 175 on 6.20.0 (7x speedup).

Implement inherited field/class lookup

Fix scoping inside switch statements

Fix a few bugs

Handle inherited methods

Interfaces should inherit Object methods

Move lub into TypeSystem

Handle class types induced by intersections

Fix lambda congruence

Test lambda with intersection type

Fix inference

Fix same type check using equals

Simplify intersection type induction

Remove type sys extension

Simplify sym factories

Finish symbol factory streamlining

Document

Cache non-erased symbols separately

Doc

Revert, erased types are only raw

Get rid of generic constants in TypeSystem

Remove some dead code

Fix exact method reference

Improve unchecked conversion handling

Fix dependency of delegated ivars

Improve logging, fix a few bugs

Test enclosing types

Improve loggin

Print file location

Fix subtyping for wildcards

Fix standalone method types

Fix boxing conversion

Fix promotion on unary exprs

Implement special treatment of getClass()

Add tests for anon classes

Make symbol tables use lists for methods

Fix method reference with void target type

Move graphUtils

Make unresolved types bottom

(instead of top)

It's more likely to be useful. Eg.

Unresolved var = ...;

knownMethod(var);

Here, var must conform to the parameter,
if it is unresolved, we assume that's the
case. Otherwise we would fail resolution
of knownMethod for this call site.

The reverse situation is rarer.

Fix conversions in loose phase

Make JInferenceVar a class

Hide TypePair

Remove special string type

Fix toString of anon classes

Implement overload specificity for generic methdos

Fix anon class ctors

Fix Object methods not in scope in interfaces

Fixing anon class ctors WIP

Fix rebase

Cleanup

Print type var bounds

Fix tests, improve pretty printing

Hide ast sym factory

Fix array method erasure

Fix superclass, uncover bug with substitution

Substitute  type param bounds

Make Array have Object methods

Fix duplicated logging categories

Make root symbolFactory thread safe

Fix overload ambiguity with hiding

Fix exact method when they shadow each other

Make PMultimap type

Make shadowGroup

Make a few utilities to replace import tables

Replace other tables

Cleanup

Compat with old impl

Fix rebase

Port to using sigs

Make base class for shadow groups

Fix method group

Test shadowing of inherited members

Fix bugs with tparams

Specialize to StringMultimap

Big optimizations

Simplify a lot of things, remove caching
of getAllMethods

Factorize group implementations

Add resolveFirst

Fix bug with ctor invocation

Fix type parsing for union types

Generify multimap

Implement nextShadowGroup

Remove unused API of pmultimap

Use interface where possible

Fix tests

Use singleton resolvers more frequently

Remove commons collections dependency

Tries don't make a significant difference
in execution time. Mostly because tries
used in symbol tables are very small.

Remove some api of jtypemirror

Fix shadow barriers

Fix accessibility check for protected member

Qualified ctor invocations have access to inner class name

Make strict stream for profiling

LOOK AT ME strict streams

Strict streams are actually *much* more
efficient for our use case

Extract some stuff into CollectionUtil

Make methods shadow each other

doc

Simplify OptionalBool

Improve strict stream

Eventually I'll remove it

Doc newer symtable

Make PMultimap type

Make shadowGroup

Make a few utilities to replace import tables

Cleanup

Checkout newer sym table from typeres branch

Port

Checkout tests

Port tests, remove old impl

Extract augment function

Move classes back into internal package

Abstract stuff away for pmd-core

Optimise singular map case even more

Fix nextShadowGroup WIP

Make ShadowIterator to replace getNextGroup

Use chain iterator

Add tests

Finish impl

Add tests for supertype enumerator

Add tests for method shadowing in imports

Port to using types etc

Fix tests

Fix outdated tests

Fix anon class ctors

Fix more outdated tests

Object methods should be in scope in interfaces

Fix compil

Make simple signature parser

Make stubs

Figure out loading logic

Progress on type param parsing

Do away with nested classes

Class signatures

It works!

Parse tvar bounds lazily

Fix a lot of stuff

No errors on pmd-core

JDK 13 under 80s

Implement toString everywhere

Try to make the whole thing thread safe

Still a spurious NPE, access flags are weird.
For j.l.invoke.DelegatingMethodHandle
(declared as `final class Holder {}`) the
access flags from the class file are 0x32, and
the enclosing type is null, while when accessed
through reflection, the access flags are correctly
0x10. The class is engineered through VM magic
so idk what happens

Remove shared caching of TypeSystem

The sub caches are not useful anymore
and creating them all the time is wasteful

Add some tests

Fix improper locking

Reorganise typeSystem initialization

Change the name

Doc

Opts

Optimise away some expensive lookaheads in the parser

Doc

Fix modifiers

Optimise big switches in parser

Placing token decls that are frequently used together closer
increases the chance that the compiler generate a TABLESWITCH
instruction instead of a LOOKUPSWITCH. Table switches take
constant lookup time, while lookupswitch is linear. Selection
of table switch is now done for the biggest switches of the
parser: the one in types, in modifiers, in statements, and
at the start of expressions. Other lookup switches are unimportant
because they have very few labels (typically 2).

Optimise variable initializer lookahead

make test rule noop

PARSER Optimise common branches in expressions

PARSER opt blocks & statements

doc

Don't accept void by default

Split signature parsers

Simplify type param parsing

Simplify type params parsing

Some optimisations

Tests

Simplify synchronization

Factorize synchronization logic

Move ConsList into pmd-core

Prune more empty nodes

Use single map for asm resolver

Remove changes to parser

Add option to suppress type inference log entry creation

Use soft references to allow class stubs to be GCed

Fix rebase
2020-07-26 16:35:10 +02:00
Andreas Dangel
49ab75aeb7 [maven-release-plugin] prepare for next development iteration 2020-07-25 13:45:36 +02:00
Andreas Dangel
a9632e2a06 [maven-release-plugin] prepare release pmd_releases/6.26.0 2020-07-25 13:45:27 +02:00
Clément Fournier
6d73eaf3c7 Fix custom parser spec
Add kotest-runner-junit5-jvm as a dependency,
in pmd-java. This makes kotest discoverable
as Junit tests, which IDEs can pick up on (at
least IntelliJ does).

Update kotlin version to latest stable (1.3.72)
2020-07-20 16:33:29 +02:00
Clément Fournier
68ae318f02 Update to kotest 2020-07-20 00:12:40 +02:00
Andreas Dangel
c7d884c629 Merge branch 'pmd/7.0.x' into java-grammar 2020-07-17 16:38:12 +02:00
Andreas Dangel
dcaa8a1167 Merge branch 'master' into pmd/7.0.x 2020-07-17 16:13:02 +02:00
Andreas Dangel
94afdb117d Add test engines as surefire plugin dependencies
This removes junit-vintage-engine as a test dependency
as well as kotlintest-runner-junit5.
The engines are only needed during test execution, but should
not be available for test compilation.

For this to work, the latest surefire plugin is required.
2020-07-17 12:03:45 +02:00
Andreas Dangel
370c0b0b6d Remove unused dependency, explicitly declare used dependencies 2020-07-02 15:12:31 +02:00
Andreas Dangel
80d9e18011 pmd-lang-test: clarify dependencies 2020-07-02 14:16:39 +02:00
Andreas Dangel
95d8e80c1b [maven-release-plugin] prepare for next development iteration 2020-06-27 11:31:27 +02:00
Andreas Dangel
a219b2e1be [maven-release-plugin] prepare release pmd_releases/6.25.0 2020-06-27 11:31:16 +02:00
Clément Fournier
399fdd7b47 Move classes around 2020-06-22 21:17:16 +02:00
Andreas Dangel
93edd66ddd Merge branch 'pmd/7.0.x' into java-grammar 2020-06-21 13:12:51 +02:00
Andreas Dangel
a329621403 Merge branch 'pr-2463' into pmd/7.0.x
[swift] Refactor antlr implementation #2463
2020-06-21 12:25:41 +02:00
Andreas Dangel
891010468a Merge branch 'master' into pmd/7.0.x 2020-06-21 12:00:32 +02:00
Clément Fournier
bc604ab747 Merge branch '7.0.x' into java-grammar 2020-06-19 02:22:24 +02:00
Clément Fournier
c49d9e315f Merge branch 'master' into 7.0.x 2020-06-19 01:32:32 +02:00
Clément Fournier
d624ee99f0 Add tests 2020-06-18 21:32:19 +02:00
Clément Fournier
185c172b3c c++ ident unicode support 2020-06-18 20:54:41 +02:00
Andreas Dangel
b607fa95d0 Don't use \\R yet... 2020-06-18 19:58:12 +02:00
Clément Fournier
ce8166c324 Merge branch '7.0.x' into antlr-touchups 2020-06-15 17:20:27 +02:00
Clément Fournier
4b3d58d4c9 Normalize path to avoid surprises 2020-06-13 21:52:45 +02:00
Clément Fournier
6ff4a1c4d4 Rename test file 2020-06-13 21:37:47 +02:00
Clément Fournier
709996fddc Finish cpp module 2020-06-13 20:34:30 +02:00
Clément Fournier
551ab453fd Convert CPP tests 2020-06-13 20:14:08 +02:00
Clément Fournier
0a1e82efad Rename dir 2020-06-13 19:21:27 +02:00
Clément Fournier
1ee33c7c20 Normalize CPD newlines
Otherwise tests are not platform-independent.
Denormalizing to a platform-specific delimiter
should be done in the renderers
2020-06-13 16:57:57 +02:00
Clément Fournier
ceda6bb965 Fix newline-only tokens
This happens eg in XML. Previously the end column would have been zero. We can't blindly make it 1 because the end column is inclusive. So we instead use the last column of the previous line.
2020-06-13 14:46:55 +03:00
Clément Fournier
826bc36331 Normalize text before tokenizing
Otherwise column numbers are messed up on windows
2020-06-12 17:27:11 +02:00
Clément Fournier
1540ec6d91 Port remaining dart tests 2020-06-12 16:56:43 +02:00
Clément Fournier
ecc8699269 Add doc 2020-06-12 16:27:40 +02:00
Clément Fournier
b47001c90d Add text comparison tests for CPD 2020-06-12 16:01:00 +02:00
Andreas Dangel
cdeff1ab5c Merge branch 'pmd/7.0.x' into java-grammar 2020-06-12 14:35:09 +02:00
Andreas Dangel
c3219b91c5 Merge branch 'master' into pmd/7.0.x 2020-06-12 14:21:10 +02:00
Andreas Dangel
8defb2fde2 Add missing relativePath configuration in all pom modules 2020-06-07 12:36:58 +02:00
Andreas Dangel
abc230c637 [scala] Refactor project structure
* Avoid using symlinks, this is very difficult to get working
  under Windows
* Provide names for the different scala modules
* Rename pmd-scala to pmd-scala-common
* Restore main module pmd-scala for backwards compatibility
2020-06-07 11:52:10 +02:00
Andreas Dangel
ab04bdacdd [maven-release-plugin] prepare for next development iteration 2020-05-24 17:34:34 +02:00
Andreas Dangel
229cb2bdca [maven-release-plugin] prepare release pmd_releases/6.24.0 2020-05-24 17:34:25 +02:00
Andreas Dangel
18749b01ec Merge branch 'pmd/7.0.x' into java-grammar 2020-05-23 12:05:24 +02:00
Andreas Dangel
2dae9c085f Merge branch 'master' into pmd/7.0.x 2020-05-23 11:42:20 +02:00
Andreas Dangel
5f3ff0aed8 Remove hamcrest dependency, where it is not needed directly.
Use scope compile for hamcrest in pmd-lang-test
2020-05-22 11:36:49 +02:00
Artem Krosheninnikov
3fba3f6217 Update hamcrest to 2.2, Junit to 4.13, mockito to 2.28.2 2020-05-04 23:00:28 +03:00
Clément Fournier
97fef3fbd9 Fix tree builder, add tests 2020-05-02 22:56:42 +02:00
Andreas Dangel
5ce33352ad Merge branch 'pmd/7.0.x' into java-grammar 2020-05-02 18:08:17 +02:00
Andreas Dangel
4308c545e5 [maven-release-plugin] prepare for next development iteration 2020-04-24 10:53:12 +02:00
Andreas Dangel
921c65f5ab [maven-release-plugin] prepare release pmd_releases/6.23.0 2020-04-24 10:53:00 +02:00
Clément Fournier
036b2d5eca Cleanup more things 2020-04-23 20:00:17 +02:00
Clément Fournier
434881edac Fix tests 2020-04-23 19:59:52 +02:00
Clément Fournier
0735011c7c Move AbstractNode in .impl package 2020-04-23 19:59:52 +02:00
Andreas Dangel
ecb73cf7ac Merge branch 'pmd/7.0.x' into java-grammar 2020-04-23 12:26:14 +02:00
Andreas Dangel
46e966105d Merge branch 'master' into pmd/7.0.x 2020-04-23 11:47:21 +02:00
Andreas Dangel
61321c88f1 javadoc: add pmd-lang-test 2020-04-14 16:02:49 +02:00
Andreas Dangel
f32f5247bf Merge branch 'pmd/7.0.x' into java-grammar 2020-04-13 12:45:34 +02:00
Andreas Dangel
3621eed40d Merge remote-tracking branch 'origin/master' into pmd/7.0.x 2020-04-13 12:34:03 +02:00
Clément Fournier
e84de6c323 Merge branch '7.0.x' into java-grammar 2020-04-11 14:51:28 +02:00
Clément Fournier
53a43f61af Cleanup test utils 2020-04-02 13:47:50 +02:00
Clément Fournier
6ba8497f05 Fix static method import 2020-03-31 10:34:33 +02:00
Clément Fournier
5cbfdfdd99 Use ascii printer for tree dumps
Some environments may not display
the structure correctly otherwise. See
eg https://travis-ci.org/github/pmd/pmd/jobs/668122788#L9312-L9322
2020-03-29 09:21:38 +02:00
Clément Fournier
e84349531b Normalize line endings 2020-03-29 09:17:49 +02:00
Clément Fournier
89cddd8aa8 Use parsing helper 2020-03-28 17:46:33 +01:00
Clément Fournier
09ddc628cd Fix reference files 2020-03-28 17:46:33 +01:00
Clément Fournier
c83790fab5 Recycle tree printer from the designer 2020-03-28 17:46:33 +01:00
Clément Fournier
bb92044a15 Add ability to test an AST dump as cheap regression test 2020-03-28 17:46:32 +01:00
Clément Fournier
7f6e53eccb Test 2020-03-27 10:16:10 +01:00
Clément Fournier
62a9d5b655 Fix build 2020-03-20 18:07:56 +01:00
Clément Fournier
39d1c9be28 Merge branch '7.0.x' into java-grammar 2020-03-20 03:09:40 +01:00
Clément Fournier
ea3085e560 Normalize line endings
Tries to fix build failure on windows...
2020-03-19 19:34:16 +01:00
Clément Fournier
fd0d53b590 Merge branch '7.0.x' into port-jsp-vf-modules 2020-03-17 15:46:41 +01:00
Andreas Dangel
4c020bfbf7 [maven-release-plugin] prepare for next development iteration 2020-03-12 15:15:18 +01:00
Andreas Dangel
eb93aaeca7 [maven-release-plugin] prepare release pmd_releases/6.22.0 2020-03-12 15:15:09 +01:00
Clément Fournier
2910303dd8 Merge branch '7.0.x' into java-grammar 2020-03-02 22:06:32 +01:00
Clément Fournier
9788a3af5d Merge branch 'master' into 7.0.x 2020-03-02 19:12:28 +01:00
Clément Fournier
a9b6e78cfc Normalise line endings in test 2020-02-17 16:59:14 +01:00
Clément Fournier
4c81633a88 Add a bunch of additional tests 2020-02-12 21:46:30 +01:00
Clément Fournier
87afc7360c Add tests for ast symbols 2020-02-12 18:01:56 +01:00
Clément Fournier
65329d60bd Fix scope of for statements 2020-02-12 18:01:24 +01:00
Clément Fournier
e9ccaa6821 Add tests 2020-02-12 18:01:24 +01:00
Clément Fournier
ad023e8fa6 Support type test patterns 2020-02-09 00:10:50 +01:00
Clément Fournier
3191ef360d Rework AccessNode
Introduce a ModifierList node, that ranges
 over the modifiers of a declaration (including
annotations).

This is a combination of a few old commits:

Figure out modifiers

Fix tests

Remove AccessTypeNode

Document

Remove specific methods

Fix symboltable test

Fix tests

Rename to JModifier

Fix copypaste default/abstract

Improve doc

Test anon classes

Remove useless impl

Static modifier should not be present on toplevel classes

Simplify impl

Add visibility enum

Port some tests

Fix test ranges

Fix modifier ordering

Cleanup

Fix unnecessary modifier rule

Rename to use plural

Improve visibility doc

Simplify some things

Checkstyle

Remove some usages of typekind

Fix missing import

Remove irrelevant method

REmove some duplication

Replace AccessNode with ModifierOwner

Rename to AccessNode to reduce diff

Remove changes to rules

Add convenience methods

Make VariableDeclaratorId a ModifierOwner

Fix variable name decl

Make enum constant an implicit AccessNode

Fix compil

Checkstyle

Cleanup

Deprecate TypeKind

Cleanup

Remove TypeKind

Revert "Remove TypeKind"

This reverts commit 222c169c3401a01507726f339ae9f9b2b20dc69a.

Fix doc

Fix UnnecessaryModifierRule

Use special node instead of ModifierSet

Remove useless tests

Fix tests WIP

Work should be resumed when #2211 is merged into java-grammar

Fix some tests

Doc
2020-01-28 15:28:21 +01:00
Clément Fournier
83b8827a26 Merge branch '7.0.x' into java-grammar 2020-01-24 23:49:31 +01:00
Clément Fournier
ec1eb208eb Merge branch 'master' into 7.0.x 2020-01-24 23:48:22 +01:00
Clément Fournier
58fa793e67 Fix indentation in poms
For some reason pmd-apex and pmd-apex-jorje
use 2 spaces while the rest use 4.
2020-01-24 23:17:26 +01:00
Andreas Dangel
d994700617 [maven-release-plugin] prepare for next development iteration 2020-01-24 17:20:47 +01:00
Andreas Dangel
a28e9e22e5 [maven-release-plugin] prepare release pmd_releases/6.21.0 2020-01-24 17:20:38 +01:00
Clément Fournier
8d38036015 Merge branch '7.0.x' into java-grammar 2020-01-17 15:03:06 +01:00
Clément Fournier
ecef88aa0a Merge branch 'master' into 7.0.x 2020-01-17 12:10:51 +01:00
Clément Fournier
d9ad819dab Replace usages of node methods everywhere 2020-01-17 11:57:19 +01:00
Clément Fournier
342a0bac08 Checkout some code from java grammar 2020-01-15 10:24:42 +01:00
Clément Fournier
30d3d4615d Move parsing contexts to upper level 2020-01-11 09:57:47 +01:00
Clément Fournier
99700d7526 Extract changes from #2166 to 7.0.x
* Make Java nodes text-available
* Introduce shared JavaccToken in pmd-core
* Use factory to produce char streams

Tests are still on java-grammar,
since they use the DSL & newer
AST structure.

This is to prepare for other changes
that concern all javacc languages and
should not be done on java-grammar
2020-01-10 21:15:15 +01:00
Clément Fournier
d6296bd85f Fix apex multifile tests 2020-01-10 20:22:57 +01:00
Clément Fournier
db1a8d7649 [lang-test] Use processing stages only in BaseParsingHelper 2020-01-10 17:55:41 +01:00
Andreas Dangel
a6c95b17d9 [lang-test] BaseParsingHelper uses AstProcessingStages 2020-01-10 15:20:04 +01:00
Andreas Dangel
ea86a23b73 Merge branch 'master' into pmd/7.0.x 2020-01-10 14:41:27 +01:00
Andreas Dangel
c53d9508e9 Small changes from code review
* rename BaseParserHelper
* Not using org.jetbrains.annotations.NotNull
2020-01-10 12:18:43 +01:00
Clément Fournier
a7c5a1f0be Cleanup PMD.EOL in tests
Instead, normalize line endings in parse method.
This makes sure test code snippets are portable
and readable. For now they're platform-specific,
and assume that the resource files are saved with
the platform-specific line separator. This may not
be the case, as eg a git file may be checked out
with CRLF on a unix system.
2019-12-22 20:16:19 +01:00
Clément Fournier
8afe5ae7a8 Abstract away parser utils
Convert a few pieces of code

Share with modelica

Remove yet another dup

Fix tests

Doc

Share with plsql

Fix tests

Fix build

Cleanup

Minimize diff

Share with JSP module

Share with JS module

Share with XML module

Share with VisualForce module

Share with Scala module

Fix last tests
2019-12-20 18:30:17 +01:00
Andreas Dangel
00392cefc2 [maven-release-plugin] prepare for next development iteration 2019-11-29 19:46:14 +01:00
Andreas Dangel
78da370fb8 [maven-release-plugin] prepare release pmd_releases/6.20.0 2019-11-29 19:46:05 +01:00
Andreas Dangel
deec9c44b2 [maven-release-plugin] prepare for next development iteration 2019-10-31 18:36:51 +01:00
Andreas Dangel
2881b6f585 [maven-release-plugin] prepare release pmd_releases/6.19.0 2019-10-31 18:36:42 +01:00
Clément Fournier
ad822f7e2b Accomodate tests for scala empty nodes
refs #2021
2019-09-19 00:30:17 +02:00
Clément Fournier
95d6ea3f37 Fix scala text bounds 2019-09-17 04:21:05 +02:00
Andreas Dangel
e536ca1947 [maven-release-plugin] prepare for next development iteration 2019-09-15 10:14:14 +02:00
Andreas Dangel
3f42cca200 [maven-release-plugin] prepare release pmd_releases/6.18.0 2019-09-15 10:14:05 +02:00
Clément Fournier
052c298a85 Merge branch 'master' into 7.0.x 2019-09-14 15:08:12 +02:00
Clément Fournier
8ac3a10020 Bump kotlin test version 2019-09-14 15:04:38 +02:00
Andreas Dangel
7a7971f64d [maven-release-plugin] prepare for next development iteration 2019-07-28 10:24:51 +02:00
Andreas Dangel
365e1c9e8b [maven-release-plugin] prepare release pmd_releases/6.17.0 2019-07-28 10:24:43 +02:00
Andreas Dangel
73a8e4cc69 [maven-release-plugin] prepare for next development iteration 2019-06-30 10:33:08 +02:00
Andreas Dangel
45facbd323 [maven-release-plugin] prepare release pmd_releases/6.16.0 2019-06-30 10:32:58 +02:00
Andreas Dangel
5ac687918a [maven-release-plugin] prepare for next development iteration 2019-05-26 11:02:26 +02:00
Andreas Dangel
ba2d795f59 [maven-release-plugin] prepare release pmd_releases/6.15.0 2019-05-26 11:02:18 +02:00
Andreas Dangel
9a93a6c5e9 Delegate text coordinates to the tokens 2019-05-01 17:29:32 +02:00
Andreas Dangel
5ec4324fbc Fix AbstractLrBinaryExpr type check 2019-05-01 17:25:01 +02:00
Andreas Dangel
367ae2a4a9 Remove need for late init completely 2019-05-01 17:23:34 +02:00
Clément Fournier
eedc3210fc Add text bounds implicit assertions 2019-05-01 17:18:52 +02:00
Clément Fournier
13bbbfb2c4 Expose default config 2019-05-01 17:18:33 +02:00
Clément Fournier
d0eaf73e29 Remove pmd-java test dependency 2019-05-01 17:17:58 +02:00
Andreas Dangel
ca9c859c0b [maven-release-plugin] prepare for next development iteration 2019-04-28 10:35:44 +02:00
Andreas Dangel
cd8b2e3217 [maven-release-plugin] prepare release pmd_releases/6.14.0 2019-04-28 10:35:36 +02:00
Andreas Dangel
e5bafbc475 Merge remote-tracking branch 'origin/master' into pmd/7.0.x 2019-04-27 19:26:05 +02:00
Andreas Dangel
01e372d887 [core] Module pmd-lang-test is missing javadoc artifact
Fixes #1515
2019-04-26 20:41:50 +02:00
Clément Fournier
2ef63354ea Merge branch 'master' into 7.0.x 2019-04-01 02:02:04 +02:00
Andreas Dangel
5818abc0c7 [maven-release-plugin] prepare for next development iteration 2019-03-31 12:07:07 +02:00
Andreas Dangel
4ed549f0b2 [maven-release-plugin] prepare release pmd_releases/6.13.0 2019-03-31 12:06:56 +02:00
Andreas Dangel
6c6cb3ecf3 Merge branch 'pr-1707' 2019-03-19 16:23:32 +01:00
Clément Fournier
6680d020ae Add copyright notices on pmd-lang-test 2019-03-11 22:30:49 +01:00
Clément Fournier
134d3d745e Merge branch 'master' into 7.0.x 2019-03-11 22:16:13 +01:00
Andreas Dangel
fe0b7fd450 Merge branch 'pr-1541' 2019-03-11 16:22:28 +01:00
Andreas Dangel
002ecb7783 Fix test dependencies with junit5/kotlin/junit4 combination
When using kotlin test, which brings in the JUnit5 platform,
additionally the junit-vintage-engine needs to be added to
the test classpath, so that surefire will execute all tests
(junit5/kotlin test + junit4 tests).
2019-03-10 19:32:20 +01:00
Andreas Dangel
4bb1d9327d [maven-release-plugin] prepare for next development iteration 2019-02-24 08:57:18 +01:00
Andreas Dangel
41e77bc34b [maven-release-plugin] prepare release pmd_releases/6.12.0 2019-02-24 08:57:10 +01:00
Clément Fournier
754309a926 Layer tests into containers 2019-02-19 19:23:57 +01:00
Clément Fournier
9d1cb2105f Merge branch 'master' into externalize-ast-matching-dsl 2019-02-19 18:57:40 +01:00
Andreas Dangel
63cd6d0f5c [maven-release-plugin] prepare for next development iteration 2019-01-27 13:25:00 +01:00
Andreas Dangel
ea2776f70c [maven-release-plugin] prepare release pmd_releases/6.11.0 2019-01-27 13:24:51 +01:00
Clément Fournier
a5d23116e5 Merge branch 'master' into 7.0.x 2019-01-08 23:36:45 +01:00
Clément Fournier
dc7e023644 Default methods are not abstract 2019-01-05 22:57:58 +01:00
Clément Fournier
4697cfded6 Externalise node matching DSL to oowekyala/kt-tree-utils 2018-12-22 11:55:00 +01:00
Clément Fournier
12b647c548 Merge branch 'master' into 7.0.x
Conflicts:
	pmd-apex-jorje/pom.xml
	pmd-apex/pom.xml
	pmd-core/pom.xml
	pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java
	pmd-core/src/main/java/net/sourceforge/pmd/util/designer/Designer.java
	pmd-cpp/pom.xml
	pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/CppHandler.java
	pmd-cs/pom.xml
	pmd-dist/pom.xml
	pmd-doc/pom.xml
	pmd-fortran/pom.xml
	pmd-go/pom.xml
	pmd-groovy/pom.xml
	pmd-java/pom.xml
	pmd-java8/pom.xml
	pmd-javascript/pom.xml
	pmd-jsp/pom.xml
	pmd-kotlin/pom.xml
	pmd-lang-test/pom.xml
	pmd-matlab/pom.xml
	pmd-matlab/src/main/java/net/sourceforge/pmd/lang/matlab/MatlabHandler.java
	pmd-objectivec/pom.xml
	pmd-objectivec/src/main/java/net/sourceforge/pmd/lang/objectivec/ObjectiveCHandler.java
	pmd-perl/pom.xml
	pmd-php/pom.xml
	pmd-plsql/pom.xml
	pmd-python/pom.xml
	pmd-python/src/main/java/net/sourceforge/pmd/lang/python/PythonHandler.java
	pmd-ruby/pom.xml
	pmd-scala/pom.xml
	pmd-swift/pom.xml
	pmd-test/pom.xml
	pmd-ui/pom.xml
	pmd-visualforce/pom.xml
	pmd-vm/pom.xml
	pmd-xml/pom.xml
	pom.xml
2018-12-13 18:53:10 +01:00
Andreas Dangel
5589540e9f Add workaround for #1515 2018-12-09 11:49:12 +01:00
Andreas Dangel
dcb8bb42a2 [maven-release-plugin] prepare for next development iteration 2018-12-09 10:42:20 +01:00
Andreas Dangel
27374d8592 [maven-release-plugin] prepare release pmd_releases/6.10.0 2018-12-09 10:42:09 +01:00
Clément Fournier
efc22da116 Fix pom version 2018-11-02 07:32:19 +01:00
Andreas Dangel
544c819274 [test] Kotlin DSL to ease test writing
* Merge branch 'pr-1395'
* Fixes #1318
* Update release notes
* Update version for new module
2018-10-29 19:23:06 +01:00
Clément Fournier
387e794116 Split pmd-test to isolate kotlin dependencies 2018-09-24 15:02:19 +02:00