View | Details | Raw Unified | Return to bug 121715
Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/util/Util.java (-1 / +13 lines)
Lines 750-756 Link Here
750
				JAVA_LIKE_EXTENSIONS = new char[][] {SuffixConstants.EXTENSION_java.toCharArray()};
750
				JAVA_LIKE_EXTENSIONS = new char[][] {SuffixConstants.EXTENSION_java.toCharArray()};
751
			else {
751
			else {
752
				IContentType javaContentType = Platform.getContentTypeManager().getContentType(JavaCore.JAVA_SOURCE_CONTENT_TYPE);
752
				IContentType javaContentType = Platform.getContentTypeManager().getContentType(JavaCore.JAVA_SOURCE_CONTENT_TYPE);
753
				String[] fileExtensions = javaContentType == null ? null : javaContentType.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
753
				IContentType[] contentTypes = Platform.getContentTypeManager().getAllContentTypes();
754
				List extList = new ArrayList();
755
				if (javaContentType != null) {
756
					extList.addAll(Arrays.asList(javaContentType.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
757
				}
758
				for (int i = 0; i < contentTypes.length; i++) {
759
					IContentType base = contentTypes[i].getBaseType();
760
					if ((base != null) && (base.equals(javaContentType))) {
761
						String[] ext = contentTypes[i].getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
762
						extList.addAll(Arrays.asList(ext));
763
					}
764
				}
765
				String[] fileExtensions = (String[]) extList.toArray(new String[0]);				
754
				// note that file extensions contains "java" as it is defined in JDT Core's plugin.xml
766
				// note that file extensions contains "java" as it is defined in JDT Core's plugin.xml
755
				int length = fileExtensions == null ? 0 : fileExtensions.length;
767
				int length = fileExtensions == null ? 0 : fileExtensions.length;
756
				char[][] extensions = new char[length][];
768
				char[][] extensions = new char[length][];

Return to bug 121715