private Map buildMap(final Class type, final boolean tupleKeyed) { Class cls = type; DictionaryEntry lastDictionaryEntry = null; final LinkedList superClasses = new LinkedList(); while (lastDictionaryEntry == null) { if (Object.class.equals(cls) || cls == null) { lastDictionaryEntry = OBJECT_DICTIONARY_ENTRY; } else { lastDictionaryEntry = getDictionaryEntry(cls); } if (lastDictionaryEntry == null) { superClasses.addFirst(cls); cls = cls.getSuperclass(); } } for (final Iterator iter = superClasses.iterator(); iter.hasNext();) { cls = (Class)iter.next(); DictionaryEntry newDictionaryEntry = buildDictionaryEntryForClass(cls, lastDictionaryEntry); synchronized (this) { final DictionaryEntry concurrentEntry = getDictionaryEntry(cls); if (concurrentEntry == null) { dictionaryEntries.put(cls, newDictionaryEntry); } else { newDictionaryEntry = concurrentEntry; } } lastDictionaryEntry = newDictionaryEntry; } return tupleKeyed ? lastDictionaryEntry.getKeyedByFieldKey() : lastDictionaryEntry.getKeyedByFieldName(); }
private Map buildMap(final Class type, final boolean tupleKeyed) { Class cls = type; DictionaryEntry lastDictionaryEntry = null; final LinkedList superClasses = new LinkedList(); while (lastDictionaryEntry == null) { if (Object.class.equals(cls) || cls == null) { lastDictionaryEntry = OBJECT_DICTIONARY_ENTRY; } else { lastDictionaryEntry = getDictionaryEntry(cls); } if (lastDictionaryEntry == null) { superClasses.addFirst(cls); cls = cls.getSuperclass(); } } for (final Iterator iter = superClasses.iterator(); iter.hasNext();) { cls = (Class)iter.next(); DictionaryEntry newDictionaryEntry = buildDictionaryEntryForClass(cls, lastDictionaryEntry); synchronized (this) { final DictionaryEntry concurrentEntry = getDictionaryEntry(cls); if (concurrentEntry == null) { dictionaryEntries.put(cls, newDictionaryEntry); } else { newDictionaryEntry = concurrentEntry; } } lastDictionaryEntry = newDictionaryEntry; } return tupleKeyed ? lastDictionaryEntry.getKeyedByFieldKey() : lastDictionaryEntry.getKeyedByFieldName(); }
private Map buildMap(final Class type, final boolean tupleKeyed) { Class cls = type; DictionaryEntry lastDictionaryEntry = null; final LinkedList superClasses = new LinkedList(); while (lastDictionaryEntry == null) { if (Object.class.equals(cls) || cls == null) { lastDictionaryEntry = OBJECT_DICTIONARY_ENTRY; } else { lastDictionaryEntry = getDictionaryEntry(cls); } if (lastDictionaryEntry == null) { superClasses.addFirst(cls); cls = cls.getSuperclass(); } } for (final Iterator iter = superClasses.iterator(); iter.hasNext();) { cls = (Class)iter.next(); DictionaryEntry newDictionaryEntry = buildDictionaryEntryForClass(cls, lastDictionaryEntry); synchronized (this) { final DictionaryEntry concurrentEntry = getDictionaryEntry(cls); if (concurrentEntry == null) { dictionaryEntries.put(cls, newDictionaryEntry); } else { newDictionaryEntry = concurrentEntry; } } lastDictionaryEntry = newDictionaryEntry; } return tupleKeyed ? lastDictionaryEntry.getKeyedByFieldKey() : lastDictionaryEntry.getKeyedByFieldName(); }
private Map buildMap(final Class type, final boolean tupleKeyed) { Class cls = type; DictionaryEntry lastDictionaryEntry = null; final LinkedList superClasses = new LinkedList(); while (lastDictionaryEntry == null) { if (Object.class.equals(cls) || cls == null) { lastDictionaryEntry = OBJECT_DICTIONARY_ENTRY; } else { lastDictionaryEntry = getDictionaryEntry(cls); } if (lastDictionaryEntry == null) { superClasses.addFirst(cls); cls = cls.getSuperclass(); } } for (final Iterator iter = superClasses.iterator(); iter.hasNext();) { cls = (Class)iter.next(); DictionaryEntry newDictionaryEntry = buildDictionaryEntryForClass(cls, lastDictionaryEntry); synchronized (this) { final DictionaryEntry concurrentEntry = getDictionaryEntry(cls); if (concurrentEntry == null) { dictionaryEntries.put(cls, newDictionaryEntry); } else { newDictionaryEntry = concurrentEntry; } } lastDictionaryEntry = newDictionaryEntry; } return tupleKeyed ? lastDictionaryEntry.getKeyedByFieldKey() : lastDictionaryEntry.getKeyedByFieldName(); }