Beispiel #1
0
 // Given a name consisting of parts separated by dots returns the unquoted
 // version stripped of all special symbols like '$' and '_'
 private static String unquoteName(String s, boolean stripTrailingUnderscore) {
   if (s != null) {
     String[] parts = JVMModuleUtil.unquoteJavaKeywords(s.split("\\."));
     String name = parts[parts.length - 1];
     if (stripTrailingUnderscore
         && !name.isEmpty()
         && Character.isLowerCase(name.charAt(0))
         && name.charAt(name.length() - 1) == '_') {
       name = name.substring(0, name.length() - 1);
     }
     parts[parts.length - 1] = name;
     s = JVMModuleUtil.join(".", parts);
   }
   return s;
 }
Beispiel #2
0
 private static ClassInfo getModuleInfo(final Index index, final String moduleName) {
   // we need to escape any java keyword from the package list
   String quotedModuleName = JVMModuleUtil.quoteJavaKeywords(moduleName);
   DotName moduleClassName = DotName.createSimple(quotedModuleName + ".$module_");
   ClassInfo ret = index.getClassByName(moduleClassName);
   if (ret == null) {
     // read previous module descriptor name
     moduleClassName = DotName.createSimple(quotedModuleName + ".module_");
     ret = index.getClassByName(moduleClassName);
   }
   return ret;
 }