Returns the java package name that was configured in the proto. Note that {@link #getJavaPackageName()} will have
the same value as this, if the compiler options did not have entries that override it.
766789
public String getOriginalJavaPackageName()
    {
        if (javaPackageName == null)
            return null;

        String original = javaPackageName.getLast();
        return original != null ? original : javaPackageName.getValue();
    }
45546
public java.lang.String getVariableName() {
    java.lang.Object ref = variableName_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      variableName_ = s;
      return s;
    }
  }
711968
protected static String toPackageName(String rootPackage,  File packageName) {
		final StringBuilder name = new StringBuilder();
		File tmp = packageName;
		while (tmp != null) {
			final String elementName = tmp.getName();
			if (!Strings.equal(FileSystem.CURRENT_DIRECTORY, elementName)
					&& !Strings.equal(FileSystem.PARENT_DIRECTORY, elementName)) {
				if (name.length() > 0) {
					name.insert(0, "."); //$NON-NLS-1$
				}
				name.insert(0, elementName);
			}
			tmp = tmp.getParentFile();
		}
		if (!Strings.isEmpty(rootPackage)) {
			if (name.length() > 0) {
				name.insert(0, "."); //$NON-NLS-1$
			}
			name.insert(0, rootPackage);
		}
		return name.toString();
	}
792584
@Override
    protected String evalProgramName()
    {
        final String urlPath = getUrl().getPath();
        String name = urlPath.substring(urlPath.lastIndexOf('/') + 1);
        name = name.substring(0, name.lastIndexOf('.'));

        // regular expression for the package name
        final Pattern pckPattern = Pattern.compile("package +[^;]+;");
        final Matcher pckMatcher = pckPattern.matcher(getCode());
        if (pckMatcher.find()) {
            final String pkg = pckMatcher.group()
                                         .replaceFirst("^(package) +", "")
                                         .replaceFirst(";$", "");
            name = pkg + "." + name;
        }
        return name;
    }
1144270
public String autoDetectPackageName(final File file) {
        try {
            final Set<String> packageNames = new HashSet<>();
            try (JarFile jarFile = new JarFile(file)) {
                final Enumeration<JarEntry> entries = jarFile.entries();
                while (entries.hasMoreElements()) {
                    final JarEntry entry = entries.nextElement();
                    String name = entry.getName();
                    if (name.endsWith(".class")) {
                        logger.debug("Considering package of entry '{}'", name);

                        final int lastIndexOfSlash = name.lastIndexOf('/');
                        if (lastIndexOfSlash != -1) {
                            name = name.substring(0, lastIndexOfSlash);
                            packageNames.add(name);
                        }

                    }
                }
            }

            if (packageNames.isEmpty()) {
                return null;
            }

            logger.info("Found {} packages in extension jar: {}", packageNames.size(), packageNames);

            // find the longest common prefix of all the package names
            String packageName = StringUtils.getLongestCommonToken(packageNames, '/');
            if (packageName == "") {
                logger.debug("No common package prefix");
                return null;
            }

            packageName = packageName.replace('/', '.');
            return packageName;
        } catch (final Exception e) {
            logger.warn("Error occurred while auto detecting package name", e);
            return null;
        }
    }
207914
public static String getPackageName(final Class<?> cls) {
        if (cls == null) {
            return StringUtils.EMPTY;
        }
        return getPackageName(cls.getName());
    }
587256
public static String getPackageName(String className, boolean resource)
   {
       String packageName = null;
       if (className != null)
       {
       	if (resource)
       		if (className.endsWith(PROPERTIES))
       			className = className.substring(0, className.length() - PROPERTIES.length());
           if (className.lastIndexOf('.') != -1)
               packageName = className.substring(0, className.lastIndexOf('.'));
       }
       return packageName;
   }
712700
public java.lang.String getHostname() {
    java.lang.Object ref = hostname_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (bs.isValidUtf8()) {
        hostname_ = s;
      }
      return s;
    }
  }
921002
@VisibleForTesting
  static String packageName(String source) {
    try (StringReader r = new StringReader(source)) {
      StreamTokenizer tokenizer = new StreamTokenizer(r);
      tokenizer.slashSlashComments(true);
      tokenizer.slashStarComments(true);
      StringBuilder sb = new StringBuilder();
      boolean inName = false;
      while (tokenizer.nextToken() != StreamTokenizer.TT_EOF) {
        if (inName) {
          switch (tokenizer.ttype) {
            case ';':
              return sb.length() > 0 ? sb.toString() : null;
            case '.':
              sb.append('.');
              break;
            case StreamTokenizer.TT_WORD:
              sb.append(tokenizer.sval);
              break;
            default:
              inName = false; // Invalid package statement pattern.
              break;
          }
        } else if (tokenizer.ttype == StreamTokenizer.TT_WORD && tokenizer.sval.equals("package")) {
          inName = true;
        }
      }
      return null; // Package statement not found.
    } catch (IOException e) {
      throw new AssertionError("Exception reading string: " + e);
    }
  }
761324
public static String getJ2EEComponentName() {
        ComponentMetaData wcmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
        if (wcmd != null) {
            J2EEName j2eename = wcmd.getJ2EEName();
            return j2eename.getComponent();
        } else {
            return null;
        }
    }
256769
public String parsePackageName(PackageElement p) {
        String pkgname = p.isUnnamed() ? "" : getPackageName(p);
        int index = -1;
        for (int j = 0; j < MAX_CONSTANT_VALUE_INDEX_LENGTH; j++) {
            index = pkgname.indexOf(".", index + 1);
        }
        if (index != -1) {
            pkgname = pkgname.substring(0, index);
        }
        return pkgname;
    }
61214
public String getPackage()
    {
        if (_propertySet == null || _propertySet.getPackage() == null )
            return "";
        
        return _propertySet.getPackage().getQualifiedName();
    }
315385
private static String getJsPackage(FileDescriptor file) {
    String protoPackage = file.getPackage();
    if (!protoPackage.isEmpty()) {
      return "proto." + protoPackage;
    }
    return "proto";
  }
687195
public static String getPackageName(String className) {
        int i = className.lastIndexOf(".");
        String packageName = "";
        if (i > -1) {
            packageName = className.substring(0, i);
        }
        return packageName;
    }
691676
public static String removeJavaPackageName(String className) {
        int idx = className.lastIndexOf('.');
        if (idx >= 0) {
            return className.substring(idx + 1);
        } else {
            return className;
        }
    }
753928
public String jsModuleNames() {

        List<String> moduleNames = sortModules(getAvailableModules().values());
        StringBuffer jsCode = new StringBuffer(1024);
        jsCode.append("\t// an array from 1...n holding the module package names\n");
        jsCode.append("\tvar modulePackageNames = new Array(");
        jsCode.append(moduleNames.size());
        jsCode.append(");\n");
        for (int i = 0; i < moduleNames.size(); i++) {
            String moduleName = moduleNames.get(i);
            jsCode.append("\tmodulePackageNames[" + i + "] = \"" + moduleName + "\";\n");
        }
        jsCode.append("\n\n");
        return jsCode.toString();
    }
421034
private String getPackageName(ObjectMappableAnnotatedClass clazz) {
    PackageElement pkg = elements.getPackageOf(clazz.getElement());
    return pkg.isUnnamed() ? "" : pkg.getQualifiedName().toString();
  }