java: fixes comments in TemplateBuffer.java

This commit is contained in:
FURUHASHI Sadayuki
2010-12-03 22:54:20 +09:00
parent a71439607f
commit 8b7894f9bd
2 changed files with 10 additions and 10 deletions

View File

@@ -212,12 +212,12 @@ public abstract class TemplateBuilder {
Field[] allFields = readAllFields(targetClass); Field[] allFields = readAllFields(targetClass);
/* index: /* index:
* @Index(0) int a; // 0 * @Index(0) int field_a; // 0
* int b; // 1 * int field_b; // 1
* @Index(3) int c; // 3 * @Index(3) int field_c; // 3
* int e; // 4 * int field_d; // 4
* @Index(2) int d; // 2 * @Index(2) int field_e; // 2
* int e; // 5 * int field_f; // 5
*/ */
List<FieldEntry> indexed = new ArrayList<FieldEntry>(); List<FieldEntry> indexed = new ArrayList<FieldEntry>();
int maxIndex = -1; int maxIndex = -1;
@@ -231,10 +231,10 @@ public abstract class TemplateBuilder {
int index = readFieldIndex(f, maxIndex); int index = readFieldIndex(f, maxIndex);
if(indexed.size() > index && indexed.get(index) != null) { if(indexed.size() > index && indexed.get(index) != null) {
throw new RuntimeException("duplicated index: "+index); // FIXME exception throw new TemplateBuildException("duplicated index: "+index);
} }
if(index < 0) { if(index < 0) {
throw new RuntimeException("invalid index: "+index); // FIXME exception throw new TemplateBuildException("invalid index: "+index);
} }
while(indexed.size() <= index) { while(indexed.size() <= index) {

View File

@@ -125,7 +125,7 @@ public class TemplateRegistry {
for(Class<?> i : target.getInterfaces()) { for(Class<?> i : target.getInterfaces()) {
tmpl = map.get(i); tmpl = map.get(i);
if(tmpl != null) { if(tmpl != null) {
map.put(target, tmpl); register(target, tmpl);
return tmpl; return tmpl;
} }
} }
@@ -135,7 +135,7 @@ public class TemplateRegistry {
for(; c != Object.class; c = c.getSuperclass()) { for(; c != Object.class; c = c.getSuperclass()) {
tmpl = map.get(c); tmpl = map.get(c);
if(tmpl != null) { if(tmpl != null) {
map.put(target, tmpl); register(target, tmpl);
return tmpl; return tmpl;
} }
} }