Cherry pick some changes from 1.8 for inner class discovery, also fix the negativecache. Closes #1872
This commit is contained in:
parent
0f456b4684
commit
c308a47124
|
@ -38,7 +38,7 @@ public class DirectoryDiscoverer implements ITypeDiscoverer
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File file)
|
public boolean accept(File file)
|
||||||
{
|
{
|
||||||
return (file.isFile() && classFile.matcher(file.getName()).find()) || file.isDirectory();
|
return (file.isFile() && classFile.matcher(file.getName()).matches()) || file.isDirectory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,8 @@ import cpw.mods.fml.common.ModContainer;
|
||||||
|
|
||||||
public interface ITypeDiscoverer
|
public interface ITypeDiscoverer
|
||||||
{
|
{
|
||||||
public static Pattern classFile = Pattern.compile("([^\\s$]+).class$");
|
// main class part, followed by an optional $ and an "inner class" part. $ cannot be last, otherwise scala breaks
|
||||||
|
public static Pattern classFile = Pattern.compile("[^\\s\\$]+(\\$[^\\s]+)?\\.class$");
|
||||||
|
|
||||||
public List<ModContainer> discover(ModCandidate candidate, ASMDataTable table);
|
public List<ModContainer> discover(ModCandidate candidate, ASMDataTable table);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class ModCandidate
|
||||||
public void addClassEntry(String name)
|
public void addClassEntry(String name)
|
||||||
{
|
{
|
||||||
String className = name.substring(0, name.lastIndexOf('.')); // strip the .class
|
String className = name.substring(0, name.lastIndexOf('.')); // strip the .class
|
||||||
foundClasses.add(className.replace('.', '/'));
|
foundClasses.add(className);
|
||||||
className = className.replace('/','.');
|
className = className.replace('/','.');
|
||||||
int pkgIdx = className.lastIndexOf('.');
|
int pkgIdx = className.lastIndexOf('.');
|
||||||
if (pkgIdx > -1)
|
if (pkgIdx > -1)
|
||||||
|
|
Loading…
Reference in New Issue