projects
/
org.ibex.classgen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7fbbcd1
)
fixed bug where ['s were getting appended instead of prepended
author
adam
<adam@megacz.com>
Fri, 3 Jun 2005 05:46:05 +0000
(
05:46
+0000)
committer
adam
<adam@megacz.com>
Fri, 3 Jun 2005 05:46:05 +0000
(
05:46
+0000)
darcs-hash:
20050603054605
-5007d-
7fbd2a41532c006ca29bb17487e692eafbd99329
.gz
src/org/ibex/classgen/Type.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/classgen/Type.java
b/src/org/ibex/classgen/Type.java
index
a8a68d8
..
84c9343
100644
(file)
--- a/
src/org/ibex/classgen/Type.java
+++ b/
src/org/ibex/classgen/Type.java
@@
-33,7
+33,7
@@
public class Type {
public static Type instance(String d) {
Type ret = (Type)instances.get(d);
if (ret != null) return ret;
public static Type instance(String d) {
Type ret = (Type)instances.get(d);
if (ret != null) return ret;
- if (d.endsWith("[")) return new Type.Array(instance(d.substring(d.length()-1)));
+ if (d.startsWith("[")) return new Type.Array(instance(d.substring(1)));
return new Type.Class(d);
}
return new Type.Class(d);
}
@@
-42,7
+42,7
@@
public class Type {
public int hashCode() { return descriptor.hashCode(); }
public boolean equals(java.lang.Object o) { return this==o; }
public int hashCode() { return descriptor.hashCode(); }
public boolean equals(java.lang.Object o) { return this==o; }
- public Type.Array makeArray() { return (Type.Array)instance(descriptor+"["); }
+ public Type.Array makeArray() { return (Type.Array)instance("["+descriptor); }
public Type.Ref asRef() { throw new RuntimeException("attempted to use "+this+" as a Type.Ref, which it is not"); }
public Type.Class asClass() { throw new RuntimeException("attempted to use "+this+" as a Type.Class, which it is not"); }
public Type.Ref asRef() { throw new RuntimeException("attempted to use "+this+" as a Type.Ref, which it is not"); }
public Type.Class asClass() { throw new RuntimeException("attempted to use "+this+" as a Type.Class, which it is not"); }
@@
-92,10
+92,10
@@
public class Type {
}
public static class Array extends Type.Ref {
}
public static class Array extends Type.Ref {
- protected Array(Type t) { super(t.getDescriptor() + "[", t.toString() + "[]"); }
+ protected Array(Type t) { super("[" + t.getDescriptor(), t.toString() + "[]"); }
public Type.Array asArray() { return this; }
public boolean isArray() { return true; }
public Type.Array asArray() { return this; }
public boolean isArray() { return true; }
- public int dimension() { return descriptor.length() - descriptor.indexOf('['); }
+ public int dimension() { return getDescriptor().lastIndexOf('['); }
}
}
}
}