beautification

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1257 379699f6-c40d-0410-875b-85095c16579e
master
hoenicke 25 years ago
parent bf597fea43
commit 0b2f10fddf
  1. 6
      jode/jode/bytecode/MethodInfo.java
  2. 4
      jode/jode/decompiler/ClassAnalyzer.java
  3. 1
      jode/jode/decompiler/MethodAnalyzer.java
  4. 2
      jode/jode/obfuscator/ClassIdentifier.java

@ -54,7 +54,7 @@ public final class MethodInfo extends BinaryInfo implements Comparable {
&& name.equals("Exceptions")) { && name.equals("Exceptions")) {
int count = input.readUnsignedShort(); int count = input.readUnsignedShort();
exceptions = new String[count]; exceptions = new String[count];
for (int i=0; i< count; i++) for (int i = 0; i < count; i++)
exceptions[i] = cp.getClassName(input.readUnsignedShort()); exceptions[i] = cp.getClassName(input.readUnsignedShort());
if (length != 2 * (count + 1)) if (length != 2 * (count + 1))
throw new ClassFormatException throw new ClassFormatException
@ -95,7 +95,7 @@ public final class MethodInfo extends BinaryInfo implements Comparable {
} }
if (exceptions != null) { if (exceptions != null) {
gcp.putUTF8("Exceptions"); gcp.putUTF8("Exceptions");
for (int i=0; i< exceptions.length; i++) for (int i = 0; i < exceptions.length; i++)
gcp.putClassName(exceptions[i]); gcp.putClassName(exceptions[i]);
} }
if (syntheticFlag) if (syntheticFlag)
@ -130,7 +130,7 @@ public final class MethodInfo extends BinaryInfo implements Comparable {
output.writeShort(gcp.putUTF8("Exceptions")); output.writeShort(gcp.putUTF8("Exceptions"));
output.writeInt(2 + count * 2); output.writeInt(2 + count * 2);
output.writeShort(count); output.writeShort(count);
for (int i=0; i< count; i++) for (int i = 0; i < count; i++)
output.writeShort(gcp.putClassName(exceptions[i])); output.writeShort(gcp.putClassName(exceptions[i]));
} }
if (syntheticFlag) { if (syntheticFlag) {

@ -308,8 +308,7 @@ public class ClassAnalyzer
// First analyze constructors and synthetic fields: // First analyze constructors and synthetic fields:
constrAna = null; constrAna = null;
if (constructors.length > 0) { if (constructors.length > 0) {
for (int j=0; j< constructors.length; j++) for (int j=0; j< constructors.length; j++) {
{
if (pl != null) { if (pl != null) {
double constrCompl = constructors[j].getComplexity() double constrCompl = constructors[j].getComplexity()
* subScale; * subScale;
@ -408,6 +407,7 @@ public class ClassAnalyzer
} }
public void makeDeclaration(Set done) { public void makeDeclaration(Set done) {
// First prepare constructors:
if (constrAna != null) if (constrAna != null)
constrAna.transform(); constrAna.transform();
if (staticConstructor != null) { if (staticConstructor != null) {

@ -635,6 +635,7 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
if (!li.isShadow()) if (!li.isShadow())
imports.useType(li.getType()); imports.useType(li.getType());
} }
for (int i=0; i < param.length; i++) { for (int i=0; i < param.length; i++) {
param[i].guessName(); param[i].guessName();
Iterator doneIter = done.iterator(); Iterator doneIter = done.iterator();

@ -232,7 +232,7 @@ public class ClassIdentifier extends Identifier {
for (Iterator i = methods.iterator(); i.hasNext(); ) { for (Iterator i = methods.iterator(); i.hasNext(); ) {
MethodIdentifier method = (MethodIdentifier) i.next(); MethodIdentifier method = (MethodIdentifier) i.next();
modifiers = method.info.getModifiers(); modifiers = method.info.getModifiers();
if( Modifier.isPrivate(modifiers)) if (Modifier.isPrivate(modifiers))
continue; continue;
out.writeUTF(method.getName()); out.writeUTF(method.getName());

Loading…
Cancel
Save