acanda / eclipse-pmd

eclipse-pmd has been moved to
https://github.com/eclipse-pmd/eclipse-pmd
Other
21 stars 10 forks source link

False positives for FieldDeclarationsShouldBeAtStartOfClass when using annotations #25

Closed jamcole closed 9 years ago

jamcole commented 9 years ago

Pretty much seeing the same behavior in Eclipse as described in this parent PMD bug: http://sourceforge.net/p/pmd/bugs/1354/

Oddly enough, this doesn't affect the maven-pmd-plugin (version 3.4 which uses pmd 5.2.3).

I am using the eclipse-pmd plugin from the Eclipse Marketplace version 1.4

acanda commented 9 years ago

This bug has been fixed in PMD 5.2.3 which was released yesterday. The eclipse-pmd plugin 1.4 uses an older version of PMD which is still affected this bug. I just released eclipse-pmd 1.5 which uses the latest PMD. All you have to do is check for updates (Help > Check for Updates) and the new version of eclipse-pmd should be installed.

neelu-sarkar commented 9 years ago

Just upgraded to Eclipse Mars and I'm seeing this issue with v1.5.0.201505230804 of the plugin.

Any ideas?

acanda commented 9 years ago

@neelu-sarkar: try to clean and build the affected Eclispe projects. Eclipse stores the PMD warnings and if you just upgraded from eclipse-pmd 1.4 to 1.5 then you might still have the PMD warnings generated by eclipse-pmd 1.4. Cleaning and building the projects will trigger a new PMD analysis with eclipse-pmd 1.5.

If you still have the warnings after cleaning and building then please run PMD 5.3.2 from the command line and check if it produces the same false positives. If it does then this is probably a (slightly) different bug which has to be fixed in PMD. In this case you have to report the bug at the PMD bug tracker.

neelu-sarkar commented 9 years ago

@acanda I've tried clean and build a few times already with no luck. PMD running from maven / command line is fine.

I've only had v1.5 of the plugin installed in Mars but workspace I was using was an upgraded Luna one, so I've just tried creating a new Mars workspace and importing the same projects and the pmd warnings no longer appear so happy just to carry on with that.

Maybe something in the upgrade workspace process went wrong? I've definitely had v1.4 installed in Luna in the past but not at the point of upgrading to Mars.

Cheers

jeffjensen commented 9 years ago

I'm seeing the same issue with Luna. Maven PMD doesn't flag it but Eclipse does.

For us, it will only happen in some Entity classes on some instance variables with at least 2 annotations.

On Wed, Jul 1, 2015 at 5:59 AM, Neelu Sarkar notifications@github.com wrote:

@acanda https://github.com/acanda I've tried clean and build a few times already with no luck. PMD running from maven / command line is fine.

I've only had v1.5 of the plugin installed in Mars but workspace I was using was an upgraded Luna one, so I've just tried creating a new Mars workspace and importing the same projects and the pmd warnings no longer appear so happy just to carry on with that.

Maybe something in the upgrade workspace process went wrong? I've definitely had v1.4 installed in Luna in the past but not at the point of upgrading to Mars.

Cheers

— Reply to this email directly or view it on GitHub https://github.com/acanda/eclipse-pmd/issues/25#issuecomment-117606020.

neelu-sarkar commented 9 years ago

@jeffjensen

Seeing the same thing - my new Mars workspace has started reporting the PMD violations again :(

neelu-sarkar commented 9 years ago

@acanda

I just looked inside ch.acanda.eclipse.pmd.core_1.5.0.201505230804.jar and it's using PMD 5.3.2.

I guess I'll need to wait until the plugin is updated to use 5.3.3?

The related PMD bug was only fixed in this version: http://sourceforge.net/p/pmd/bugs/1364/

Cheers (Thanks for the plugin btw!)

acanda commented 9 years ago

@neelu-sarkar @jeffjensen Thank you for clarifying - this is a different bug than the one originally reported. Your bug has been fixed and will most likely be part of the not yet released PMD 5.3.3. I will release a new version of eclipse-pmd as soon as PMD 5.3.3 is officially available.

jeffjensen commented 9 years ago

Nice, thanks for letting us know Philip!

On Thu, Jul 2, 2015 at 11:44 AM, Philip Graf notifications@github.com wrote:

@neelu-sarkar https://github.com/neelu-sarkar @jeffjensen https://github.com/jeffjensen Thank you for clarifying - this is a different bug than the one originally reported. Your bug has been fixed and will most likely be part of the not yet released PMD 5.3.3. I will release a new version of eclipse-pmd as soon as PMD 5.3.3 is officially available.

— Reply to this email directly or view it on GitHub https://github.com/acanda/eclipse-pmd/issues/25#issuecomment-118089653.

acanda commented 9 years ago

PMD 5.3.3 has been released with a fix for PMD bug 1364 so I released eclipse-pmd 1.6 with PMD 5.3.3. Enjoy!