Skip to content

Instantly share code, notes, and snippets.

@KisaragiEffective
Created August 18, 2019 13:33
Show Gist options
  • Save KisaragiEffective/9ea69405b48a94a8f33629d7288bd865 to your computer and use it in GitHub Desktop.
Save KisaragiEffective/9ea69405b48a94a8f33629d7288bd865 to your computer and use it in GitHub Desktop.
おまじない
import java.lang.reflect.Array;

@ForReferenceType
@SupressWarnings("unchecked")
public static <T> T[] newArray(final Class<T> type, final int size) {
  return Array.newInstance(type);
}

public static boolean[] newBooleanArray(final int size) {
  return new boolean[size];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment