List of usage examples for java.lang CloneNotSupportedException printStackTrace
public void printStackTrace(PrintStream s)
From source file:padl.kernel.impl.Constituent.java
/** * This method performs a shallow copy.//from ww w . j a va2s . co m */ public void startCloneSession() { try { final Constituent tmpObject = (Constituent) super.clone(); this.clone = tmpObject; tmpObject.clone = null; // Yann 2010/10/03: Paths! // The "path" of each cloned constituent // must be reset of course because the // clone does not yet belong to any model. // Yann 2013/10/24: Miracle?! // It is a miracle that cloning did work sometimes... // Of course the clone should start with it ID as // minimum path to make sure that it has a path! // this.clone.setPath(ArrayUtils.EMPTY_CHAR_ARRAY); this.clone.setPath(this.id); } catch (final CloneNotSupportedException cnse) { cnse.printStackTrace(ProxyConsole.getInstance().errorOutput()); } }
From source file:open.dolphin.infomodel.DocumentModel.java
public DocumentModel claimClone() { if (modules == null && modules.isEmpty()) { return null; }//from w ww. j a v a 2 s. c o m DocumentModel ret = new DocumentModel(); for (ModuleModel module : modules) { if (module.getModuleInfoBean().getStampRole().equals(IInfoModel.ROLE_P)) { ModuleModel m; try { m = (ModuleModel) module.clone(); ret.addModule(m); } catch (CloneNotSupportedException ex) { ex.printStackTrace(System.err); } } } if (ret.getModules() == null && ret.getModules().isEmpty()) { return null; } ret.getDocInfoModel().setDocId(this.getDocInfoModel().getDocId()); ret.getDocInfoModel().setDocType(this.getDocInfoModel().getDocType()); ret.getDocInfoModel().setTitle(this.getDocInfoModel().getTitle()); ret.getDocInfoModel().setPurpose(this.getDocInfoModel().getPurpose()); ret.getDocInfoModel().setVersionNumber("1.0"); ret.getDocInfoModel().setDepartmentDesc(this.getDocInfoModel().getDepartmentDesc()); ret.getDocInfoModel().setDepartment(this.getDocInfoModel().getDepartment()); ret.getDocInfoModel().setHealthInsuranceDesc(this.getDocInfoModel().getHealthInsuranceDesc()); ret.getDocInfoModel().setHealthInsurance(this.getDocInfoModel().getHealthInsurance()); ret.getDocInfoModel().setHealthInsuranceGUID(this.getDocInfoModel().getHealthInsuranceGUID()); ret.getDocInfoModel().setDocPk(getId()); ret.getDocInfoModel().setParentPk(getLinkId()); ret.getDocInfoModel().setConfirmDate(getConfirmed()); ret.getDocInfoModel().setFirstConfirmDate(getStarted()); ret.getDocInfoModel().setStatus(getStatus()); ret.getDocInfoModel().setClaimDate(this.getDocInfoModel().getClaimDate()); return ret; }
From source file:org.nmrfx.processor.gui.spectra.DatasetAttributes.java
@Override public Object clone() { Object o = null;//from w w w .j a va2s.c o m try { o = super.clone(); ((DatasetAttributes) o).setPosColor(getPosColor()); ((DatasetAttributes) o).setNegColor(getNegColor()); ((DatasetAttributes) o).setPosWidth(getPosWidth()); ((DatasetAttributes) o).setNegWidth(getNegWidth()); ((DatasetAttributes) o).setLvl(getLvl()); ((DatasetAttributes) o).clm = clm; ((DatasetAttributes) o).setNlvls(getNlvls()); ((DatasetAttributes) o).nDim = nDim; ((DatasetAttributes) o).fileName = fileName; ((DatasetAttributes) o).theFile = theFile; ((DatasetAttributes) o).setPos(getPos()); ((DatasetAttributes) o).setNeg(getNeg()); if (drawList != null) { ((DatasetAttributes) o).drawList = drawList.clone(); } if (selectionList != null) { ((DatasetAttributes) o).selectionList = selectionList.clone(); } ((DatasetAttributes) o).selected = selected; } catch (CloneNotSupportedException e) { e.printStackTrace(System.err); } return o; }