From 1f6a9956f204e25466182c099a3b169186ed6a7f Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Wed, 7 Mar 2012 18:01:54 -0800 Subject: [PATCH] Bug 360030 - Support refactroing on files with custom content types Change-Id: I7cb50d90c9e49a48a833c52dd9f09b54de0dfac4 Reviewed-on: https://git.eclipse.org/r/12112 Reviewed-by: Sergey Prigogin IP-Clean: Sergey Prigogin Tested-by: Sergey Prigogin --- .../cdt/internal/ui/refactoring/rename/CRefactory.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactory.java index 3bbcfce2558..30c94e6d0a9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactory.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactory.java @@ -105,7 +105,8 @@ public class CRefactory { public String[] getCCppPatterns() { IContentType[] cts= Platform.getContentTypeManager().getAllContentTypes(); HashSet all= new HashSet(); - for (IContentType type : cts) { + for (IContentType candidate : cts) { + IContentType type = candidate; boolean useIt= false; while (!useIt && type != null) { String id= type.getId(); @@ -119,7 +120,7 @@ public class CRefactory { } } if (useIt) { - String exts[] = type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC); + String exts[] = candidate.getFileSpecs(IContentType.FILE_EXTENSION_SPEC); all.addAll(Arrays.asList(exts)); } }