Skip to content

Commit

Permalink
Fix for issue #277: Gradle plug-in's icon takes precedence for *.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Apr 6, 2017
1 parent e1303c4 commit f357cf9
Show file tree
Hide file tree
Showing 5 changed files with 218 additions and 155 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2016 the original author or authors.
* Copyright 2009-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -182,7 +182,7 @@ public boolean isSourceFile(String fileName, boolean isInterestingProject) {
if (isInterestingProject) {
return Util.isJavaLikeFileName(fileName);
} else {
return ContentTypeUtils.isJavaLikeButNotGroovyLikeExtension(fileName);
return ContentTypeUtils.isJavaLikeButNotGroovyLikeFileName(fileName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.codehaus.jdt.groovy.integration.internal;

import static org.eclipse.jdt.groovy.core.util.ContentTypeUtils.isGroovyLikeFileName;
import static org.eclipse.jdt.groovy.core.util.ContentTypeUtils.isJavaLikeButNotGroovyLikeExtension;
import static org.eclipse.jdt.groovy.core.util.ContentTypeUtils.isJavaLikeButNotGroovyLikeFileName;

import java.util.regex.Pattern;

Expand Down Expand Up @@ -61,7 +61,7 @@ public CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit, Compila
}

private static boolean isGroovyLikeSourceUnit(ICompilationUnit sourceUnit) {
if (sourceUnit.getFileName() == null || !isJavaLikeButNotGroovyLikeExtension(String.valueOf(sourceUnit.getFileName()))) {
if (sourceUnit.getFileName() == null || !isJavaLikeButNotGroovyLikeFileName(String.valueOf(sourceUnit.getFileName()))) {
if (GROOVY_SOURCE_DISCRIMINATOR.matcher(new CharArraySequence(sourceUnit.getContents())).find()) {
Util.log(1, "Identified a Groovy source unit through inspection of its contents: " +
String.valueOf(sourceUnit.getContents(), 0, Math.min(250, sourceUnit.getContents().length)));
Expand Down
Loading

0 comments on commit f357cf9

Please sign in to comment.