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

String Analysis #1

Open
wants to merge 593 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
593 commits
Select commit Hold shift + click to select a range
ba0f1e6
Cleanup path transformation
maximilianruesch Jan 27, 2024
b54c1c9
Fix initialization handling in field access information key
maximilianruesch Jan 28, 2024
4a1f3de
Convert interprocedural analysis to contextprovider
maximilianruesch Jan 28, 2024
2b9940c
Simplify switch statement processing a bit
maximilianruesch Feb 1, 2024
c01be5f
Simplify and fix path leaning and processing
maximilianruesch Feb 1, 2024
935b913
Reduce nesting of string expressions
maximilianruesch Feb 1, 2024
a546963
Start refactor of interprocedural analysis
maximilianruesch Feb 4, 2024
272c271
Denote nested switch improvement
maximilianruesch Feb 4, 2024
ac25c20
Refactor to l0 and l1
maximilianruesch Feb 5, 2024
4a9f267
Fix formatting
maximilianruesch Feb 6, 2024
1ab4a86
Merge branch 'bug/fix-initialization-of-field-access-information-key'…
maximilianruesch Feb 8, 2024
b7db6a1
Start to unify string analysis
maximilianruesch Feb 8, 2024
8bd2657
Refactor dependent vars handling
maximilianruesch Feb 8, 2024
c1e9209
Simplify lean path computation
maximilianruesch Feb 8, 2024
c4deda8
Refactor path elements to hold pcs instead of def sites
maximilianruesch Feb 8, 2024
6bbcfd2
Start support of string_concat calls on l0 level
maximilianruesch Feb 9, 2024
74acf8c
Refactor state dependency of interpretation handlers
maximilianruesch Feb 9, 2024
e25bd09
Move array access handling to l0
maximilianruesch Feb 10, 2024
b6c4f63
Revamp testing scheme to level based testing
maximilianruesch Feb 10, 2024
cd34702
Add static method test
maximilianruesch Feb 10, 2024
800e5c6
Simplify L1Analysis
maximilianruesch Feb 10, 2024
e232e4d
Simplify virtual function call resolving
maximilianruesch Feb 10, 2024
a561116
Support simple contexts for callees via context provider
maximilianruesch Feb 10, 2024
c296ec3
Revamp state hierarchy
maximilianruesch Feb 10, 2024
4f57fc1
Fix field interpretation for l1 tests
maximilianruesch Feb 10, 2024
eb304c6
Remove unused l0 interpreters
maximilianruesch Feb 10, 2024
71475f7
Repair some l1 test cases
maximilianruesch Feb 10, 2024
e688f93
Properly deduplicate possible string values in string constancy
maximilianruesch Feb 13, 2024
703aa8a
Support substring calls on l0 string analysis
maximilianruesch Feb 13, 2024
5829189
Merge branch 'bug/fix-constant-value-integer-range-canonical-forms' i…
maximilianruesch Feb 13, 2024
d4adea8
Fix formatting after scalaFmt intro post work
maximilianruesch Feb 13, 2024
cb124c3
Fix substring test
maximilianruesch Feb 13, 2024
a1c8f6f
Exclude some broken L1 tests from general test runs
maximilianruesch Feb 13, 2024
61e072b
Reduce static function call handling to l0 level
maximilianruesch Feb 13, 2024
2100448
Reduce non-virtual method call handling to l0 level
maximilianruesch Feb 13, 2024
c302ff3
Revamp interpretation result system
maximilianruesch Feb 14, 2024
b3308a3
Lower upper bound of interpreted instructions
maximilianruesch Feb 14, 2024
da42432
Remove unnecessary state handling for virtual function calls
maximilianruesch Feb 14, 2024
dcce8f1
Introduce refinability traits into interpretation results
maximilianruesch Feb 15, 2024
bdb8855
Revamp dependency handling for interpretation
maximilianruesch Feb 15, 2024
0d11391
Remove fallthrough ip result
maximilianruesch Feb 29, 2024
244ea73
Split interpretation handler from state
maximilianruesch Feb 29, 2024
15e0e69
Completely revamp interpretation dependency handling
maximilianruesch Mar 8, 2024
ea74cbb
Group all simple value const expr interpreters
maximilianruesch Mar 8, 2024
4b7a53b
Merge branch 'develop' into feature/StringAnalysis
maximilianruesch Mar 8, 2024
dc467a5
Remove debug statements from property store
maximilianruesch Mar 8, 2024
40b2dfd
Use PCs for interpretation instead of def sites
maximilianruesch Mar 8, 2024
1d2a997
Fix complex sci detection for parameters
maximilianruesch Mar 8, 2024
f1903f8
Rebuild string constancy information with constancy trees
maximilianruesch Mar 13, 2024
c7ee182
Move control of callees to using interpreter
maximilianruesch Mar 13, 2024
b00b2fb
Remove method context from l1 state responsibility
maximilianruesch Mar 13, 2024
b45921b
Collapse computation state into single class
maximilianruesch Mar 13, 2024
7f80037
Remove unused code
maximilianruesch Mar 13, 2024
f06b1e2
Use own state for def site analysis
maximilianruesch Mar 14, 2024
bd9ce1b
Simplify string tree repetition
maximilianruesch Mar 15, 2024
62c88db
Remove unwanted changes
maximilianruesch Mar 15, 2024
7b34f1b
Introduce realistic test assertion values
maximilianruesch Apr 2, 2024
6168ffd
Remove complex path finding for control structures
maximilianruesch Apr 2, 2024
623e5f7
Turn around string analysis to produce UBs instead of LBs
maximilianruesch Apr 3, 2024
d0ffa12
Simplify all string analysis levels
maximilianruesch Apr 4, 2024
dffb636
Further simplify all string analysis levels
maximilianruesch Apr 15, 2024
231fa30
Remove nested paths from string analysis for now
maximilianruesch Apr 15, 2024
a49c1fd
Simplify lean path construction
maximilianruesch May 2, 2024
8f7fa64
Add simple form of structural analysis
maximilianruesch May 2, 2024
d30fefa
Implement location of proper acyclic intervals
maximilianruesch May 2, 2024
cc52286
Reimagine def site entities as def use site entities
maximilianruesch May 3, 2024
84caf22
Simplify path handling
maximilianruesch May 3, 2024
6075f15
Return functions for string constancy and introduce path finder hiera…
maximilianruesch May 3, 2024
c82b6d6
Introduce path finder for structural analysis
maximilianruesch May 5, 2024
b62fd8f
Introduce hyperedges to better visualize structural analysis
maximilianruesch May 6, 2024
64ebe9d
Stabilize post order traversal
maximilianruesch May 6, 2024
ee598a6
Break up basic blocks in structural analysis
maximilianruesch May 6, 2024
81f3b3a
Remove pathfinder hierarchy in favor of structural analysis based pat…
maximilianruesch May 6, 2024
97b0d2f
Simplify string analysis and definition package names
maximilianruesch May 6, 2024
ca9787d
Fix detection for cyclic graphs in structural analysis
maximilianruesch May 6, 2024
a77c94c
Fix color coding for DOT export
maximilianruesch May 16, 2024
185e606
Fix detection of cycles in block types
maximilianruesch May 16, 2024
2f5b4d5
Implement location of cycles structural analysis
maximilianruesch May 16, 2024
286c8f0
Refactor structural analysis structure
maximilianruesch May 17, 2024
177aea7
Simplify ayclic region detection
maximilianruesch May 17, 2024
152fa7b
Improve node coloring for dot export
maximilianruesch May 17, 2024
58b2f7d
Clarify variable reference
maximilianruesch May 17, 2024
759c242
Overhaul string analysis computation for flow functions
maximilianruesch May 17, 2024
c64f8ec
Correct package file name
maximilianruesch May 17, 2024
bd39888
Remove unused functions
maximilianruesch May 17, 2024
68855e3
Compute super flow graph in structural analysis as well
maximilianruesch May 18, 2024
a00b64c
Generalize used flow graph nodes to a trait
maximilianruesch May 18, 2024
9f4bd78
Add a special global exit node
maximilianruesch May 18, 2024
636423e
Enable computing the entry node to a region during structural analysis
maximilianruesch May 18, 2024
2f52fa6
Implement rudimentary data flow analysis
maximilianruesch May 20, 2024
d039725
Extend environments by webs
maximilianruesch May 20, 2024
7f35866
Extend data flow analysis for remaining acyclic regions
maximilianruesch May 20, 2024
85778e7
Fix substring and append flow functions
maximilianruesch May 21, 2024
93bbe9c
Fix computation of registered webs
maximilianruesch May 21, 2024
f6062dc
Return lower bound when cyclic control structures exist
maximilianruesch May 21, 2024
a4a9031
Update many test cases for L0
maximilianruesch May 21, 2024
75de3db
Correctly interpret arguments of setLength
maximilianruesch May 21, 2024
fc09357
Fix interpreting arguments of substring calls
maximilianruesch May 21, 2024
4ad4694
Return LB for values which were not interpreted
maximilianruesch May 21, 2024
bdb4628
Stabelize traversal for data flow analysis
maximilianruesch May 21, 2024
e606db4
Fix multiple disjoint def sites that meet at analyzed variable
maximilianruesch May 21, 2024
373f3f5
Fix return value interpretation of virtual function calls
maximilianruesch May 21, 2024
e74bf87
Correctly forward string builder references during append calls
maximilianruesch May 25, 2024
013e883
Refactor method string flow into its own property
maximilianruesch May 25, 2024
76f4302
Fix some of the L1 test cases
maximilianruesch May 25, 2024
ca87162
Simplify interface of interpretation handler levels
maximilianruesch May 25, 2024
dc18adb
Let loops map to dynamic elements if they modify the environment
maximilianruesch May 25, 2024
93888e3
Rebuild for context oriented analysis
maximilianruesch Jun 3, 2024
9d0624c
Fix the parameter read tests
maximilianruesch Jun 4, 2024
aa1d43d
Fix missing simplify in tests
maximilianruesch Jun 4, 2024
87ad517
Fix remaining static call based tests
maximilianruesch Jun 4, 2024
63e1f33
Fix post order traversal and implement more efficient cycle check
maximilianruesch Jun 5, 2024
d867a54
Implement much more efficient back edge path detection
maximilianruesch Jun 5, 2024
ef57f72
Refactor out individual processing functions in data flow analysis
maximilianruesch Jun 5, 2024
d21898d
Optimize data flow analysis
maximilianruesch Jun 5, 2024
37f7959
Remove timing debug statements
maximilianruesch Jun 5, 2024
b8519f5
Remove filters on L0 tests
maximilianruesch Jun 16, 2024
c9acbc3
Correctly handle dependencies in string analysis
maximilianruesch Jun 16, 2024
a4f5cb4
Interpret arbitrary calls to object return types as well
maximilianruesch Jun 16, 2024
dbd7db0
Fix L1 tests by interpreting notable variable usages correctly
maximilianruesch Jun 16, 2024
600ef56
Remove debug statements
maximilianruesch Jun 16, 2024
2f4e0c6
Enable a few more L1 tests that now pass
maximilianruesch Jun 16, 2024
f7092ed
Refactor test overrides such that only annotations need to be specifi…
maximilianruesch Jun 17, 2024
3d93873
Improve performance of natural loop interpretation
maximilianruesch Jun 18, 2024
ec553c1
Add more L0 test cases
maximilianruesch Jun 18, 2024
38bfe45
Refactor reflective calls support tool into a more readable form
maximilianruesch Jun 18, 2024
3f06497
Run tests with domains from both L1 and L2
maximilianruesch Jun 26, 2024
721554b
Remove unused methods
maximilianruesch Jun 27, 2024
9102ff9
Handle invalid flow instead of neutral elements
maximilianruesch Jun 27, 2024
8248100
Use field access information FPCF property instead of the project inf…
maximilianruesch Jun 28, 2024
fb07cb8
Simplify or-nodes into single child if present
maximilianruesch Jun 29, 2024
6c07b23
Remove superflouous comment
maximilianruesch Jun 29, 2024
7be416a
Fix handling of field reads for EPK access dependees
maximilianruesch Jun 29, 2024
b68d366
Harden context string analysis against missing parameters
maximilianruesch Jun 29, 2024
0e570dd
Remove unused functions
maximilianruesch Jun 29, 2024
6caa4ba
Fix dependee collection of field read interpretation
maximilianruesch Jun 29, 2024
a5e8c91
Fix some L1 tests
maximilianruesch Jun 29, 2024
6193e55
Properly react to updates in function call interpretation
maximilianruesch Jun 29, 2024
6811a89
Integrate system properties analysis
maximilianruesch Jun 29, 2024
e2c1403
Fix function call interpreter for non-defined method dependees
maximilianruesch Jun 29, 2024
8a1ed5e
Improve structural analysis performance
maximilianruesch Jun 29, 2024
07312ba
Add global entry to flow graphs
maximilianruesch Jun 30, 2024
739036a
Start optimizing memory footprint of data flow analysis
maximilianruesch Jun 30, 2024
8dfb5d4
Slightly optimize index building for dominator tree during structural…
maximilianruesch Jun 30, 2024
dd4a0e0
Optimize some predecessor checks
maximilianruesch Jun 30, 2024
99adecf
Fix acyclic regions and greatly improve acyclic region performance
maximilianruesch Jul 1, 2024
9815bb0
Speed up post order traversal by using inner elements
maximilianruesch Jul 3, 2024
9edd5e9
Implement mutable dominator information
maximilianruesch Jul 4, 2024
961f5e4
Simplify location of acyclic interval
maximilianruesch Jul 4, 2024
2d6a861
Simplify path back
maximilianruesch Jul 4, 2024
aa843ba
Implement rudimentary cycle caching
maximilianruesch Jul 4, 2024
6aaa5cc
Simplify replace method
maximilianruesch Jul 4, 2024
ff7575f
Use mutable graphs in structural analysis
maximilianruesch Jul 4, 2024
2feeb21
Simplify dominator updates
maximilianruesch Jul 5, 2024
862373c
Simplify post order traversal
maximilianruesch Jul 5, 2024
7f6fd1d
Make analyzing proper regions somewhat more efficient
maximilianruesch Jul 6, 2024
c196d7e
Rework data flow analysis of proper regions
maximilianruesch Jul 6, 2024
371850c
Correct webs computation for data flow analysis start
maximilianruesch Jul 7, 2024
3088212
Speed up proper region data flow somewhat
maximilianruesch Jul 7, 2024
f637269
Prefilter string tree concats for empty elements
maximilianruesch Jul 7, 2024
97901f0
Fix parameter dependency handling in context string analysis
maximilianruesch Jul 8, 2024
a03542d
Really fix parameter dependency handling and add test case
maximilianruesch Jul 11, 2024
0936496
Add soundness mode and failure to string interpretation
maximilianruesch Jul 11, 2024
d9ce2f3
Fix soundness mode config key for failures
maximilianruesch Jul 21, 2024
c77c3e4
Remove unnecessary statements
maximilianruesch Jul 22, 2024
dc41edb
Improve memory efficiency of joining environments
maximilianruesch Jul 22, 2024
9b079c2
Cache loop graphs during data flow analysis
maximilianruesch Jul 22, 2024
f7d932d
Introduce after phase scheduling to properties test
maximilianruesch Jul 27, 2024
16cba15
Rework string analysis tests
maximilianruesch Jul 29, 2024
860f6a4
Flatten call stack for handling new callers
maximilianruesch Jul 29, 2024
15875f2
Raise all levels by one and add L0 for handling const values
maximilianruesch Aug 5, 2024
221f262
Reduce usage of memory inefficient constForAllFlow
maximilianruesch Aug 7, 2024
948c255
Increase memory efficiency of data flow analysis
maximilianruesch Aug 7, 2024
dea60cb
Increase memory efficiency of preparations for data flow analysis
maximilianruesch Aug 7, 2024
ec64401
Improve memory efficiency of string trees using multi layer caching
maximilianruesch Aug 7, 2024
645ab05
Remove unused imports
maximilianruesch Aug 7, 2024
84978ba
Add regex caching and preliminary sorting on string tree node
maximilianruesch Aug 7, 2024
980df12
Stabilize string tree node ordering by introducing set and seq based …
maximilianruesch Aug 7, 2024
22cb723
Cache more of the start env if possible
maximilianruesch Sep 1, 2024
dab0378
Improve sorting and fix tests related to sorting
maximilianruesch Sep 1, 2024
0da7ef5
Add performance caching for PDUWebs
maximilianruesch Sep 1, 2024
a2421fd
Improve joining environments
maximilianruesch Sep 1, 2024
3de6534
Rework context string analysis for more controlled continuation
maximilianruesch Sep 1, 2024
ce9f140
Split up analyses for method parameter contexts
maximilianruesch Sep 1, 2024
4a122dc
Introduce node hashcode caching for flow graph nodes
maximilianruesch Sep 5, 2024
75ef400
Optimize parameter replacement in string trees
maximilianruesch Sep 5, 2024
b80f551
Optimize children mapping in string tree OR nodes
maximilianruesch Sep 5, 2024
010c26c
Limit size of string trees by configurable maximum depth
maximilianruesch Sep 5, 2024
4c9fac4
Optimize handling of string environments during data flow analysis
maximilianruesch Sep 5, 2024
9a1f166
Fix loading domain into test framework
maximilianruesch Sep 5, 2024
b2d2b0b
Make excluded packages configurable
maximilianruesch Sep 5, 2024
a352518
Introduce soundness mode for data flow analysis
maximilianruesch Sep 5, 2024
7ef3a13
Fill in missing config values into string analysis and reference conf
maximilianruesch Sep 5, 2024
951b950
Fix invalid parameter references due to cross-method field read strin…
maximilianruesch Sep 5, 2024
11f14e1
Move soundness mode into parent package
maximilianruesch Sep 5, 2024
9b30598
Add soundness mode to more interpreters
maximilianruesch Sep 8, 2024
964dcbb
Restrict constructor call interpretation to string relevant types
maximilianruesch Sep 8, 2024
10733bf
Remove write threshold from field read interpretation
maximilianruesch Sep 8, 2024
d714256
Improve maximum depth detection
maximilianruesch Sep 8, 2024
823c006
Support more java serialized class strings
maximilianruesch Sep 8, 2024
bbcc3c4
Improve return value soundness mode for several interpreters
maximilianruesch Sep 8, 2024
deb608c
Introduce l3 and raise field access interpretation
maximilianruesch Sep 8, 2024
71823b0
Merge branch 'develop' into feature/StringAnalysis
maximilianruesch Sep 8, 2024
34f1f3b
Fix variable definitions after merge
maximilianruesch Sep 8, 2024
e502d1b
Improve performance of string tree environments
maximilianruesch Sep 8, 2024
1c5a3eb
Fix indents in config
maximilianruesch Sep 8, 2024
a4e762a
Limit string tree depth to 10
maximilianruesch Sep 8, 2024
dee9b5f
Add some improve comments
maximilianruesch Sep 8, 2024
bc0d6c4
Merge branch 'develop' into feature/StringAnalysis
maximilianruesch Sep 9, 2024
d7d4ee9
Add trivial string analysis
maximilianruesch Sep 9, 2024
a2c09bf
Move the method string flow analysis and its state into the flow anal…
maximilianruesch Sep 9, 2024
1d41aaa
Move the interpretation state into the interpretation package
maximilianruesch Sep 9, 2024
7c3b47c
Rename test fixture package to match fpcf package name
maximilianruesch Sep 9, 2024
ea80b66
Remove intermediate string constancy information
maximilianruesch Sep 9, 2024
7517af8
Remove unused string constancy type
maximilianruesch Sep 9, 2024
586821a
Convert string constancy level from enum to case objects
maximilianruesch Sep 9, 2024
f506918
Remove unused string tree repetition
maximilianruesch Sep 9, 2024
506f096
Fix recursion depth limit barrier
maximilianruesch Sep 11, 2024
76d5210
Revert unwanted changes in class usage analysis
maximilianruesch Sep 11, 2024
abc228d
Unify handling of soundness mode
maximilianruesch Sep 11, 2024
b509566
Refactor max depth to depth threshold
maximilianruesch Sep 11, 2024
455df95
Remove some instability by hardening method parameter handling for fi…
maximilianruesch Sep 11, 2024
395f738
Add improvement comment for joining environments
maximilianruesch Sep 11, 2024
4ff5439
Fix inefficiency for computing new upper bounds for field read trees
maximilianruesch Sep 11, 2024
5452078
Allow string constants to be resolved outside of method string flow
maximilianruesch Sep 11, 2024
3e43f08
Simplify string analysis state definition
maximilianruesch Sep 11, 2024
04d9271
Remove unused code
maximilianruesch Sep 11, 2024
2489ed6
Simplify supported types and move into their only usage
maximilianruesch Sep 11, 2024
63e6a0e
Fix formatting
maximilianruesch Sep 12, 2024
d431a92
Compute string analysis within callgraph in the tests
maximilianruesch Sep 16, 2024
1b1f0ba
Add invalid string constancy level
maximilianruesch Sep 16, 2024
9e991f9
Fix return values of many string analyis parts
maximilianruesch Sep 16, 2024
6351151
Fix crash when no callers dependee was computed before but receives a…
maximilianruesch Sep 16, 2024
4ce8957
Simplify to string on constancy property
maximilianruesch Sep 16, 2024
c407442
Greatly refactor reflective call analysis tool
maximilianruesch Sep 16, 2024
0a1e057
Simplify high soundness handling down to boolean type alias
maximilianruesch Sep 16, 2024
90339a6
Add tests for missing configurations
maximilianruesch Sep 16, 2024
fceb1f5
Add tests for missing configurations
maximilianruesch Sep 16, 2024
ce6bc7f
Document all string analysis tests
maximilianruesch Sep 18, 2024
63da916
Rename hierarchy related string analysis test fixtures
maximilianruesch Sep 18, 2024
bd24501
Rename test properties packages
maximilianruesch Sep 18, 2024
a5584c1
Add some documentation to test annotations
maximilianruesch Sep 18, 2024
00ac794
Add documentation to string analysis related properties
maximilianruesch Sep 18, 2024
018369b
Improve string constancy level tests
maximilianruesch Sep 18, 2024
4c54426
Remove high soundness type alias
maximilianruesch Sep 23, 2024
10615d4
Rename string constancy level meet function
maximilianruesch Sep 23, 2024
8d8713b
Rename config object
maximilianruesch Sep 23, 2024
db2daf0
Improve equality check for supported types
maximilianruesch Sep 23, 2024
07d9c3f
Improve documentation for all string analysis modules
maximilianruesch Sep 23, 2024
1e9b2e9
Merge branch 'develop' into feature/StringAnalysis
maximilianruesch Sep 23, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package analyses
package string
package interpretation

import org.opalj.br.FieldType
import org.opalj.br.Method
import org.opalj.br.fpcf.FPCFAnalysis
import org.opalj.br.fpcf.properties.string.StringTreeNode
Expand Down Expand Up @@ -80,44 +79,4 @@ abstract class InterpretationHandler extends FPCFAnalysis with UniversalStringCo
object InterpretationHandler {

def getEntity(implicit state: InterpretationState): MethodPC = MethodPC(state.pc, state.dm)

/**
* This function checks whether a given type is a supported primitive type. Supported currently
* means short, int, float, or double.
*/
private def isSupportedPrimitiveNumberType(typeName: String): Boolean =
typeName == "short" || typeName == "int" || typeName == "float" || typeName == "double"

/**
* Checks whether a given type, identified by its string representation, is supported by the
* string analysis. That means, if this function returns `true`, a value, which is of type
* `typeName` may be approximated by the string analysis better than just the lower bound.
*
* @param typeName The name of the type to check. May either be the name of a primitive type or
* a fully-qualified class name (dot-separated).
* @return Returns `true`, if `typeName` is an element in [char, short, int, float, double,
* java.lang.String] and `false` otherwise.
*/
def isSupportedType(typeName: String): Boolean =
typeName == "char" || isSupportedPrimitiveNumberType(typeName) ||
typeName == "java.lang.String" || typeName == "java.lang.String[]"

/**
* Determines whether a given element is supported by the string analysis.
*
* @return Returns true if the given [[FieldType]] is of a supported type. For supported types,
* see [[InterpretationHandler.isSupportedType(String)]].
*/
def isSupportedType(v: V): Boolean =
if (v.value.isPrimitiveValue) {
isSupportedType(v.value.asPrimitiveValue.primitiveType.toJava)
} else {
try {
isSupportedType(v.value.verificationTypeInfo.asObjectVariableInfo.clazz.toJava)
} catch {
case _: Exception => false
}
}

def isSupportedType(fieldType: FieldType): Boolean = isSupportedType(fieldType.toJava)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package interpretation
import scala.collection.mutable.ListBuffer

import org.opalj.br.DeclaredField
import org.opalj.br.FieldType
import org.opalj.br.ObjectType
import org.opalj.br.PUVar
import org.opalj.br.analyses.DeclaredFields
import org.opalj.br.analyses.SomeProject
Expand Down Expand Up @@ -79,7 +81,7 @@ class L3FieldReadInterpreter(
override def interpretExpr(target: PV, fieldRead: E)(implicit
state: InterpretationState
): ProperPropertyComputationResult = {
if (!InterpretationHandler.isSupportedType(fieldRead.declaredFieldType)) {
if (!L3FieldReadInterpreter.isSupportedType(fieldRead.declaredFieldType)) {
return failure(target)
}

Expand Down Expand Up @@ -217,3 +219,12 @@ class L3FieldReadInterpreter(
}
}
}

object L3FieldReadInterpreter {

/**
* Checks whether the given type is supported by the field read analysis, i.e. if it may contain values desirable
* AND resolvable by the string analysis as a whole.
*/
private def isSupportedType(fieldType: FieldType): Boolean = fieldType.isBaseType || fieldType == ObjectType.String
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can even use eq instead of ==

}