auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void added(Provider<Rule> provider, Rule element) { Rule ruleCopy = RuleUtils.getRuleCopy(element); super.added(provider, ruleCopy); postRuleAddedEvent(ruleCopy); try { Rule resolvedRule = resolveRuleByTemplate(ruleCopy); if (resolvedRule.getTemplateUID() == null) { RuleStatusInfo statusInfo = disabledRulesStorage != null && disabledRulesStorage.get(ruleCopy.getUID()) == null ? new RuleStatusInfo(RuleStatus.INITIALIZING) : new RuleStatusInfo(RuleStatus.DISABLED); addToRuleEngine(resolvedRule, statusInfo); } if (ruleCopy != resolvedRule) { update(resolvedRule); } } catch (Exception e) { logger.debug("Added rule '{}' is invalid", ruleCopy.getUID(), e); } }

Target:
public void added(Provider<Rule> provider, Rule element) { String ruleUID = element.getUID(); Rule resolvedRule = element; try { resolvedRule = resolveRuleByTemplate(element); } catch (IllegalArgumentException e) { logger.debug("Added rule '{}' is invalid", ruleUID, e); } super.added(provider, element); if (element != resolvedRule) { if (provider instanceof ManagedRuleProvider) { update(resolvedRule); } else { super.updated(provider, element, resolvedRule); } } }
Source:
public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); Utils.setContext(context); if (!LaunchManager.isWidgetEnabled()) { return; } if (intent.getAction() != null && intent.getAction().equals(ACTION_BUTTON_PRESS)) { if (WidgetManager.isWidgetTemporarilyVisible()) { WidgetManager.setWidgetTemporarilyVisible(false); updateMe(context); } long now = System.currentTimeMillis(); long diff = now - mLastTime; if (diff < TOUCH_INTERVAL) { mClicks++; } else { mClicks = 0; } mLastTime = now; if (WidgetManager.getTapCountToOpen() - 1 <= mClicks) { PinActivity.launch(context); mClicks = 0; } } }

Target:
public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); Utils.setContext(context); if (!LaunchManager.isWidgetEnabled()) { return; } if (intent.getAction() != null && intent.getAction().equals(ACTION_BUTTON_PRESS)) { if (WidgetManager.isWidgetTemporarilyVisible()) { WidgetManager.setWidgetTemporarilyVisible(false); updateMe(context); } long now = System.currentTimeMillis(); long diff = now - mLastTime; if (diff < TOUCH_INTERVAL) { mClicks++; } else { mClicks = 1; } mLastTime = now; if (WidgetManager.getTapCountToOpen() == mClicks) { PinActivity.launch(context); mClicks = 0; mLastTime = 0; } } }
Source:
public State readChildState(String parentId, String name, Set<String> ignored) { processReceivedInvalidations(); String childCacheKey = computeChildCacheKey(parentId, name); String stateId = childCache.getIfPresent(childCacheKey); if (stateId != null) { State state = cache.getIfPresent(stateId); if (state != null && parentId.equals(state.get(KEY_PARENT_ID)) && name.equals(state.get(KEY_NAME))) { return state; } } State state = repository.readChildState(parentId, name, ignored); putInCache(state); return state; }

Target:
public State readChildState(String parentId, String name, Set<String> ignored) { processReceivedInvalidations(); String childCacheKey = computeChildCacheKey(parentId, name); String stateId = childCache.getIfPresent(childCacheKey); if (stateId != null) { State state = cache.getIfPresent(stateId); if (state != null) { if (parentId.equals(state.get(KEY_PARENT_ID)) && name.equals(state.get(KEY_NAME))) { return state; } else { childCache.invalidate(childCacheKey); } } } State state = repository.readChildState(parentId, name, ignored); putInCache(state); return state; }
Source:
protected void reportAllLinesForGroupAsFailuresDueToOrphanedCashAdvanceLines( BiConsumer<ConcurStandardAccountingExtractDetailLine, String> lineErrorReporter) { List<ConcurStandardAccountingExtractDetailLine> linesForGroup = getDetailLinesSortedBySequenceNumberNumerically(); Set<String> sequenceNumbersForOrphanedCashAdvanceLines = getSequenceNumbersForOrphanedCashAdvanceLines(); for (ConcurStandardAccountingExtractDetailLine detailLine : linesForGroup) { String errorMessage = GROUP_WITH_ORPHANED_CASH_ADVANCE_MESSAGE; if (sequenceNumbersForOrphanedCashAdvanceLines.contains(detailLine.getSequenceNumber())) { errorMessage = String.format(ORPHANED_CASH_ADVANCE_MESSAGE_FORMAT, ORPHANED_CASH_ADVANCE_MESSAGE_FRAGMENT, detailLine.getCashAdvanceKey()); } lineErrorReporter.accept(detailLine, errorMessage); } }

Target:
protected void reportAllLinesForGroupAsFailuresDueToOrphanedCashAdvanceLines( BiConsumer<ConcurStandardAccountingExtractDetailLine, String> lineErrorReporter) { List<ConcurStandardAccountingExtractDetailLine> linesForGroup = getDetailLinesSortedBySequenceNumberNumerically(); Set<String> sequenceNumbersForOrphanedCashAdvanceLines = getSequenceNumbersForOrphanedCashAdvanceLines(); for (ConcurStandardAccountingExtractDetailLine detailLine : linesForGroup) { String errorMessage; if (sequenceNumbersForOrphanedCashAdvanceLines.contains(detailLine.getSequenceNumber())) { errorMessage = collectorHelper.getFormattedValidationMessage( ConcurKeyConstants.CONCUR_SAE_ORPHANED_CASH_ADVANCE, detailLine.getCashAdvanceKey()); } else { errorMessage = collectorHelper.getValidationMessage(ConcurKeyConstants.CONCUR_SAE_GROUP_WITH_ORPHANED_CASH_ADVANCE); } lineErrorReporter.accept(detailLine, errorMessage); } }
Source:
public static boolean isPossibleClientTermination(Throwable cause) { if (cause instanceof SSLException) { return SSL_ENGINE_CLOSED_EXCEPTION_MSG.equals(cause.getMessage()); } else if (cause instanceof IOException) { return CLIENT_RESET_EXCEPTION_MSG.equals(cause.getMessage()) || CLIENT_BROKEN_PIPE_EXCEPTION_MSG.equals( cause.getMessage()); } else { return false; } }

Target:
public static boolean isPossibleClientTermination(Throwable cause) { return cause instanceof IOException && (CLIENT_RESET_EXCEPTION_MSG.equals(cause.getMessage()) || CLIENT_BROKEN_PIPE_EXCEPTION_MSG.equals(cause.getMessage()) || SSL_ENGINE_CLOSED_EXCEPTION_MSG.equals( cause.getMessage())); }
Source:
public void run() throws Exception { Runnable actionMethod = actions.get(prefix); if(actionMethod == null) { throw new IllegalArgumentException( String.format("No such action '%1$s' exists for module '%2$s'", prefix, getName()) ); } actionMethod.run(); }

Target:
public void run() throws Exception { actionMethod.run(); }
Source:
private static BasicDocumentRevision getFullRevisionFromCurrentCursor(Cursor cursor, List<? extends Attachment> attachments) { String docId = cursor.getString(0); long internalId = cursor.getLong(1); String revId = cursor.getString(2); long sequence = cursor.getLong(3); byte[] json = cursor.getBlob(4); boolean current = cursor.getInt(5) > 0; boolean deleted = cursor.getInt(6) > 0; long parent = -1L; if(cursor.columnType(7) == Cursor.FIELD_TYPE_INTEGER) { parent = cursor.getLong(7); } else if(cursor.columnType(7) == Cursor.FIELD_TYPE_NULL) { } else { throw new IllegalArgumentException("Unexpected type: " + cursor.columnType(7)); } DocumentRevisionBuilder builder = new DocumentRevisionBuilder() .setDocId(docId) .setRevId(revId) .setBody(BasicDocumentBody.bodyWith(json)) .setDeleted(deleted) .setSequence(sequence) .setInternalId(internalId) .setCurrent(current) .setParent(parent) .setAttachments(attachments); return builder.build(); }

Target:
private static BasicDocumentRevision getFullRevisionFromCurrentCursor(Cursor cursor, List<? extends Attachment> attachments) { String docId = cursor.getString(0); long internalId = cursor.getLong(1); String revId = cursor.getString(2); long sequence = cursor.getLong(3); byte[] json = cursor.getBlob(4); boolean current = cursor.getInt(5) > 0; boolean deleted = cursor.getInt(6) > 0; long parent = -1L; if(cursor.columnType(7) == Cursor.FIELD_TYPE_INTEGER) { parent = cursor.getLong(7); } else if(cursor.columnType(7) == Cursor.FIELD_TYPE_NULL) { } else { throw new RuntimeException("Unexpected type: " + cursor.columnType(7)); } DocumentRevisionBuilder builder = new DocumentRevisionBuilder() .setDocId(docId) .setRevId(revId) .setBody(BasicDocumentBody.bodyWith(json)) .setDeleted(deleted) .setSequence(sequence) .setInternalId(internalId) .setCurrent(current) .setParent(parent) .setAttachments(attachments); return builder.build(); }
Source:
private void setSidePane(boolean displayed) { if (displayed) { gameDetailPane.setVisible(true); gameDetailPane.setManaged(true); toggleSidePaneButton.setText(i18n.get("view.hideSidePane")); gamesGridPane.getColumnConstraints().stream().filter(c -> c.getHgrow() == Priority.SOMETIMES).forEach(c -> c.setMinWidth(300)); } else { gameDetailPane.setVisible(false); gameDetailPane.setManaged(false); toggleSidePaneButton.setText(i18n.get("view.showSidePane")); gamesGridPane.getColumnConstraints().stream().filter(c -> c.getHgrow() == Priority.SOMETIMES).forEach(c -> c.setMinWidth(0)); gameViewContainer.setPrefWidth(10000); } }

Target:
private void setSidePane(boolean displayed) { if (displayed) { toggleSidePaneButton.setText(i18n.get("view.hideSidePane")); sidePaneColumn.setMinWidth(sidePaneColumn.getPrefWidth()); } else { toggleSidePaneButton.setText(i18n.get("view.showSidePane")); sidePaneColumn.setMinWidth(0); } }
Source:
public Object getAdapter( Object adaptableObject, Class adapterType ) { Object molecule = null; if ( adaptableObject instanceof CMLMolecule) { CMLMolecule mol = (CMLMolecule) adaptableObject; if ( adapterType.equals( CMLMolecule.class ) ) { try { molecule = Activator.getDefault() .getJavaCDKManager().fromCml( mol.toCML() ); } catch ( BioclipseException e ) { logger.debug( LogUtils.traceStringOf( e )); return null; } catch ( IOException e ) { logger.debug( LogUtils.traceStringOf( e )); return null; } } } if(molecule !=null &&adapterType.isAssignableFrom( molecule.getClass())) return molecule; return null; }

Target:
public Object getAdapter( Object adaptableObject, Class adapterType ) { Object molecule = null; if ( adaptableObject instanceof CMLMolecule) { CMLMolecule mol = (CMLMolecule) adaptableObject; if ( adapterType.equals( ICDKMolecule.class ) ) { try { molecule = Activator.getDefault() .getJavaCDKManager().fromCml( mol.toCML() ); } catch ( BioclipseException e ) { logger.debug( LogUtils.traceStringOf( e )); return null; } catch ( IOException e ) { logger.debug( LogUtils.traceStringOf( e )); return null; } } } if(molecule !=null &&adapterType.isAssignableFrom( molecule.getClass())) return molecule; return null; }
Source:
protected List<QuickActionType> getQuickActionTypes() { ArrayList<QuickActionType> quickActionTypes = new ArrayList<>(); quickActionTypes.add(AddPOIAction.TYPE); quickActionTypes.add(AddOSMBugAction.TYPE); quickActionTypes.add(ShowHideOSMBugAction.TYPE); return quickActionTypes; }

Target:
protected List<QuickActionType> getQuickActionTypes() { List<QuickActionType> quickActionTypes = new ArrayList<>(); quickActionTypes.add(AddPOIAction.TYPE); quickActionTypes.add(AddOSMBugAction.TYPE); quickActionTypes.add(ShowHideOSMBugAction.TYPE); return quickActionTypes; }
Source:
private void connectNewPeers(){ if (qcm != null && quorumVerifier != null && lastSeenQuorumVerifier != null) { Map<Long, QuorumServer> committedView = quorumVerifier.getAllMembers(); for (Entry<Long, QuorumServer> e: lastSeenQuorumVerifier.getAllMembers().entrySet()){ if (e.getKey() != getId() && !committedView.containsKey(e.getKey())) qcm.connectOne(e.getKey(), lastSeenQuorumVerifier); } } }

Target:
private void connectNewPeers(){ synchronized (QV_LOCK) { if (qcm != null && quorumVerifier != null && lastSeenQuorumVerifier != null) { Map<Long, QuorumServer> committedView = quorumVerifier.getAllMembers(); for (Entry<Long, QuorumServer> e : lastSeenQuorumVerifier.getAllMembers().entrySet()) { if (e.getKey() != getId() && !committedView.containsKey(e.getKey())) qcm.connectOne(e.getKey()); } } } }
Source:
private void submitBatch(int batch, int batchSize, int numPartitions, final JavaRDD<String> streamed, final Properties properties) { final List<Integer> list = new ArrayList<>(); for (int j = batch*batchSize; j < numPartitions && j < (batch+1)*batchSize; j++) { list.add(j); } if (LOG.isTraceEnabled()) LOG.trace("Submitting batch " + batch + " with partitions " + list); final Seq objects = JavaConversions.asScalaBuffer(list).toList(); completionService.submit(new Callable<Object>() { @Override public Object call() throws Exception { SparkContext sc = SpliceSpark.getContextUnsafe().sc(); sc.setLocalProperties(properties); if (shufflePartitions != null) sc.setLocalProperty(SQLConf.SHUFFLE_PARTITIONS().key(), shufflePartitions.toString()); AtomicBoolean cont = new AtomicBoolean(true); SimpleFutureAction<Boolean> job = sc.submitJob(streamed.rdd(), new FunctionAdapter(), objects, new AbstractFunction2<Object, String, BoxedUnit>() { @Override public BoxedUnit apply(Object index, String result) { if ("STOP".equals(result)) cont.set(false); return BoxedUnit.UNIT; } }, new AbstractFunction0<Boolean>() { @Override public Boolean apply() { return cont.get(); } }); Boolean result = null; while (result == null) { try { result = Await.result(job, Duration.apply(1, TimeUnit.SECONDS)); } catch (InterruptedException e) { job.cancel(); throw new CancellationException("Interrupted"); } catch (TimeoutException e) { if (!jobStatus.isRunning()) { job.cancel(); throw new CancellationException("The olap job is no longer running, cancelling Spark job"); } } } return result ? "CONTINUE" : "STOP"; } }); }

Target:
private void submitBatch(int batch, int batchSize, int numPartitions, final JavaRDD<String> streamed, final Properties properties) { final List<Integer> list = new ArrayList<>(); for (int j = batch*batchSize; j < numPartitions && j < (batch+1)*batchSize; j++) { list.add(j); } if (LOG.isTraceEnabled()) LOG.trace("Submitting batch " + batch + " with partitions " + list); final Seq objects = JavaConversions.asScalaBuffer(list).toList(); completionService.submit(new Callable<Object>() { @Override public Object call() throws Exception { SparkContext sc = SpliceSpark.getContextUnsafe().sc(); sc.setLocalProperties(properties); AtomicBoolean cont = new AtomicBoolean(true); SimpleFutureAction<Boolean> job = sc.submitJob(streamed.rdd(), new FunctionAdapter(), objects, new AbstractFunction2<Object, String, BoxedUnit>() { @Override public BoxedUnit apply(Object index, String result) { if ("STOP".equals(result)) cont.set(false); return BoxedUnit.UNIT; } }, new AbstractFunction0<Boolean>() { @Override public Boolean apply() { return cont.get(); } }); Boolean result = null; while (result == null) { try { result = Await.result(job, Duration.apply(1, TimeUnit.SECONDS)); } catch (InterruptedException e) { job.cancel(); throw new CancellationException("Interrupted"); } catch (TimeoutException e) { if (!jobStatus.isRunning()) { job.cancel(); throw new CancellationException("The olap job is no longer running, cancelling Spark job"); } } } return result ? "CONTINUE" : "STOP"; } }); }
Source:
public ConfigDaoImpl(Configuration appConfig) throws ClassNotFoundException, SQLException, ConfigurationException, ConnectException, XPathExpressionException { valueColumn = appConfig.getString("configColumnValue"); configTable = appConfig.getString("configTable"); nameColumn = appConfig.getString("configColumnName"); versionColumn = appConfig.getString("configColumnVersion"); defaultColumn = appConfig.getString("configColumnDefault"); selectSql = MessageFormat.format("select {0} from {1} where {2}=? and {3} =?", valueColumn, configTable, nameColumn, versionColumn); updateSql = MessageFormat.format("update {0} set {1}=? where {2}=? and {3}=?", configTable, valueColumn, nameColumn, versionColumn); selectKeysForNameSql = MessageFormat.format("select * from {0} where {1}=? ", configTable, nameColumn); selectConfigDiff = MessageFormat.format("SELECT {0}, {1}, {2}, {3} FROM {4} WHERE {5} != {6}", nameColumn, valueColumn, defaultColumn, versionColumn, configTable, valueColumn, defaultColumn); System.out.println(selectConfigDiff); ds = new StandaloneDataSource(); }

Target:
public ConfigDaoImpl(Configuration appConfig) throws ClassNotFoundException, SQLException, ConfigurationException, ConnectException, XPathExpressionException { valueColumn = appConfig.getString("configColumnValue"); configTable = appConfig.getString("configTable"); nameColumn = appConfig.getString("configColumnName"); versionColumn = appConfig.getString("configColumnVersion"); defaultColumn = appConfig.getString("configColumnDefault"); selectSql = MessageFormat.format("select {0} from {1} where {2}=? and {3} =?", valueColumn, configTable, nameColumn, versionColumn); updateSql = MessageFormat.format("update {0} set {1}=? where {2}=? and {3}=?", configTable, valueColumn, nameColumn, versionColumn); selectKeysForNameSql = MessageFormat.format("select * from {0} where {1}=? ", configTable, nameColumn); selectConfigDiff = MessageFormat.format("SELECT {0}, {1}, {2}, {3} FROM {4} WHERE {5} != {6}", nameColumn, valueColumn, defaultColumn, versionColumn, configTable, valueColumn, defaultColumn); ds = new StandaloneDataSource(); }
Source:
private SsMediaSource(SsManifest manifest, Uri manifestUri, DataSource.Factory manifestDataSourceFactory, ParsingLoadable.Parser<? extends SsManifest> manifestParser, SsChunkSource.Factory chunkSourceFactory, int minLoadableRetryCount, long livePresentationDelayMs, Handler eventHandler, AdaptiveMediaSourceEventListener eventListener) { Assertions.checkState(manifest == null || !manifest.isLive); this.manifest = manifest; this.manifestUri = manifestUri == null ? null : lastPathSegment.contains("manifest") && lastPathSegment.contains("(") && lastPathSegment.contains(")")) ? manifestUri : lastPathSegment.equals("manifest") ? manifestUri : Uri.withAppendedPath(manifestUri, "Manifest"); this.manifestDataSourceFactory = manifestDataSourceFactory; this.manifestParser = manifestParser; this.chunkSourceFactory = chunkSourceFactory; this.minLoadableRetryCount = minLoadableRetryCount; this.livePresentationDelayMs = livePresentationDelayMs; this.eventDispatcher = new EventDispatcher(eventHandler, eventListener); mediaPeriods = new ArrayList<>(); }

Target:
private SsMediaSource(SsManifest manifest, Uri manifestUri, DataSource.Factory manifestDataSourceFactory, ParsingLoadable.Parser<? extends SsManifest> manifestParser, SsChunkSource.Factory chunkSourceFactory, int minLoadableRetryCount, long livePresentationDelayMs, Handler eventHandler, AdaptiveMediaSourceEventListener eventListener) { Assertions.checkState(manifest == null || !manifest.isLive); this.manifest = manifest; String lastPathSegment = Util.toLowerInvariant(manifestUri.getLastPathSegment()); this.manifestUri = manifestUri == null ? null : lastPathSegment.equals("manifest") ? manifestUri : lastPathSegment.matches("manifest\\(.*\\)") ? manifestUri : Uri.withAppendedPath(manifestUri, "Manifest"); this.manifestDataSourceFactory = manifestDataSourceFactory; this.manifestParser = manifestParser; this.chunkSourceFactory = chunkSourceFactory; this.minLoadableRetryCount = minLoadableRetryCount; this.livePresentationDelayMs = livePresentationDelayMs; this.eventDispatcher = new EventDispatcher(eventHandler, eventListener); mediaPeriods = new ArrayList<>(); }
Source:
public DynamicUrlContentPresenter get() { if (presenter == null) { presenter = new DynamicUrlContentPresenter(getEventBus(), new DynamicUrlContentView(), this, slot); presenter.bind(); } presenter.setContentUrl(contentUrl); return presenter; }

Target:
public DynamicUrlContentPresenter get() { if (presenter == null) { presenter = new DynamicUrlContentPresenter(contentUrl, getEventBus(), viewProvider.get(), this, slot); presenter.bind(); } return presenter; }
Source:
void fillChunks() throws InterruptedException { try { PutChunk chunkToFill; if (!chunkFillingCompleted && !operationCompleted) { do { if (channelReadBuffer == null) { channelReadBuffer = chunkFillerChannel.getNextChunk(0); } if (channelReadBuffer != null) { chunkToFill = getChunkToFill(); if (chunkToFill == null) { break; } bytesFilledSoFar += chunkToFill.fillFrom(channelReadBuffer); if (!channelReadBuffer.hasRemaining()) { chunkFillerChannel.resolveOldestChunk(null); channelReadBuffer = null; } } else { break; } } while (bytesFilledSoFar < blobSize); if (bytesFilledSoFar == blobSize) { chunkFillingCompleted = true; } } } catch (InterruptedException e) { throw e; } catch (Exception e) { logger.error("Unexpected error caught in PutOperation fillChunks; ignoring.", e); routerMetrics.unexpectedErrorCount.inc(); setOperationException(new RouterException("PutOperation fillChunks encountered unexpected error", e, RouterErrorCode.UnexpectedInternalError)); } }

Target:
void fillChunks() { try { PutChunk chunkToFill; if (!chunkFillingCompleted && !operationCompleted) { do { if (channelReadBuffer == null) { channelReadBuffer = chunkFillerChannel.getNextChunk(0); } if (channelReadBuffer != null) { chunkToFill = getChunkToFill(); if (chunkToFill == null) { break; } bytesFilledSoFar += chunkToFill.fillFrom(channelReadBuffer); if (!channelReadBuffer.hasRemaining()) { chunkFillerChannel.resolveOldestChunk(null); channelReadBuffer = null; } } else { break; } } while (bytesFilledSoFar < blobSize); if (bytesFilledSoFar == blobSize) { chunkFillingCompleted = true; } } } catch (Exception e) { setOperationExceptionAndComplete(new RouterException("PutOperation fillChunks encountered unexpected error", e, RouterErrorCode.UnexpectedInternalError)); } }
Source:
K replacementTerm() { if (remainingCells.size() == 1) { return KVariable(var.name(), var.att().remove("sort")); } throw KEMException.compilerError("Unsupported cell fragment with types: " + remainingCells, var); }

Target:
K replacementTerm() { if (remainingCells.size() == 1) { return KVariable(var.name(), var.att().remove(Attribute.SORT_KEY)); } throw KEMException.compilerError("Unsupported cell fragment with types: " + remainingCells, var); }
Source:
private static String formatDoubleAsCpuCost(double value) { if (value == Double.NEGATIVE_INFINITY) { return "-INF"; } else if (value == Double.POSITIVE_INFINITY) { return "+INF"; } else if(!isNaN(value)) { String formattedValue = DataSize.succinctDataSize(value, BYTE).toString(); return formattedValue.substring(0, formattedValue.length() - 1); } return "?"; }

Target:
private static String formatDoubleAsCpuCost(double value) { return formatDoubleAsDataSize(value).replaceAll("B$", ""); }
Source:
public ColumnPartSerde read(ByteBuffer buffer, ColumnBuilder builder) { final boolean isSingleValued = buffer.get() == 0x0; final GenericIndexed<String> dictionary = GenericIndexed.read(buffer, GenericIndexed.stringStrategy); final VSizeIndexedInts singleValuedColumn; final VSizeIndexed multiValuedColumn; builder.setType(ValueType.STRING); if (isSingleValued) { singleValuedColumn = VSizeIndexedInts.readFromByteBuffer(buffer); multiValuedColumn = null; builder.setHasMultipleValues(false) .setDictionaryEncodedColumn(new DictionaryEncodedColumnSupplier(dictionary, singleValuedColumn, null)); } else { singleValuedColumn = null; multiValuedColumn = VSizeIndexed.readFromByteBuffer(buffer); builder.setHasMultipleValues(true) .setDictionaryEncodedColumn(new DictionaryEncodedColumnSupplier(dictionary, null, multiValuedColumn)); } GenericIndexed<ImmutableConciseSet> bitmaps = GenericIndexed.read( buffer, ConciseCompressedIndexedInts.objectStrategy ); GenericIndexed<ImmutableRTree> spatialIndex = null; if (buffer.hasRemaining()) { spatialIndex = GenericIndexed.read( buffer, IndexedRTree.objectStrategy ); } builder.setBitmapIndex(new BitmapIndexColumnPartSupplier(bitmaps, dictionary)); builder.setSpatialIndex(new SpatialIndexColumnPartSupplier(spatialIndex)); return new DictionaryEncodedColumnPartSerde( dictionary, singleValuedColumn, multiValuedColumn, bitmaps, spatialIndex ); }

Target:
public ColumnPartSerde read(ByteBuffer buffer, ColumnBuilder builder) { final boolean isSingleValued = buffer.get() == 0x0; final GenericIndexed<String> dictionary = GenericIndexed.read(buffer, GenericIndexed.stringStrategy); final VSizeIndexedInts singleValuedColumn; final VSizeIndexed multiValuedColumn; builder.setType(ValueType.STRING); if (isSingleValued) { singleValuedColumn = VSizeIndexedInts.readFromByteBuffer(buffer); multiValuedColumn = null; builder.setHasMultipleValues(false) .setDictionaryEncodedColumn(new DictionaryEncodedColumnSupplier(dictionary, singleValuedColumn, null)); } else { singleValuedColumn = null; multiValuedColumn = VSizeIndexed.readFromByteBuffer(buffer); builder.setHasMultipleValues(true) .setDictionaryEncodedColumn(new DictionaryEncodedColumnSupplier(dictionary, null, multiValuedColumn)); } GenericIndexed<ImmutableConciseSet> bitmaps = GenericIndexed.read( buffer, ConciseCompressedIndexedInts.objectStrategy ); builder.setBitmapIndex(new BitmapIndexColumnPartSupplier(bitmaps, dictionary)); ImmutableRTree spatialIndex = null; if (buffer.hasRemaining()) { spatialIndex = ByteBufferSerializer.read( buffer, IndexedRTree.objectStrategy ); builder.setSpatialIndex(new SpatialIndexColumnPartSupplier(spatialIndex)); } return new DictionaryEncodedColumnPartSerde( dictionary, singleValuedColumn, multiValuedColumn, bitmaps, spatialIndex ); }
Source:
private boolean copyFile(File src, File dest) throws IOException { InputStream destInput = null; OutputStream srcOutput = null; destInput = new FileInputStream(src); srcOutput = new FileOutputStream(dest); byte[] buffer = new byte[1024]; int length; while ((length = destInput.read(buffer)) > 0) { srcOutput.write(buffer, 0, length); } destInput.close(); srcOutput.close(); return true; }

Target:
private void copyFile(File src, File dest) { InputStream destInput = null; OutputStream srcOutput = null; try { destInput = new FileInputStream(src); srcOutput = new FileOutputStream(dest); byte[] buffer = new byte[1024]; int length; while ((length = destInput.read(buffer)) != -1) { srcOutput.write(buffer, 0, length); } } catch (FileNotFoundException e) { openErroDialog(Messages.PerfSaveSession_failure_title, Messages.PerfSaveSession_failure_msg, dest.toString()); } catch (IOException e) { openErroDialog(Messages.PerfSaveSession_failure_title, Messages.PerfSaveSession_failure_msg, dest.toString()); } finally { closeResource(destInput, dest.getName()); closeResource(srcOutput, src.getName()); } }
Source:
public Long evaluate(TransactionContext txnCtx, Input<Object>... args) { assert args.length == 2 : String.format(Locale.ENGLISH, "number of arguments must be 2, got %d instead", args.length); String zoneStr = (String) args[0].value(); if (zoneStr == null || zoneStr.isBlank()) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "invalid argument to %s: zone cannot be null or blanc", NAME)); } ZoneId zoneId = null; try { zoneId = ZoneId.of(zoneStr); } catch (DateTimeException e) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "invalid argument to %s: %s", NAME, zoneStr)); } Number utcTimestamp = (Number) args[1].value(); if (utcTimestamp == null) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "invalid argument to %s: timestamp cannot be null", NAME)); } Instant instant = Instant.ofEpochMilli(utcTimestamp.longValue()); ZoneId srcZoneId = paramHadTimezone ? zoneId : UTC; ZoneId dstZoneId = paramHadTimezone ? UTC : zoneId; ZonedDateTime zonedDateTime = instant.atZone(srcZoneId).withZoneSameLocal(dstZoneId); return zonedDateTime.toEpochSecond() * 1000; }

Target:
public Long evaluate(TransactionContext txnCtx, Input<Object>... args) { assert args.length == 2 : String.format(Locale.ENGLISH, "number of arguments must be 2, got %d instead", args.length); String zoneStr = (String) args[0].value(); if (zoneStr == null) { return null; } ZoneId zoneId; try { zoneId = ZoneId.of(zoneStr); } catch (DateTimeException e) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, " time zone \"%s\" not recognized", zoneStr)); } Number utcTimestamp = (Number) args[1].value(); if (utcTimestamp == null) { return null; } Instant instant = Instant.ofEpochMilli(utcTimestamp.longValue()); boolean paramHadTimezone = info.returnType() == DataTypes.TIMESTAMP; ZoneId srcZoneId = paramHadTimezone ? zoneId : UTC; ZoneId dstZoneId = paramHadTimezone ? UTC : zoneId; ZonedDateTime zonedDateTime = instant.atZone(srcZoneId).withZoneSameLocal(dstZoneId); return zonedDateTime.toEpochSecond() * 1000; }
Source:
public void endSuccessfully() { super.endSuccessfully(); if (getParameters().getImportAsTemplate()) { Guid newTemplateId = createTemplate(); if (newTemplateId != null) { attachDiskToTemplate(newTemplateId); } } updateDiskStatus(ImageStatus.OK); getReturnValue().setSucceeded(true); }

Target:
public void endSuccessfully() { super.endSuccessfully(); if (getParameters().getImportAsTemplate()) { Guid newTemplateId = createTemplate(); if (newTemplateId != null) { attachDiskToTemplate(newTemplateId); } } updateDiskStatus(ImageStatus.OK); setSucceeded(true); }
Source:
public QueryRunner( ClientSession session, boolean debug, Optional<HostAndPort> socksProxy, Optional<HostAndPort> httpProxy, Optional<String> keystorePath, Optional<String> keystorePassword, Optional<String> truststorePath, Optional<String> truststorePassword, Optional<String> user, Optional<String> password, Optional<String> kerberosPrincipal, Optional<String> kerberosRemoteServiceName, Optional<String> kerberosConfigPath, Optional<String> kerberosKeytabPath, Optional<String> kerberosCredentialCachePath, boolean kerberosUseCanonicalHostname) { this.session = new AtomicReference<>(requireNonNull(session, "session is null")); this.debug = debug; this.sslSetup = builder -> setupSsl(builder, keystorePath, keystorePassword, truststorePath, truststorePassword); OkHttpClient.Builder builder = new OkHttpClient.Builder(); setupTimeouts(builder, 30, SECONDS); setupCookieJar(builder); setupSocksProxy(builder, socksProxy); setupHttpProxy(builder, httpProxy); setupBasicAuth(builder, session, user, password); if (kerberosRemoteServiceName.isPresent()) { checkArgument(session.getServer().getScheme().equalsIgnoreCase("https"), "Authentication using Kerberos requires SSL to be enabled"); setupKerberos( builder, kerberosRemoteServiceName.get(), kerberosUseCanonicalHostname, kerberosPrincipal, kerberosConfigPath.map(File::new), kerberosKeytabPath.map(File::new), kerberosCredentialCachePath.map(File::new)); } this.httpClient = builder.build(); }

Target:
public QueryRunner( ClientSession session, boolean debug, Optional<HostAndPort> socksProxy, Optional<HostAndPort> httpProxy, Optional<String> keystorePath, Optional<String> keystorePassword, Optional<String> truststorePath, Optional<String> truststorePassword, Optional<String> user, Optional<String> password, Optional<String> kerberosPrincipal, Optional<String> kerberosRemoteServiceName, Optional<String> kerberosConfigPath, Optional<String> kerberosKeytabPath, Optional<String> kerberosCredentialCachePath, boolean kerberosUseCanonicalHostname) { this.session = new AtomicReference<>(requireNonNull(session, "session is null")); this.debug = debug; this.sslSetup = builder -> setupSsl(builder, keystorePath, keystorePassword, truststorePath, truststorePassword); OkHttpClient.Builder builder = new OkHttpClient.Builder(); setupTimeouts(builder, 30, SECONDS); setupCookieJar(builder); setupSocksProxy(builder, socksProxy); setupHttpProxy(builder, httpProxy); setupBasicAuth(builder, session, user, password); if (kerberosRemoteServiceName.isPresent()) { checkArgument(session.getServer().getScheme().equalsIgnoreCase("https"), "Authentication using Kerberos requires HTTPS to be enabled"); setupKerberos( builder, kerberosRemoteServiceName.get(), kerberosUseCanonicalHostname, kerberosPrincipal, kerberosConfigPath.map(File::new), kerberosKeytabPath.map(File::new), kerberosCredentialCachePath.map(File::new)); } this.httpClient = builder.build(); }
Source:
private void throwCheckFailedException(Iterable<Class<?>> exceptionsThrown, Iterable<Class<?>> allowedExceptions) { throw newIllegalStateException( "Method %s#%s throws prohibited exception types: %s. " + "The allowed exception types for this method are: %s", method.getDeclaringClass() .getCanonicalName(), method.getName(), iterableToString(exceptionsThrown), iterableToString(allowedExceptions) ); }

Target:
private void throwCheckFailedException(Iterable<Class<?>> exceptionsThrown, Iterable<Class<?>> allowedExceptions) { throw newIllegalStateException( "Method %s.%s throws prohibited exception types: %s. " + "The allowed exception types for this method are: %s", method.getDeclaringClass() .getCanonicalName(), method.getName(), iterableToString(exceptionsThrown), iterableToString(allowedExceptions) ); }
Source:
public static void main(String[] args) { SplashScreen.getInstance().post("Java Runtime " + System.getProperty("java.version") + " loaded"); handlePrintUsageRequest(args); handleLaunchArguments(args); try (final TerasologyEngine engine = new TerasologyEngine(createSubsystemList())) { if (!writeSaveGamesEnabled) { CoreRegistry.get(Config.class).getTransients().setWriteSaveGamesEnabled(writeSaveGamesEnabled); } CoreRegistry.get(Config.class).getNetwork().setServerPort(serverPort); if (isHeadless) { engine.subscribeToStateChange(new HeadlessStateChangeListener()); engine.run(new StateHeadlessSetup()); } else { if (loadLastGame) { engine.submitTask("loadGame", new Runnable() { @Override public void run() { GameManifest gameManifest = getLatestGameManifest(); if (gameManifest != null) { engine.changeState(new StateLoading(gameManifest, NetworkMode.NONE)); } } }); } SplashScreen.getInstance().close(); engine.run(new StateMainMenu()); } } catch (Throwable e) { if (!GraphicsEnvironment.isHeadless()) { reportException(e); } } finally { SplashScreen.getInstance().close(); } }

Target:
public static void main(String[] args) { SplashScreen.getInstance().post("Java Runtime " + System.getProperty("java.version") + " loaded"); handlePrintUsageRequest(args); handleLaunchArguments(args); try (final TerasologyEngine engine = new TerasologyEngine(createSubsystemList())) { Config config = CoreRegistry.get(Config.class); if (!writeSaveGamesEnabled) { config.getTransients().setWriteSaveGamesEnabled(writeSaveGamesEnabled); } if (serverPort != -1) { config.getTransients().setServerPort(serverPort); } if (isHeadless) { engine.subscribeToStateChange(new HeadlessStateChangeListener()); engine.run(new StateHeadlessSetup()); } else { if (loadLastGame) { engine.submitTask("loadGame", new Runnable() { @Override public void run() { GameManifest gameManifest = getLatestGameManifest(); if (gameManifest != null) { engine.changeState(new StateLoading(gameManifest, NetworkMode.NONE)); } } }); } SplashScreen.getInstance().close(); engine.run(new StateMainMenu()); } } catch (Throwable e) { if (!GraphicsEnvironment.isHeadless()) { reportException(e); } } finally { SplashScreen.getInstance().close(); } }
Source:
public byte[] toBytes() { byte[] buf = null; switch (version) { case VERSION_0: int size = 2 * Short.BYTES + 2 * Long.BYTES; if(latestBlobId != null) { size += latestBlobId.length(); } buf = new byte[size]; ByteBuffer bufWrap = ByteBuffer.wrap(buf); bufWrap.putShort(version); bufWrap.putLong(latestUploadTime); bufWrap.putLong(bytesRead); if (latestBlobId != null) { bufWrap.putShort((short) latestBlobId.length()); bufWrap.put(latestBlobId.getBytes()); } else { bufWrap.putShort((short) 0); } break; case VERSION_3: size = 3 * Short.BYTES + 2 * Long.BYTES; if(latestBlobId != null) { size += latestBlobId.length(); } buf = new byte[size]; bufWrap = ByteBuffer.wrap(buf); bufWrap.putShort(version); bufWrap.putShort((short) type.ordinal()); bufWrap.putLong(latestUploadTime); bufWrap.putLong(bytesRead); if (latestBlobId != null) { bufWrap.putShort((short) latestBlobId.length()); bufWrap.put(latestBlobId.getBytes()); } else { bufWrap.putShort((short) 0); } break; default: throw new IllegalStateException("Unknown version: " + version); } return buf; }

Target:
public byte[] toBytes() { byte[] buf = null; switch (version) { case VERSION_0: int size = 3 * Short.BYTES + 2 * Long.BYTES; if (latestBlobId != null) { size += latestBlobId.length(); } buf = new byte[size]; ByteBuffer bufWrap = ByteBuffer.wrap(buf); bufWrap.putShort(version); bufWrap.putShort((short) type.ordinal()); bufWrap.putLong(latestUploadTime); bufWrap.putLong(bytesRead); if (latestBlobId != null) { bufWrap.putShort((short) latestBlobId.length()); bufWrap.put(latestBlobId.getBytes()); } else { bufWrap.putShort((short) 0); } break; default: throw new IllegalStateException("Unknown version: " + version); } return buf; }
Source:
private void endCommand() { List<VM> listVms = getVmsForDiskId(); for (VM vm : listVms) { getVmStaticDAO().incrementDbGeneration(vm.getId()); } disk = getDiskDao().get((Guid) getParameters().getEntityId()); Backend.getInstance().EndAction(VdcActionType.RemoveImage, getParameters().getImagesParameters().get(0)); setSucceeded(true); }

Target:
private void endCommand() { List<VM> listVms = getVmsForDiskId(); for (VM vm : listVms) { getVmStaticDAO().incrementDbGeneration(vm.getId()); } getDisk(); Backend.getInstance().EndAction(VdcActionType.RemoveImage, getParameters().getImagesParameters().get(0)); setSucceeded(true); }
Source:
public void andTest() throws Exception { AndClauseInTrigger clause = new AndClauseInTrigger( new EqualsClauseInTrigger("alias", "f1", "a"), new EqualsClauseInTrigger("alias", "f2", 1)); Parcel parcel = Parcel.obtain(); clause.writeToParcel(parcel, 0); parcel.setDataPosition(0); AndClauseInTrigger deserializedClause = AndClauseInTrigger.CREATOR.createFromParcel(parcel); Assert.assertTrue(Arrays.equals( clause.getClauses().toArray(), deserializedClause.getClauses().toArray())); }

Target:
public void andTest() throws Exception { AndClauseInTrigger clause = new AndClauseInTrigger( new EqualsClauseInTrigger("alias", "f1", "a"), new NotEqualsClauseInTrigger( new EqualsClauseInTrigger("alias", "f2", 1)), RangeClauseInTrigger.greaterThan("alias", "f3", 23), RangeClauseInTrigger.lessThan("alias", "f3", 230), RangeClauseInTrigger.range("alias", "f4", 11, true, 23, false)); Parcel parcel = Parcel.obtain(); clause.writeToParcel(parcel, 0); parcel.setDataPosition(0); AndClauseInTrigger deserializedClause = AndClauseInTrigger.CREATOR.createFromParcel(parcel); Assert.assertTrue(Arrays.equals( clause.getClauses().toArray(), deserializedClause.getClauses().toArray())); }
Source:
public Void visitStatisticsWriterNode(StatisticsWriterNode node, Set<Symbol> boundSymbols) { node.getSource().accept(this, boundSymbols); return null; }

Target:
public Void visitStatisticsWriterNode(StatisticsWriterNode node, Set<Symbol> boundSymbols) { node.getSource().accept(this, boundSymbols); StatisticAggregationsDescriptor<Symbol> descriptor = node.getDescriptor(); Set<Symbol> dependencies = ImmutableSet.<Symbol>builder() .addAll(descriptor.getGrouping().values()) .addAll(descriptor.getColumnStatistics().values()) .addAll(descriptor.getTableStatistics().values()) .build(); List<Symbol> outputSymbols = node.getSource().getOutputSymbols(); checkDependencies(dependencies, dependencies, "Invalid node. Dependencies (%s) not in source plan output (%s)", dependencies, outputSymbols); return null; }
Source:
public boolean isUserDefined() { return Arrays.asList( context.getNode(ContentType.PREF_USER_DEFINED) .get(ContentType.PREF_USER_DEFINED, ContentType.EMPTY_STRING) .split(ContentType.PREF_USER_DEFINED__SEPARATOR)) .contains(contentType.getId()); }

Target:
public boolean isUserDefined() { return Arrays.asList(ContentTypeManager.getUserDefinedContentTypeIds(context)).contains(contentType.getId()); }
Source:
public void addService(Object... service) { for (Object svc : service) { services.put(svc.getClass().getAnnotation(Path.class).value(), svc); } updateMetadata(); Arrays.stream(service).forEach(svc -> { if (log.isDebugEnabled()) { log.debug("Added microservice: " + svc); } }); }

Target:
public void addService(Object... service) { for (Object svc : service) { services.put(svc.getClass().getAnnotation(Path.class).value(), svc); } updateMetadata(); if (log.isDebugEnabled()) { Arrays.stream(service).forEach(svc -> log.debug("Added microservice: {}.", svc)); } }
Source:
public void concurrentModificationEmptyAsyncRealmObject() { final Realm realm = looperThread.realm; Dog dog1 = new Dog(); dog1.setName("Dog 1"); Dog dog2 = new Dog(); dog2.setName("Dog 2"); realm.beginTransaction(); dog1 = realm.copyToRealm(dog1); dog2 = realm.copyToRealm(dog2); realm.commitTransaction(); final WeakReference<RealmObjectProxy> weakReference1 = new WeakReference<RealmObjectProxy>((RealmObjectProxy)dog1); final WeakReference<RealmObjectProxy> weakReference2 = new WeakReference<RealmObjectProxy>((RealmObjectProxy)dog2); final RealmQuery<Dog> dummyQuery = RealmQuery.createQuery(realm, Dog.class); looperThread.realm.handlerController.emptyAsyncRealmObject.put(weakReference1, dummyQuery); final CountDownLatch dogAddFromBg = new CountDownLatch(1); Iterator<Map.Entry<WeakReference<RealmObjectProxy>, RealmQuery<? extends RealmModel>>> iterator = looperThread.realm.handlerController.emptyAsyncRealmObject.entrySet().iterator(); AtomicBoolean fireOnce = new AtomicBoolean(true); while (iterator.hasNext()) { Dog next = (Dog) iterator.next().getKey().get(); if (fireOnce.compareAndSet(true, false)) { new Thread() { @Override public void run() { looperThread.realm.handlerController.emptyAsyncRealmObject.put(weakReference2, dummyQuery); dogAddFromBg.countDown(); } }.start(); TestHelper.awaitOrFail(dogAddFromBg); } assertEquals("Dog 1", next.getName()); } looperThread.testComplete(); }

Target:
public void concurrentModificationEmptyAsyncRealmObject() { RealmConfiguration config = configFactory.createConfiguration(); final Realm realm = Realm.getInstance(config); Dog dog1 = new Dog(); dog1.setName("Dog 1"); Dog dog2 = new Dog(); dog2.setName("Dog 2"); realm.beginTransaction(); dog1 = realm.copyToRealm(dog1); dog2 = realm.copyToRealm(dog2); realm.commitTransaction(); final WeakReference<RealmObjectProxy> weakReference1 = new WeakReference<RealmObjectProxy>((RealmObjectProxy)dog1); final WeakReference<RealmObjectProxy> weakReference2 = new WeakReference<RealmObjectProxy>((RealmObjectProxy)dog2); final RealmQuery<Dog> dummyQuery = RealmQuery.createQuery(realm, Dog.class); realm.handlerController.emptyAsyncRealmObject.put(weakReference1, dummyQuery); final CountDownLatch dogAddFromBg = new CountDownLatch(1); Iterator<Map.Entry<WeakReference<RealmObjectProxy>, RealmQuery<? extends RealmModel>>> iterator = realm.handlerController.emptyAsyncRealmObject.entrySet().iterator(); AtomicBoolean fireOnce = new AtomicBoolean(true); while (iterator.hasNext()) { Dog next = (Dog) iterator.next().getKey().get(); if (fireOnce.compareAndSet(true, false)) { new Thread() { @Override public void run() { realm.handlerController.emptyAsyncRealmObject.put(weakReference2, dummyQuery); dogAddFromBg.countDown(); } }.start(); TestHelper.awaitOrFail(dogAddFromBg); } assertEquals("Dog 1", next.getName()); assertFalse(iterator.hasNext()); } realm.close(); }
Source:
public static Archive<?> deploy() { WebArchive war = TestUtil.prepareArchive(RestClientProxyTest.class.getSimpleName()); war.addClass(RestClientProxyTest.class); war.addClass(HelloResource.class); war.addClass(HeaderPropagator.class); war.addPackage(HelloResource.class.getPackage()); war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); war.addClass(PortProviderUtil.class); war.addClass(Category.class); war.addClass(MicroProfileDependent.class); war.addClass(NotForBootableJar.class); war.addClasses(TestParamConverter.class, TestParamConverterProvider.class); war.addAsManifestResource(new StringAsset("Dependencies: org.eclipse.microprofile.restclient,org.jboss.resteasy.resteasy-rxjava2 services\n"), "MANIFEST.MF"); return TestUtil.finishContainerPrepare(war, null); }

Target:
public static Archive<?> deploy() { WebArchive war = TestUtil.prepareArchive(RestClientProxyTest.class.getSimpleName()); war.addClass(RestClientProxyTest.class); war.addClass(HelloResource.class); war.addClass(HeaderPropagator.class); war.addPackage(HelloResource.class.getPackage()); war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); war.addClass(PortProviderUtil.class); war.addClass(Category.class); war.addClass(MicroProfileDependent.class); war.addClasses(TestParamConverter.class, TestParamConverterProvider.class); war.addAsManifestResource(new StringAsset("Dependencies: org.eclipse.microprofile.restclient,org.jboss.resteasy.resteasy-rxjava2 services\n"), "MANIFEST.MF"); return TestUtil.finishContainerPrepare(war, null); }
Source:
private void handleBlockExit(ExplodedGraph.ProgramPoint programPosition) { CFG.Block block = programPosition.block; if (block.terminator() != null) { switch (block.terminator().kind()) { case IF_STATEMENT: handleBranch(block, ((IfStatementTree) block.terminator()).condition()); return; case CONDITIONAL_OR: case CONDITIONAL_AND: handleBranch(block, ((BinaryExpressionTree) block.terminator()).leftOperand()); return; case CONDITIONAL_EXPRESSION: handleBranch(block, ((ConditionalExpressionTree) block.terminator()).condition()); return; case FOR_STATEMENT: ForStatementTree forStatement = (ForStatementTree) block.terminator(); if (forStatement.condition() != null) { handleBranch(block, forStatement.condition(), false); return; } } } for (CFG.Block successor : block.successors()) { enqueue(new ExplodedGraph.ProgramPoint(successor, 0), programState); } }

Target:
private void handleBlockExit(ExplodedGraph.ProgramPoint programPosition) { CFG.Block block = programPosition.block; Tree terminator = block.terminator(); if (terminator != null) { switch (terminator.kind()) { case IF_STATEMENT: handleBranch(block, ((IfStatementTree) terminator).condition()); return; case CONDITIONAL_OR: case CONDITIONAL_AND: handleBranch(block, ((BinaryExpressionTree) terminator).leftOperand()); return; case CONDITIONAL_EXPRESSION: handleBranch(block, ((ConditionalExpressionTree) terminator).condition()); return; case FOR_STATEMENT: ForStatementTree forStatement = (ForStatementTree) terminator; if (forStatement.condition() != null) { handleBranch(block, forStatement.condition(), false); return; } default: } } for (CFG.Block successor : block.successors()) { enqueue(new ExplodedGraph.ProgramPoint(successor, 0), programState); } }
Source:
private static List<DivType> getDivTypesByFileTypes(List<FileType> fileTypes) { List<DivType> divTypes = new ArrayList<>(); int counter = 1; for (FileType file : fileTypes) { DivType div = objectFactory.createDivType(); div.setID("PHYS_" + String.format("%04d", counter)); div.setORDER(BigInteger.valueOf(counter)); div.setORDERLABEL("uncounted"); div.setTYPE(getPhysicalDivTypeByFileType(file)); DivType.Fptr divTypeFptr = objectFactory.createDivTypeFptr(); divTypeFptr.setFILEID(file); div.getFptr().add(divTypeFptr); divTypes.add(div); counter++; } return divTypes; }

Target:
private static List<DivType> getDivTypesByFileTypes(List<FileType> fileTypes) { List<DivType> divTypes = new ArrayList<>(); int counter = 1; for (FileType file : fileTypes) { DivType div = objectFactory.createDivType(); div.setID("PHYS_" + String.format("%04d", counter)); div.setORDER(BigInteger.valueOf(counter)); div.setORDERLABEL(Config.getParameter("MetsEditorDefaultPagination")); div.setTYPE(getPhysicalDivTypeByFileType(file)); DivType.Fptr divTypeFptr = objectFactory.createDivTypeFptr(); divTypeFptr.setFILEID(file); div.getFptr().add(divTypeFptr); divTypes.add(div); counter++; } return divTypes; }
Source:
private String getDstRef(Repository repo, boolean launchFetch) { if (launchFetch) { String realName = getRealBranchName(repo); String name = BRANCH_NAME_PATTERN.matcher(realName).replaceAll(""); StoredConfig config = repo.getConfig(); String remote = config.getString(CONFIG_BRANCH_SECTION, name, CONFIG_KEY_REMOTE); String merge = config.getString(CONFIG_BRANCH_SECTION, name, CONFIG_KEY_MERGE); if (remote == null || merge == null) return HEAD; String mergeBranchName = merge.substring( merge.lastIndexOf("/"), merge.length()); return R_REMOTES + remote + mergeBranchName; } else return HEAD; }

Target:
private String getDstRef(Repository repo, boolean launchFetch) { if (launchFetch) { String realName = getRealBranchName(repo); String name = BRANCH_NAME_PATTERN.matcher(realName).replaceAll(""); StoredConfig config = repo.getConfig(); String remote = config.getString(CONFIG_BRANCH_SECTION, name, CONFIG_KEY_REMOTE); String merge = config.getString(CONFIG_BRANCH_SECTION, name, CONFIG_KEY_MERGE); if (remote == null || merge == null) return HEAD; String mergeBranchName = merge.replace(R_HEADS, ""); return R_REMOTES + remote + "/" + mergeBranchName; } else return HEAD; }