7727 Commits

Author SHA1 Message Date
Andreas Dangel
9522ab3cd4 #1306 False positive on duplicate when using static imports 2015-01-22 19:30:20 +01:00
Andreas Dangel
57beb7ed13 #914 False +ve from UnusedImports with wildcard static imports 2015-01-21 21:56:43 +01:00
Andreas Dangel
df81f1fbb5 Update changelog 2015-01-19 21:39:00 +01:00
Andreas Dangel
e122ab2450 Fix unit tests after xerces is removed 2015-01-19 21:26:20 +01:00
Andreas Dangel
8d487384a3 Remove LineNumberAwareSaxHandler - as this would have needed xerces 2015-01-19 19:22:03 +01:00
Andreas Dangel
a2a8d6c227 Remove xerces dependencies 2015-01-19 19:22:03 +01:00
Andreas Dangel
6ca24d1f8a Implement DOMLineNumbers to determine the line numbers after the parsing 2015-01-19 19:22:03 +01:00
Andreas Dangel
0da50b9e89 Fix XMLParser test to expect more accurate line numbers/columns 2015-01-19 19:22:03 +01:00
Andreas Dangel
5ae01d2d3e Up version to 5.3.0-SNAPSHOT 2015-01-18 12:19:52 +01:00
Andreas Dangel
3e7391ab64 Update changelog and credits 2015-01-18 12:15:01 +01:00
Andreas Dangel
be6a422860 Merge branch 'tiobe/pmd-core-cpdcmdlineoptfix' of https://github.com/tiobe/pmd into tiobe-tiobe/pmd-core-cpdcmdlineoptfix 2015-01-18 12:13:09 +01:00
Andreas Dangel
2e8ff0487e Update changelog 2015-01-18 12:08:09 +01:00
Andreas Dangel
381a697a99 Merge branch 'tiobe/pmd-cpp-fixlexicalerrors' of https://github.com/tiobe/pmd into tiobe-tiobe/pmd-cpp-fixlexicalerrors 2015-01-18 12:06:29 +01:00
Andreas Dangel
6d89f5b30d Update changelog 2015-01-18 11:59:58 +01:00
Andreas Dangel
17e4d2fb9e Merge branch 'tiobe/pmd-cs-linenumberfix' of https://github.com/tiobe/pmd into tiobe-tiobe/pmd-cs-linenumberfix 2015-01-18 11:52:08 +01:00
Andreas Dangel
d69624e823 Update changelog for scala pull request; update license infos 2015-01-18 11:45:26 +01:00
Andreas Dangel
a4fbcef536 Merge branch 'tiobe/pmd-scala' of https://github.com/tiobe/pmd into tiobe-tiobe/pmd-scala 2015-01-18 11:22:03 +01:00
Andreas Dangel
f5b36f3984 Update changelog for Objective-C pull request 2015-01-18 11:17:04 +01:00
Andreas Dangel
cf442b463e Merge branch 'tiobe/pmd-objectivec' of https://github.com/tiobe/pmd into tiobe-tiobe/pmd-objectivec 2015-01-18 11:14:40 +01:00
Andreas Dangel
e1886ac48e Update changelog for Matlab pull request 2015-01-18 11:09:41 +01:00
Andreas Dangel
68e4b3e4f1 Merge branch 'tiobe/pmd-matlab' of https://github.com/tiobe/pmd into tiobe-tiobe/pmd-matlab 2015-01-18 11:04:23 +01:00
Andreas Dangel
3ef82a6c3a Update changelog for python pull request 2015-01-18 11:00:10 +01:00
Andreas Dangel
d5593f516f Merge branch 'tiobe/pmd-python' of https://github.com/tiobe/pmd into tiobe-tiobe/pmd-python 2015-01-18 10:47:24 +01:00
Andreas Dangel
6b69174e24 #1296 PMD UnusedPrivateMethod invalid detection of 'private void method(int,boolean,Integer...)' 2015-01-17 22:42:58 +01:00
Andreas Dangel
9d96d974de #1299 MethodReturnsInternalArray false positive 2015-01-17 11:32:55 +01:00
Andreas Dangel
24a435a42e RedundantFieldInitializer - consider binary literals and underscores (java7) 2015-01-17 11:08:46 +01:00
Andreas Dangel
89572efe0d #1298 Member variable int type with value 0xff000000 causes processing error 2015-01-16 21:34:05 +01:00
Jan van Nunen
5776c0e9c5 Made exceptions of the Scala tokenizer non-fatal when CPD is executed with the '--skipLexicalErrors' command line option. 2015-01-15 16:01:28 +01:00
Jan van Nunen
110184e542 Made exceptions of the Scala tokenizer non-fatal when CPD is executed with the '--skipLexicalErrors' command line option. 2015-01-15 15:32:19 +01:00
Jan van Nunen
a376da0d9e Fixed '--files' command line option of CPD, so it also works for files and not only for directories.
The '--files' command line option of CPD lets you specify which
directories and files should be scanned for duplicated code.
Unfortunately it didn't work when you specified files instead of
directories, for example: '--files foo.c bar.c'. In this example CPD
executed successful, but the files 'foo.c' and 'bar.c' are completely
ignored.
2015-01-14 17:34:17 +01:00
Jan van Nunen
6c0b45519c Added pmd-python to default PMD distribution. 2015-01-13 14:25:42 +01:00
Jan van Nunen
5bbc99a6f8 Added pmd-objectivec to default PMD distribution. 2015-01-13 14:23:16 +01:00
Jan van Nunen
06f769ddd0 Added pmd-scala to default PMD distribution. 2015-01-13 14:19:08 +01:00
Jan van Nunen
f58ee38cca Fixed build error by adding the configuration base-directory to the POM.xml 2015-01-13 14:11:06 +01:00
Jan van Nunen
23f03a78a9 Added pmd-matlab to default PMD distribution. 2015-01-13 14:07:43 +01:00
Jan van Nunen
c92dc9706c Relaxed C++ tokenizer so a '\'(backslash) can be use to escape any character inside a string or character.
The following 2 code snippets could not be tokenized:

1:  if (*pbuf == '\0x05'), the problem is the '\0' in the character
literal '\0x05'.
2:  szPath = m_sdcacheDir + _T("\    oMedia");, the problem is the '\ '
in the string literal "\    oMedia".

I relaxed the lexical grammar so a '\' (backslash) can escape any
character inside a string or character literal. We can relax the grammar
because CPD only needs the tokens, so it is no problem to accept
'invalid' string / character literals. (according to the ANSI C
standard).  Failing too fast because the tokenizer is too strict is
annoying because then we can't check the files for duplicated code.

Both snippets were taken from existing projects and be successfully
compiled, so for some C / C++ compilers it is valid code.
2015-01-13 11:36:54 +01:00
Jan van Nunen
d830974842 Fixed lexical error when a C++ file contains an empty character literal L''.
This commit fixes a lexical error when a C++ file contains an empty
character literal L''. The following code could not be tokenized:

std::wstring wsMessage( sMessage.length(), L'');

It triggers the following error:

net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error in file
'foo.cpp' at line 1, column 46.  Encountered: "\'" (39), after : "\'"
2015-01-13 11:36:54 +01:00
Jan van Nunen
ceef6cd236 Fixed lexical eror when a preprocessor directive is followed by a single line comment that starts with "//*".
This commit fixes a lexical eror when a preprocessor directive is
followed by a single line comment that starts with "//*".

The following code could not be tokenized:

#define LSTFVLES_CPP  //*

It triggers the following error:

net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error in file
'foo.cpp' at line 2, column 0.  Encountered: <EOF> after : ""
2015-01-13 11:36:53 +01:00
Jan van Nunen
5c2df4c877 Fixed lexical error when a C++ file contains ASM with the '@' character.
This commit fixes a lexical error when a C++ file contains ASM with the
'@' character. The following code cannot be tokenized and triggers a
lexical error:

asm void eSPI_boot()
{
// setup stack pointer
lis r1, _stack_addr@h
ori r1, r1, _stack_addr@l
}

The error that occurs:

net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error in file
CODE_LOADED_FROM_STRING at line 4, column 22.  Encountered: "@" (64),
after : ""
2015-01-13 11:36:53 +01:00
Jan van Nunen
6d0be8b126 Fixed incorrect line numbers after mutiline comments and verbatim strings. 2015-01-12 10:53:34 +01:00
Jan van Nunen
952ace3128 Fixed build warning of Scala compiler. 2015-01-12 09:18:20 +01:00
Jan van Nunen
bffea4bb3b Added support for Scala to CPD.
The Scala tokenizer was extracted from the Sonar Scala plugin.
(https://github.com/SonarCommunity/sonar-scala) I copied the code
because the Sonar Scala plugin has a lot of unwanted dependencies. I
tried to keep the changes to the Scala Sonar plugin as minimal as
possible.

To tokenize the source files the official Scala compiler is used.
2015-01-09 15:20:25 +01:00
Jan van Nunen
8dd3755db1 Added support for Objective-C to CPD. 2015-01-08 16:04:15 +01:00
Jan van Nunen
43750e3799 Added support for Python to CPD. 2015-01-07 12:07:24 +01:00
Jan van Nunen
16fabee7c3 Added support for Matlab to CPD. 2015-01-07 11:56:47 +01:00
Jan van Nunen
779ea00647 Created branch to add Matlab support 2015-01-07 11:00:49 +01:00
Andreas Dangel
c1bc045c65 Update release process - use compression when uploading the site 2014-12-21 16:55:04 +01:00
Andreas Dangel
111fc31cd7 Update changelog for next version 2014-12-21 11:54:14 +01:00
Andreas Dangel
0e6a5db426 [maven-release-plugin] prepare for next development iteration 2014-12-21 11:46:02 +01:00
Andreas Dangel
6c316e9375 [maven-release-plugin] prepare release pmd_releases/5.2.3 pmd_releases/5.2.3 2014-12-21 11:46:02 +01:00