Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Log output from SpotBugs #3

Open
ezienecker opened this issue Oct 2, 2019 · 0 comments
Open

Disable Log output from SpotBugs #3

ezienecker opened this issue Oct 2, 2019 · 0 comments
Labels
good first issue Good for newcomers Hacktoberfest help wanted Extra attention is needed

Comments

@ezienecker
Copy link
Owner

Currently spotbugs print out the byte code

de.manuzid.some.More.<init> : ()V
  0 aload_0         []::[< Lde/manuzid/some/More;, IP, r0 >]
  1 invokespecial   [< Lde/manuzid/some/More;, IP, r0 >]::[< Lde/manuzid/some/More;, IP, r0 >]
  4 return          []::[< Lde/manuzid/some/More;, IP, r0 >]

de.manuzid.some.More.main : ([Ljava.lang.String;)V
  0 aconst_null     []::[< [Ljava/lang/String;, IP, r0 >]
  1 astore_1        [< Ljava/lang/Object;, isNull >]::[< [Ljava/lang/String;, IP, r0 >]
  2 getstatic       []::[< [Ljava/lang/String;, IP, r0 >, < Ljava/lang/Object;, isNull, r1 >]
  5 aload_1         [< Ljava/io/PrintStream;, static java.lang.System.out Ljava/io/PrintStream; >]::[< [Ljava/lang/String;, IP, r0 >, < Ljava/lang/Object;, isNull, r1 >]
  6 invokevirtual   [< Ljava/io/PrintStream;, static java.lang.System.out Ljava/io/PrintStream; >, < Ljava/lang/String;, isNull, r1 >]::[< [Ljava/lang/String;, IP, r0 >, < Ljava/lang/Object;, isNull, r1 >]
  9 invokevirtual   [< Ljava/io/PrintStream;, static java.lang.System.out Ljava/io/PrintStream; >, < I, return value from java.lang.String.length()I >]::[< [Ljava/lang/String;, IP, r0 >, < Ljava/lang/Object;, isNull, r1 >]
 12 return          []::[< [Ljava/lang/String;, IP, r0 >, < Ljava/lang/Object;, isNull, r1 >]

de.manuzid.some.TestBug.<init> : ()V
  0 aload_0         []::[< Lde/manuzid/some/TestBug;, IP, r0 >]
  1 invokespecial   [< Lde/manuzid/some/TestBug;, IP, r0 >]::[< Lde/manuzid/some/TestBug;, IP, r0 >]
  4 return          []::[< Lde/manuzid/some/TestBug;, IP, r0 >]

de.manuzid.some.TestBug.main : ([Ljava.lang.String;)V
  0 aload_0         []::[< [Ljava/lang/String;, IP, r0 >]
  1 arraylength     [< [Ljava/lang/String;, IP, r0 >]::[< [Ljava/lang/String;, IP, r0 >]
  2 ifge            [< I, non_negative >]::[< [Ljava/lang/String;, IP, r0 >]
  5 new             []::[< [Ljava/lang/String;, IP, r0 >]
  8 dup             [< Ljava/lang/IllegalArgumentException;, new >]::[< [Ljava/lang/String;, IP, r0 >]
  9 ldc             [< Ljava/lang/IllegalArgumentException;, new >, < Ljava/lang/IllegalArgumentException;, new >]::[< [Ljava/lang/String;, IP, r0 >]
 11 invokespecial   [< Ljava/lang/IllegalArgumentException;, new >, < Ljava/lang/IllegalArgumentException;, new >, < Ljava/lang/String;, "x must be nonnegative" >]::[< [Ljava/lang/String;, IP, r0 >]
 14 pop             [< Ljava/lang/IllegalArgumentException;, new, return value from java.lang.IllegalArgumentException.<init>(Ljava/lang/String;)V >]::[< [Ljava/lang/String;, IP, r0 >]
 15 return          []::[< [Ljava/lang/String;, IP, r0 >]

de.manuzid.some.TestBug.foo : (I)I
  0 bipush          []::[< Lde/manuzid/some/TestBug;, IP, r0 >, < I, IP, r1 >]
  2 istore_2        [< I, 12 >]::[< Lde/manuzid/some/TestBug;, IP, r0 >, < I, IP, r1 >]
  3 iload_1         []::[< Lde/manuzid/some/TestBug;, IP, r0 >, < I, IP, r1 >, < I, 12, r2 >]
  4 iconst_1        [< I, IP, r1 >]::[< Lde/manuzid/some/TestBug;, IP, r0 >, < I, IP, r1 >, < I, 12, r2 >]
  5 if_icmpne       [< I, IP, r1 >, < I, 1 >]::[< Lde/manuzid/some/TestBug;, IP, r0 >, < I, IP, r1 >, < I, 12, r2 >]
  8 iload_2         []::[< Lde/manuzid/some/TestBug;, IP, r0 >, < I, IP, r1 >, < I, 12, r2 >]
  9 ireturn         [< I, 12, r2 >]::[< Lde/manuzid/some/TestBug;, IP, r0 >, < I, IP, r1 >, < I, 12, r2 >]
 10 iload_2         []::[< Lde/manuzid/some/TestBug;, IP, r0 >, < I, IP, r1 >, < I, 12, r2 >]
 11 ireturn         [< I, 12, r2 >]::[< Lde/manuzid/some/TestBug;, IP, r0 >, < I, IP, r1 >, < I, 12, r2 >]

It would be nice to remove this detector. This can be done in this way: https://github.com/ManuZiD/spotbugs-reporter/blob/master/src/main/kotlin/de/manuzid/spotbugsreporter/service/AnalyseService.kt#L37

@ezienecker ezienecker added Hacktoberfest good first issue Good for newcomers help wanted Extra attention is needed labels Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant