Tabnine Logo
Object.clone
Code IndexAdd Tabnine to your IDE (free)

How to use
clone
method
in
java.lang.Object

Best Java code snippets using java.lang.Object.clone (Showing top 20 results out of 24,660)

origin: log4j/log4j

 /**
  * Create new instance.
  * @since 1.2.15
  * @param r String representation of throwable.
  */
public ThrowableInformation(final String[] r) {
  if (r != null) {
   rep = (String[]) r.clone();
  }
}
origin: alibaba/canal

public LogPosition clone() {
  try {
    return (LogPosition) super.clone();
  } catch (CloneNotSupportedException e) {
    // Never happend
    return null;
  }
}
origin: jenkinsci/jenkins

  @Override
  protected CLICommand createClone() {
    try {
      return (CLICommand)clone();
    } catch (CloneNotSupportedException e) {
      throw new AssertionError(e);
    }
  }
}
origin: prestodb/presto

/**
 * Clone this object.
 *
 * @return a clone of this object.
 */
public Object clone() {
  try {
    return super.clone();
  } catch (CloneNotSupportedException ex) {
    throw new InternalError("Clone error");
  }
}
origin: prestodb/presto

/**
 * Clone this object.
 *
 * @return a clone of this object.
 */
public Object clone() {
  try {
    return super.clone();
  } catch (CloneNotSupportedException ex) {
    throw new InternalError("Clone error");
  }
}
origin: prestodb/presto

/**
 * Clone this object.
 *
 * @return a clone of this object.
 */
public Object clone() {
  try {
    return super.clone();
  } catch (CloneNotSupportedException ex) {
    throw new InternalError("Clone error");
  }
}
origin: redisson/redisson

/**
 * Creates and returns a copy of this object.
 * The constant pool object is shared between this object
 * and the cloned object.
 */
public Object clone() throws CloneNotSupportedException {
  ExceptionTable r = (ExceptionTable)super.clone();
  r.entries = new ArrayList(entries);
  return r;
}
origin: commons-lang/commons-lang

/**
 * Constructor that creates a matcher from a character array.
 *
 * @param chars  the characters to match, must not be null
 */
CharSetMatcher(char chars[]) {
  super();
  this.chars = (char[]) chars.clone();
  Arrays.sort(this.chars);
}
origin: apache/incubator-druid

 @Override
 public WordIterator clone()
 {
  try {
   return (WordIterator) super.clone();
  }
  catch (CloneNotSupportedException e) {
   throw new RuntimeException(e);
  }
 }
}
origin: apache/incubator-druid

 @Override
 public Offset clone()
 {
  try {
   return (Offset) super.clone();
  }
  catch (CloneNotSupportedException e) {
   throw new RuntimeException(e);
  }
 }
}
origin: apache/flink

public RequestedGlobalProperties clone() {
  try {
    return (RequestedGlobalProperties) super.clone();
  } catch (CloneNotSupportedException cnse) {
    // should never happen, but propagate just in case
    throw new RuntimeException(cnse);
  }
}
origin: apache/flink

  @Override
  public Costs clone() {
    try {
      return (Costs) super.clone();
    } catch (CloneNotSupportedException e) {
      throw new RuntimeException(e);	// should never happen
    }
  }
}
origin: Tencent/tinker

/**
 * Returns a deep copy of this zip entry.
 */
@Override public Object clone() {
  try {
    TinkerZipEntry result = (TinkerZipEntry) super.clone();
    result.extra = extra != null ? extra.clone() : null;
    return result;
  } catch (CloneNotSupportedException e) {
    throw new AssertionError(e);
  }
}
origin: square/okhttp

@Override public MockResponse clone() {
 try {
  MockResponse result = (MockResponse) super.clone();
  result.headers = headers.build().newBuilder();
  result.promises = new ArrayList<>(promises);
  return result;
 } catch (CloneNotSupportedException e) {
  throw new AssertionError();
 }
}
origin: org.apache.commons/commons-lang3

  @Override
  public CloneableString clone() throws CloneNotSupportedException {
    return (CloneableString)super.clone();
  }
}
origin: redisson/redisson

public Object clone() throws CloneNotSupportedException {
  ByteVector bv = (ByteVector)super.clone();
  bv.buffer = (byte[])buffer.clone();
  return bv;
}
origin: commons-lang/commons-lang

/**
 * Gets a copy of the full token list as an independent modifiable array.
 *
 * @return the tokens as a String array
 */
public String[] getTokenArray() {
  checkTokenized();
  return (String[]) tokens.clone();
}
origin: Tencent/tinker

@Override
public SparseIntArray clone() {
  SparseIntArray clone = null;
  try {
    clone = (SparseIntArray) super.clone();
    clone.mKeys = mKeys.clone();
    clone.mValues = mValues.clone();
  } catch (CloneNotSupportedException cnse) {
    /* ignore */
  }
  return clone;
}
origin: Tencent/tinker

@Override
public SparseBoolArray clone() {
  SparseBoolArray clone = null;
  try {
    clone = (SparseBoolArray) super.clone();
    clone.mKeys = mKeys.clone();
    clone.mValues = mValues.clone();
  } catch (CloneNotSupportedException cnse) {
    /* ignore */
  }
  return clone;
}
origin: google/guava

final void testAllDeclarations() throws Exception {
 checkState(method == null);
 Method[] methods = getClass().getMethods();
 Arrays.sort(
   methods,
   new Comparator<Method>() {
    @Override
    public int compare(Method a, Method b) {
     return a.getName().compareTo(b.getName());
    }
   });
 for (Method method : methods) {
  if (method.isAnnotationPresent(TestSubtype.class)) {
   method.setAccessible(true);
   SubtypeTester tester = (SubtypeTester) clone();
   tester.method = method;
   method.invoke(tester, new Object[] {null});
  }
 }
}
java.langObjectclone

Popular methods of Object

  • getClass
  • toString
  • equals
  • hashCode
  • wait
  • notifyAll
  • <init>
  • notify
  • finalize

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now