mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Cherry pick some changes from 1.8 for inner class discovery, also fix the negativecache. Closes #1872
This commit is contained in:
1 parent
0f456b4684
commit
c308a47124
3 files changed
+5
-4
No files matched your search
@@ -38,7 +38,7 @@ public class DirectoryDiscoverer implements ITypeDiscoverer
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
@@ -19,7 +19,8 @@ import cpw.mods.fml.common.ModContainer;
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class ModCandidate
|
||||
public void addClassEntry(String name)
|
||||
{
|
||||
String className = name.substring(0, name.lastIndexOf('.')); // strip the .class
|
||||
foundClasses.add(className.replace('.', '/'));
|
||||
foundClasses.add(className);
|
||||
className = className.replace('/','.');
|
||||
int pkgIdx = className.lastIndexOf('.');
|
||||
if (pkgIdx > -1)
|
||||
|
||||
Reference in new issue
Block a user