We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a weird issue where the LSC_LITERAL_STRING_COMPARISON check is firing for this line of code:
766: String newLocale = "de_DE".equals(customer_locale) ? "fr_FR" : "de_DE";
Replacing that with just "de_DE" resolves the spotbugs warning.
Here is the result from javap -v:
42: ldc #147 // String de_DE 44: aload_0 45: getfield #8 // Field customer_locale:Ljava/lang/String; 48: invokevirtual #148 // Method java/lang/String.equals:(Ljava/lang/Object;)Z 51: ifeq 59 54: ldc #149 // String fr_FR 56: goto 61 59: ldc #147 // String de_DE 61: astore 4 63: aload_0 ... LineNumberTable: ... line 766: 42 line 767: 63
SpotBugs version: 3.1.12 sb-contrib version: 7.4.7 Java version: both OpenJDK 11.0.1+13 and Adopt OpenJDK 11.0.6+10
Happy to provide more code if needed but wanted to avoid making this initial post too large
The text was updated successfully, but these errors were encountered:
it's almost certainly the ternary... spotbugs doesn't handle them all that well, specifically the first part of the ternary is
ldc #149 // String fr_FR 56: goto 61
is kind of ignored.
I'll see if i can figure something out here.
Sorry, something went wrong.
add fp example for LSC for #393
71dda65
Alright, so i pushed your code to LSC_Sample.fp363 and it doesn't show the error, with this, javap
public java.lang.String fp393(); descriptor: ()Ljava/lang/String; flags: ACC_PUBLIC Code: stack=2, locals=2, args_size=1 0: ldc #160 // String de_DE 2: aload_0 3: getfield #162 // Field loc:Ljava/lang/String; 6: invokevirtual #29 // Method java/lang/String.equals:(Ljava/lang/Object;)Z 9: ifeq 17 12: ldc #164 // String fr_FR 14: goto 19 17: ldc #160 // String de_DE 19: astore_1 20: aload_1 21: areturn
No branches or pull requests
I have a weird issue where the LSC_LITERAL_STRING_COMPARISON check is firing for this line of code:
Replacing that with just "de_DE" resolves the spotbugs warning.
Here is the result from javap -v:
SpotBugs version: 3.1.12
sb-contrib version: 7.4.7
Java version: both OpenJDK 11.0.1+13 and Adopt OpenJDK 11.0.6+10
Happy to provide more code if needed but wanted to avoid making this initial post too large
The text was updated successfully, but these errors were encountered: