} IType type= null; if (cuFile != null && cuFile.exists()) { IJavaElement  cu= JavaCore.create(cuFile); if (cu != null && cu.exists() && cu.getElementType() == IJavaElement.COMPILATION_UNIT) type= ((ICompilationUnit)cu).findPrimaryType();
if (cuFile != null && cuFile.exists()) { IJavaElement  cu= JavaCore.create(cuFile); if (cu != null && cu.exists() && cu.getElementType() == IJavaElement.COMPILATION_UNIT) type= ((ICompilationUnit)cu).findPrimaryType();
	private SearchPatternData tryIfPropertyFileSelected(ISelection selection) {		if (selection instanceof IStructuredSelection) {			Object o= ((IStructuredSelection) selection).getFirstElement();			if (o instanceof IFile && ((IFile) o).getFileExtension().equalsIgnoreCase("properties")) { //$NON-NLS-1$				IPath propertyFullPath= ((IFile)o).getFullPath();				String typePathStr= null;				// try to be smarter and find a corresponding CU				IPath cuPath= propertyFullPath.removeFileExtension().addFileExtension("java"); //$NON-NLS-1$				IFile cuFile= (IFile)JavaPlugin.getWorkspace().getRoot().findMember(cuPath);				if (cuFile == null) { //try with uppercase first char					String filename= cuPath.removeFileExtension().lastSegment();					if (filename != null && filename.length() > 0) {						filename= Character.toUpperCase(filename.charAt(0)) + filename.substring(1);						IPath dirPath= propertyFullPath.removeLastSegments(1).addTrailingSeparator();						cuPath= dirPath.append(filename).addFileExtension("java"); //$NON-NLS-1$						cuFile= (IFile)JavaPlugin.getWorkspace().getRoot().findMember(cuPath);					}				}				IType type= null;				if (cuFile != null && cuFile.exists()) {					IJavaElement  cu= JavaCore.create(cuFile);					if (cu != null && cu.exists() && cu.getElementType() == IJavaElement.COMPILATION_UNIT)						type= ((ICompilationUnit)cu).findPrimaryType();						if (type != null)							typePathStr= JavaModelUtil.getFullyQualifiedName(type);						else {							IPath propertyFile= propertyFullPath.removeFirstSegments(propertyFullPath.segmentCount() - 1);							typePathStr= propertyFile.removeFileExtension().toString();						}				}				return new SearchPatternData(typePathStr, type, propertyFullPath.toString());			}		}		return null;	}