diff options
author | Roman Shevchenko <roman.shevchenko@jetbrains.com> | 2014-05-20 19:43:24 +0400 |
---|---|---|
committer | Roman Shevchenko <roman.shevchenko@jetbrains.com> | 2014-05-20 20:59:12 +0400 |
commit | 310058e6ebb570413b1ed1211163bfa842ba4acc (patch) | |
tree | faa09b9aed67da0a01d0f7217461396dac9277e3 /src | |
parent | 6c2cc096fbc7d5a1ed02ebaa383853a7b6a69eee (diff) | |
download | fernflower-310058e6ebb570413b1ed1211163bfa842ba4acc.tar fernflower-310058e6ebb570413b1ed1211163bfa842ba4acc.tar.gz fernflower-310058e6ebb570413b1ed1211163bfa842ba4acc.tar.lz fernflower-310058e6ebb570413b1ed1211163bfa842ba4acc.tar.xz fernflower-310058e6ebb570413b1ed1211163bfa842ba4acc.zip |
single "extends Object" omitted for type parameters
Diffstat (limited to 'src')
-rw-r--r-- | src/de/fernflower/main/ClassWriter.java | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/de/fernflower/main/ClassWriter.java b/src/de/fernflower/main/ClassWriter.java index a4732f8..d05e494 100644 --- a/src/de/fernflower/main/ClassWriter.java +++ b/src/de/fernflower/main/ClassWriter.java @@ -418,14 +418,17 @@ public class ClassWriter { if(i>0) { writer.write(", "); } - writer.write(descriptor.fparameters.get(i)+" extends "); + writer.write(descriptor.fparameters.get(i)); List<GenericType> lstBounds = descriptor.fbounds.get(i); - writer.write(GenericMain.getGenericCastTypeName(lstBounds.get(0))); - - for(int j=1;j<lstBounds.size();j++) { - writer.write(" & " + GenericMain.getGenericCastTypeName(lstBounds.get(j))); - } + if (lstBounds.size() > 1 || !"java/lang/Object".equals(lstBounds.get(0).value)) { + writer.write(" extends "); + writer.write(GenericMain.getGenericCastTypeName(lstBounds.get(0))); + + for(int j=1;j<lstBounds.size();j++) { + writer.write(" & " + GenericMain.getGenericCastTypeName(lstBounds.get(j))); + } + } } writer.write(">"); } @@ -819,14 +822,17 @@ public class ClassWriter { if(i>0) { bufstrwriter.write(", "); } - bufstrwriter.write(descriptor.fparameters.get(i)+" extends "); + bufstrwriter.write(descriptor.fparameters.get(i)); List<GenericType> lstBounds = descriptor.fbounds.get(i); - bufstrwriter.write(GenericMain.getGenericCastTypeName(lstBounds.get(0))); - - for(int j=1;j<lstBounds.size();j++) { - bufstrwriter.write(" & " + GenericMain.getGenericCastTypeName(lstBounds.get(j))); - } + if (lstBounds.size() > 1 || !"java/lang/Object".equals(lstBounds.get(0).value)) { + bufstrwriter.write(" extends "); + bufstrwriter.write(GenericMain.getGenericCastTypeName(lstBounds.get(0))); + + for(int j=1;j<lstBounds.size();j++) { + bufstrwriter.write(" & " + GenericMain.getGenericCastTypeName(lstBounds.get(j))); + } + } } bufstrwriter.write("> "); } |