auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AnalyticsTracker.track(AnalyticsTracker.Stat.READER_SEARCH_LOADED); if (savedInstanceState != null) { AppLog.d(T.READER, "reader post list > restoring instance state"); if (savedInstanceState.containsKey(ReaderConstants.ARG_TAG)) { mCurrentTag = (ReaderTag) savedInstanceState.getSerializable(ReaderConstants.ARG_TAG); } if (savedInstanceState.containsKey(ReaderConstants.ARG_BLOG_ID)) { mCurrentBlogId = savedInstanceState.getLong(ReaderConstants.ARG_BLOG_ID); } if (savedInstanceState.containsKey(ReaderConstants.ARG_FEED_ID)) { mCurrentFeedId = savedInstanceState.getLong(ReaderConstants.ARG_FEED_ID); } if (savedInstanceState.containsKey(ReaderConstants.ARG_SEARCH_QUERY)) { mCurrentSearchQuery = savedInstanceState.getString(ReaderConstants.ARG_SEARCH_QUERY); } if (savedInstanceState.containsKey(ReaderConstants.ARG_POST_LIST_TYPE)) { mPostListType = (ReaderPostListType) savedInstanceState.getSerializable(ReaderConstants.ARG_POST_LIST_TYPE); } if (getPostListType() == ReaderPostListType.TAG_PREVIEW) { mTagPreviewHistory.restoreInstance(savedInstanceState); } mRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION); mWasPaused = savedInstanceState.getBoolean(ReaderConstants.KEY_WAS_PAUSED); mHasUpdatedPosts = savedInstanceState.getBoolean(ReaderConstants.KEY_ALREADY_UPDATED); mFirstLoad = savedInstanceState.getBoolean(ReaderConstants.KEY_FIRST_LOAD); } }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null) { AppLog.d(T.READER, "reader post list > restoring instance state"); if (savedInstanceState.containsKey(ReaderConstants.ARG_TAG)) { mCurrentTag = (ReaderTag) savedInstanceState.getSerializable(ReaderConstants.ARG_TAG); } if (savedInstanceState.containsKey(ReaderConstants.ARG_BLOG_ID)) { mCurrentBlogId = savedInstanceState.getLong(ReaderConstants.ARG_BLOG_ID); } if (savedInstanceState.containsKey(ReaderConstants.ARG_FEED_ID)) { mCurrentFeedId = savedInstanceState.getLong(ReaderConstants.ARG_FEED_ID); } if (savedInstanceState.containsKey(ReaderConstants.ARG_SEARCH_QUERY)) { mCurrentSearchQuery = savedInstanceState.getString(ReaderConstants.ARG_SEARCH_QUERY); } if (savedInstanceState.containsKey(ReaderConstants.ARG_POST_LIST_TYPE)) { mPostListType = (ReaderPostListType) savedInstanceState.getSerializable(ReaderConstants.ARG_POST_LIST_TYPE); } if (getPostListType() == ReaderPostListType.TAG_PREVIEW) { mTagPreviewHistory.restoreInstance(savedInstanceState); } mRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION); mWasPaused = savedInstanceState.getBoolean(ReaderConstants.KEY_WAS_PAUSED); mHasUpdatedPosts = savedInstanceState.getBoolean(ReaderConstants.KEY_ALREADY_UPDATED); mFirstLoad = savedInstanceState.getBoolean(ReaderConstants.KEY_FIRST_LOAD); } }
Source:
private void run() throws Exception { String output = null; OutputStream outputStream; this.validateArguments(); if (algorithm.equals(SHA256_ALGORITHM)) { output = passwordManager.createPBDKF2SHA256Password(password); } else if (algorithm.equals(SHA512_ALGORITHM)) { output = passwordManager.createPBDKF2SHA512Password(password); } if (!fileName.isEmpty()) { outputStream = new FileOutputStream(this.fileName, !created); } else { outputStream = System.out; } if (output != null) { try { outputStream.write(username.getBytes()); outputStream.write(":".getBytes()); outputStream.write(output.getBytes()); outputStream.write("\n".getBytes()); } catch (IOException e) { throw new RuntimeException(e.getMessage()); } } else { throw new RuntimeException("Invalid output from algorithm, this should not happens, could be a bug"); } }

Target:
private void run() throws Exception { String output = null; OutputStream outputStream; this.validateArguments(); if (algorithm.equals(SHA256_ALGORITHM)) { output = passwordManager.createPBDKF2SHA256Password(password); } else if (algorithm.equals(SHA512_ALGORITHM)) { output = passwordManager.createPBDKF2SHA512Password(password); } if (!fileName.isEmpty()) { outputStream = new FileOutputStream(this.fileName, !overwrite); } else { outputStream = System.out; } if (output != null) { try { outputStream.write(username.getBytes()); outputStream.write(":".getBytes()); outputStream.write(output.getBytes()); outputStream.write("\n".getBytes()); } catch (IOException e) { throw new RuntimeException(e.getMessage()); } finally { outputStream.close(); } } else { throw new RuntimeException("Invalid output from algorithm, this should not happens, could be a bug"); } }
Source:
public void testGetContentSummary() throws IOException { ContentSummary summaryBefore = fsView.getContentSummary(new Path("/internalDir")); String expected = "GET CONTENT SUMMARY"; Path filePath = new Path("/internalDir/internalDir2/linkToDir3", "foo"); try (FSDataOutputStream outputStream = fsView.create(filePath)) { try (OutputStreamWriter writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8)) { try (BufferedWriter buffer = new BufferedWriter(writer)) { buffer.write(expected); } } } Path newDirPath = new Path("/internalDir/linkToDir2", "bar"); fsView.mkdirs(newDirPath); ContentSummary summaryAfter = fsView.getContentSummary(new Path("/internalDir")); Assert.assertEquals("The file count didn't match", summaryBefore.getFileCount() + 1, summaryAfter.getFileCount()); Assert.assertEquals("The size didn't match", summaryBefore.getLength() + expected.length(), summaryAfter.getLength()); Assert.assertEquals("The directory count didn't match", summaryBefore.getDirectoryCount() + 1, summaryAfter.getDirectoryCount()); }

Target:
public void testGetContentSummary() throws IOException { ContentSummary summaryBefore = fsView.getContentSummary(new Path("/internalDir")); String expected = "GET CONTENT SUMMARY"; Path filePath = new Path("/internalDir/internalDir2/linkToDir3", "foo"); try (FSDataOutputStream outputStream = fsView.create(filePath)) { outputStream.write(expected.getBytes()); } Path newDirPath = new Path("/internalDir/linkToDir2", "bar"); fsView.mkdirs(newDirPath); ContentSummary summaryAfter = fsView.getContentSummary(new Path("/internalDir")); assertEquals("The file count didn't match", summaryBefore.getFileCount() + 1, summaryAfter.getFileCount()); assertEquals("The size didn't match", summaryBefore.getLength() + expected.length(), summaryAfter.getLength()); assertEquals("The directory count didn't match", summaryBefore.getDirectoryCount() + 1, summaryAfter.getDirectoryCount()); }
Source:
public ArrayOfDoublesSketchAggregatorFactory( @JsonProperty("name") final String name, @JsonProperty("fieldName") final String fieldName, @JsonProperty("nominalEntries") @Nullable final Integer nominalEntries, @JsonProperty("metricColumns") @Nullable final List<String> metricColumns, @JsonProperty("numberOfValues") @Nullable final Integer numberOfValues) { this.name = Preconditions.checkNotNull(name, "Must have a valid, non-null aggregator name"); this.fieldName = Preconditions.checkNotNull(fieldName, "Must have a valid, non-null fieldName"); this.nominalEntries = nominalEntries == null ? Util.DEFAULT_NOMINAL_ENTRIES : nominalEntries; Util.checkIfPowerOf2(this.nominalEntries, "nominalEntries"); this.metricColumns = metricColumns; this.numberOfValues = numberOfValues == null ? (metricColumns == null ? 1 : metricColumns.size()) : numberOfValues; if (metricColumns != null && metricColumns.size() != this.numberOfValues) { throw new IAE( "Number of metricColumns (%d) must agree with numValues (%d)", metricColumns.size(), this.numberOfValues ); } }

Target:
public ArrayOfDoublesSketchAggregatorFactory( @JsonProperty("name") final String name, @JsonProperty("fieldName") final String fieldName, @JsonProperty("nominalEntries") @Nullable final Integer nominalEntries, @JsonProperty("metricColumns") @Nullable final List<String> metricColumns, @JsonProperty("numberOfValues") @Nullable final Integer numberOfValues ) { this.name = Preconditions.checkNotNull(name, "Must have a valid, non-null aggregator name"); this.fieldName = Preconditions.checkNotNull(fieldName, "Must have a valid, non-null fieldName"); this.nominalEntries = nominalEntries == null ? Util.DEFAULT_NOMINAL_ENTRIES : nominalEntries; Util.checkIfPowerOf2(this.nominalEntries, "nominalEntries"); this.metricColumns = metricColumns; this.numberOfValues = numberOfValues == null ? (metricColumns == null ? 1 : metricColumns.size()) : numberOfValues; if (metricColumns != null && metricColumns.size() != this.numberOfValues) { throw new IAE( "Number of metricColumns [%d] must agree with numValues [%d]", metricColumns.size(), this.numberOfValues ); } }
Source:
public void listNetworkInterfaceCards() { final NetworkInterfaceCardApi nicApi = api.getNetworkInterfaceCardApi(resourcegroup); List<NetworkInterfaceCard> nicList = nicApi.list(); assertTrue(nicList.size() > 0); }

Target:
public void listNetworkInterfaceCards() { final NetworkInterfaceCardApi nicApi = api.getNetworkInterfaceCardApi(resourcegroup); List<NetworkInterfaceCard> nicList = nicApi.list(); assertTrue(nicList.contains(nicApi.get(NETWORKINTERFACECARD_NAME))); }
Source:
private Collection createOrCheckCollection(final XmldbURI sourcePath) throws MessageReceiveException { Collection collection = null; try (DBBroker broker = brokerPool.get(Optional.of(securityManager.getSystemSubject())); Txn txn = txnManager.beginTransaction()) { setOrigin(txn); collection = broker.getOrCreateCollection(txn, sourcePath); if (collection == null) { throw new MessageReceiveException("Collection " + sourcePath.toString() + " does not exist"); } broker.saveCollection(txn, collection); txn.commit(); broker.flush(); } catch (final Throwable t) { if (LOG.isDebugEnabled()) { LOG.error(t.getMessage(), t); } else { LOG.error(t.getMessage()); } throw new MessageReceiveException(t.getMessage(), t); } return collection; }

Target:
private Collection createOrCheckCollection(final XmldbURI sourcePath) throws MessageReceiveException { Collection collection = null; try (DBBroker broker = brokerPool.get(Optional.of(securityManager.getSystemSubject())); Txn txn = txnManager.beginTransaction()) { setOrigin(txn); collection = broker.getOrCreateCollection(txn, sourcePath); if (collection == null) { throw new MessageReceiveException("Collection " + sourcePath.toString() + " does not exist"); } broker.saveCollection(txn, collection); txn.commit(); } catch (final Throwable t) { if (LOG.isDebugEnabled()) { LOG.error(t.getMessage(), t); } else { LOG.error(t.getMessage()); } throw new MessageReceiveException(t.getMessage(), t); } return collection; }
Source:
private void initializeThing(@Nullable ThingStatus bridgeStatus) { logger.debug("initializeThing thing bridge status {}", getThing().getUID(), bridgeStatus); final String configLightId = (String) getConfig().get(LIGHT_ID); if (configLightId != null) { lightId = configLightId; if (getHueClient() != null) { if (bridgeStatus == ThingStatus.ONLINE) { initializeProperties(); if (colorModeChannelRequired()) { addColorModeChannel(); } updateStatus(ThingStatus.ONLINE); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); } } else { updateStatus(ThingStatus.OFFLINE); } } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "@text/offline.conf-error-no-light-id"); } }

Target:
private void initializeThing(@Nullable ThingStatus bridgeStatus) { logger.debug("initializeThing thing bridge status {}", getThing().getUID(), bridgeStatus); final String configLightId = (String) getConfig().get(LIGHT_ID); if (configLightId != null) { lightId = configLightId; if (getHueClient() != null) { if (bridgeStatus == ThingStatus.ONLINE) { initializeProperties(); updateStatus(ThingStatus.ONLINE); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); } } else { updateStatus(ThingStatus.OFFLINE); } } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "@text/offline.conf-error-no-light-id"); } }
Source:
public boolean shutdownBlobStore(PartitionId id) { CloudBlobStore blobStore = partitionToStore.getOrDefault(id, null); if (blobStore == null) { return false; } blobStore.shutdown(); return true; }

Target:
public boolean shutdownBlobStore(PartitionId id) { CloudBlobStore blobStore = partitionToStore.get(id); if (blobStore == null) { return false; } blobStore.shutdown(); return true; }
Source:
protected int run() throws Exception { boolean errorOccurred = false; final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { stderr.println("The Jenkins instance has not been started, or was already shut down!"); return -1; } final HashSet<String> hs = new HashSet<String>(); hs.addAll(nodes); List<String> names = null; for (String node_s : hs) { Computer item = null; try { item = jenkins.getComputer(node_s); if(item == null) { if(names == null) { names = new ArrayList<String>(); for (Computer c : jenkins.getComputers()) if (c.getName().length() > 0) names.add(c.getName()); } String adv = EditDistance.findNearest(node_s, names); stderr.println(adv == null ? hudson.model.Messages.Computer_NoSuchSlaveExistsWithoutAdvice(node_s) : hudson.model.Messages.Computer_NoSuchSlaveExists(node_s, adv)); errorOccurred = true; continue; } item.cliConnect(force); } catch (AccessDeniedException2 e) { stderr.println(e.getMessage()); errorOccurred = true; continue; } catch (Exception e) { final String errorMsg = String.format("Unexpected exception occurred during deletion of item '%s': %s", item == null ? "(null)" : item.getName(), e.getMessage()); stderr.println(errorMsg); LOGGER.warning(errorMsg); errorOccurred = true; continue; } } return errorOccurred ? 1 : 0; }

Target:
protected int run() throws Exception { boolean errorOccurred = false; final Jenkins jenkins = Jenkins.getActiveInstance(); final HashSet<String> hs = new HashSet<String>(); hs.addAll(nodes); List<String> names = null; for (String node_s : hs) { Computer computer = null; try { computer = jenkins.getComputer(node_s); if(computer == null) { if(names == null) { names = new ArrayList<String>(); for (Computer c : jenkins.getComputers()) if (!c.getName().isEmpty()) names.add(c.getName()); } String adv = EditDistance.findNearest(node_s, names); throw new IllegalArgumentException(adv == null ? hudson.model.Messages.Computer_NoSuchSlaveExistsWithoutAdvice(node_s) : hudson.model.Messages.Computer_NoSuchSlaveExists(node_s, adv)); } computer.cliConnect(force); } catch (Exception e) { if (hs.size() == 1) { throw e; } final String errorMsg = String.format(node_s + ": " + e.getMessage()); stderr.println(errorMsg); errorOccurred = true; continue; } } if (errorOccurred) { throw new AbortException("Error occured while performing this command, see previous stderr output."); } return 0; }
Source:
protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { setPoolBeingDestroyed(); setPrestartedToZero(); return null; } }); setSucceeded(stopVms() && removeVmsInPool() && removeVmPool()); }

Target:
protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(getVmPool()); setPoolBeingDestroyed(); setPrestartedToZero(); getCompensationContext().stateChanged(); return null; } }); setSucceeded(stopVms() && removeVmsInPool() && removeVmPool()); }
Source:
public void handle(Event event, Context context) { try { runner.execute(context.getConnection(), getCommands(event, context)); } catch(Exception sqe) { if (sqe instanceof BadSqlGrammarException && sqe.getMessage().contains("already exists")) { throw new DataFlowSchemaMigrationException( "An exception occured during migration. This may indicate " + "that you have run Spring Batch Jobs or Spring Cloud " + "Tasks prior to running Spring Cloud Data Flow first", sqe); } throw sqe; } }

Target:
public void handle(Event event, Context context) { try { runner.execute(context.getConnection(), getCommands(event, context)); } catch(Exception sqe) { if (sqe instanceof BadSqlGrammarException) { throw new DataFlowSchemaMigrationException( "An exception occured during migration. This may indicate " + "that you have run Spring Batch Jobs or Spring Cloud " + "Tasks prior to running Spring Cloud Data Flow first. " + "Data Flow must create these tables.", sqe); } throw sqe; } }
Source:
public void onDetach() { if (call == null) { return; } call.cancel(); super.onDetach(); }

Target:
public void onDetach() { if (call != null) { call.cancel(); } super.onDetach(); }
Source:
AbstractFastaSequenceFile(final Path path) { this.path = path; this.source = path == null ? "unknown" : path.toAbsolutePath().toString(); this.sequenceDictionary = findAndLoadSequenceDictionary(path); }

Target:
AbstractFastaSequenceFile(final Path path) { this.path = path; this.source = path == null ? "unknown" : path.toAbsolutePath().toString(); this.dictionary = new Lazy<>(() -> findAndLoadSequenceDictionary(path)); }
Source:
public static void removeOverlay(final ManagementClient managementClient, final String deployment,final String overlayName, final Set<String> overlayPaths) throws Exception { try { for (String overlayPath: overlayPaths) { removeContentItem(managementClient, overlayName, overlayPath); } removeDeploymentItem(managementClient, overlayName, deployment); ModelNode op = new ModelNode(); op.get(ModelDescriptionConstants.OP_ADDR).set(ModelDescriptionConstants.DEPLOYMENT_OVERLAY, overlayName); op.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.REMOVE); ManagementOperations.executeOperation(managementClient.getControllerClient(), op); } catch (Exception e) { e.printStackTrace(); } }

Target:
public static void removeOverlay(final ManagementClient managementClient, final String deployment,final String overlayName, final Set<String> overlayPaths) throws Exception { for (String overlayPath: overlayPaths) { removeContentItem(managementClient, overlayName, overlayPath); } removeDeploymentItem(managementClient, overlayName, deployment); ModelNode op = new ModelNode(); op.get(ModelDescriptionConstants.OP_ADDR).set(ModelDescriptionConstants.DEPLOYMENT_OVERLAY, overlayName); op.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.REMOVE); ManagementOperations.executeOperation(managementClient.getControllerClient(), op); }
Source:
public RakdosFirewheeler(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}{R}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ROGUE); this.power = new MageInt(4); this.toughness = new MageInt(3); Effect effect = new DamageTargetEffect(2); effect.setText("it deals 2 damage to target opponent and 2 damage to up to one target creature or planeswalker"); Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); ability.addTarget(new TargetOpponent()); ability.addTarget(new TargetCreatureOrPlaneswalker()); this.addAbility(ability); }

Target:
public RakdosFirewheeler(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}{R}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ROGUE); this.power = new MageInt(4); this.toughness = new MageInt(3); Effect effect = new DamageTargetEffect(2); effect.setText("it deals 2 damage to target opponent and 2 damage to up to one target creature or planeswalker"); Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); ability.addTarget(new TargetOpponent()); ability.addTarget(new TargetCreatureOrPlaneswalker(0, 1, new FilterCreatureOrPlaneswalkerPermanent(), false)); this.addAbility(ability); }
Source:
public Map<String, Short> votes() throws RestApiException { String request = getRequestPath() + "/votes"; JsonElement jsonElement = gerritRestClient.getRequest(request); return new Gson().fromJson(jsonElement,new TypeToken<Map<String, Short>>() {}.getType()); }

Target:
public Map<String, Short> votes() throws RestApiException { String request = getRequestPath() + "/votes"; JsonElement jsonElement = gerritRestClient.getRequest(request); return gerritRestClient.getGson().fromJson(jsonElement, new TypeToken<Map<String, Short>>() {}.getType()); }
Source:
public void testForceRefreshWithoutAutoRefresh() throws Exception { genericSetUp(SEMANTIC_MODEL_PATH_FOR_NULL_VALUE, MODELER_DESCRIPTION_PATH_FOR_NULL_VALUE, SESSION_PATH_FOR_NULL_VALUE); changeSiriusPreference(SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), false); Iterator<DRepresentation> iterator = getRepresentations("PackageDiag").iterator(); DDiagram firstDiag = (DDiagram) iterator.next(); DiagramEditor diagramEditor = (DiagramEditor) DialectUIManager.INSTANCE.openEditor(session, firstDiag, new NullProgressMonitor()); DDiagram secondDiag = (DDiagram) iterator.next(); diagramEditor = (DiagramEditor) DialectUIManager.INSTANCE.openEditor(session, secondDiag, new NullProgressMonitor()); assertTrue("Diagram should be empty", firstDiag.getOwnedDiagramElements().isEmpty()); assertTrue("Diagram should be empty", secondDiag.getOwnedDiagramElements().isEmpty()); try { applyNodeCreationTool("createPackageWithRefresh", secondDiag, secondDiag); assertEquals("Diagram should not be empty", 1, secondDiag.getOwnedDiagramElements().size()); assertTrue("Diagram should be empty", firstDiag.getOwnedDiagramElements().isEmpty()); } catch (NullPointerException exception) { Assert.fail("No expcetion should have been raised during Node creation. This is a regression."); } }

Target:
public void testForceRefreshWithoutAutoRefresh() throws Exception { changeSiriusPreference(SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), false); assertTrue("Diagram should be empty", firstDiag.getOwnedDiagramElements().isEmpty()); assertTrue("Diagram should be empty", secondDiag.getOwnedDiagramElements().isEmpty()); applyNodeCreationTool("createPackageWithRefresh", secondDiag, secondDiag); assertEquals("Force refresh diagram has not been refreshed.", 1, secondDiag.getOwnedDiagramElements().size()); assertTrue("The non 'force refresh' diagram has been refreshed whereas 'automatic refresh' is false.", firstDiag.getOwnedDiagramElements().isEmpty()); }
Source:
protected static Object invokeMethod(Class<?> definingClass, String methodName, Class<?>[] parameterTypes, Object invokingObject, Object[] args) throws Exception { Method method = definingClass.getDeclaredMethod(methodName, parameterTypes); method.setAccessible(true); return method.invoke(invokingObject, args); }

Target:
protected static Object invokeMethod(Class<?> definingClass, String methodName, Class<?>[] parameterTypes, Object invokingObject, Object[] args) throws ReflectiveOperationException { Method method = definingClass.getDeclaredMethod(methodName, parameterTypes); method.setAccessible(true); return method.invoke(invokingObject, args); }
Source:
public IStatus run(IProgressMonitor monitor) { monitor.beginTask(Messages.ExportToTextJob_Export_trace_to + destination, 100); IStatus ret = saveImpl(monitor); monitor.done(); return ret; }

Target:
public IStatus run(IProgressMonitor monitor) { monitor.beginTask(Messages.ExportToTextJob_Export_trace_to + destination, TOTAL_WORK); IStatus ret = saveImpl(monitor); monitor.done(); return ret; }
Source:
private String promptCommitMessage(final Shell shell, final String message) { final String[] msg = { message }; shell.getDisplay().syncExec(new Runnable() { @Override public void run() { CommitMessageEditorDialog dialog = new CommitMessageEditorDialog( shell, msg[0], UIText.RebaseInteractiveHandler_EditMessageDialogOkButton, UIText.SquashHandler_EditMessageDialogCancelButton); if (dialog.open() == Window.OK) msg[0] = dialog.getCommitMessage(); else msg[0] = message; } }); return msg[0]; }

Target:
private String promptCommitMessage(final Shell shell, final String message) { final String[] msg = { message }; shell.getDisplay().syncExec(new Runnable() { @Override public void run() { CommitMessageEditorDialog dialog = new CommitMessageEditorDialog( shell, msg[0], UIText.CommitMessageEditorDialog_OkButton, UIText.SquashHandler_EditMessageDialogCancelButton); if (dialog.open() == Window.OK) msg[0] = dialog.getCommitMessage(); else msg[0] = message; } }); return msg[0]; }
Source:
public String getShortName() { return "mailinglists" ; }

Target:
public String getShortName() { return "mailingLists" ; }
Source:
public MVQueryRewriter(ParsedSelectStmt stmt) { m_stmt = stmt; if (m_stmt.m_tableList.size() == 1 && !m_stmt.hasOrderByColumns() && m_stmt.isGrouped() && m_stmt.getHavingPredicate() == null) { final Optional<Pair<MaterializedViewInfo, Map<Pair<String, Integer>, Pair<String, Integer>>>> any = getMviAndViews(m_stmt.m_tableList).entrySet().stream() .flatMap(kv -> { final MaterializedViewInfo mv = kv.getKey(); final Map<Pair<String, Integer>, Pair<String, Integer>> rel = gbyMatches(mv); return rel != null ? Stream.of(new Pair<>(mv, rel)) : null; }).findFirst(); if (any.isPresent()) { final Pair<MaterializedViewInfo, Map<Pair<String, Integer>, Pair<String, Integer>>> entry = any.get(); m_rel = entry.getSecond(); m_mvi = entry.getFirst(); } } }

Target:
public MVQueryRewriter(ParsedSelectStmt stmt) { m_unionStmt = null; m_selectStmt = stmt; if (m_selectStmt.m_tableList.size() == 1 && !m_selectStmt.hasOrderByColumns() && m_selectStmt.getHavingPredicate() == null) { final Optional<Pair<MaterializedViewInfo, Map<Pair<String, Integer>, Pair<String, Integer>>>> any = getMviAndViews(m_selectStmt.m_tableList).entrySet().stream() .flatMap(kv -> { final MaterializedViewInfo mv = kv.getKey(); final Map<Pair<String, Integer>, Pair<String, Integer>> rel = gbyMatches(mv); return rel != null ? Stream.of(Pair.of(mv, rel)) : null; }).findFirst(); if (any.isPresent()) { final Pair<MaterializedViewInfo, Map<Pair<String, Integer>, Pair<String, Integer>>> entry = any.get(); m_QueryColumnNameAndIndx_to_MVColumnNameAndIndx = entry.getSecond(); m_mvi = entry.getFirst(); } } }
Source:
public Setting getSetting(VDomainModelReference domainModelReference, EObject object) throws DatabindingFailedException { if (domainModelReference == null) { throw new IllegalArgumentException("The given VDomainModelReference must not be null."); } if (!VIndexDomainModelReference.class.isInstance(domainModelReference)) { throw new IllegalArgumentException( "DomainModelReference must be an instance of VIndexDomainModelReference."); } final VIndexDomainModelReference indexDMR = VIndexDomainModelReference.class .cast(domainModelReference); EList<EObject> eList; if (indexDMR.getPrefixDMR() == null) { if (indexDMR.getDomainModelEFeature() == null) { throw new DatabindingFailedException( "The field domainModelEFeature of the given VIndexDomainModelReference must not be null."); } checkListType(indexDMR.getDomainModelEFeature()); EObject currentObject = object; for (final EReference eReference : indexDMR.getDomainModelEReferencePath()) { currentObject = (EObject) currentObject.eGet(eReference); } eList = (EList<EObject>) currentObject.eGet(indexDMR.getDomainModelEFeature()); } else { final Setting setting = emfFormsDatabinding.getSetting(indexDMR.getPrefixDMR(), object); eList = (EList<EObject>) setting.get(true); } final EObject eObject = eList.get(indexDMR.getIndex()); return emfFormsDatabinding.getSetting(indexDMR.getTargetDMR(), eObject); }

Target:
public Setting getSetting(VDomainModelReference domainModelReference, EObject object) throws DatabindingFailedException { if (domainModelReference == null) { throw new IllegalArgumentException("The given VDomainModelReference must not be null."); } if (!VIndexDomainModelReference.class.isInstance(domainModelReference)) { throw new IllegalArgumentException( "DomainModelReference must be an instance of VIndexDomainModelReference."); } final VIndexDomainModelReference indexDMR = VIndexDomainModelReference.class .cast(domainModelReference); EList<EObject> eList; if (indexDMR.getPrefixDMR() == null) { if (indexDMR.getDomainModelEFeature() == null) { throw new DatabindingFailedException( "The field domainModelEFeature of the given VIndexDomainModelReference must not be null."); } checkListType(indexDMR.getDomainModelEFeature()); EObject currentObject = object; for (final EReference eReference : indexDMR.getDomainModelEReferencePath()) { currentObject = (EObject) currentObject.eGet(eReference); if (currentObject == null) { throw new DatabindingFailedException("The path is not fully resolved."); } } eList = (EList<EObject>) currentObject.eGet(indexDMR.getDomainModelEFeature()); } else { final Setting setting = emfFormsDatabinding.getSetting(indexDMR.getPrefixDMR(), object); eList = (EList<EObject>) setting.get(true); } final EObject eObject = eList.get(indexDMR.getIndex()); return emfFormsDatabinding.getSetting(indexDMR.getTargetDMR(), eObject); }
Source:
public void testRepeatableReadWithNullRemoval() throws Exception { LockTestData tl = lockTestData; Cache<String, String> cache = tl.cache; TransactionManager tm = tl.tm; tm.begin(); cache.get("a"); Transaction tx = tm.suspend(); cache.put("a", "v2"); assertEquals(cache.get("a"), "v2"); tm.resume(tx); assertNull("expected null but received " + cache.get("a"), cache.get("a")); cache.remove("a"); try { tm.commit(); } catch (RollbackException e) { LogFactory.getLog(RepeatableReadLockTest.class).trace("Expected exception", e); } assertEquals(cache.get("a"), "v2"); }

Target:
public void testRepeatableReadWithNullRemoval() throws Exception { LockTestData tl = lockTestData; Cache<String, String> cache = tl.cache; TransactionManager tm = tl.tm; tm.begin(); cache.get("a"); Transaction tx = tm.suspend(); cache.put("a", "v2"); assertEquals(cache.get("a"), "v2"); tm.resume(tx); assertEquals(null, cache.get("a")); cache.remove("a"); Exceptions.expectException(RollbackException.class, tm::commit); assertEquals(cache.get("a"), "v2"); }
Source:
private void getShuyookhData() { if (disposable != null) { disposable.dispose(); mOnDownloadInfo = new DisposableSingleObserver<List<QariDownloadInfo>>() { @Override public void onSuccess(List<QariDownloadInfo> downloadInfo) { progressBar.setVisibility(View.GONE); surahAdapter.setDownloadInfo(downloadInfo); surahAdapter.notifyDataSetChanged(); } @Override public void onError(Throwable e) { } }; } disposable = AudioManagerUtils.shuyookhDownloadObservable(quranInfo, basePath, qariItems) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(mOnDownloadInfo); }

Target:
private void getShuyookhData() { if (disposable != null) { disposable.dispose(); } downloadInfoObserver = new DisposableSingleObserver<List<QariDownloadInfo>>() { @Override public void onSuccess(List<QariDownloadInfo> downloadInfo) { progressBar.setVisibility(View.GONE); surahAdapter.setDownloadInfo(downloadInfo); surahAdapter.notifyDataSetChanged(); } @Override public void onError(Throwable e) { } }; disposable = AudioManagerUtils.shuyookhDownloadObservable(quranInfo, basePath, qariItems) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(downloadInfoObserver); }
Source:
protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); Guid volumeId = getParameters().getVolumeId(); if (volumeId != null) { volume = getGlusterVolumeDao().getById(volumeId); if (volume == null) { throw new RuntimeException(String.format("Invalid volume id %s", volumeId)); } asyncTask = volume.getAsyncTask(); if(asyncTask == null) { throw new RuntimeException(String.format("No async task available for volume id %s", volumeId)); } getQueryReturnValue().setReturnValue(fetchTaskStatusDetails()); } }

Target:
protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); Guid volumeId = getParameters().getVolumeId(); if (volumeId != null) { volume = getGlusterVolumeDao().getById(volumeId); if (volume == null) { throw new RuntimeException(String.format("Invalid volume id %s", volumeId)); } asyncTask = volume.getAsyncTask(); if(asyncTask == null) { getQueryReturnValue().setReturnValue(null); return; } getQueryReturnValue().setReturnValue(fetchTaskStatusDetails()); } }
Source:
private void createShowSourceNotFoundAllTime(Composite parent) { fshowSourceNotFoundAllTime = createRadioButton(fbuttonGroupForSourceNotFound, PreferenceMessages.getString("CDebugPreferencePage.22")); fshowSourceNotFoundOnlyCaseSourceNotFound = createRadioButton(fbuttonGroupForSourceNotFound, PreferenceMessages.getString("CDebugPreferencePage.23")); if (!Platform.getPreferencesService().getBoolean(CCorePlugin.PLUGIN_ID, CCorePreferenceConstants.SHOW_SOURCE_NOT_FOUND_EDITOR, true, null)) { fshowSourceNotFoundAllTime.setEnabled(false); fshowSourceNotFoundOnlyCaseSourceNotFound.setEnabled(false); } }

Target:
private void createShowSourceNotFoundAllTime(Composite parent) { fShowSourceNotFoundAllTime = createRadioButton(parent, PreferenceMessages.getString("CDebugPreferencePage.22")); fShowSourceNotFoundOnlyCaseSourceNotFound = createRadioButton(parent, PreferenceMessages.getString("CDebugPreferencePage.23")); if (!Platform.getPreferencesService().getBoolean(CCorePlugin.PLUGIN_ID, CCorePreferenceConstants.SHOW_SOURCE_NOT_FOUND_EDITOR, true, null)) { fShowSourceNotFoundAllTime.setEnabled(false); fShowSourceNotFoundOnlyCaseSourceNotFound.setEnabled(false); } }
Source:
private void createOreoShortcut(Context context, Intent intent) { DataHandler dh = KissApplication.getApplication(context).getDataHandler(); ShortcutsProvider sp = dh.getShortcutsProvider(); if (sp == null) { Log.e(TAG, "Shortcuts disabled."); return; } final LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); assert launcherApps != null; final LauncherApps.PinItemRequest pinItemRequest = intent.getParcelableExtra(LauncherApps.EXTRA_PIN_ITEM_REQUEST); final ShortcutInfo shortcutInfo = pinItemRequest.getShortcutInfo(); assert shortcutInfo != null; Log.d(TAG, "Shortcut: " + shortcutInfo.getPackage() + " " + shortcutInfo.getId()); ShortcutsPojo pojo = new ShortcutsPojo(); pojo.id = ShortcutsPojo.SCHEME + ShortcutsPojo.OREO_PREFIX + shortcutInfo.getId(); pojo.packageName = shortcutInfo.getPackage(); if (shortcutInfo.getShortLabel() != null) { pojo.setName(shortcutInfo.getShortLabel().toString()); } else if (shortcutInfo.getLongLabel() != null) { pojo.setName(shortcutInfo.getLongLabel().toString()); } else { Log.d(TAG, "Invalid shortcut " + pojo.id + ", ignoring"); return; } final Drawable iconDrawable = launcherApps.getShortcutIconDrawable(shortcutInfo, 0); pojo.icon = drawableToBitmap(iconDrawable); pojo.setOreoId(shortcutInfo.getId()); dh.addShortcut(pojo); pinItemRequest.accept(); }

Target:
private void createOreoShortcut(Context context, Intent intent) { DataHandler dh = KissApplication.getApplication(context).getDataHandler(); ShortcutsProvider sp = dh.getShortcutsProvider(); if (sp == null) { Log.e(TAG, "Shortcuts disabled."); Toast.makeText(mainActivity, R.string.unable_add_shortcut, Toast.LENGTH_LONG).show(); return; } final LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); assert launcherApps != null; final LauncherApps.PinItemRequest pinItemRequest = intent.getParcelableExtra(LauncherApps.EXTRA_PIN_ITEM_REQUEST); final ShortcutInfo shortcutInfo = pinItemRequest.getShortcutInfo(); assert shortcutInfo != null; Log.d(TAG, "Shortcut: " + shortcutInfo.getPackage() + " " + shortcutInfo.getId()); ShortcutsPojo pojo = new ShortcutsPojo(); pojo.id = ShortcutsPojo.SCHEME + ShortcutsPojo.OREO_PREFIX + shortcutInfo.getId(); pojo.packageName = shortcutInfo.getPackage(); if (shortcutInfo.getShortLabel() != null) { pojo.setName(shortcutInfo.getShortLabel().toString()); } else if (shortcutInfo.getLongLabel() != null) { pojo.setName(shortcutInfo.getLongLabel().toString()); } else { Log.d(TAG, "Invalid shortcut " + pojo.id + ", ignoring"); return; } final Drawable iconDrawable = launcherApps.getShortcutIconDrawable(shortcutInfo, 0); pojo.icon = drawableToBitmap(iconDrawable); pojo.setOreoId(shortcutInfo.getId()); dh.addShortcut(pojo); pinItemRequest.accept(); }
Source:
public static void showRateDialog(final FragmentActivity activity) { final RateDialogSupportFragment fragment = RateDialogSupportFragment .newInstance(sIsShoWNeutralButton); fragment.show(activity.getSupportFragmentManager(), TAG); }

Target:
private static void showRateDialog(final FragmentActivity activity) { final RateDialogSupportFragment fragment = RateDialogSupportFragment .newInstance(sIsShoWNeutralButton); fragment.show(activity.getSupportFragmentManager(), TAG); }
Source:
public static PrimitiveLongIterator exactIndexMatches( PropertyAccessor accessor, PrimitiveLongIterator indexedNodeIds, IndexQuery... predicates ) { if ( !indexedNodeIds.hasNext() ) { return indexedNodeIds; } IndexQuery[] numericPredicates = Arrays.stream( predicates ) .filter( LookupFilter::isNumericPredicate ) .toArray( IndexQuery[]::new ); if ( numericPredicates.length > 0 ) { LongPredicate combinedPredicate = nodeId -> { try { for ( IndexQuery predicate : numericPredicates ) { int propertyKeyId = predicate.propertyKeyId(); Object value = accessor.getProperty( nodeId, propertyKeyId ); if ( !predicate.test( value ) ) { return false; } } return true; } catch ( EntityNotFoundException ignored ) { return false; } }; return PrimitiveLongCollections.filter( indexedNodeIds, combinedPredicate ); } return indexedNodeIds; }

Target:
public static PrimitiveLongIterator exactIndexMatches( PropertyAccessor accessor, PrimitiveLongIterator indexedNodeIds, IndexQuery... predicates ) { if ( !indexedNodeIds.hasNext() ) { return indexedNodeIds; } IndexQuery[] numericPredicates = Arrays.stream( predicates ) .filter( LookupFilter::isNumericPredicate ) .toArray( IndexQuery[]::new ); if ( numericPredicates.length > 0 ) { LongPredicate combinedPredicate = nodeId -> { try { for ( IndexQuery predicate : numericPredicates ) { int propertyKeyId = predicate.propertyKeyId(); Object value = accessor.getProperty( nodeId, propertyKeyId ).value( null ); if ( !predicate.test( value ) ) { return false; } } return true; } catch ( EntityNotFoundException ignored ) { return false; } }; return PrimitiveLongCollections.filter( indexedNodeIds, combinedPredicate ); } return indexedNodeIds; }
Source:
HdfsFileStatus startFile(String src, PermissionStatus permissions, String holder, String clientMachine, EnumSet<CreateFlag> flag, boolean createParent, short replication, long blockSize, CryptoProtocolVersion[] supportedVersions, String ecPolicyName, String storagePolicy, boolean logRetryCache) throws IOException { HdfsFileStatus status; try { status = startFileInt(src, permissions, holder, clientMachine, flag, createParent, replication, blockSize, supportedVersions, ecPolicyName, storagePolicy, logRetryCache); } catch (AccessControlException e) { logAuditEvent(false, "create(options=" + flag.toString() + ")", src); throw e; } logAuditEvent(true, "create(options=" + flag.toString() + ")", src, status); return status; }

Target:
HdfsFileStatus startFile(String src, PermissionStatus permissions, String holder, String clientMachine, EnumSet<CreateFlag> flag, boolean createParent, short replication, long blockSize, CryptoProtocolVersion[] supportedVersions, String ecPolicyName, String storagePolicy, boolean logRetryCache) throws IOException { HdfsFileStatus status; try { status = startFileInt(src, permissions, holder, clientMachine, flag, createParent, replication, blockSize, supportedVersions, ecPolicyName, storagePolicy, logRetryCache); } catch (AccessControlException e) { logAuditEvent(false, "create (options=" + flag + ")", src); throw e; } logAuditEvent(true, "create (options=" + flag + ")", src, status); return status; }
Source:
private Optional<VSwitch> tryFindVSwitchInVPC(String regionId, String vpcId, String vSwitchId) { checkNotNull(vpcId, "vpcId"); ListVSwitchesOptions listVSwitchesOptions = Strings.isNullOrEmpty(vSwitchId) ? ListVSwitchesOptions.Builder.vpcId(vpcId) : ListVSwitchesOptions.Builder.vpcId(vpcId).vSwitchId(vSwitchId); return api.vSwitchApi().list(regionId, listVSwitchesOptions).firstMatch(Predicates.<VSwitch>notNull()); }

Target:
private Optional<VSwitch> tryFindVSwitchInVPC(String regionId, String vpcId, String vSwitchId) { ListVSwitchesOptions listVSwitchesOptions = ListVSwitchesOptions.Builder.vpcId(vpcId).vSwitchId(vSwitchId); return api.vSwitchApi().list(regionId, listVSwitchesOptions).first(); }
Source:
private void processInstance(Instance inst, InstancesContentEvent instContentEvent, boolean isTesting, boolean isTraining){ inst.setDataset(this.dataset); boolean testAndTrain = false; double[] prediction = null; if (isTesting) { prediction = getVotesForInstance(inst, testAndTrain); this.resultStream.put(newResultContentEvent(prediction, inst, instContentEvent)); } if (isTraining && testAndTrain == false) { trainOnInstanceImpl(inst); if (this.changeDetector != null) { if (prediction == null) { prediction = getVotesForInstance(inst); } boolean correctlyClassifies = this.correctlyClassifies(inst,prediction); double oldEstimation = this.changeDetector.getEstimation(); this.changeDetector.input(correctlyClassifies ? 0 : 1); if (this.changeDetector.getEstimation() > oldEstimation) { this.resetLearning(); this.changeDetector.resetLearning(); } } } }

Target:
private void processInstance(Instance inst, InstancesContentEvent instContentEvent, boolean isTesting, boolean isTraining){ inst.setDataset(this.dataset); boolean testAndTrain = false; double[] prediction = null; if (isTesting) { prediction = getVotesForInstance(inst, testAndTrain); this.resultStream.put(newResultContentEvent(prediction, inst, instContentEvent)); } if (isTraining && testAndTrain == false) { trainOnInstanceImpl(inst); if (this.changeDetector != null) { if (prediction == null) { prediction = getVotesForInstance(inst); } boolean correctlyClassifies = this.correctlyClassifies(inst,prediction); double oldEstimation = this.changeDetector.getEstimation(); this.changeDetector.input(correctlyClassifies ? 0 : 1); if (this.changeDetector.getEstimation() > oldEstimation) { logger.info("Change detected, resetting the classifier"); this.resetLearning(); this.changeDetector.resetLearning(); } } } }
Source:
public HttpResponse execute(ClientRequestContext ctx, HttpRequest req) throws Exception { String credentials = basicCredentials.getCredentials(); if (Objects.nonNull(credentials)) { ctx.addAdditionalRequestHeader(HttpHeaderNames.AUTHORIZATION, credentials); } return delegate().execute(ctx, req); }

Target:
public HttpResponse execute(ClientRequestContext ctx, HttpRequest req) throws Exception { String credentials = basicCredentials.getCredentials(); if (credentials != null) { ctx.addAdditionalRequestHeader(HttpHeaderNames.AUTHORIZATION, credentials); } return delegate().execute(ctx, req); }
Source:
private static FileObject findDataCleanerHome() throws FileSystemException { final FileSystemManager manager = VFSUtils.getFileSystemManager(); FileObject candidate = null; String env = System.getenv("DATACLEANER_HOME"); if (!StringUtils.isNullOrEmpty(env)) { if (env.startsWith("~")) { String userHomePath = System.getProperty("user.home"); env = env.replace("~", userHomePath); } candidate = manager.resolveFile(env); logger.info("Resolved env. variable DATACLEANER_HOME ({}) to: {}", env, candidate); } else { String sysProp = System.getProperty("DATACLEANER_HOME"); if (!StringUtils.isNullOrEmpty(sysProp)) { if (sysProp.startsWith("~")) { String userHomePath = System.getProperty("user.home"); sysProp = sysProp.replace("~", userHomePath); } candidate = manager.resolveFile(sysProp); logger.info("Resolved system property DATACLEANER_HOME ({}) to: {}", sysProp, candidate); } } if (isUsable(candidate)) { return candidate; } else { return initializeDataCleanerHome(candidate); } }

Target:
private static FileObject findDataCleanerHome() throws FileSystemException { final FileSystemManager manager = VFSUtils.getFileSystemManager(); FileObject candidate = null; String path = System.getenv("DATACLEANER_HOME"); if (!StringUtils.isNullOrEmpty(path)) { logger.info("Resolved env. variable DATACLEANER_HOME: {}", path); } else { path = System.getProperty("DATACLEANER_HOME"); if (!StringUtils.isNullOrEmpty(path)) { candidate = manager.resolveFile(path); logger.info("Resolved system property DATACLEANER_HOME: {}", path, candidate); } } if (!StringUtils.isNullOrEmpty(path)) { if (path.startsWith("~")) { String userHomePath = System.getProperty("user.home"); path = path.replace("~", userHomePath); } candidate = manager.resolveFile(path); } if (isUsable(candidate)) { return candidate; } else { return initializeDataCleanerHome(candidate); } }
Source:
InnerPublisherSubscription(ClusterPublisherManagerImpl<K, ?>.SubscriberHandler<I, R> parent, int batchSize, Supplier<Map.Entry<Address, IntSet>> supplier, Map<Address, Set<K>> excludedKeys, int topologyId, Map.Entry<Address, IntSet> specificTarget) { this.parent = parent; this.queue = new SpscArrayQueue<>(batchSize); this.supplier = supplier; this.batchSize = batchSize; this.excludedKeys = excludedKeys; this.topologyId = topologyId; this.currentTarget = Objects.requireNonNull(specificTarget); }

Target:
InnerPublisherSubscription(ClusterPublisherManagerImpl<K, ?>.SubscriberHandler<I, R> parent, int batchSize, Supplier<Map.Entry<Address, IntSet>> supplier, Map<Address, Set<K>> excludedKeys, int topologyId, Map.Entry<Address, IntSet> specificTarget) { this(parent, batchSize, supplier, excludedKeys, topologyId); this.currentTarget = Objects.requireNonNull(specificTarget); }
Source:
public <T> T convertTo(Class<T> type, Exchange exchange, Object value) throws TypeConversionException { if (type.getCanonicalName().startsWith("org.apache")) { return null; } if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof List)) { return null; } for (ConversionService conversionService : conversionServices) { if (conversionService.canConvert(value.getClass(), type)) { return conversionService.convert(value, type); } } return null; }

Target:
public <T> T convertTo(Class<T> type, Exchange exchange, Object value) throws TypeConversionException { if (type.getCanonicalName().startsWith("org.apache")) { return null; } if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof Collection)) { return null; } for (ConversionService conversionService : conversionServices) { if (conversionService.canConvert(value.getClass(), type)) { return conversionService.convert(value, type); } } return null; }
Source:
public Entry parseWorkflowContent(Entry entry, String content) { ConfigSlurper slurper = new ConfigSlurper(); ConfigObject parse = slurper.parse(content); ConfigObject manifest = (ConfigObject)parse.get("manifest"); if (manifest.containsKey("description")) { entry.setDescription((String)manifest.get("description")); } if (manifest.containsKey("author")) { entry.setDescription((String)manifest.get("author")); } return entry; }

Target:
public Entry parseWorkflowContent(Entry entry, String content) { ConfigSlurper slurper = new ConfigSlurper(); ConfigObject parse = slurper.parse(content); ConfigObject manifest = (ConfigObject)parse.get("manifest"); if (manifest.containsKey("description")) { entry.setDescription((String)manifest.get("description")); } if (manifest.containsKey("author")) { entry.setAuthor((String)manifest.get("author")); } return entry; }
Source:
public static void createFakeDockstoreConfigFile() { String path = System.getProperty("user.home") + File.separator + ".dockstore/config"; File customDir = new File(path); if (customDir.exists()) { System.out.println(customDir + " already exists"); } else if (customDir.mkdirs()) { System.out.println(customDir + " was created"); } else { System.out.println(customDir + " was not created"); } }

Target:
public static void createFakeDockstoreConfigFile() { String path = System.getProperty("user.home") + File.separator + ".dockstore/config"; File customDir = new File(path); if (customDir.exists()) { LOG.info(customDir + " already exists"); } else if (customDir.mkdirs()) { LOG.info(customDir + " was created"); } else { LOG.error(customDir + " was not created"); } }
Source:
public <T extends Card> void removeCards(Class<T> type, List<Card> items) { Iterator<Card> iterator = items.iterator(); while (iterator.hasNext()) { Card card = iterator.next(); if (type.isInstance(card)) { items.remove(card); } } }

Target:
public <T extends Card> void removeCards(Class<T> type, List<Card> items) { Iterator<Card> iterator = items.iterator(); while (iterator.hasNext()) { Card card = iterator.next(); if (type.isInstance(card)) { iterator.remove(); } } }