File file = filePath.toFile(); if (file.exists()) { return new LocalFileStorage(file);
@Override public Object findSourceElement(String name) throws CoreException { if (getDirectory() == null) { return null; } String pathStr= name.replace('.', '/'); int lastSlash = pathStr.lastIndexOf('/'); try { IPath root = new Path(getDirectory().getCanonicalPath()); boolean possibleInnerType = false; String typeName = pathStr; do { IPath filePath = root.append(new Path(typeName + ".java")); //$NON-NLS-1$ File file = filePath.toFile(); if (file.exists()) { return new LocalFileStorage(file); } int index = typeName.lastIndexOf('$'); if (index > lastSlash) { typeName = typeName.substring(0, index); possibleInnerType = true; } else { possibleInnerType = false; } } while (possibleInnerType); } catch (IOException e) { throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), e.getMessage(), e)); } return null; }