Skip to content

Commit 8de9909

Browse files
author
Dominik Helm
committed
String analysis improvements from the review
1 parent 482d38f commit 8de9909

File tree

21 files changed

+259
-445
lines changed

21 files changed

+259
-445
lines changed

DEVELOPING_OPAL/validate/src/test/java/org/opalj/fpcf/fixtures/string/Complex.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void analyzeString(String s) {}
3131
@Failure(n = 0, levels = Level.L0)
3232
@Invalid(n = 0, levels = Level.L1, soundness = SoundnessMode.LOW)
3333
@PartiallyConstant(n = 0, levels = Level.L1, soundness = SoundnessMode.HIGH, value = "(get-.*|get-Hello, World-.*)")
34-
public void complexDependencyResolve(String s, Class clazz) {
34+
public void complexDependencyResolve(String s, Class<?> clazz) {
3535
String properName = s.length() == 1 ? s.substring(0, 1) :
3636
getHelloWorld() + "-" + getRuntimeClassName();
3737
String getterName = "get-" + properName;
@@ -40,7 +40,7 @@ public void complexDependencyResolve(String s, Class clazz) {
4040
m = clazz.getMethod(getterName);
4141
System.out.println(m);
4242
analyzeString(getterName);
43-
} catch (NoSuchMethodException var13) {
43+
} catch (NoSuchMethodException ignored) {
4444
}
4545
}
4646

DEVELOPING_OPAL/validate/src/test/scala/org/opalj/fpcf/StringAnalysisTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ sealed abstract class StringAnalysisTest extends PropertiesTest {
189189

190190
Tuple3(
191191
vc,
192-
{ s: String => s"${am._2(s)} (#$index)" },
192+
{ (s: String) => s"${am._2(s)} (#$index)" },
193193
annotationsByIndex(index).toList
194194
)
195195
}

DEVELOPING_OPAL/validate/src/test/scala/org/opalj/fpcf/properties/string/StringMatcher.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ sealed trait StringMatcher extends AbstractPropertyMatcher {
2222

2323
protected def getActualValues: Property => Option[(String, String)] = {
2424
case prop: StringConstancyProperty =>
25-
val tree = prop.tree.simplify.sorted
25+
val tree = prop.tree.simplified.sorted
2626
if (tree.isInvalid) {
2727
None
2828
} else {
29-
Some((tree.constancyLevel.toString.toLowerCase, tree.toRegex))
29+
Some((tree.constancyLevel.toString.toLowerCase, tree.regex))
3030
}
3131
case p => throw new IllegalArgumentException(s"Tried to extract values from non string property: $p")
3232
}

OPAL/br/src/main/scala/org/opalj/br/fpcf/properties/SystemProperties.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ sealed trait SystemPropertiesPropertyMetaInformation extends PropertyMetaInforma
3333
case class SystemProperties(values: Set[StringTreeNode])
3434
extends Property with SystemPropertiesPropertyMetaInformation {
3535

36-
def mergeWith(other: SystemProperties): SystemProperties = {
36+
def meet(other: SystemProperties): SystemProperties = {
3737
if (values == other.values) this
3838
else SystemProperties(values ++ other.values)
3939
}

OPAL/br/src/main/scala/org/opalj/br/fpcf/properties/string/StringConstancyProperty.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class StringConstancyProperty(
3232
val level = tree.constancyLevel
3333
val strings = if (level == StringConstancyLevel.Invalid) {
3434
"No possible strings - Invalid Flow"
35-
} else tree.sorted.toRegex
35+
} else tree.sorted.regex
3636

3737
s"Level: ${level.toString.toLowerCase}, Possible Strings: $strings"
3838
}

0 commit comments

Comments
 (0)