Skip to content

0.4

Choose a tag to compare

@OxideWaveLength OxideWaveLength released this 04 Jun 23:54
· 10 commits to main since this release

These release notes come from this commit
BetterReflection:

  • Added an int Pattern
  • Added some primitives to the primitives map
  • Added the method #getBetterReflectionClasses(), which will return a copy of the betterReflectionClasses list
  • Added #getVersion(), which will return a hard-coded value that will be changed on each version
  • Added #getLatestVersion(), which will query GitHub and return the latest version as a String
  • Added #isUpToDate(), which will call #getLatestVersion() and #getVersion() to check if the current version is up to date
  • Added #versionToInts(String), which will convert a String (e.g. "0.4") to an array of integers (such as { 0, 4 })
  • Replaced the betterReflectionClasses CopyOnWriteArrayList with a simple synchronized ArrayList

BetterReflectionClass:

  • Added the #forName() method, this will simply return #BetterReflectionClass(String) but return null if a ClassNotFoundException is to be thrown.
  • #getName() - returns the class' name
  • #getSimpleName() - returns the class' simple name
  • #getCanonicalName() - returns the class' canonical name
  • #getTypeName() - returns the class' type name
  • Replaced BetterReflectionUtils#getClasses to BetterReflectionUtils#getTypes (renamed)

BetterReflectionUtils:

  • Added a public static final File that holds the current jar file the program is being run from
  • Added the method #getCurrentJarFile() which returns the current jar file the program is being run from (not cached, will be retrieved every time)
  • Added the method #getCurrentJar() which returns the current jar File wrapped in a JarFile class
  • Added the method #isRunningFromJar() which returns true if the program is running off of a jar, false if it's running in an IDE
  • Added #getJavaVersion(), which will return the current java version as int
  • Added #setFinal(Field field, boolean final), which will set a field to the desired final state (works in Java 12+ too but that'd require some additional JVM arguments)
  • Fixed the class' content being pasted twice
  • Renamed #getClasses(String) -> #getClassesInPackage(String), which returns a list of classes in the current package and now works both when running in an IDE and off of a jar, if the jar is still present
  • Renamed #getClassByNameStart(String, String) -> #getClassesFromNameBeginning(String, String) (now works when running off a jar too)
  • Removed #findClasses(File, String)

Tests:

  • Now using nanoseconds instead of milliseconds
  • Removed Timer class

Now also including sources in jar file, this way the javadocs will be accessible when using a good IDE.