mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 13:09:59 +00:00
Clean up null issues, add more annotations (#3590)
This commit is contained in:
1 parent
43efa3cfc4
commit
c545b8ecd4
130 files changed
+629
-262
No files matched your search
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.fml.relauncher;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.util.Arrays;
|
||||
@@ -40,7 +41,7 @@ public final class FileListHelper {
|
||||
Arrays.sort(files, CaseInsensitiveFileComparator.INSTANCE);
|
||||
return files;
|
||||
}
|
||||
public static File[] sortFileList(File dir, FilenameFilter filter)
|
||||
public static File[] sortFileList(File dir, @Nullable FilenameFilter filter)
|
||||
{
|
||||
File[] files = dir.listFiles(filter);
|
||||
return sortFileList(files);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.fml.relauncher;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -60,6 +61,7 @@ public interface IFMLLoadingPlugin
|
||||
* minecraft class loading
|
||||
* TODO: implement crash ;)
|
||||
*/
|
||||
@Nullable
|
||||
String getSetupClass();
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,6 +33,8 @@ import com.google.common.io.Files;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ModListHelper {
|
||||
public static class JsonModList {
|
||||
public String repositoryRoot;
|
||||
@@ -148,7 +150,7 @@ public class ModListHelper {
|
||||
tryAddFile(fileName.toString(), repoRoot, genericName.toString());
|
||||
}
|
||||
}
|
||||
private static void tryAddFile(String modFileName, File repoRoot, String descriptor) {
|
||||
private static void tryAddFile(String modFileName, @Nullable File repoRoot, String descriptor) {
|
||||
File modFile = repoRoot != null ? new File(repoRoot,modFileName) : new File(mcDirectory, modFileName);
|
||||
if (!modFile.exists())
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package net.minecraftforge.fml.relauncher;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
/**
|
||||
@@ -46,7 +47,7 @@ public class ReflectionHelper
|
||||
private static final long serialVersionUID = 1L;
|
||||
//private String[] classNames;
|
||||
|
||||
public UnableToFindClassException(String[] classNames, Exception err)
|
||||
public UnableToFindClassException(String[] classNames, @Nullable Exception err)
|
||||
{
|
||||
super(err);
|
||||
//this.classNames = classNames;
|
||||
@@ -97,7 +98,7 @@ public class ReflectionHelper
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T, E> T getPrivateValue(Class <? super E > classToAccess, E instance, int fieldIndex)
|
||||
public static <T, E> T getPrivateValue(Class <? super E > classToAccess, @Nullable E instance, int fieldIndex)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user