/** * Returns a type ID or creates a new one if it does not exist. The caller must * attach a reference to it after calling this method or it may leak. */ public NdTypeId createTypeId(char[] fieldDescriptor) { NdTypeId existingType = findType(fieldDescriptor); if (existingType != null) { return existingType; } if (fieldDescriptor.length > 1) { if (fieldDescriptor[0] == 'L') { if (fieldDescriptor[fieldDescriptor.length - 1] != ';') { throw new IllegalStateException(new String(fieldDescriptor) + " is not a valid field descriptor"); //$NON-NLS-1$ } } } NdTypeId result = new NdTypeId(this.nd, fieldDescriptor); if (!CharArrayUtils.equals(result.getFieldDescriptor().getChars(), fieldDescriptor)) { throw new IllegalStateException("Field descriptor didn't match"); //$NON-NLS-1$ } return result; }
/** * Returns a type ID or creates a new one if it does not exist. The caller must * attach a reference to it after calling this method or it may leak. */ public NdTypeId createTypeId(char[] fieldDescriptor) { NdTypeId existingType = findType(fieldDescriptor); if (existingType != null) { return existingType; } if (fieldDescriptor.length > 1) { if (fieldDescriptor[0] == 'L') { if (fieldDescriptor[fieldDescriptor.length - 1] != ';') { throw new IllegalStateException(new String(fieldDescriptor) + " is not a valid field descriptor"); //$NON-NLS-1$ } } } NdTypeId result = new NdTypeId(this.nd, fieldDescriptor); if (!CharArrayUtils.equals(result.getFieldDescriptor().getChars(), fieldDescriptor)) { throw new IllegalStateException("Field descriptor didn't match"); //$NON-NLS-1$ } return result; }
NdTypeId foundType = index.findType(fieldDefinition);
NdTypeId foundType = index.findType(fieldDefinition);
@Override public NdType get() { NdTypeId typeId = JavaIndex.getIndex(TypeRef.this.ref.getNd()).findType(TypeRef.this.fieldDescriptor); if (typeId == null) { return null; } List<NdType> implementations = typeId.getTypes(); for (NdType next : implementations) { NdResourceFile nextResourceFile = next.getResourceFile(); if (nextResourceFile.getLocation().compare(TypeRef.this.fileName, false) == 0) { if (nextResourceFile.isDoneIndexing()) { return next; } } } return null; } }
@Override public NdType get() { NdTypeId typeId = JavaIndex.getIndex(TypeRef.this.ref.getNd()).findType(TypeRef.this.fieldDescriptor); if (typeId == null) { return null; } List<NdType> implementations = typeId.getTypes(); for (NdType next : implementations) { NdResourceFile nextResourceFile = next.getResourceFile(); if (nextResourceFile.getLocation().compare(TypeRef.this.fileName, false) == 0) { if (nextResourceFile.isDoneIndexing()) { return next; } } } return null; } }
Nd nd = index.getNd(); try (IReader lock = nd.acquireReadLock()) { NdTypeId typeId = index.findType(fieldDescriptor);
Nd nd = index.getNd(); try (IReader lock = nd.acquireReadLock()) { NdTypeId typeId = index.findType(fieldDescriptor);
NdTypeId typeId = index.findType(fieldDescriptor); NdType targetType = null; if (typeId != null) {
NdTypeId typeId = index.findType(fieldDescriptor); NdType targetType = null; if (typeId != null) {