Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
  • Loading branch information
JLLeitschuh and atorralba authored Mar 4, 2022
commit 17b6e66814f7f6d39f02c8c353af1a8ffdea156b
4 changes: 2 additions & 2 deletions java/ql/test/library-tests/constants/constants/Values.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void values(final int notConstant) {
int var_local = final_local; //42
int var_param = notConstant; //Not constant
int var_nonfinald_local = var_field; //Not constant
String concatinatedString = "a" + "b"; //ab
String concatinatedChar = "ab" + 'c'; //abc
String concatenatedString = "a" + "b"; //ab
String concatenatedChar = "ab" + 'c'; //abc
}
}
4 changes: 2 additions & 2 deletions java/ql/test/library-tests/constants/getStringValue.ql
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import semmle.code.java.Variable

from Variable v, Expr init, RefType enclosing, string constant
from Variable v, CompileTimeConstantExpr init, RefType enclosing, string constant
where
v.getInitializer() = init and
init.getEnclosingCallable().getDeclaringType() = enclosing and
enclosing.hasQualifiedName("constants", "Values") and
constant = init.(CompileTimeConstantExpr).getStringValue()
constant = init.getStringValue()
select init, constant