Skip to content

Commit cd292b9

Browse files
author
Johannes Emerich
committed
Add collector for const struct names
In order to expose consts on obfuscated modules, their names need to be added to the set of protected symbols.
1 parent 3ad1b2c commit cd292b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spaghetti-core/src/main/java/com/prezi/spaghetti/obfuscation/internal/SymbolCollectVisitor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public Collection<String> visitStructNode(StructNode node) {
5454

5555
@Override
5656
public Collection<String> visitConstNode(ConstNode node) {
57-
return extractNames(node.getEntries());
57+
return ImmutableList.<String>builder().add(node.getName()).addAll(extractNames(node.getEntries())).build();
5858
}
5959

6060
@Override

spaghetti-core/src/test/groovy/com/prezi/spaghetti/obfuscation/SymbolCollectVisitorTest.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class SymbolCollectVisitorTest extends Specification {
6060
}
6161
"""
6262
expect:
63-
result == ["alpha", "beta"]
63+
result == ["Constants", "alpha", "beta"]
6464
}
6565

6666
def "enum values are found"() {

0 commit comments

Comments
 (0)