-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
fix the print of field signatures #793
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #793 +/- ##
=============================================
+ Coverage 63.38% 63.52% +0.14%
- Complexity 3376 3382 +6
=============================================
Files 314 314
Lines 15074 15072 -2
Branches 2557 2558 +1
=============================================
+ Hits 9555 9575 +20
+ Misses 4626 4604 -22
Partials 893 893 ☔ View full report in Codecov by Sentry. |
@@ -196,8 +191,12 @@ public void printTo(SootClass<?> cl, PrintWriter out, LabeledStmtPrinter printer | |||
SootField f = (SootField) fieldIt.next(); | |||
printer.newline(); | |||
printer.handleIndent(); | |||
printer.literal(f.getDeclaration()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need/use/want .getDeclaration() somewhere else? maybe we can remove it.. I mean its nice to have when needed - but I would not expect to find it and its basically just concatenating two SootField methods which I would do quickly myself before searching for getDeclaration() unless I stumbled over it already.
printer.literal(f.getDeclaration()); | ||
printer.literal(";"); | ||
if (!f.getModifiers().isEmpty()) { | ||
printer.literal(FieldModifier.toString(f.getModifiers())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Offtopic: FieldModifier.toString(...) already assumes valid Modifier combinations (theoretically its currently possible to assign public+private+protected modifier at the same time) - maybe we should implement a wrapper of EnumSet<...Modifier> to handle only valid combinations and implement toString there?
fixes missed escaping + StmtPrinter.typeSignature() to adapt type printing