Skip to content

Commit ca539b9

Browse files
EcljpseB0Tjukzi
authored andcommitted
rename ContentTypeCatalog.internalFindContentTypesFor
Sometimes VisualVm shows internalFindContentTypesFor as hotspot during filesearch but since there are three distinct methods with the same name it is hard to figure out what is going on.
1 parent 2c18fb8 commit ca539b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

runtime/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeCatalog.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ IContentType[] findContentTypesFor(ContentTypeMatcher matcher, InputStream conte
367367
}
368368

369369
IContentType[] findContentTypesFor(ContentTypeMatcher matcher, final String fileName) {
370-
IContentType[] selected = concat(internalFindContentTypesFor(matcher, fileName, policyConstantGeneralIsBetter));
370+
IContentType[] selected = concat(internalFindContentTypesSorted(matcher, fileName, policyConstantGeneralIsBetter));
371371
// give the policy a chance to change the results
372372
ISelectionPolicy policy = matcher.getPolicy();
373373
if (policy != null)
@@ -460,7 +460,7 @@ private boolean internalAccept(ContentTypeVisitor visitor, ContentType root) {
460460
return true;
461461
}
462462

463-
private IContentType[] internalFindContentTypesFor(ILazySource buffer, IContentType[][] subset, Comparator<IContentType> validPolicy, Comparator<IContentType> indeterminatePolicy) throws IOException {
463+
private IContentType[] internalFindContentTypesForSubset(ILazySource buffer, IContentType[][] subset, Comparator<IContentType> validPolicy, Comparator<IContentType> indeterminatePolicy) throws IOException {
464464
Map<String, Object> properties = new HashMap<>();
465465
final List<ContentType> appropriate = new ArrayList<>(5);
466466
final int validFullName = collectMatchingByContents(0, subset[0], appropriate, buffer, properties);
@@ -501,7 +501,7 @@ private IContentType[] internalFindContentTypesFor(ContentTypeMatcher matcher, I
501501
indeterminatePolicy = policyConstantGeneralIsBetter;
502502
validPolicy = policyConstantSpecificIsBetter;
503503
} else {
504-
subset = internalFindContentTypesFor(matcher, fileName, policyLexicographical);
504+
subset = internalFindContentTypesSorted(matcher, fileName, policyLexicographical);
505505
indeterminatePolicy = policyGeneralIsBetter;
506506
validPolicy = policySpecificIsBetter;
507507
}
@@ -524,7 +524,7 @@ private IContentType[] internalFindContentTypesFor(ContentTypeMatcher matcher, I
524524
// only eligible content type is binary and contents are text, ignore it
525525
return NO_CONTENT_TYPES;
526526
}
527-
return internalFindContentTypesFor(buffer, subset, validPolicy, indeterminatePolicy);
527+
return internalFindContentTypesForSubset(buffer, subset, validPolicy, indeterminatePolicy);
528528
}
529529

530530
/**
@@ -533,7 +533,7 @@ private IContentType[] internalFindContentTypesFor(ContentTypeMatcher matcher, I
533533
* @return all matching content types in the preferred order
534534
* @see IContentTypeManager#findContentTypesFor(String)
535535
*/
536-
synchronized private IContentType[][] internalFindContentTypesFor(ContentTypeMatcher matcher, final String fileName, Comparator<IContentType> sortingPolicy) {
536+
synchronized private IContentType[][] internalFindContentTypesSorted(ContentTypeMatcher matcher, final String fileName, Comparator<IContentType> sortingPolicy) {
537537
IScopeContext context = matcher.getContext();
538538
IContentType[][] result = { NO_CONTENT_TYPES, NO_CONTENT_TYPES, NO_CONTENT_TYPES };
539539

0 commit comments

Comments
 (0)