Converts package name in serialized string to new name.
This is temporary change and should get removed after all the states are switched from old to new package name.
@param serialized serialized string possibly having old package names
@return
973302
public static String getSerializedWithNewPackage(String serialized) {
    serialized = serialized.replace("\"gobblin.data.management.", "\"org.apache.gobblin.data.management.");
    log.debug("Serialized updated copy entity: " + serialized);
    return serialized;
  }
1105775
protected void setPackageName(String newName, ResourceSet resourceSet) {
		final EObject object = resourceSet.getEObject(this.uriProvider.apply(resourceSet), true);
		if (object instanceof SarlScript) {
			((SarlScript) object).setPackage(newName);
		} else {
			throw new RefactoringException("SARL script not loaded."); //$NON-NLS-1$
		}
	}
596169
private String getCustSerializedName(FieldOptions options, String defaultName) {
    for (Extension<FieldOptions, String> extension : serializedNameExtensions) {
      if (options.hasExtension(extension)) {
        return options.getExtension(extension);
      }
    }
    return protoFormat.to(jsonFormat, defaultName);
  }
769427
public static String getPackageName(Object obj)
	{
		if(obj == null)
			throw new NullPointerException("obj is null");
		return getPackageName(obj.getClass());
	}
857245
public static String getSerializedCatalogStringFromJar(InMemoryJarfile jarfile)
    {
        byte[] serializedCatalogBytes = jarfile.get(CatalogUtil.CATALOG_FILENAME);
        String serializedCatalog = new String(serializedCatalogBytes, Constants.UTF8ENCODING);
        return serializedCatalog;
    }
650361
@Nonnull
	private static Package createPackage(@Nonnull final String packageName) {
		Check.notNull(packageName, "packageName");
		return packageName.isEmpty() ? Package.UNDEFINED : new Package(packageName);
	}
687195
public static String getPackageName(String className) {
        int i = className.lastIndexOf(".");
        String packageName = "";
        if (i > -1) {
            packageName = className.substring(0, i);
        }
        return packageName;
    }
837742
public static long fromHeaderValue(String serialized) {
        checkArgument(!serialized.isEmpty(), "empty timeout");
        checkArgument(serialized.length() <= 9, "bad timeout format");
        final long value = Long.parseLong(serialized.substring(0, serialized.length() - 1));
        final char unit = serialized.charAt(serialized.length() - 1);
        switch (unit) {
            case 'n':
                return TimeUnit.NANOSECONDS.toNanos(value);
            case 'u':
                return TimeUnit.MICROSECONDS.toNanos(value);
            case 'm':
                return TimeUnit.MILLISECONDS.toNanos(value);
            case 'S':
                return TimeUnit.SECONDS.toNanos(value);
            case 'M':
                return TimeUnit.MINUTES.toNanos(value);
            case 'H':
                return TimeUnit.HOURS.toNanos(value);
            default:
                throw new IllegalArgumentException(String.format("Invalid timeout unit: %s", unit));
        }
    }
1276467
public StringBuffer serializeBundles() {
		StringBuffer sb = new StringBuffer("{");

		// Iterates over the
		for (Iterator<String> it = keyMap.keySet().iterator(); it.hasNext();) {
			String currentKey = it.next();
			handleKey(sb, keyMap, currentKey, currentKey, !it.hasNext());
		}

		return sb.append("}");
	}
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);
    }
  }
812258
public function unserialize($serialized)
    {
        $data = unserialize($serialized);

        $this->name = $data['name'];
        $this->type = $data['type'];
        $this->picklistEntries = $data['picklistEntries'];
        $this->fieldMetadata = $data['fieldMetadata'];
        $this->required = $data['required'];
        $this->readonly = $data['readonly'];
        $this->label = $data['label'];
    }
197731
protected static String serialize(Serializable serializable) throws JMSException {
        if (serializable == null) {
            return null;
        }
        String serializedString;
        ObjectOutputStream objectOutputStream = null;
        try {
            ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
            objectOutputStream = new ObjectOutputStream(bytesOut);
            objectOutputStream.writeObject(serializable);
            objectOutputStream.flush();
            serializedString = Base64.encodeAsString(bytesOut.toByteArray());
        } catch (IOException e) {
            LOG.error("IOException: cannot serialize objectMessage", e);
            throw convertExceptionToMessageFormatException(e);
        } finally {
            if (objectOutputStream != null) {
                try {
                    objectOutputStream.close();
                } catch (IOException e) {
                    LOG.warn(e.getMessage());
                }
            }
        }
        return serializedString;
    }
735886
public void convertToTypes( String serialization, Class<?> clazz, JsonObject newDef ) {
		convertToTypes( serialization, clazz.getSimpleName(), newDef );
		this.processedClasses.add( clazz );
	}
277490
private StringBuilder makeNewPackageName(final StringBuilder packageName, final File dir) {
		if (packageName.length() == 0) {
			return new StringBuilder(dir.getName());
		} else {
			return new StringBuilder(packageName).append(PATH_SEPARATOR).append(dir.getName());
		}
	}
919646
private String getReplacementName(String oldName) {
    for (Renamer renamer : renamerStack) {
      String newName = renamer.getReplacementName(oldName);
      if (newName != null) {
        return newName;
      }
    }
    return null;
  }
1063624
@Override
  public String getQualifiedName() {
    String prefix = StringUtil.defaultString(entityPrefix, "");
    String suffix = StringUtil.defaultString(entitySuffix, "");

    if (packageName == null || packageName.isEmpty()) {
      return prefix + simpleName + suffix;
    }

    return packageName + "." + prefix + simpleName + suffix;
  }
1292967
public Object findConvertStringToObject(String className, String versionRange, String string)
    {
    	Object object = this.convertStringToObject(null, className, versionRange, string);

        if (object == null) {
            Object resource = this.deployThisResource(ClassFinderActivator.getPackageName(className, false), versionRange, false);
            if (resource != null)
            {
            	object = this.convertStringToObject(null, className, versionRange, string);	// It is possible that the newly started bundle registered itself
            	if (object == null)
            		object = this.convertStringToObject(resource, className, versionRange, string);
            }
        }

        return object;
    }