Example usage for java.lang String intern

List of usage examples for java.lang String intern

Introduction

In this page you can find the example usage for java.lang String intern.

Prototype

public native String intern();

Source Link

Document

Returns a canonical representation for the string object.

Usage

From source file:edu.umd.cs.findbugs.TypeAnnotation.java

public void setDescription(String roleDescription) {
    this.roleDescription = roleDescription.intern();
}

From source file:org.quartz.impl.jdbcjobstore.DBSemaphore.java

/**
 * Release the lock on the identified resource if it is held by the calling
 * thread./*from w  ww.j ava  2  s .c om*/
 */
public void releaseLock(Connection conn, String lockName) {

    lockName = lockName.intern();

    if (isLockOwner(conn, lockName)) {
        if (getLog().isDebugEnabled()) {
            getLog().debug("Lock '" + lockName + "' returned by: " + Thread.currentThread().getName());
        }
        getThreadLocks().remove(lockName);
        //getThreadLocksObtainer().remove(lockName);
    } else if (getLog().isDebugEnabled()) {
        getLog().warn("Lock '" + lockName + "' attempt to return by: " + Thread.currentThread().getName()
                + " -- but not owner!", new Exception("stack-trace of wrongful returner"));
    }
}

From source file:org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizationManager.java

/**
 * Deletes the DeploymentSynchronizer for the specified file path. This will simply remove the
 * repository from the control of the DeploymentSynchronizationManager. Any tasks spawned by the
 * synchronizer will continue to run until the synchronizer is properly stopped.
 *
 * @param filePath File path on which the repository is created
 * @return A RegistryBasedRepository or null
 *//* w  w w  .java  2s .  com*/
public DeploymentSynchronizer deleteSynchronizer(String filePath) {
    synchronized (filePath.intern()) {
        return synchronizers.remove(filePath);
    }
}

From source file:ru.runa.wfe.lang.GraphElement.java

public void setName(String name) {
    this.name = null == name ? null : name.intern();
    if (getNodeId() == null) {
        setNodeId(name);/* www. j  av a2s. c  o  m*/
    }
}

From source file:com.netxforge.oss2.model.OnmsGroup.java

public void addUser(final String userName) {
    if (m_users == null) {
        m_users = new ArrayList<String>();
    }//from ww w.  j  a  v  a 2  s  . co  m
    m_users.add(userName.intern());
}

From source file:hudson.Util.java

/**
 * Null-safe String intern method.//from   w  w w. j  a v a 2s .c o m
 */
public static String intern(String s) {
    return s == null ? s : s.intern();
}

From source file:ru.runa.wfe.lang.GraphElement.java

public void setNodeId(String nodeId) {
    this.nodeId = null == nodeId ? null : nodeId.intern();
}

From source file:hudson.widgets.RenderOnDemandClosure.java

public RenderOnDemandClosure(JellyContext context, String attributesToCapture) {
    List<Script> bodyStack = new ArrayList<Script>();
    for (JellyContext c = context; c != null; c = c.getParent()) {
        Script script = (Script) c.getVariables().get("org.apache.commons.jelly.body");
        if (script != null)
            bodyStack.add(script);//from  ww  w  . j  av  a2 s .  c om
    }
    this.bodyStack = bodyStack.toArray(new Script[bodyStack.size()]);
    assert !bodyStack.isEmpty(); // there must be at least one, which is the direct child of <l:renderOnDemand>

    Map<String, Object> variables = new HashMap<String, Object>();
    for (String v : Util.fixNull(attributesToCapture).split(","))
        variables.put(v.intern(), context.getVariable(v));

    // capture the current base of context for descriptors
    currentDescriptorByNameUrl = Descriptor.getCurrentDescriptorByNameUrl();

    this.variables = PackedMap.of(variables);

    Set<String> _adjuncts = AdjunctsInPage.get().getIncluded();
    this.adjuncts = new String[_adjuncts.size()];
    int i = 0;
    for (String adjunct : _adjuncts) {
        this.adjuncts[i++] = adjunct.intern();
    }
}

From source file:com.opensearchserver.client.common.analyzer.ClassFactoryItem.java

/**
 * @param name/*from  w  w w.j av  a2 s.  c  o  m*/
 *            the name of the property
 * @param value
 *            the property to add
 * @return this instance
 */
@XmlTransient
@JsonIgnore
public ClassFactoryItem addProperty(String name, String value) {
    if (properties == null)
        properties = new LinkedHashMap<String, Object>();
    properties.put(name.intern(), value);
    return this;
}

From source file:com.netxforge.oss2.xml.event.Logmsg.java

/**
 * Sets the value of field 'dest'.//from w  ww  .ja v  a2  s.  c  om
 * 
 * @param dest the value of field 'dest'.
 */
public void setDest(final java.lang.String dest) {
    this._dest = dest.intern();
}