You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dennis Lundberg (JIRA)" <ji...@apache.org> on 2015/12/07 13:50:10 UTC

[jira] [Closed] (MPMD-215) FieldDeclarationsShouldBeAtStartOfClass false positive

     [ https://issues.apache.org/jira/browse/MPMD-215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg closed MPMD-215.
--------------------------------
    Resolution: Fixed
      Assignee: Dennis Lundberg

Fixed in r1718337, by upgrading to PMD 5.3.5.

> FieldDeclarationsShouldBeAtStartOfClass false positive
> ------------------------------------------------------
>
>                 Key: MPMD-215
>                 URL: https://issues.apache.org/jira/browse/MPMD-215
>             Project: Maven PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.5
>         Environment: Windows 10 64bit
>            Reporter: sakis kaliakoudas
>            Assignee: Dennis Lundberg
>             Fix For: 3.6
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> I get the FieldDeclarationsShouldBeAtStartOfClass error:
> "Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes." for line 32
> Adding my first 32 lines of the project, excluding imports:
> @RunWith(RobolectricTestRunner.class)
> @PowerMockIgnore({"org.mockito.*", "org.robolectric.*", "android.*", "org.slf4j.*"})
> @PrepareForTest(ActivityRecognitionResult.class)
> public class MobilityStatusFetcherIntentServiceTest {
>     @SuppressWarnings("checkstyle:visibilitymodifier")
>     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD",
>             justification = "Bootstrap PowerMock using a JUnit Rule instead of using the PowerMockRunner and the RunWith annotation.")
>     @Rule public PowerMockRule powerMockRule = new PowerMockRule();
> The line that starts with @Rule is line 32.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)