Skip to content

Commit

Permalink
bug-fix(tsrg): don't output redundent class lines for anonymous classes
Browse files Browse the repository at this point in the history
Resolves #22, though it still requires a deeper dive.
  • Loading branch information
jamierocks committed May 17, 2019
1 parent c097a23 commit d74e593
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public Optional<FieldMapping> getFieldMapping(final String obfuscatedName) {
}

@Override
public Optional<FieldMapping> computeFieldMapping(FieldSignature signature) {
public Optional<FieldMapping> computeFieldMapping(final FieldSignature signature) {
// If the field type is not provided, lookup up only the field name
if (!signature.getType().isPresent()) {
return this.getFieldMapping(signature.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void write(final MappingSet mappings) {
protected void writeClassMapping(final ClassMapping<?, ?> mapping) {
// Effectively ClassMapping#hasMappings() without the inner class check
if (mapping.hasDeobfuscatedName() ||
mapping.getFieldMappings().stream().anyMatch(Mapping::hasDeobfuscatedName) ||
mapping.getFieldsByName().values().stream().anyMatch(Mapping::hasDeobfuscatedName) ||
mapping.getMethodMappings().stream().anyMatch(MethodMapping::hasMappings)) {
this.writer.println(String.format("%s %s", mapping.getFullObfuscatedName(), mapping.getFullDeobfuscatedName()));
}
Expand Down

0 comments on commit d74e593

Please sign in to comment.