The config home defines the base directory relative to which user specific configuration + * files should be stored. On Linux, this can be modified by the environment variable + * {@code $XDG_CONFIG_HOME}. On OS X, this is ~/Library/Application Support. On Windows, + * this is %APPDATA%. + * + * @return The path to the config home, as defined by the XDG Base Directory specification. + */ + public String getConfigFolder() { switch (this) { case OSX: return System.getProperty("user.home") + "/Library/Application Support"; case WINDOWS: return System.getenv("APPDATA"); case LINUX: + throw new AssertionError(); case UNKNOWN: default: return System.getProperty("user.home"); } } + + /** + * Returns the path to the data home, as defined by the XDG Base Directory specification. + * + *
The data home defines the base directory relative to which user specific data + * files should be stored. On Linux, this can be modified by the environment variable + * {@code $XDG_DATA_HOME}. On other operating systems, this method is equivalent to + * {@code getConfigFolder()}. + * + * @return The path to the data home, as defined by the XDG Base Directory specification. + */ + public String getDataFolder() { + return getConfigFolder(); + } + + /** + * Returns the path to the cache home, as defined by the XDG Base Directory specification. + * + *
The cache home defines the base directory relative to which user specific
+ * non-essential data files should be stored. On Linux, this can be modified
+ * by the environment variable {@code $XDG_CACHE_HOME}. On other operating systems,
+ * this method is equivalent to {@code getConfigFolder()}.
+ *
+ * @return The path to the cache home, as defined by the XDG Base Directory specification.
+ */
+ public String getCacheFolder() {
+ return getConfigFolder();
+ }
/**
* Gets the operating system currently running on the user's system.
diff --git a/src/main/java/blue/lapis/nocturne/util/helper/HierarchyHelper.java b/src/main/java/blue/lapis/nocturne/util/helper/HierarchyHelper.java
index a1e76b6..e98e611 100644
--- a/src/main/java/blue/lapis/nocturne/util/helper/HierarchyHelper.java
+++ b/src/main/java/blue/lapis/nocturne/util/helper/HierarchyHelper.java
@@ -31,6 +31,7 @@
import blue.lapis.nocturne.processor.index.model.IndexedClass;
import blue.lapis.nocturne.processor.index.model.IndexedMethod;
+import blue.lapis.nocturne.processor.index.model.signature.MethodSignature;
import java.util.Set;
import java.util.stream.Collectors;
@@ -40,7 +41,7 @@
*/
public final class HierarchyHelper {
- public static Set