@Test public void testGenericType() throws NoSuchMethodException { Type type = LocalClass.class.getMethod("testType").getGenericReturnType(); Path p = Utilities.getSourceFileRelativePath(type); assertEquals(p.toString(), perOS("java/util/List.java")); }
public static Path getSourceFileRelativePath(Type type) { Class declaringClass = Cast.toClass(type); Path packageRelativePath = transformIntoPath(declaringClass); String declaringFileName = getSourceFileName(declaringClass); return packageRelativePath.resolve(declaringFileName); }
Utilities { public static Path getSourceFileRelativePath(Type type) { Class declaringClass = Cast.toClass(type); Path packageRelativePath = transformIntoPath(declaringClass); String declaringFileName = getSourceFileName(declaringClass); return packageRelativePath.resolve(declaringFileName); } }
Utilities { public static Path getSourceFileRelativePath(Type type) { Class declaringClass = Cast.toClass(type); Path packageRelativePath = transformIntoPath(declaringClass); String declaringFileName = getSourceFileName(declaringClass); return packageRelativePath.resolve(declaringFileName); }  }
Utilities { public static Path getSourceFileRelativePath(Type type) { Class declaringClass = Cast.toClass(type); Path packageRelativePath = transformIntoPath(declaringClass); String declaringFileName = getSourceFileName(declaringClass); return packageRelativePath.resolve(declaringFileName); }  static Path getSourceFileRelativePath(Type type); }
Utilities { public static Path getSourceFileRelativePath(Type type) { Class declaringClass = Cast.toClass(type); Path packageRelativePath = transformIntoPath(declaringClass); String declaringFileName = getSourceFileName(declaringClass); return packageRelativePath.resolve(declaringFileName); }  static Path getSourceFileRelativePath(Type type);  }