auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run(@NotNull ProgressIndicator indicator) { SonarApplication sonarlint = ApplicationManager.getApplication().getComponent(SonarApplication.class); indicator.setText("Creating token with " + host + "..."); indicator.setIndeterminate(true); try { ServerConfiguration.Builder serverConfigBuilder = ServerConfiguration.builder() .userAgent("SonarLint IntelliJ " + sonarlint.getVersion()) .connectTimeoutMilliseconds(SonarLintUtils.CONNETION_TIMEOUT_MS) .readTimeoutMilliseconds(SonarLintUtils.CONNETION_TIMEOUT_MS) .url(host) .credentials(login, password); ServerConfiguration serverConfig = serverConfigBuilder.build(); WsHelper wsHelper = new WsHelperImpl(); String tokenName = TOKEN_NAME + name; token = wsHelper.generateAuthenticationToken(serverConfig, tokenName, true); } catch (Exception e) { LOGGER.info("Creation of token failed", e); exception = e; } }

Target:
public void run(@NotNull ProgressIndicator indicator) { SonarApplication sonarlint = ApplicationManager.getApplication().getComponent(SonarApplication.class); indicator.setText("Creating token with " + host + "..."); indicator.setIndeterminate(true); try { ServerConfiguration.Builder serverConfigBuilder = ServerConfiguration.builder() .userAgent("SonarLint IntelliJ " + sonarlint.getVersion()) .connectTimeoutMilliseconds(SonarLintUtils.CONNECTION_TIMEOUT_MS) .readTimeoutMilliseconds(SonarLintUtils.CONNECTION_TIMEOUT_MS) .url(host) .credentials(login, password); ServerConfiguration serverConfig = serverConfigBuilder.build(); WsHelper wsHelper = new WsHelperImpl(); String tokenName = TOKEN_NAME + name; token = wsHelper.generateAuthenticationToken(serverConfig, tokenName, true); } catch (Exception e) { LOGGER.info("Creation of token failed", e); exception = e; } }
Source:
public void validate() throws JobConfigValidationException { super.validate(); try { final JobArguments arguments = this.getJobArguments(); final String ownerKey = arguments.getAsString(OWNER_KEY); final String consumerUuid = arguments.getAsString(CONSUMER_UUID_KEY); final PoolIdAndQuantity[] poolQuantities = arguments .getAs(POOL_QUANTITIES_KEY, PoolIdAndQuantity[].class); if (ownerKey == null || ownerKey.isEmpty()) { final String errmsg = "Owner has not been set!"; throw new JobConfigValidationException(errmsg); } if (consumerUuid == null || consumerUuid.isEmpty()) { final String errmsg = "Consumer UUID has not been set!"; throw new JobConfigValidationException(errmsg); } if (poolQuantities == null || poolQuantities.length == 0) { final String errmsg = "Pool quantities has not been set!"; throw new JobConfigValidationException(errmsg); } } catch (ArgumentConversionException e) { final String errmsg = "One or more required arguments are of the wrong type"; throw new JobConfigValidationException(errmsg, e); } }

Target:
public void validate() throws JobConfigValidationException { super.validate(); try { final JobArguments arguments = this.getJobArguments(); final String consumerUuid = arguments.getAsString(CONSUMER_UUID_KEY); final String poolId = arguments.getAsString(POOL_ID_KEY); final Integer poolQuantity = arguments.getAsInteger(POOL_QUANTITY_KEY); if (consumerUuid == null || consumerUuid.isEmpty()) { final String errmsg = "Consumer UUID has not been set!"; throw new JobConfigValidationException(errmsg); } if (poolId == null || poolId.isEmpty()) { final String errmsg = "Pool id has not been set!"; throw new JobConfigValidationException(errmsg); } if (poolQuantity == null || poolQuantity < 0) { final String errmsg = "Pool quantity has not been set!"; throw new JobConfigValidationException(errmsg); } } catch (ArgumentConversionException e) { final String errmsg = "One or more required arguments are of the wrong type"; throw new JobConfigValidationException(errmsg, e); } }
Source:
public void shouldSaveASequentialIdentifierGenerator() throws Exception { long initialIdentifierSourceCount = getAllCount(); SimpleObject identifierSource = new SimpleObject(); identifierSource.add("name", "test sequential identifier"); identifierSource.add("description", "test sequential identifier"); identifierSource.add("identifierType", IDENTIFIER_TYPE_UUID); identifierSource.add("firstIdentifierBase", "1"); identifierSource.add("prefix", "ABC"); identifierSource.add("suffix", "XYZ"); identifierSource.add("minLength", "36"); identifierSource.add("maxLength", "38"); identifierSource.add("baseCharacterSet", "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); identifierSource.add("sourceType", "SequentialIdentifierGenerator"); String jsonIdentifierSource = new ObjectMapper().writeValueAsString(identifierSource); MockHttpServletRequest req = newPostRequest(getURI(), jsonIdentifierSource); handle(req); assertEquals(service.getAllIdentifierSources(false).get(7).getName(), "test sequential identifier"); assertEquals(initialIdentifierSourceCount + 1, getAllCount()); }

Target:
public void shouldSaveASequentialIdentifierGenerator() throws Exception { long initialIdentifierSourceCount = getAllCount(); SimpleObject identifierSource = new SimpleObject(); identifierSource.add("name", "test sequential identifier"); identifierSource.add("description", "This is a test description for the sequential identifier"); identifierSource.add("identifierType", IDENTIFIER_TYPE_UUID); identifierSource.add("firstIdentifierBase", "1"); identifierSource.add("prefix", "ABC"); identifierSource.add("suffix", "XYZ"); identifierSource.add("minLength", "36"); identifierSource.add("maxLength", "38"); identifierSource.add("baseCharacterSet", "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); identifierSource.add("sourceType", SEQUENTIAL_IDENTIFIER_SOURCE_TYPE); String jsonIdentifierSource = new ObjectMapper().writeValueAsString(identifierSource); MockHttpServletRequest req = newPostRequest(getURI(), jsonIdentifierSource); SimpleObject newIdentifierSource = deserialize(handle(req)); String newIdentifierSourceUuid = PropertyUtils.getProperty(newIdentifierSource, "uuid").toString(); SequentialIdentifierGenerator generatedIdentifierSource = (SequentialIdentifierGenerator) service.getIdentifierSourceByUuid(newIdentifierSourceUuid); assertEquals(newIdentifierSourceUuid, generatedIdentifierSource.getUuid()); assertEquals(generatedIdentifierSource.getName(), "test sequential identifier"); assertEquals(generatedIdentifierSource.getDescription(), "This is a test description for the sequential identifier"); assertEquals(generatedIdentifierSource.getFirstIdentifierBase(), "1"); assertEquals(generatedIdentifierSource.getPrefix(), "ABC"); assertEquals(generatedIdentifierSource.getSuffix(), "XYZ"); assertEquals(generatedIdentifierSource.getMinLength().toString(), "36"); assertEquals(generatedIdentifierSource.getMaxLength().toString(), "38"); assertEquals(generatedIdentifierSource.getBaseCharacterSet(), "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); assertEquals(generatedIdentifierSource.getIdentifierType().getUuid(), IDENTIFIER_TYPE_UUID); assertEquals(initialIdentifierSourceCount + 1, getAllCount()); }
Source:
private void loadInitialState(ITmfStateProvider provider) { final ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException("Trace is null. It should be impossible to load states. "); } File path = new File(trace.getPath()); path = path.isDirectory() ? path : path.getParentFile(); if (path == null) { return; } for (ITmfStateSystem ss : getStateSystems()) { if (ss instanceof ITmfStateSystemBuilder) { ITmfStateSystemBuilder ssb = (ITmfStateSystemBuilder) ss; StateSnapshot snapshot = StateSnapshot.read(path.toPath(), ss.getSSID()); if (snapshot == null || provider.getVersion() != snapshot.getVersion()) { continue; } for (Entry<List<String>, ITmfStateInterval> attributeSnapshot : snapshot.getStates().entrySet()) { List<String> attributePath = Objects.requireNonNull(attributeSnapshot.getKey()); int quark = ssb.getQuarkAbsoluteAndAdd(attributePath.toArray(new String[attributePath.size()])); ITmfStateInterval interval = Objects.requireNonNull(attributeSnapshot.getValue()); Object initialState = interval.getValue(); ssb.modifyAttribute(Math.max(interval.getStartTime(), ssb.getStartTime()), initialState, quark); } } } }

Target:
private void loadInitialState(ITmfStateProvider provider) { final ITmfTrace trace = provider.getTrace(); File path = new File(trace.getPath()); path = path.isDirectory() ? path : path.getParentFile(); if (path == null) { return; } for (ITmfStateSystem ss : getStateSystems()) { if (ss instanceof ITmfStateSystemBuilder) { ITmfStateSystemBuilder ssb = (ITmfStateSystemBuilder) ss; StateSnapshot snapshot = StateSnapshot.read(path.toPath(), ss.getSSID()); if (snapshot == null || provider.getVersion() != snapshot.getVersion()) { continue; } for (Entry<List<String>, ITmfStateInterval> attributeSnapshot : snapshot.getStates().entrySet()) { List<String> attributePath = Objects.requireNonNull(attributeSnapshot.getKey()); int quark = ssb.getQuarkAbsoluteAndAdd(attributePath.toArray(new String[attributePath.size()])); ITmfStateInterval interval = Objects.requireNonNull(attributeSnapshot.getValue()); Object initialState = interval.getValue(); ssb.modifyAttribute(Math.max(interval.getStartTime(), ssb.getStartTime()), initialState, quark); } } } }
Source:
public int compareTo(final ITmfTimestamp ts) { long value = getValue(); int scale = getScale(); if (ts == null) { return 1; } if (this == ts || (value == ts.getValue() && scale == ts.getScale())) { return 0; } if ((value == BIG_BANG.getValue() && scale == BIG_BANG.getScale()) || (ts.getValue() == BIG_CRUNCH.getValue() && ts.getScale() == BIG_CRUNCH.getScale())) { return -1; } if ((value == BIG_CRUNCH.getValue() && scale == BIG_CRUNCH.getScale()) || (ts.getValue() == BIG_BANG.getValue() && ts.getScale() == BIG_BANG.getScale())) { return 1; } if (getScale() == ts.getScale()) { final long delta = saturatedAdd(getValue(), -ts.getValue()); return (delta == 0) ? 0 : (delta > 0) ? 1 : -1; } final ITmfTimestamp nts = ts.normalize(0, scale); if (hasSaturated(ts, nts)) { final long otherValue = ts.getValue(); if (value == 0 && otherValue == 0) { return 0; } if (value < 0 && otherValue >= 0) { return -1; } if (value >= 0 && otherValue < 0) { return 1; } final int otherScale = ts.getScale(); return (scale > otherScale) ? (otherValue >= 0) ? 1 : -1 : (otherValue >= 0) ? -1 : 1; } final long delta = value - nts.getValue(); return Long.compare(delta, 0); }

Target:
public int compareTo(final ITmfTimestamp ts) { long value = getValue(); int scale = getScale(); if (BIG_BANG.equals(ts)) { return 1; } if (BIG_CRUNCH.equals(ts)) { return -1; } if (this == ts || (value == ts.getValue() && scale == ts.getScale())) { return 0; } if (getScale() == ts.getScale()) { final long delta = saturatedAdd(getValue(), -ts.getValue()); return (delta == 0) ? 0 : (delta > 0) ? 1 : -1; } final ITmfTimestamp nts = ts.normalize(0, scale); if (hasSaturated(ts, nts)) { final long otherValue = ts.getValue(); if (value == 0 && otherValue == 0) { return 0; } if (value < 0 && otherValue >= 0) { return -1; } if (value >= 0 && otherValue < 0) { return 1; } final int otherScale = ts.getScale(); return (scale > otherScale) ? (otherValue >= 0) ? 1 : -1 : (otherValue >= 0) ? -1 : 1; } final long delta = value - nts.getValue(); return Long.compare(delta, 0); }
Source:
public AudioAnalysisSection createModelObject(JsonObject jsonObject) { if (jsonObject == null || jsonObject.isJsonNull()) { return null; } return new AudioAnalysisSection.Builder() .setKey( hasAndNotNull(jsonObject, "key") ? jsonObject.get("key").getAsInt() : null) .setKeyConfidence( hasAndNotNull(jsonObject, "key_confidence") ? jsonObject.get("key_confidence").getAsFloat() : null) .setLoudness( hasAndNotNull(jsonObject, "loudness") ? jsonObject.get("loudness").getAsFloat() : null) .setMeasure( (hasAndNotNull(jsonObject, "start") && hasAndNotNull(jsonObject, "duration") && hasAndNotNull(jsonObject, "confidence")) ? new AudioAnalysisMeasure.JsonUtil().createModelObject(jsonObject) : null) .setMode( hasAndNotNull(jsonObject, "type") ? Modality.keyOf( jsonObject.get("mode").getAsInt()) : null) .setModeConfidence( hasAndNotNull(jsonObject, "mode_confidence") ? jsonObject.get("mode_confidence").getAsFloat() : null) .setTempo( hasAndNotNull(jsonObject, "tempo") ? jsonObject.get("tempo").getAsFloat() : null) .setTempoConfidence( hasAndNotNull(jsonObject, "tempo_confidence") ? jsonObject.get("tempo_confidence").getAsFloat() : null) .setTimeSignature( hasAndNotNull(jsonObject, "time_signature") ? jsonObject.get("time_signature").getAsInt() : null) .setTimeSignatureConfidence( hasAndNotNull(jsonObject, "time_signature_confidence") ? jsonObject.get("time_signature_confidence").getAsFloat() : null) .build(); }

Target:
public AudioAnalysisSection createModelObject(JsonObject jsonObject) { if (jsonObject == null || jsonObject.isJsonNull()) { return null; } return new AudioAnalysisSection.Builder() .setKey( hasAndNotNull(jsonObject, "key") ? jsonObject.get("key").getAsInt() : null) .setKeyConfidence( hasAndNotNull(jsonObject, "key_confidence") ? jsonObject.get("key_confidence").getAsFloat() : null) .setLoudness( hasAndNotNull(jsonObject, "loudness") ? jsonObject.get("loudness").getAsFloat() : null) .setMeasure( new AudioAnalysisMeasure.JsonUtil().createModelObject(jsonObject)) .setMode( hasAndNotNull(jsonObject, "type") ? Modality.keyOf( jsonObject.get("mode").getAsInt()) : null) .setModeConfidence( hasAndNotNull(jsonObject, "mode_confidence") ? jsonObject.get("mode_confidence").getAsFloat() : null) .setTempo( hasAndNotNull(jsonObject, "tempo") ? jsonObject.get("tempo").getAsFloat() : null) .setTempoConfidence( hasAndNotNull(jsonObject, "tempo_confidence") ? jsonObject.get("tempo_confidence").getAsFloat() : null) .setTimeSignature( hasAndNotNull(jsonObject, "time_signature") ? jsonObject.get("time_signature").getAsInt() : null) .setTimeSignatureConfidence( hasAndNotNull(jsonObject, "time_signature_confidence") ? jsonObject.get("time_signature_confidence").getAsFloat() : null) .build(); }
Source:
public void onUpdate(TrapdConfiguration config) { this.m_snmpTrapAddress = config.getSnmpTrapAddress(); this.m_snmpTrapPort =config.getSnmpTrapPort(); this.m_snmpV3Users=new ArrayList<SnmpV3User>(TrapReceiverImpl.addToSnmpV3Users(config).values()); }

Target:
public void onUpdate(TrapdConfiguration config) { this.m_snmpTrapAddress = config.getSnmpTrapAddress(); this.m_snmpTrapPort = config.getSnmpTrapPort(); synchronized (m_snmpV3Users) { m_snmpV3Users.clear(); if (config.getSnmpv3UserCollection() != null) { m_snmpV3Users.addAll(config.getSnmpv3UserCollection().stream().map(TrapReceiverImpl::toSnmpV3User).collect(Collectors.toList())); } } }
Source:
public void clear() { head = null; free = null; }

Target:
public void clear() { head = null; free = null; inQueue = 0; }
Source:
public PrettyPrinterConfiguration setIndent(String indent) { throw new NotImplementedException(); }

Target:
public PrettyPrinterConfiguration setIndent(String indent) { System.err.println("PrettyPrinterConfiguration.setIndent is deprecated, please review the changes."); indentSize = indent.length(); return this; }
Source:
public void rollback(Xid xid) throws XAException { if (LOGGER.isLoggable(Level.FINEST)) { debug("rolling back xid = " + xid); } try { if (currentXid != null && xid.equals(currentXid)) { state = State.IDLE; currentXid = null; conn.rollback(); conn.setAutoCommit(localAutoCommitMode); } else { String s = RecoveredXid.xidToString(xid); conn.setAutoCommit(true); Statement stmt = conn.createStatement(); try { stmt.executeUpdate("ROLLBACK PREPARED '" + s + "'"); } finally { stmt.close(); } } committedOrRolledBack = true; } catch (SQLException ex) { int errorCode = XAException.XAER_RMERR; if (PSQLState.UNDEFINED_OBJECT.getState().equals(ex.getSQLState())) { if (committedOrRolledBack || !xid.equals(preparedXid)) { errorCode = XAException.XAER_NOTA; } } if (PSQLState.isConnectionError(ex.getSQLState())) { errorCode = XAException.XAER_RMFAIL; } throw new PGXAException(GT.tr("Error rolling back prepared transaction"), ex, errorCode); } }

Target:
public void rollback(Xid xid) throws XAException { if (LOGGER.isLoggable(Level.FINEST)) { debug("rolling back xid = " + xid); } try { if (currentXid != null && currentXid.equals(xid)) { state = State.IDLE; currentXid = null; conn.rollback(); conn.setAutoCommit(localAutoCommitMode); } else { String s = RecoveredXid.xidToString(xid); conn.setAutoCommit(true); Statement stmt = conn.createStatement(); try { stmt.executeUpdate("ROLLBACK PREPARED '" + s + "'"); } finally { stmt.close(); } } committedOrRolledBack = true; } catch (SQLException ex) { int errorCode = XAException.XAER_RMERR; if (PSQLState.UNDEFINED_OBJECT.getState().equals(ex.getSQLState())) { if (committedOrRolledBack || !xid.equals(preparedXid)) { if (LOGGER.isLoggable(Level.FINEST)) { debug("rolling back xid " + xid + " while the connection prepared xid is " + preparedXid + (committedOrRolledBack ? ", but the connection was already committed/rolled-back" : "")); } errorCode = XAException.XAER_NOTA; } } if (PSQLState.isConnectionError(ex.getSQLState())) { if (LOGGER.isLoggable(Level.FINEST)) { debug("rollback connection failure (sql error code " + ex.getSQLState() + "), reconnection could be expected"); } errorCode = XAException.XAER_RMFAIL; } throw new PGXAException(GT.tr("Error rolling back prepared transaction. rollback xid={0}, preparedXid={1}, currentXid={2}", xid, preparedXid), ex, errorCode); } }
Source:
public void shutdown() { LOGGER.debug("Closing connection to Solr client."); final SolrClient c = client; try { c.close(); } catch (IOException e) { LOGGER.info("Unable to close Solr client", e); } LOGGER.debug("Finished closing connection to Solr client."); }

Target:
public void shutdown() { provider.shutdown(); }
Source:
private void checkIsOnTarget() { if (!checkErrorThreshold && !checkDerivativeThreshold && !checkOnTargetForDuration) { onTarget = false; return; } onTarget = true; if (checkErrorThreshold) { onTarget &= errorIsSmall; } if (checkDerivativeThreshold) { onTarget &= derivativeIsSmall; } if (checkOnTargetForDuration) { if(onTarget){ if(waitingToStabilize == false){ waitingToStabilize = true; startTime = Timer.getFPGATimestamp(); onTarget = false; } else { onTarget = Timer.getFPGATimestamp() - startTime > onTargetThreshold; } } else { waitingToStabilize = false; onTarget = false; } } }

Target:
private void checkIsOnTarget() { if (!checkErrorThreshold && !checkDerivativeThreshold && !checkTimeThreshold) { onTargetStartTime = false; return; } onTargetStartTime = true; if (checkErrorThreshold) { onTargetStartTime &= errorIsSmall; } if (checkDerivativeThreshold) { onTargetStartTime &= derivativeIsSmall; } if (checkTimeThreshold) { if(onTargetStartTime){ if(waitingToStabilize == false){ waitingToStabilize = true; startTime = Timer.getFPGATimestamp(); onTargetStartTime = false; } else { onTargetStartTime = Timer.getFPGATimestamp() - startTime > timeToleranceInSeconds; } } else { waitingToStabilize = false; onTargetStartTime = false; } } }
Source:
public String getColumnText(Object element, int columnIndex) { if (element instanceof ECTransition) { switch (columnIndex) { case 0: return Integer.toString(getType().getOutTransitions().indexOf(element) + 1); case 1: if (null != ((ECTransition) element).getDestination()) { return ((ECTransition) element).getDestination().getName(); } break; case 2: if (null != ((ECTransition) element).getConditionEvent()) { return ((ECTransition) element).getConditionEvent().getName(); } break; case 3: if (null != ((ECTransition) element).getConditionExpression()) { return ((ECTransition) element).getConditionExpression(); } break; case 4: if (null != ((ECTransition) element).getComment()) { return ((ECTransition) element).getComment(); } break; default: break; } } return ECCContentAndLabelProvider.EMPTY_FIELD; }

Target:
public String getColumnText(Object element, int columnIndex) { if (element instanceof ECTransition) { switch (columnIndex) { case TRANSITION_COLUMN_PRIORITY: return Integer.toString(getType().getOutTransitions().indexOf(element) + 1); case TRANSITION_COLUMN_DESTINATION: if (null != ((ECTransition) element).getDestination()) { return ((ECTransition) element).getDestination().getName(); } break; case TRANSITION_COLUMN_EVENT: if (null != ((ECTransition) element).getConditionEvent()) { return ((ECTransition) element).getConditionEvent().getName(); } break; case TRANSITION_COLUMN_CONDITION: if (null != ((ECTransition) element).getConditionExpression()) { return ((ECTransition) element).getConditionExpression(); } break; case TRANSITION_COLUMN_COMMENT: if (null != ((ECTransition) element).getComment()) { return ((ECTransition) element).getComment(); } break; default: break; } } return ECCContentAndLabelProvider.EMPTY_FIELD; }
Source:
public void deleteWorkflowTask(WorkflowTask task) throws DotDataException { final DotConnect db = new DotConnect(); HibernateUtil.evict(task); Contentlet c = new Contentlet(); c.setIdentifier(task.getWebasset()); c.setLanguageId(task.getLanguageId()); boolean localTransaction = false; try { localTransaction = HibernateUtil.startLocalTransactionIfNeeded(); db.setSQL("delete from workflow_comment where workflowtask_id = ?"); db.addParam(task.getId()); db.loadResult(); db.setSQL("delete from workflow_history where workflowtask_id = ?"); db.addParam(task.getId()); db.loadResult(); db.setSQL("delete from workflowtask_files where workflowtask_id = ?"); db.addParam(task.getId()); db.loadResult(); db.setSQL("delete from workflow_task where id = ?"); db.addParam(task.getId()); db.loadResult(); if(localTransaction){ HibernateUtil.closeAndCommitTransaction(); } } catch (final Exception e) { if(localTransaction){ HibernateUtil.rollbackTransaction(); } Logger.error(this, "deleteWorkflowTask failed:" + e, e); throw new DotDataException(e.toString()); } finally { cache.remove(task); } }

Target:
public void deleteWorkflowTask(WorkflowTask task) throws DotDataException { final DotConnect db = new DotConnect(); HibernateUtil.evict(task); Contentlet c = new Contentlet(); c.setIdentifier(task.getWebasset()); c.setLanguageId(task.getLanguageId()); boolean localTransaction = false; try { localTransaction = HibernateUtil.startLocalTransactionIfNeeded(); db.setSQL("delete from workflow_comment where workflowtask_id = ?"); db.addParam(task.getId()); db.loadResult(); db.setSQL("delete from workflow_history where workflowtask_id = ?"); db.addParam(task.getId()); db.loadResult(); db.setSQL("delete from workflowtask_files where workflowtask_id = ?"); db.addParam(task.getId()); db.loadResult(); db.setSQL("delete from workflow_task where id = ?"); db.addParam(task.getId()); db.loadResult(); if(localTransaction){ HibernateUtil.closeAndCommitTransaction(); } } catch (final Exception e) { if(localTransaction){ HibernateUtil.rollbackTransaction(); } Logger.error(this, "deleteWorkflowTask failed:" + e, e); throw new DotDataException(e); } finally { cache.remove(task); } }
Source:
private VariantEvaluationContext composeTruthOverlappingVariantContext(final VariantContext truth, final List<VariantContext> calls, final TargetCollection<Target> targets) { final VariantEvaluationContextBuilder builder = new VariantEvaluationContextBuilder(); builder.loc(truth.getContig(), truth.getStart(), truth.getEnd()); builder.attribute(VCFConstants.END_KEY, truth.getEnd()); builder.id(truth.getID()); builder.alleles(CopyNumberTriStateAllele.PLAIN_ALL_ALLELES); builder.genotypes(samples.stream() .map(s -> buildAndAnnotateTruthOverlappingGenotype(s, truth, calls, targets)) .collect(Collectors.toList())); builder.attribute(GenotypeCopyNumberTriStateSegments.NUMBER_OF_TARGETS_KEY, targets.targetCount(truth)); builder.evidence(truth, calls); return builder.make(); }

Target:
private VariantEvaluationContext composeTruthOverlappingVariantContext(final VariantContext truth, final List<VariantContext> calls, final TargetCollection<Target> targets) { return composeEvaluationVariantContext(truth, CopyNumberTriStateAllele.PLAIN_ALL_ALLELES, s -> buildAndAnnotateTruthOverlappingGenotype(s, truth, calls, targets), targets, truth, calls); }
Source:
public void cannotDropTable() { assertThrowsAtlasDbDependencyExceptionAndDoesNotChangeCassandraSchema(() -> getTestKvs().truncateTable(TABLE_TO_DROP)); }

Target:
public void cannotDropTable() { assertThrowsAtlasDbDependencyExceptionAndDoesNotChangeCassandraSchema(() -> getTestKvs().dropTable(TABLE_TO_DROP)); }
Source:
private void createTreeViewer(FormToolkit toolkit, Composite activityComposite) { TreeViewer viewer = new TreeViewer(toolkit.createTree(activityComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER)); GridDataFactory.fillDefaults().hint(500, 100).grab(true, true).applyTo(viewer.getControl()); viewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); viewer.setContentProvider(new ActivityRecordContentProvider()); viewer.setLabelProvider(new DecoratingStyledCellLabelProvider(new ActivityRecordLabelProvider(), null, null)); IActivityStream stream = new ActivityManager().getStream(new TaskActivityScope(getModel().getTask())); viewer.setInput(stream); }

Target:
private void createTreeViewer(FormToolkit toolkit, Composite activityComposite) { TreeViewer viewer = new TreeViewer(toolkit.createTree(activityComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION)); GridDataFactory.fillDefaults().hint(SWT.DEFAULT, SWT.DEFAULT).grab(true, true).applyTo(viewer.getControl()); viewer.setContentProvider(new ActivityRecordContentProvider()); viewer.setLabelProvider(new DecoratingStyledCellLabelProvider(new ActivityRecordLabelProvider(), null, null)); IActivityStream stream = new ActivityManager().getStream(new TaskActivityScope(getModel().getTask())); viewer.setInput(stream); }
Source:
public void updateColumn1(String component1, Function<Long, Long> processor) { Optional<Long> result = getColumn1(component1); if (result.isPresent()) { Long newValue = processor.apply(result.get()); if (newValue != result.get()) { putColumn1(component1, processor.apply(result.get())); } } }

Target:
public void updateColumn1(String component1, Function<Long, Long> processor) { Optional<Long> result = getColumn1(component1); if (result.isPresent()) { Long newValue = processor.apply(result.get()); if (Objects.equals(newValue, result.get()) == false) { putColumn1(component1, processor.apply(result.get())); } } }
Source:
private static long now() { final long sinceepoch = new Date().getTime(); return sinceepoch - (sinceepoch % Tv.THOUSAND); }

Target:
private static long now() { final long sinceepoch = System.currentTimeMillis(); return sinceepoch - (sinceepoch % Tv.THOUSAND); }
Source:
public void testModeShapeInMemory() throws Exception { Map<String, URL> parameters = new HashMap<String, URL>(); parameters.put(JcrRepositoryFactory.URL, getClass().getClassLoader().getResource("configRepository.xml")); RunnerConfiguration runnerConfig = new RunnerConfiguration().addTestsToExclude( ConcurrentReadTestSuite.class.getSimpleName(), ConcurrentReadWriteTestSuite.class.getSimpleName(), BigFileReadTestSuite.class.getSimpleName(), SmallFileReadTestSuite.class.getSimpleName()); new PerformanceTestSuiteRunner(runnerConfig).runPerformanceTests(parameters, null); }

Target:
public void testModeShapeInMemory() throws Exception { Map<String, URL> parameters = new HashMap<String, URL>(); parameters.put(JcrRepositoryFactory.URL, getClass().getClassLoader().getResource("configRepository.xml")); performanceTestSuiteRunner.runPerformanceTests(parameters, null); }
Source:
public void testRemoveFromCourseAction(){ ______TS("action: remove instructor from course"); String googleId = "AAMgtUiT.instr2"; String courseId = "AAMgtUiT.CS2104"; detailsPage.clickRemoveInstructorFromCourse(courseId) .verifyStatus(Const.StatusMessages.INSTRUCTOR_REMOVED_FROM_COURSE); detailsPage.verifyHtml("/adminAccountDetailsRemoveInstructor.html"); assertNull(BackDoor.getInstructorByGoogleId(googleId, courseId)); ______TS("action: remove student from course"); courseId = "AAMgtUiT.CS1101"; detailsPage.clickRemoveStudentFromCourse(courseId) .verifyStatus(Const.StatusMessages.INSTRUCTOR_REMOVED_FROM_COURSE); assertNull(BackDoor.getStudent(courseId, "AAMgtUiT.instr2@gmail.com")); detailsPage.verifyHtml("/adminAccountDetailsRemoveStudent.html"); }

Target:
public void testRemoveFromCourseAction(){ ______TS("action: remove instructor from course"); String googleId = "AAMgtUiT.instr2"; String courseId = "AAMgtUiT.CS2104"; detailsPage.clickRemoveInstructorFromCourse(courseId) .verifyStatus(Const.StatusMessages.INSTRUCTOR_REMOVED_FROM_COURSE); assertNull(BackDoor.getInstructorByGoogleId(googleId, courseId)); ______TS("action: remove student from course"); courseId = "AAMgtUiT.CS1101"; detailsPage.clickRemoveStudentFromCourse(courseId) .verifyStatus(Const.StatusMessages.INSTRUCTOR_REMOVED_FROM_COURSE); assertNull(BackDoor.getStudent(courseId, "AAMgtUiT.instr2@gmail.com")); detailsPage.verifyHtmlMainContent("/adminAccountDetailsRemoveStudent.html"); }
Source:
public void testPreformattedBlockParsedToHtml() { StringWriter out = new StringWriter(); DocumentBuilder builder = new CreoleDocumentBuilder(out); builder.beginDocument(); builder.beginDocument(); builder.beginBlock(BlockType.PREFORMATTED, new Attributes()); builder.characters("line 1"); builder.lineBreak(); builder.characters("line 2"); builder.lineBreak(); builder.lineBreak(); builder.characters("line 3"); builder.endBlock(); builder.lineBreak(); builder.characters("line 4"); builder.endDocument(); assertParsedHtmlMatchesRoundTrip("<pre>line 1\\\\line 2\\\\\\\\line 3</pre><p><br/>line 4</p>", out.toString()); }

Target:
public void testPreformattedBlockParsedToHtml() { StringWriter out = new StringWriter(); DocumentBuilder builder = new CreoleDocumentBuilder(out); builder.beginDocument(); builder.beginBlock(BlockType.PREFORMATTED, new Attributes()); builder.characters("line 1"); builder.lineBreak(); builder.characters("line 2"); builder.lineBreak(); builder.lineBreak(); builder.characters("line 3"); builder.endBlock(); builder.lineBreak(); builder.characters("line 4"); builder.endDocument(); assertParsedHtmlMatchesRoundTrip("<pre>line 1\\\\line 2\\\\\\\\line 3</pre><p><br/>line 4</p>", out.toString()); }
Source:
public static byte[] createThumbnailFromUri(Context context, Uri imageUri, int maxWidth, String fileExtension, int orientation) { if (context == null || imageUri == null || maxWidth <= 0) return null; ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { boolean res = resizeImageAndWriteToStream(context, imageUri, fileExtension, maxWidth, orientation, 90, stream); if (!res) { AppLog.w(AppLog.T.POSTS, "Failed to compress the resized image. Use the full picture instead."); return null; } } catch (IOException e) { AppLog.e(AppLog.T.POSTS, "Failed to create resized image. Use the full picture instead."); return null; } catch (OutOfMemoryError e) { AppLog.e(AppLog.T.POSTS, "Can't resize the picture due to low memory. Use the full picture instead."); return null; } return stream.toByteArray(); }

Target:
public static byte[] createThumbnailFromUri(Context context, Uri imageUri, int maxWidth, String fileExtension, int orientation) { if (context == null || imageUri == null || maxWidth <= 0) return null; ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { boolean res = resizeImageAndWriteToStream(context, imageUri, fileExtension, maxWidth, orientation, 90, stream); if (!res) { AppLog.w(AppLog.T.MEDIA, "Failed to compress the resized image. Use the full picture instead."); return null; } } catch (IOException e) { AppLog.e(AppLog.T.MEDIA, "Failed to create resized image. Use the full picture instead."); return null; } catch (OutOfMemoryError e) { AppLog.e(AppLog.T.MEDIA, "Can't resize the picture due to low memory. Use the full picture instead."); return null; } return stream.toByteArray(); }
Source:
WebAppMsiHandler withoutExternalManagedServiceIdentity(String identityId) { this.userAssignedIdentities.remove(identityId); return this; }

Target:
WebAppMsiHandler withoutExternalManagedServiceIdentity(String identityId) { this.userAssignedIdentities.put(identityId, null); return this; }
Source:
public void testRuleIsNotLoaded() { SonarLintGlobalSettings settings = new SonarLintGlobalSettings(); assertThat(settings.getRuleParam(RULE, PARAM)).isEqualTo(null); }

Target:
public void testRuleIsNotLoaded() { SonarLintGlobalSettings settings = new SonarLintGlobalSettings(); assertThat(settings.getRuleParamValue(RULE, PARAM).isPresent()).isFalse(); }
Source:
public boolean addOrUpdate(String itemName, String autocompleteSection) throws ConstructorException { return add(itemName, autocompleteSection, null); }

Target:
public boolean addOrUpdate(String itemName, String autocompleteSection) throws ConstructorException { return addOrUpdate(itemName, autocompleteSection, null); }
Source:
public void testNormalJoinGroupLeader() { final String consumerId = "leader"; final Set<String> subscription = singleton(topic1); final List<TopicPartition> owned = Collections.emptyList(); final List<TopicPartition> assigned = Arrays.asList(t1p); subscriptions.subscribe(singleton(topic1), rebalanceListener); client.updateMetadata(metadataResponse); client.prepareResponse(groupCoordinatorResponse(node, Errors.NONE)); coordinator.ensureCoordinatorReady(time.timer(Long.MAX_VALUE)); Map<String, List<String>> memberSubscriptions = singletonMap(consumerId, singletonList(topic1)); partitionAssignor.prepare(singletonMap(consumerId, assigned)); client.prepareResponse(joinGroupLeaderResponse(1, consumerId, memberSubscriptions, Errors.NONE)); client.prepareResponse(new MockClient.RequestMatcher() { @Override public boolean matches(AbstractRequest body) { SyncGroupRequest sync = (SyncGroupRequest) body; return sync.data.memberId().equals(consumerId) && sync.data.generationId() == 1 && sync.groupAssignments().containsKey(consumerId); } }, syncGroupResponse(assigned, Errors.NONE)); coordinator.poll(time.timer(Long.MAX_VALUE)); assertFalse(coordinator.rejoinNeededOrPending()); assertEquals(toSet(assigned), subscriptions.assignedPartitions()); assertEquals(subscription, subscriptions.groupSubscription()); assertEquals(0, rebalanceListener.revokedCount); assertNull(rebalanceListener.revoked); assertEquals(1, rebalanceListener.assignedCount); assertEquals(getAdded(owned, assigned), rebalanceListener.assigned); }

Target:
public void testNormalJoinGroupLeader() { final String consumerId = "leader"; final Set<String> subscription = singleton(topic1); final List<TopicPartition> owned = Collections.emptyList(); final List<TopicPartition> assigned = Arrays.asList(t1p); subscriptions.subscribe(singleton(topic1), rebalanceListener); client.updateMetadata(metadataResponse); client.prepareResponse(groupCoordinatorResponse(node, Errors.NONE)); coordinator.ensureCoordinatorReady(time.timer(Long.MAX_VALUE)); Map<String, List<String>> memberSubscriptions = singletonMap(consumerId, singletonList(topic1)); partitionAssignor.prepare(singletonMap(consumerId, assigned)); client.prepareResponse(joinGroupLeaderResponse(1, consumerId, memberSubscriptions, Errors.NONE)); client.prepareResponse(body -> { SyncGroupRequest sync = (SyncGroupRequest) body; return sync.data.memberId().equals(consumerId) && sync.data.generationId() == 1 && sync.groupAssignments().containsKey(consumerId); }, syncGroupResponse(assigned, Errors.NONE)); coordinator.poll(time.timer(Long.MAX_VALUE)); assertFalse(coordinator.rejoinNeededOrPending()); assertEquals(toSet(assigned), subscriptions.assignedPartitions()); assertEquals(subscription, subscriptions.groupSubscription()); assertEquals(0, rebalanceListener.revokedCount); assertNull(rebalanceListener.revoked); assertEquals(1, rebalanceListener.assignedCount); assertEquals(getAdded(owned, assigned), rebalanceListener.assigned); }
Source:
public void start() throws IOException { Preconditions.checkState(conf != null, "Configuration must be set before starting mini HBase cluster"); Preconditions.checkState(zookeeperClientPort != null, "The zookeeper client port must be configured"); try { hbaseCluster = new MiniHBaseCluster(conf, 0, 0, null, null); } catch (InterruptedException e) { throw new IOException(e); } conf = configureHBaseCluster(hbaseCluster.getConf(), zookeeperClientPort, FileSystem.get(conf), forceBindIP); hbaseCluster.startMaster(); hbaseCluster.startRegionServer(); waitForHBaseToComeOnline(hbaseCluster); createManagedSchemasTable(conf); logger.info("HBase Minicluster Service Started."); }

Target:
public void start() throws IOException, InterruptedException { Preconditions.checkState(hadoopConf != null, "Hadoop Configuration must be set before starting mini HBase cluster"); Preconditions.checkState(zookeeperClientPort != 0, "The zookeeper client port must be configured to a non zero value"); hbaseCluster = new MiniHBaseCluster(hadoopConf, 0, 0, null, null); hadoopConf = configureHBaseCluster(hbaseCluster.getConf(), zookeeperClientPort, FileSystem.get(hadoopConf), bindIP, masterPort, regionserverPort); hbaseCluster.startMaster(); hbaseCluster.startRegionServer(); waitForHBaseToComeOnline(hbaseCluster); logger.info("HBase Minicluster Service Started."); }
Source:
public ReadCountCollection subsetTargets(final Set<Target> targetsToKeep) { Utils.nonNull(targetsToKeep, "the input target set cannot be null"); if (targetsToKeep.isEmpty()) { throw new IllegalArgumentException("the input target subset size must be greater than 0"); } if (targetsToKeep.size() == targets.size()) { if (targets.stream().anyMatch(name -> !targetsToKeep.contains(name))) { throw unknownTargetsToKeep(targetsToKeep); } else { return new ReadCountCollection(targets, columnNames, counts.copy()); } } else if (targetsToKeep.size() > targets.size()) { throw unknownTargetsToKeep(targetsToKeep); } final int[] targetsToKeepIndices = new int[targetsToKeep.size()]; int nextIndex = 0; final List<Target> resultTargets = new ArrayList<>(targetsToKeep.size()); for (int i = 0; i < targets.size(); i++) { final Target target = targets.get(i); if (!targetsToKeep.contains(target)) { continue; } else if (nextIndex >= targetsToKeepIndices.length) { throw unknownTargetsToKeep(targetsToKeep); } else { targetsToKeepIndices[nextIndex++] = i; resultTargets.add(target); } } if (nextIndex < targetsToKeep.size()) { throw unknownTargetsToKeep(targetsToKeep); } final double[][] resultCounts = new double[targetsToKeepIndices.length][columnNames.size()]; for (int i = 0; i < resultCounts.length; i++) { resultCounts[i] = counts.getRow(targetsToKeepIndices[i]); } return new ReadCountCollection(Collections.unmodifiableList(resultTargets), columnNames, new Array2DRowRealMatrix(resultCounts)); }

Target:
public ReadCountCollection subsetTargets(final Set<Target> targetsToKeep) { Utils.nonNull(targetsToKeep, "the input target set cannot be null"); if (targetsToKeep.isEmpty()) { throw new IllegalArgumentException("the input target subset size must be greater than 0"); } if (targetsToKeep.size() > targets.size()) { throw unknownTargetsToKeep(targetsToKeep); } if (targetsToKeep.size() == targets.size()) { if (targets.stream().anyMatch(name -> !targetsToKeep.contains(name))) { throw unknownTargetsToKeep(targetsToKeep); } else { return new ReadCountCollection(targets, columnNames, counts.copy()); } } final int[] targetsToKeepIndices = new int[targetsToKeep.size()]; int nextIndex = 0; final List<Target> resultTargets = new ArrayList<>(targetsToKeep.size()); for (int i = 0; i < targets.size(); i++) { final Target target = targets.get(i); if (!targetsToKeep.contains(target)) { continue; } if (nextIndex >= targetsToKeepIndices.length) { throw unknownTargetsToKeep(targetsToKeep); } else { targetsToKeepIndices[nextIndex++] = i; resultTargets.add(target); } } if (nextIndex < targetsToKeep.size()) { throw unknownTargetsToKeep(targetsToKeep); } final double[][] resultCounts = new double[targetsToKeepIndices.length][columnNames.size()]; for (int i = 0; i < resultCounts.length; i++) { resultCounts[i] = counts.getRow(targetsToKeepIndices[i]); } return new ReadCountCollection(Collections.unmodifiableList(resultTargets), columnNames, new Array2DRowRealMatrix(resultCounts)); }
Source:
public RegistrationFieldType getFieldType() { if (fieldType != null) { return fieldType; } else { return RegistrationFieldType.UNKNOWN; } }

Target:
public RegistrationFieldType getFieldType() { return fieldType != null ? fieldType : RegistrationFieldType.UNKNOWN; }
Source:
public void onMediaItemSelected(View sourceView, int localMediaId) { MediaModel media = mMediaStore.getMediaWithLocalId(localMediaId); if (media == null) { AppLog.w(AppLog.T.MEDIA, "Media browser > unable to load localMediaId = " + localMediaId); ToastUtils.showToast(this, R.string.error_media_load); return; } boolean isLocalFile = MediaUtils.isLocalFile(media.getUploadState()); if (mBrowserType.isPicker()) { if (isLocalFile) { return; } Intent intent = new Intent(); ArrayList<Long> remoteMediaIds = new ArrayList<>(); remoteMediaIds.add(media.getMediaId()); intent.putExtra(RESULT_IDS, ListUtils.toLongArray(remoteMediaIds)); setResult(RESULT_OK, intent); finish(); } else { String mimeType = StringUtils.notNullStr(media.getMimeType()).toLowerCase(); if (mimeType.startsWith("image") || mimeType.startsWith("video")) { if (isLocalFile) { MediaPreviewActivity.showPreview(this, sourceView, media.getFilePath(), mimeType.startsWith("video")); } else { MediaPreviewActivity.showPreview(this, sourceView, mSite, localMediaId); } } } }

Target:
public void onMediaItemSelected(View sourceView, int localMediaId) { MediaModel media = mMediaStore.getMediaWithLocalId(localMediaId); if (media == null) { AppLog.w(AppLog.T.MEDIA, "Media browser > unable to load localMediaId = " + localMediaId); ToastUtils.showToast(this, R.string.error_media_load); return; } boolean isLocalFile = MediaUtils.isLocalFile(media.getUploadState()); if (mBrowserType.isPicker()) { if (isLocalFile) { ToastUtils.showToast(this, R.string.error_media_still_uploading); return; } Intent intent = new Intent(); ArrayList<Long> remoteMediaIds = new ArrayList<>(); remoteMediaIds.add(media.getMediaId()); intent.putExtra(RESULT_IDS, ListUtils.toLongArray(remoteMediaIds)); setResult(RESULT_OK, intent); finish(); } else { showMediaSettings(media); } }
Source:
private void translateVolumeType(GlusterVolumeEntity volumeEntity) { EnumTranslator translator = EnumTranslator.getInstance(); if (translator.containsKey(volumeEntity.getVolumeType())) { String volumeType = translator.translate(volumeEntity.getVolumeType()); if (volumeEntity.getIsArbiter()) { volumeType += " " + ConstantsManager.getInstance().getConstants().arbiter(); } getDetailModel().setVolumeTypeSilently(volumeType); } }

Target:
private void translateVolumeType(GlusterVolumeEntity volumeEntity) { EnumTranslator translator = EnumTranslator.getInstance(); if (translator.containsKey(volumeEntity.getVolumeType())) { String volumeType = translator.translate(volumeEntity.getVolumeType()); if (volumeEntity.getIsArbiter()) { volumeType += " (" + ConstantsManager.getInstance().getConstants().arbiter() + ")"; } getDetailModel().setVolumeTypeSilently(volumeType); } }
Source:
public void evaluate_shouldReturnPatientsAmpathIdentifierFromAListOfIdentifiers() throws Exception { MohIdentifierRule mohIdentifierRule = new MohIdentifierRule(); PatientService patientService = Context.getPatientService(); Patient patient1 = patientService.getPatient(6); AdministrationService ams = Context.getAdministrationService(); PatientIdentifierType cccnotype = new PatientIdentifierType(); cccnotype.setName("CCC Number"); cccnotype.setDescription("A unique number generated by clinics"); patientService.savePatientIdentifierType(cccnotype); GlobalProperty globalProperty = new GlobalProperty(); globalProperty.setProperty("mflgenerator.mfl"); globalProperty.setDescription("A unique patient Number generated by Clinics"); globalProperty.setPropertyValue("CCC Number"); ams.saveGlobalProperty(globalProperty); PatientIdentifierType pit = MohCacheUtils.getPatientIdentifierType(ams.getGlobalProperty("mflgenerator.mfl")); Location location = Context.getLocationService().getLocation(1); PatientIdentifier pi = new PatientIdentifier("11740-00001", pit, location); patient1.addIdentifier(pi); patientService.savePatient(patient1); Context.flushSession(); Result result1 = mohIdentifierRule.evaluate(null, patient1.getId(), null); Result expectedResult1 = new Result("12345K"); Assert.assertEquals("The two identifiers are not equal",expectedResult1.toString(),result1.toString()); }

Target:
public void evaluate_shouldReturnPatientsAmpathIdentifierFromAListOfIdentifiers() throws Exception { MohIdentifierRule mohIdentifierRule = new MohIdentifierRule(); PatientService patientService = Context.getPatientService(); Patient patient1 = patientService.getPatient(6); AdministrationService ams = Context.getAdministrationService(); PatientIdentifierType cccnotype = new PatientIdentifierType(); cccnotype.setName("CCC Number"); cccnotype.setDescription("A unique number generated by clinics"); patientService.savePatientIdentifierType(cccnotype); GlobalProperty globalProperty = new GlobalProperty(); globalProperty.setProperty("cccgenerator.CCC"); globalProperty.setDescription("A unique patient Number generated by Clinics"); globalProperty.setPropertyValue("CCC Number"); ams.saveGlobalProperty(globalProperty); PatientIdentifierType pit = MohCacheUtils.getPatientIdentifierType(ams.getGlobalProperty("cccgenerator.CCC")); Location location = Context.getLocationService().getLocation(1); PatientIdentifier pi = new PatientIdentifier("11740-00001", pit, location); patient1.addIdentifier(pi); patientService.savePatient(patient1); Context.flushSession(); Result result1 = mohIdentifierRule.evaluate(null, patient1.getId(), null); Result expectedResult1 = new Result("12345K"); Assert.assertEquals("The two identifiers are not equal",expectedResult1.toString(),result1.toString()); }
Source:
public boolean isEmpty() { return totalCount() > 0; }

Target:
public boolean isEmpty() { return chunkCount() == 0; }
Source:
public EnvironmentDTO populate(ModelTranslator translator, Environment source, EnvironmentDTO dest) { dest = super.populate(translator, source, dest); dest.setId(source.getId()); dest.setName(source.getName()); dest.setDescription(source.getDescription()); if (translator != null) { dest.setOwner(translator.translate(source.getOwner(), OwnerDTO.class)); Set<EnvironmentContent> envContents = source.getEnvironmentContent(); if (envContents != null) { Collection<EnvironmentContent> envContent = source.getEnvironmentContent(); dest.setEnvironmentContent(Collections.<EnvironmentContentDTO>emptyList()); if (envContent != null) { ObjectTranslator<Content, ContentDTO> contentTranslator = translator .findTranslatorByClass(Content.class, ContentDTO.class); for (EnvironmentContent ec : envContent) { if (ec != null) { ContentDTO dto = contentTranslator.translate(translator, ec.getContent()); if (dto != null) { log.debug("VRITANT {}", dest); log.debug("VRITANT {}", dto); log.debug("VRITANT {}", ec.getEnabled()); dest.addContent(dto, ec.getEnabled().booleanValue()); } } } } } } else { dest.setOwner(null); dest.setEnvironmentContent(null); } return dest; }

Target:
public EnvironmentDTO populate(ModelTranslator translator, Environment source, EnvironmentDTO dest) { dest = super.populate(translator, source, dest); dest.setId(source.getId()); dest.setName(source.getName()); dest.setDescription(source.getDescription()); if (translator != null) { dest.setOwner(translator.translate(source.getOwner(), OwnerDTO.class)); Set<EnvironmentContent> envContents = source.getEnvironmentContent(); if (envContents != null) { Collection<EnvironmentContent> envContent = source.getEnvironmentContent(); dest.setEnvironmentContent(Collections.<EnvironmentContentDTO>emptyList()); if (envContent != null) { ObjectTranslator<Content, ContentDTO> contentTranslator = translator .findTranslatorByClass(Content.class, ContentDTO.class); for (EnvironmentContent ec : envContent) { if (ec != null) { ContentDTO dto = contentTranslator.translate(translator, ec.getContent()); if (dto != null) { dest.addContent(dto, ec.getEnabled()); } } } } } } else { dest.setOwner(null); dest.setEnvironmentContent(null); } return dest; }
Source:
public LogEntry save(LogEntry delegate) throws ResourceDoesNotSupportOperationException { return null; }

Target:
public LogEntry save(LogEntry delegate) throws ResourceDoesNotSupportOperationException { throw new ResourceDoesNotSupportOperationException(); }