Uploaded image for project: 'Maven PMD Plugin'
  1. Maven PMD Plugin
  2. MPMD-215

FieldDeclarationsShouldBeAtStartOfClass false positive

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.5
    • 3.6
    • PMD
    • None
    • Windows 10 64bit

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              dennisl@apache.org Dennis Lundberg
              kaliakoudas sakis kaliakoudas
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 72h
                  72h
                  Remaining:
                  Remaining Estimate - 72h
                  72h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified