Files
codeql/java/ql/test/library-tests/frameworks/spring/context/Test.java
Owen Mansel-Chan ef345a3279 Java: Inline expectation should have space after $
This was a regex-find-replace from `// \$(?! )` (using a negative lookahead) to `// $ `.
2026-03-04 12:44:54 +00:00

21 lines
621 B
Java

import org.springframework.context.support.StaticMessageSource;
import java.util.Locale;
public class Test {
public static String code = "mycode";
public static Locale locale = Locale.US;
String taint() { return "tainted"; }
void sink(Object o) {}
public void test() {
StaticMessageSource sms = new StaticMessageSource();
sms.addMessage(code, locale, "hello {0}");
sink(sms.getMessage(code, new String[]{ taint() }, locale)); // $ hasTaintFlow
sink(sms.getMessage(code, new String[]{ taint() }, "", locale)); // $ hasTaintFlow
sink(sms.getMessage(code, null, taint(), locale)); // $ hasTaintFlow
}
}