Skip to content

fix the print of field signatures#793

Merged
stschott merged 2 commits intodevelopfrom
fix/fieldSignaturePrinting
Jan 4, 2024
Merged

fix the print of field signatures#793
stschott merged 2 commits intodevelopfrom
fix/fieldSignaturePrinting

Conversation

@stschott
Copy link
Copy Markdown
Collaborator

@stschott stschott commented Jan 3, 2024

fixes missed escaping + StmtPrinter.typeSignature() to adapt type printing

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 3, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (bc6f0bc) 63.38% compared to head (57ebb6c) 63.52%.

Files Patch % Lines
...n/java/sootup/core/util/printer/JimplePrinter.java 0.00% 5 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

SootField f = (SootField) fieldIt.next();
printer.newline();
printer.handleIndent();
printer.literal(f.getDeclaration());
Copy link
Copy Markdown
Collaborator

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()));
Copy link
Copy Markdown
Collaborator

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?

@stschott stschott merged commit 46cd58a into develop Jan 4, 2024
@stschott stschott deleted the fix/fieldSignaturePrinting branch January 4, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants