auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void minimizeDependencies(HashMap<String, IPluginImport> usedPlugins, ArrayList<ImportPackageObject> usedPackages, IProgressMonitor monitor) { ListIterator<ImportPackageObject> li = usedPackages.listIterator(); while (li.hasNext()) { ImportPackageObject ipo = li.next(); String bundle = ipo.getAttribute(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE); if (usedPlugins.containsKey(bundle)) fList.add(ipo); } Iterator<String> it = usedPlugins.keySet().iterator(); Stack<String> plugins = new Stack<>(); while (it.hasNext()) plugins.push(it.next().toString()); while (!(plugins.isEmpty())) { String pluginId = plugins.pop(); IPluginModelBase base = PluginRegistry.findModel(pluginId); if (base == null) continue; IPluginImport[] imports = base.getPluginBase().getImports(); for (int j = 0; j < imports.length; j++) if (imports[j].isReexported()) { String reExportedId = imports[j].getId(); Object pluginImport = usedPlugins.remove(imports[j].getId()); if (pluginImport != null) { fList.add(pluginImport); updateMonitor(monitor, fList.size()); } plugins.push(reExportedId); } } }

Target:
private void minimizeDependencies(HashMap<String, IPluginImport> usedPlugins, ArrayList<ImportPackageObject> usedPackages, IProgressMonitor monitor) { ListIterator<ImportPackageObject> li = usedPackages.listIterator(); while (li.hasNext()) { ImportPackageObject ipo = li.next(); String bundle = ipo.getAttribute(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE); if (usedPlugins.containsKey(bundle)) fList.add(ipo); } Iterator<String> it = usedPlugins.keySet().iterator(); Stack<String> plugins = new Stack<>(); while (it.hasNext()) plugins.push(it.next().toString()); SubMonitor subMonitor = SubMonitor.convert(monitor, plugins.size()); while (!(plugins.isEmpty())) { String pluginId = plugins.pop(); IPluginModelBase base = PluginRegistry.findModel(pluginId); if (base == null) continue; IPluginImport[] imports = base.getPluginBase().getImports(); SubMonitor iterationMonitor = subMonitor.newChild(1).setWorkRemaining(imports.length); for (int j = 0; j < imports.length; j++) { if (imports[j].isReexported()) { String reExportedId = imports[j].getId(); Object pluginImport = usedPlugins.remove(imports[j].getId()); if (pluginImport != null) { fList.add(pluginImport); updateMonitor(iterationMonitor, fList.size()); } plugins.push(reExportedId); } iterationMonitor.worked(1); } } }
Source:
public void testAttachAfterKillingActive() throws Exception { int activeId = findActive(1).getAsInt(); int passiveId = findPassives(1)[0]; ActiveVoter activeVoter = new ActiveVoter("mvoter", new CompletableFuture<>(), Optional.empty(), getNode(1, activeId).getHostPort(), getNode(1, passiveId).getHostPort()); activeVoter.start(); startNode(1, 3); waitForDiagnostic(1, 3); assertThat(getUpcomingCluster("localhost", getNodePort(1, 3)).getNodeCount(), is(equalTo(1))); stopNode(1, activeId); waitForActive(1, passiveId); assertThat(configToolInvocation("attach", "-d", "localhost:" + getNodePort(1, passiveId), "-s", "localhost:" + getNodePort(1, 3)), is(successful())); Set<String> expectedRes = new HashSet<>(); expectedRes.add(getNode(1, activeId).getHostPort()); expectedRes.add(getNode(1, passiveId).getHostPort()); expectedRes.add(getNode(1, 3).getHostPort()); Thread.sleep(TOPOLOGY_FETCH_INTERVAL); assertThat(activeVoter.getExistingTopology(), is(expectedRes)); assertThat(activeVoter.getHeartbeatFutures().size(), is(3)); activeVoter.stop(); }

Target:
public void testAttachAfterKillingActive() throws Exception { ActiveVoter activeVoter = null; try { int activeId = findActive(1).getAsInt(); int passiveId = findPassives(1)[0]; activeVoter = new ActiveVoter("mvoter", new CompletableFuture<>(), Optional.empty(), getNode(1, activeId).getHostPort(), getNode(1, passiveId).getHostPort()); activeVoter.start(); startNode(1, 3); waitForDiagnostic(1, 3); assertThat(getUpcomingCluster("localhost", getNodePort(1, 3)).getNodeCount(), is(equalTo(1))); stopNode(1, activeId); waitForActive(1, passiveId); assertThat(configToolInvocation("attach", "-d", "localhost:" + getNodePort(1, passiveId), "-s", "localhost:" + getNodePort(1, 3)), is(successful())); Set<String> expectedRes = new HashSet<>(); expectedRes.add(getNode(1, activeId).getHostPort()); expectedRes.add(getNode(1, passiveId).getHostPort()); expectedRes.add(getNode(1, 3).getHostPort()); Thread.sleep(TOPOLOGY_FETCH_INTERVAL); assertThat(activeVoter.getExistingTopology(), is(expectedRes)); assertThat(activeVoter.getHeartbeatFutures().size(), is(3)); } finally { activeVoter.stop(); } }
Source:
private static void fillOperationResponses(Definition definition, org.restlet.ext.apispark.internal.model.Operation operation, Operation operationSwagger) { for (org.restlet.ext.apispark.internal.model.Response response : operation.getResponses()) { Response responseSwagger = new Response(); String message = response.getMessage(); String autoGeneratedMessage = Status.isSuccess(response.getCode()) ? "Success" : "Error " + response.getCode(); responseSwagger.setDescription(message == null ? autoGeneratedMessage : message); if (response.getOutputPayLoad() != null && response.getOutputPayLoad().getType() != null) { PayLoad entity = response.getOutputPayLoad(); final Representation representation = definition.getContract() .getRepresentation(entity.getType()); if (representation != null && representation.isRaw()) { FileProperty fileProperty = new FileProperty(); fileProperty .setDescription(representation.getDescription()); responseSwagger.setSchema(fileProperty); } else if (entity.isArray()) { ArrayProperty arrayProperty = new ArrayProperty(); arrayProperty .setItems(newPropertyForType(entity.getType())); responseSwagger.setSchema(arrayProperty); } else { responseSwagger.setSchema(newPropertyForType(entity .getType())); } } operationSwagger.addResponse(String.valueOf(response.getCode()), responseSwagger); } }

Target:
private static void fillOperationResponses(Definition definition, org.restlet.ext.apispark.internal.model.Operation operation, Operation operationSwagger) { for (org.restlet.ext.apispark.internal.model.Response response : operation.getResponses()) { Response responseSwagger = new Response(); String message = response.getMessage(); responseSwagger.setDescription(message == null ? ConversionUtils.generateResponseName(response.getCode()) : message); if (response.getOutputPayLoad() != null && response.getOutputPayLoad().getType() != null) { PayLoad entity = response.getOutputPayLoad(); final Representation representation = definition.getContract() .getRepresentation(entity.getType()); if (representation != null && representation.isRaw()) { FileProperty fileProperty = new FileProperty(); fileProperty .setDescription(representation.getDescription()); responseSwagger.setSchema(fileProperty); } else if (entity.isArray()) { ArrayProperty arrayProperty = new ArrayProperty(); arrayProperty .setItems(newPropertyForType(entity.getType())); responseSwagger.setSchema(arrayProperty); } else { responseSwagger.setSchema(newPropertyForType(entity .getType())); } } operationSwagger.addResponse(String.valueOf(response.getCode()), responseSwagger); } }
Source:
public Mono<Void> afterPostRunAsync(boolean isGroupFaulted) { return Mono.just(true) .map(aBoolean -> { postRunTasks = null; return aBoolean; }).then(); }

Target:
public Mono<Void> afterPostRunAsync(boolean isGroupFaulted) { postRunTasks = null; return Mono.empty(); }
Source:
private void taskComplete( HttpRemoteTaskRunnerWorkItem taskRunnerWorkItem, WorkerHolder workerHolder, TaskStatus taskStatus ) { Preconditions.checkArgument(!Thread.holdsLock(statusLock), "Current thread must not hold statusLock."); Preconditions.checkNotNull(taskRunnerWorkItem, "taskRunnerWorkItem"); Preconditions.checkNotNull(taskStatus, "taskStatus"); if (workerHolder != null) { log.info( "Worker[%s] completed task[%s] with status[%s]", workerHolder.getWorker().getHost(), taskStatus.getId(), taskStatus.getStatusCode() ); workerHolder.setLastCompletedTaskTime(DateTimes.nowUtc()); } taskRunnerWorkItem.setResult(taskStatus); TaskRunnerUtils.notifyStatusChanged(listeners, taskStatus.getId(), taskStatus); if (workerHolder != null) { blacklistWorkerIfNeeded(taskStatus, workerHolder); } synchronized (statusLock) { statusLock.notifyAll(); } }

Target:
private void taskComplete( HttpRemoteTaskRunnerWorkItem taskRunnerWorkItem, WorkerHolder workerHolder, TaskStatus taskStatus ) { Preconditions.checkState(!Thread.holdsLock(statusLock), "Current thread must not hold statusLock."); Preconditions.checkNotNull(taskRunnerWorkItem, "taskRunnerWorkItem"); Preconditions.checkNotNull(taskStatus, "taskStatus"); if (workerHolder != null) { log.info( "Worker[%s] completed task[%s] with status[%s]", workerHolder.getWorker().getHost(), taskStatus.getId(), taskStatus.getStatusCode() ); workerHolder.setLastCompletedTaskTime(DateTimes.nowUtc()); } taskRunnerWorkItem.setResult(taskStatus); TaskRunnerUtils.notifyStatusChanged(listeners, taskStatus.getId(), taskStatus); if (workerHolder != null) { blacklistWorkerIfNeeded(taskStatus, workerHolder); } synchronized (statusLock) { statusLock.notifyAll(); } }
Source:
private void setupBackgroundImage() { if (mode == 0) return; bgshape = bgblack; exif.setVisibility(View.GONE); if (!Utility.isLowRamDevice(mContext)) { switch (settings.getBackgroundMode()){ case Settings.BACKGROUND_BLACK: { bgshape = bgblack; break; } case Settings.BACKGROUND_GRADIENT: { bgshape = ContextCompat.getDrawable(mContext, R.drawable.background_gradient); break; } case Settings.BACKGROUND_IMAGE: { bgshape = loadBackgroundImage(); break; } case Settings.BACKGROUND_SLIDESHOW: { if (preloadBackgroundImage == null) { bgshape = loadBackgroundSlideshowImage(); } else { bgshape = new BitmapDrawable(mContext.getResources(), preloadBackgroundImage); setDominantColorFromBitmap(preloadBackgroundImage); } if (settings.background_exif) { exif.setVisibility(View.VISIBLE); try { exif.setText(getExifInformation()); } catch (Exception e) { exif.setText("Error reading exif information"); Log.e(TAG, "exception: ", e); } } break; } } } if ( settings.hideBackgroundImage && mode == 0 ) { background_images[background_image_active].setImageDrawable(bgblack); exif.setVisibility(View.GONE); } else { background_image_active = (background_image_active + 1) % 2; switch (settings.slideshowStyle) { case Settings.SLIDESHOW_STYLE_CENTER: background_images[background_image_active].setScaleType(ImageView.ScaleType.CENTER_INSIDE); break; case Settings.SLIDESHOW_STYLE_CROPPED: default: background_images[background_image_active].setScaleType(ImageView.ScaleType.CENTER_CROP); break; } background_images[background_image_active].setImageDrawable(bgshape); setupSlideshowAnimation(); } }

Target:
private void setupBackgroundImage() { if (mode == 0) return; bgshape = bgblack; exitTextView.setVisibility(View.GONE); if (!Utility.isLowRamDevice(mContext)) { switch (settings.getBackgroundMode()){ case Settings.BACKGROUND_BLACK: { bgshape = bgblack; break; } case Settings.BACKGROUND_GRADIENT: { bgshape = ContextCompat.getDrawable(mContext, R.drawable.background_gradient); break; } case Settings.BACKGROUND_IMAGE: { bgshape = loadBackgroundImage(); break; } case Settings.BACKGROUND_SLIDESHOW: { if (preloadBackgroundImage == null) { bgshape = loadBackgroundSlideshowImage(); } else { bgshape = new BitmapDrawable(mContext.getResources(), preloadBackgroundImage); setDominantColorFromBitmap(preloadBackgroundImage); } if (settings.background_exif) { exitTextView.setVisibility(View.VISIBLE); try { exitTextView.setText(getExifInformation()); } catch (Exception e) { exitTextView.setText(""); Log.e(TAG, "exception: ", e); } } break; } } } if ( settings.hideBackgroundImage && mode == 0 ) { background_images[background_image_active].setImageDrawable(bgblack); exitTextView.setVisibility(View.GONE); } else { background_image_active = (background_image_active + 1) % 2; switch (settings.slideshowStyle) { case Settings.SLIDESHOW_STYLE_CENTER: background_images[background_image_active].setScaleType(ImageView.ScaleType.CENTER_INSIDE); break; case Settings.SLIDESHOW_STYLE_CROPPED: default: background_images[background_image_active].setScaleType(ImageView.ScaleType.CENTER_CROP); break; } background_images[background_image_active].setImageDrawable(bgshape); setupSlideshowAnimation(); } }
Source:
public static GlusterBrick map(GlusterBrickEntity fromBrick, GlusterBrick toBrick) { GlusterBrick brick = (toBrick == null) ? new GlusterBrick() : toBrick; if(fromBrick.getId() != null) { brick.setId(fromBrick.getId().toString()); } if(fromBrick.getServerId() != null) { brick.setServerId(fromBrick.getServerId().toString()); } if(fromBrick.getBrickDirectory() != null) { brick.setBrickDir(fromBrick.getBrickDirectory()); } if(fromBrick.getStatus() != null) { brick.setState(fromBrick.getStatus().name().toLowerCase()); } if(fromBrick.getVolumeId() != null) { brick.setGlusterVolume(new GlusterVolume()); brick.getGlusterVolume().setId(fromBrick.getVolumeId().toString()); } return brick; }

Target:
public static GlusterBrick map(GlusterBrickEntity fromBrick, GlusterBrick toBrick) { GlusterBrick brick = (toBrick == null) ? new GlusterBrick() : toBrick; if(fromBrick.getId() != null) { brick.setId(fromBrick.getId().toString()); } if(fromBrick.getServerId() != null) { brick.setServerId(fromBrick.getServerId().toString()); } if(fromBrick.getBrickDirectory() != null) { brick.setBrickDir(fromBrick.getBrickDirectory()); } if(fromBrick.getStatus() != null) { brick.setState(map(fromBrick.getStatus(), null).toLowerCase()); } if(fromBrick.getVolumeId() != null) { brick.setGlusterVolume(new GlusterVolume()); brick.getGlusterVolume().setId(fromBrick.getVolumeId().toString()); } return brick; }
Source:
public List<String> getAllGatewayPublishedAPIArtifacts(String label) throws APIManagementException { List<String> gatewayRuntimeArtifactsArray = new ArrayList<>(); try (Connection connection = GatewayArtifactsMgtDBUtil.getArtifactSynchronizerConnection(); PreparedStatement statement = connection.prepareStatement(SQLConstants.GET_ALL_API_ARTIFACT)) { statement.setString(1, label); statement.setString(2, APIConstants.GatewayArtifactSynchronizer.GATEWAY_INSTRUCTION_PUBLISH); ResultSet rs = statement.executeQuery(); while (rs.next()) { try (InputStream inputStream = rs.getBinaryStream(1)) { String gatewayRuntimeArtifacts = IOUtils.toString(inputStream, APIConstants.DigestAuthConstants.CHARSET); gatewayRuntimeArtifactsArray.add(gatewayRuntimeArtifacts); } catch (IOException e) { handleException("Error in generating gatewayRuntimeArtifacts ", e); } } } catch (SQLException e) { handleException("Failed to get artifacts " , e); } return gatewayRuntimeArtifactsArray; }

Target:
public List<String> getAllGatewayPublishedAPIArtifacts(String label) throws APIManagementException { ResultSet rs =null; List<String> gatewayRuntimeArtifactsArray = new ArrayList<>(); try (Connection connection = GatewayArtifactsMgtDBUtil.getArtifactSynchronizerConnection(); PreparedStatement statement = connection.prepareStatement(SQLConstants.GET_ALL_API_ARTIFACT)) { connection.setAutoCommit(false); connection.commit(); statement.setString(1, label); statement.setString(2, APIConstants.GatewayArtifactSynchronizer.GATEWAY_INSTRUCTION_PUBLISH); rs = statement.executeQuery(); while (rs.next()) { try (InputStream inputStream = rs.getBinaryStream(1)) { String gatewayRuntimeArtifacts = IOUtils.toString(inputStream, APIConstants.DigestAuthConstants.CHARSET); gatewayRuntimeArtifactsArray.add(gatewayRuntimeArtifacts); } catch (IOException e) { handleException("Error in generating gatewayRuntimeArtifacts ", e); } } } catch (SQLException e) { handleException("Failed to get artifacts " , e); } finally { GatewayArtifactsMgtDBUtil.closeResultSet(rs); } return gatewayRuntimeArtifactsArray; }
Source:
private synchronized IntArrayList partitionPage(Page page, IntPredicate spillPartitionMask) { IntArrayList unspilledPositions = new IntArrayList(); for (int position = 0; position < page.getPositionCount(); position++) { int partition = partitionGenerator.getPartition(position, page); if (!spillPartitionMask.test(partition)) { unspilledPositions.add(position); continue; } spilledPartitions.add(partition); PageBuilder pageBuilder = pageBuilders[partition]; pageBuilder.declarePosition(); for (int channel = 0; channel < types.size(); channel++) { Type type = types.get(channel); type.appendTo(page.getBlock(channel), position, pageBuilder.getBlockBuilder(channel)); } } return unspilledPositions; }

Target:
private synchronized IntArrayList partitionPage(Page page, IntPredicate spillPartitionMask) { IntArrayList unspilledPositions = new IntArrayList(); for (int position = 0; position < page.getPositionCount(); position++) { int partition = partitionFunction.getPartition(page, position); if (!spillPartitionMask.test(partition)) { unspilledPositions.add(position); continue; } spilledPartitions.add(partition); PageBuilder pageBuilder = pageBuilders[partition]; pageBuilder.declarePosition(); for (int channel = 0; channel < types.size(); channel++) { Type type = types.get(channel); type.appendTo(page.getBlock(channel), position, pageBuilder.getBlockBuilder(channel)); } } return unspilledPositions; }
Source:
private boolean isInvalidJDBCConnection(IRepositoryNode repNode) { Property property = repNode.getObject().getProperty(); if (property != null && property.getItem() != null) { DatabaseConnectionItem connectionItem = (DatabaseConnectionItem) property.getItem(); if (connectionItem != null) { DatabaseConnection connection = (DatabaseConnection) connectionItem.getConnection(); String databaseType = connection.getDatabaseType(); if ((ConnectionUtils.isTcompJdbc(databaseType) || databaseType .equalsIgnoreCase(SupportDBUrlType.GENERICJDBCDEFAULTURL.getDBKey())) && (StringUtils.isBlank(connection.getDriverJarPath()))) { return true; } } } return false; }

Target:
private boolean isInvalidJDBCConnection(IRepositoryNode repNode) { Property property = repNode.getObject().getProperty(); if (property != null && property.getItem() != null) { DatabaseConnectionItem connectionItem = (DatabaseConnectionItem) property.getItem(); if (connectionItem != null) { DatabaseConnection connection = (DatabaseConnection) connectionItem.getConnection(); String databaseType = connection.getDatabaseType(); if ((ConnectionUtils.isTcompJdbc(databaseType) || SupportDBUrlType.GENERICJDBCDEFAULTURL .getDBKey() .equalsIgnoreCase(databaseType)) && StringUtils.isBlank(connection.getDriverJarPath())) { return true; } } } return false; }
Source:
public void testOptimizedCreateStandardSyncTasksWithTransient() { List<TreeResponse> treeResponses = Arrays.asList(treeResponse(addr1, range1, "same", range2, "same", range3, "same"), treeResponse(addr2, range1, "different", range2, "same", range3, "different"), treeResponse(addr3, range1, "same", range2, "same", range3, "same")); RepairJobDesc desc = new RepairJobDesc(UUID.randomUUID(), UUID.randomUUID(), "ks", "cf", Arrays.asList()); Map<SyncNodePair, SyncTask> tasks = toMap(RepairJob.createOptimisedSyncingSyncTasks(desc, treeResponses, addr1, ep -> ep.equals(addr3), addr -> "DC1", false, PreviewKind.ALL)); assertEquals(3, tasks.size()); SyncTask task = tasks.get(pair(addr1, addr2)); assertTrue(task.isLocal()); assertElementEquals(Arrays.asList(range1, range3), task.rangesToSync); assertTrue(((LocalSyncTask)task).requestRanges); assertFalse(((LocalSyncTask)task).transferRanges); task = tasks.get(pair(addr2, addr1)); assertFalse(task.isLocal()); assertElementEquals(Arrays.asList(range3), task.rangesToSync); task = tasks.get(pair(addr2, addr3)); assertFalse(task.isLocal()); assertElementEquals(Arrays.asList(range1), task.rangesToSync); }

Target:
public void testOptimizedCreateStandardSyncTasksWithTransient() { List<TreeResponse> treeResponses = Arrays.asList(treeResponse(addr1, range1, "same", range2, "same", range3, "same"), treeResponse(addr2, range1, "different", range2, "same", range3, "different"), treeResponse(addr3, range1, "same", range2, "same", range3, "same")); RepairJobDesc desc = new RepairJobDesc(UUID.randomUUID(), UUID.randomUUID(), "ks", "cf", Arrays.asList()); Map<SyncNodePair, SyncTask> tasks = toMap(RepairJob.createOptimisedSyncingSyncTasks(desc, treeResponses, addr1, ep -> ep.equals(addr3), addr -> "DC1", false, PreviewKind.ALL)); assertEquals(3, tasks.size()); SyncTask task = tasks.get(pair(addr1, addr2)); assertTrue(task.isLocal()); assertElementEquals(Arrays.asList(range1, range3), task.rangesToSync); assertTrue(((LocalSyncTask)task).requestRanges); assertFalse(((LocalSyncTask)task).transferRanges); assertStreamRangeFromEither(tasks, Arrays.asList(range3), addr2, addr1, addr3); task = tasks.get(pair(addr2, addr3)); assertFalse(task.isLocal()); assertElementEquals(Arrays.asList(range1), task.rangesToSync); }
Source:
public Integer getPageSize() { return pageSize; }

Target:
public Integer getPageSize() { return this.pageSize; }
Source:
public boolean removePermission(String permissionId) { if (permissionId == null) { throw new IllegalArgumentException("permissionId is null"); } if (this.permissions != null) { Iterator<PermissionBlueprintDTO> iterator = this.permissions.iterator(); while (iterator.hasNext()) { PermissionBlueprintDTO existing = iterator.next(); if (permissionId.equals(existing.getId())) { iterator.remove(); } } } return false; }

Target:
public boolean removePermission(String permissionId) { if (permissionId == null) { throw new IllegalArgumentException("permissionId is null"); } boolean removed = false; if (this.permissions != null) { Iterator<PermissionBlueprintDTO> iterator = this.permissions.iterator(); while (iterator.hasNext()) { PermissionBlueprintDTO existing = iterator.next(); if (permissionId.equals(existing.getId())) { iterator.remove(); removed = true; } } } return removed; }
Source:
public java.util.Iterator<Cache.Entry<K, V>> iterator() { checkClosed(); final java.util.Iterator<org.ehcache.Cache.Entry<K, V>> specIterator = jsr107Cache.specIterator(); return new java.util.Iterator<Entry<K, V>>() { @Override public boolean hasNext() { checkClosed(); return specIterator.hasNext(); } @Override public Entry<K, V> next() { checkClosed(); return new WrappedEhcacheEntry<K, V>(specIterator.next()); } @Override public void remove() { checkClosed(); specIterator.remove(); } }; }

Target:
public Iterator<Entry<K, V>> iterator() { checkClosed(); final Iterator<org.ehcache.Cache.Entry<K, V>> specIterator = jsr107Cache.specIterator(); return new Iterator<Entry<K, V>>() { @Override public boolean hasNext() { checkClosed(); return specIterator.hasNext(); } @Override public Entry<K, V> next() { checkClosed(); org.ehcache.Cache.Entry<K, V> next = specIterator.next(); return next == null ? null : new WrappedEhcacheEntry<K, V>(next); } @Override public void remove() { checkClosed(); specIterator.remove(); } }; }
Source:
private void generateResourceDeletionActivity(@NotNull VirtualFileEvent virtualFileEvent) { assert enabled : "the before file deletion listener was triggered while it was disabled"; VirtualFile deletedVirtualFile = virtualFileEvent.getFile(); if (LOG.isTraceEnabled()) { LOG.trace("Reacting before resource deletion: " + deletedVirtualFile); } SPath path = VirtualFileConverter.convertToSPath(project, deletedVirtualFile); IResource resource = intelliJReferencePointManager.getSarosResource( path.getReferencePoint(), path.getProjectRelativePath()); IFile file = resource.adaptTo(IntelliJFileImpl.class); if (path == null || !session.isShared(file)) { if (LOG.isTraceEnabled()) { LOG.trace("Ignoring non-shared resource deletion: " + deletedVirtualFile); } return; } User user = session.getLocalUser(); IActivity activity; if (deletedVirtualFile.isDirectory()) { activity = new FolderDeletedActivity(user, path); } else { activity = new FileActivity( user, Type.REMOVED, FileActivity.Purpose.ACTIVITY, path, null, null, null); editorManager.removeAllEditorsForPath(path); annotationManager.removeAnnotations(file); } dispatchActivity(activity); }

Target:
private void generateResourceDeletionActivity(@NotNull VirtualFileEvent virtualFileEvent) { assert enabled : "the before file deletion listener was triggered while it was disabled"; VirtualFile deletedVirtualFile = virtualFileEvent.getFile(); if (LOG.isTraceEnabled()) { LOG.trace("Reacting before resource deletion: " + deletedVirtualFile); } SPath path = VirtualFileConverter.convertToSPath(project, deletedVirtualFile); IResource resource = intelliJReferencePointManager.getSarosResource( path.getReferencePoint(), path.getProjectRelativePath()); if (path == null || !session.isShared(resource)) { if (LOG.isTraceEnabled()) { LOG.trace("Ignoring non-shared resource deletion: " + deletedVirtualFile); } return; } User user = session.getLocalUser(); IActivity activity; if (deletedVirtualFile.isDirectory()) { activity = new FolderDeletedActivity(user, path); } else { activity = new FileActivity( user, Type.REMOVED, FileActivity.Purpose.ACTIVITY, path, null, null, null); editorManager.removeAllEditorsForPath(path); IFile file = resource.adaptTo(IntelliJFileImpl.class); annotationManager.removeAnnotations(file); } dispatchActivity(activity); }
Source:
private PopupMenuExportContextURLs getPopupContextTreeMenuExportUrls() { if (popupContextTreeMenuExportUrls == null) { popupContextTreeMenuExportUrls = new PopupMenuExportContextURLs( Constant.messages.getString("context.export.urls.menu")) { private static final long serialVersionUID = 1L; @Override public boolean isEnableForComponent(Component invoker) { return invoker.getName().equals(SiteMapPanel.CONTEXT_TREE_COMPONENT_NAME); } }; popupContextTreeMenuExportUrls.setExtension( (ExtensionHistory) Control.getSingleton().getExtensionLoader().getExtension(ExtensionHistory.NAME)); } return popupContextTreeMenuExportUrls; }

Target:
private PopupMenuExportContextURLs getPopupContextTreeMenuExportUrls() { if (popupContextTreeMenuExportUrls == null) { popupContextTreeMenuExportUrls = new PopupMenuExportContextURLs( Constant.messages.getString("context.export.urls.menu")); popupContextTreeMenuExportUrls.setExtension( Control.getSingleton().getExtensionLoader().getExtension(ExtensionHistory.class)); } return popupContextTreeMenuExportUrls; }
Source:
public APIResult unregisterExtension(String extensionName) { try { return localExtensionManager.unRegisterExtension(extensionName); } catch (FalconException e) { throw new FalconCLIException("Failed in unRegistering the exnteison"+ e.getMessage()); } }

Target:
public APIResult unregisterExtension(String extensionName) { try { return localExtensionManager.unRegisterExtension(extensionName); } catch (FalconException e) { throw new FalconCLIException("Failed in unRegistering the extension"+ e.getMessage()); } }
Source:
public void waitForAssertShouldRunAfterLastCall_whenAssertionFails() { Runnable allwaysFailAssertion = mock(Runnable.class); doAnswer(invocation -> { throw new AssertionError(); }).when(allwaysFailAssertion).run(); Runnable afterLastCall = mock(Runnable.class); try { javaTest.waitForAssert(allwaysFailAssertion, null, afterLastCall, 10, 5); fail("NPE from mock is expected during last execution."); } catch (AssertionError e) { } verify(afterLastCall, times(1)).run(); }

Target:
public void waitForAssertShouldRunAfterLastCall_whenAssertionFails() { Runnable afterLastCall = mock(Runnable.class); try { javaTest.waitForAssert(() -> assertTrue(false), null, afterLastCall, 1000, 50); } catch (final AssertionError ex) { } verify(afterLastCall, times(1)).run(); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GetClientDefaultsAnswer that = (GetClientDefaultsAnswer) o; if (_apiRetryCount != null ? !_apiRetryCount.equals(that._apiRetryCount) : that._apiRetryCount != null) return false; if (_apiRetryInterval != null ? !_apiRetryInterval.equals(that._apiRetryInterval) : that._apiRetryInterval != null) return false; if (_currentApiVersion != null ? !_currentApiVersion.equals(that._currentApiVersion) : that._currentApiVersion != null) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof GetClientDefaultsAnswer)) return false; if (!super.equals(o)) return false; GetClientDefaultsAnswer that = (GetClientDefaultsAnswer) o; if (_apiRetryCount != null ? !_apiRetryCount.equals(that._apiRetryCount) : that._apiRetryCount != null) return false; if (_apiRetryInterval != null ? !_apiRetryInterval.equals(that._apiRetryInterval) : that._apiRetryInterval != null) return false; if (_currentApiVersion != null ? !_currentApiVersion.equals(that._currentApiVersion) : that._currentApiVersion != null) return false; return true; }
Source:
public void doPostCleanup(BibEntry entry) { new FieldFormatterCleanup(StandardField.ABSTRACT, new RemoveNewlinesFormatter()).cleanup(entry); new FieldFormatterCleanup(StandardField.ABSTRACT, new ReplaceTabsBySpaceFormater()).cleanup(entry); new FieldFormatterCleanup(StandardField.ABSTRACT, new RemoveRedundantSpacesFormatter()).cleanup(entry); new FieldFormatterCleanup(StandardField.EDITOR, new RemoveDigitsFormatter()).cleanup(entry); UnknownField identifierField = new UnknownField("identifier"); entry.getField(identifierField) .stream() .flatMap(value -> Arrays.stream(value.split("; "))) .forEach(identifierKeyValue -> { String[] identifierKeyValueSplit = identifierKeyValue.split(" "); if (identifierKeyValueSplit.length == 1) { identifierKeyValueSplit = identifierKeyValue.split(":"); } int length = identifierKeyValueSplit.length; if (length < 2) { return; } String key = identifierKeyValueSplit[length - 2]; String value = identifierKeyValueSplit[length - 1]; entry.setField(FieldFactory.parseField(key), value); }); entry.clearField(identifierField); }

Target:
public void doPostCleanup(BibEntry entry) { new FieldFormatterCleanup(StandardField.ABSTRACT, new RemoveNewlinesFormatter()).cleanup(entry); new FieldFormatterCleanup(StandardField.ABSTRACT, new ReplaceTabsBySpaceFormater()).cleanup(entry); new FieldFormatterCleanup(StandardField.ABSTRACT, new RemoveRedundantSpacesFormatter()).cleanup(entry); new FieldFormatterCleanup(StandardField.EDITOR, new RemoveDigitsFormatter()).cleanup(entry); UnknownField identifierField = new UnknownField("identifier"); entry.getField(identifierField) .stream() .flatMap(value -> Arrays.stream(value.split("; "))) .forEach(identifierKeyValue -> { String[] identifierKeyValueSplit = identifierKeyValue.split(" "); if (identifierKeyValueSplit.length == 1) { identifierKeyValueSplit = identifierKeyValue.split(":"); } int length = identifierKeyValueSplit.length; if (length < 2) { return; } String key = identifierKeyValueSplit[length - 2]; String value = identifierKeyValueSplit[length - 1]; Field field = FieldFactory.parseField(key); if (!entry.hasField(field)) { entry.setField(field, value); } }); entry.clearField(identifierField); }
Source:
public WindowFunctionSupplier getWindowFunctionImplementation(Signature signature) { try { return operatorNamespace.getWindowFunctionImplementation(signature); } catch (PrestoException e) { } if (!signature.getCatalog().isPresent() || !signature.getSchema().isPresent()) { throw new PrestoException(NOT_FOUND, format("Signature %s does not have both catalog and schema set for resolution", signature)); } return functionNamespaces.get(signature.getCatalog().get()).getWindowFunctionImplementation(signature); }

Target:
public WindowFunctionSupplier getWindowFunctionImplementation(Signature signature) { return globalFunctionNamespace.getWindowFunctionImplementation(signature); }
Source:
public Range<Double> getScanningRange() { return null; }

Target:
public Range<Double> getScanningRange() { Range<Double> scanRange = null; try { scanRange = Range.closed(Double.valueOf(getCVValue(MzMLCV.cvScanWindowLowerLimit)), Double.valueOf(getCVValue(MzMLCV.cvScanWindowUpperLimit))); } catch (Exception e) { e.printStackTrace(); } if (scanRange == null) getMzRange(); return scanRange; }
Source:
public void unmarshallWithValidationError() throws Exception { tested = spy(new DiagramMarshaller() { @Override public Graph unmarshall(Metadata metadata, InputStream input) throws IOException { throw new RuntimeException(MESSAGE); } @Override public String marshall(Diagram diagram) throws IOException { return null; } @Override public DiagramMetadataMarshaller getMetadataMarshaller() { return null; } }); final MarshallingResponse response = tested.unmarshallWithValidation(request); verify(tested).unmarshall(metadata, input); assertFalse(response.getResult().isPresent()); assertEquals(response.getState(), MarshallingResponse.State.ERROR); assertEquals(response.getMessages().size(), 1); final MarshallingMessage marshallingMessage = (MarshallingMessage) response.getMessages().stream().findFirst().get(); assertEquals(marshallingMessage.getMessage(), MESSAGE); }

Target:
public void unmarshallWithValidationError() throws Exception { tested = spy(new DiagramMarshaller() { @Override public Graph unmarshall(Metadata metadata, InputStream input) { throw new RuntimeException(MESSAGE); } @Override public String marshall(Diagram diagram) { return null; } @Override public DiagramMetadataMarshaller getMetadataMarshaller() { return null; } }); final MarshallingResponse response = tested.unmarshallWithValidation(request); verify(tested).unmarshall(metadata, input); assertFalse(response.getResult().isPresent()); assertEquals(response.getState(), MarshallingResponse.State.ERROR); assertEquals(response.getMessages().size(), 1); final MarshallingMessage marshallingMessage = (MarshallingMessage) response.getMessages().stream().findFirst().get(); assertEquals(marshallingMessage.getMessage(), MESSAGE); }
Source:
public boolean isShareable(Class<?> entityClass) { return entityHasChecksForPermission( entityClass, SharePermission.class ) && getAnnotation(entityClass, SharePermission.class).sharable(); }

Target:
public boolean isShareable(Class<?> entityClass) { return getAnnotation(entityClass, SharePermission.class) != null && getAnnotation(entityClass, SharePermission.class).sharable(); }
Source:
private void createLauncher(Properties properties) { if (group.equals("spark")) { if (properties.getProperty("master") != null && properties.getProperty("master").startsWith("k8s")) { this.launcher = new SparkK8InterpreterLauncher(this.conf); } else { this.launcher = new SparkInterpreterLauncher(this.conf); } } else { this.launcher = new ShellScriptLauncher(this.conf); } }

Target:
private void createLauncher(Properties properties) { if (group.equals("spark")) { String deployMode = properties.getProperty("spark.submit.deployMode"); String masterUrl = properties.getProperty("master"); if (deployMode != null && deployMode.equals("cluster") && masterUrl != null && masterUrl.startsWith("k8s://")) { this.launcher = new SparkK8SInterpreterLauncher(this.conf, this.recoveryStorage); } else { this.launcher = new SparkInterpreterLauncher(this.conf, this.recoveryStorage); } } else { this.launcher = new ShellScriptLauncher(this.conf, this.recoveryStorage); } }
Source:
public static void incrementAttributeLong(ITmfStateSystemBuilder ssb, long t, int attributeQuark, long increment) { @Nullable Object stateValue = ssb.queryOngoing(attributeQuark); long prevValue = 0; if (stateValue != null && stateValue instanceof Long) { prevValue = (long) stateValue; } ssb.modifyAttribute(t, prevValue + increment, attributeQuark); }

Target:
public static void incrementAttributeLong(ITmfStateSystemBuilder ssb, long t, int attributeQuark, long increment) { Object stateValue = ssb.queryOngoing(attributeQuark); long prevValue = 0; if (stateValue != null && stateValue instanceof Long) { prevValue = (long) stateValue; } ssb.modifyAttribute(t, prevValue + increment, attributeQuark); }
Source:
public TrustManagerFactory getTrustMgr(String serverName) { try { KeyStore trustStore = trustMgrMap.get(serverName); if (trustStore != null) { TrustManagerFactory fact = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); fact.init(trustStore); return fact; } return null; } catch (NoSuchAlgorithmException | KeyStoreException e) { throw new RuntimeException(e); } }

Target:
public TrustManagerFactory getTrustMgr(String serverName) { return trustMgrMap.get(serverName); }
Source:
public void testSupportsTextAttribute() { assertTrue("Should return true for supported token typs", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.IDENT))); assertTrue("Should return true for supported token typs", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.NUM_INT))); assertTrue("Should return true for supported token typs", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.STRING_LITERAL))); assertTrue("Should return true for supported token typs", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.CHAR_LITERAL))); assertTrue("Should return true for supported token typs", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.NUM_DOUBLE))); assertFalse("Should return false for unsupported token typs", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.VARIABLE_DEF))); assertFalse("Should return false for unsupported token typs", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.OBJBLOCK))); assertFalse("Should return true for supported token typs", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.LITERAL_CHAR))); }

Target:
public void testSupportsTextAttribute() { assertTrue("Should return true for supported token types", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.IDENT))); assertTrue("Should return true for supported token types", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.NUM_INT))); assertTrue("Should return true for supported token types", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.STRING_LITERAL))); assertTrue("Should return true for supported token types", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.CHAR_LITERAL))); assertTrue("Should return true for supported token types", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.NUM_DOUBLE))); assertFalse("Should return false for unsupported token types", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.VARIABLE_DEF))); assertFalse("Should return false for unsupported token types", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.OBJBLOCK))); assertFalse("Should return true for supported token types", XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.LITERAL_CHAR))); }
Source:
public ArrayList<String> getRecentSearches() { Object object = getProperty(RECENT_SEARCHES_KEY); if (object instanceof JSONArray) { JSONArray recents = (JSONArray) object; if (recents == null) { recents = new JSONArray(); } ArrayList<String> recentsList = new ArrayList<>(recents.length()); for (int i = 0; i < recents.length(); i++) { String recent = recents.optString(i); if (!recent.isEmpty()) { recentsList.add(recent); } } return recentsList; } else { return new ArrayList<>(); } }

Target:
public ArrayList<String> getRecentSearches() { Object object = getProperty(RECENT_SEARCHES_KEY); if (object instanceof JSONArray) { JSONArray recents = (JSONArray) object; ArrayList<String> recentsList = new ArrayList<>(recents.length()); for (int i = 0; i < recents.length(); i++) { String recent = recents.optString(i); if (!recent.isEmpty()) { recentsList.add(recent); } } return recentsList; } else { return new ArrayList<>(); } }
Source:
private ValidationResult validateRangesSyntax(List<String[]> rangesBoundaries) { for (String[] rangeBoundaries : rangesBoundaries) { for (String rangeBoundary : rangeBoundaries) { ValidationResult startPartValidation = validateRangePart(rangeBoundary); if (!startPartValidation.isOk()) { return startPartValidation; } } long from = MacAddressRangeUtils.macToLong(rangeBoundaries[0]); long to = MacAddressRangeUtils.macToLong(rangeBoundaries[1]); if (from > to) { return new ValidationResult(false, String.format("The entered range is invalid. " + "Range should be specified as " + "<lowerBoundMAC>"+ MacAddressRangeUtils.BOUNDARIES_DELIMITER +"<upperBoundMAC>." + " Did you mean %s?", MacAddressRangeUtils.boundariesToRangeString(from, to), MacAddressRangeUtils.boundariesToRangeString(to, from))); } } return new ValidationResult(true); }

Target:
private ValidationResult validateRangesSyntax(List<String[]> rangesBoundaries) { for (String[] rangeBoundaries : rangesBoundaries) { for (String rangeBoundary : rangeBoundaries) { ValidationResult startPartValidation = validateRangePart(rangeBoundary); if (!startPartValidation.isOk()) { return startPartValidation; } } long from = MacAddressRangeUtils.macToLong(rangeBoundaries[0]); long to = MacAddressRangeUtils.macToLong(rangeBoundaries[1]); if (from > to) { return new ValidationResult(false, String.format("The entered range is invalid. " + "Range should be specified as " + "<lowerBoundMAC>"+ MacAddressRangeUtils.BOUNDARIES_DELIMITER +"<upperBoundMAC>." + " Did you mean %s?", MacAddressRangeUtils.boundariesToRangeString(to, from))); } } return new ValidationResult(true); }
Source:
public static boolean containsTerminalInstallerWithoutExec(List<String> installers) { return new InstallerFqn("org.eclipse.che.terminal").in(installers) && !(new InstallerFqn("org.eclipse.che.exec").in(installers)); }

Target:
private static boolean containsTerminalInstallerWithoutExec(List<String> installers) { return InstallerFqn.idInKeyList("org.eclipse.che.terminal", installers) && !(InstallerFqn.idInKeyList("org.eclipse.che.exec", installers)); }
Source:
public Long execute(Context context) { KieSession ksession = ((RegistryContext) context).lookup(KieSession.class); ProcessInstance processInstance = ksession.getProcessInstance(processInstanceId); if (processInstance == null) { throw new ProcessInstanceNotFoundException("No process instance found with id " + processInstanceId); } DynamicNodeInstance dynamicContext = (DynamicNodeInstance) ((WorkflowProcessInstanceImpl) processInstance).getNodeInstances(true).stream() .filter(ni -> (ni instanceof DynamicNodeInstance) && stageId.equals(ni.getNode().getMetaData().get("UniqueId"))) .findFirst() .orElse(null); if (dynamicContext == null) { throw new StageNotFoundException("No stage found with id " + stageId); } CaseEventSupport caseEventSupport = getCaseEventSupport(context); caseEventSupport.fireBeforeDynamicProcessAdded(caseId, processInstanceId, processId, parameters); long subProcessInstanceId = DynamicUtils.addDynamicSubProcess(dynamicContext, ksession, processId, parameters); if (subProcessInstanceId < 0) { throw new ProcessDefinitionNotFoundException("No process definition found with id: " + processId); } caseEventSupport.fireAfterDynamicProcessAdded(caseId, processInstanceId, processId, parameters, subProcessInstanceId); return subProcessInstanceId; }

Target:
public Long execute(Context context) { KieSession ksession = ((RegistryContext) context).lookup(KieSession.class); ProcessInstance processInstance = ksession.getProcessInstance(processInstanceId); if (processInstance == null) { throw new ProcessInstanceNotFoundException("No process instance found with id " + processInstanceId); } DynamicNodeInstance dynamicContext = (DynamicNodeInstance) ((WorkflowProcessInstanceImpl) processInstance).getNodeInstances(true).stream() .filter(ni -> (ni instanceof DynamicNodeInstance) && stageId.equals(ni.getNode().getMetaData().get("UniqueId"))) .findFirst() .orElse(null); if (dynamicContext == null) { throw new StageNotFoundException("No stage found with id " + stageId); } try { CaseEventSupport caseEventSupport = getCaseEventSupport(context); caseEventSupport.fireBeforeDynamicProcessAdded(caseId, processInstanceId, processId, parameters); long subProcessInstanceId = DynamicUtils.addDynamicSubProcess(dynamicContext, ksession, processId, parameters); if (subProcessInstanceId < 0) { throw new ProcessDefinitionNotFoundException("No process definition found with id: " + processId); } caseEventSupport.fireAfterDynamicProcessAdded(caseId, processInstanceId, processId, parameters, subProcessInstanceId); return subProcessInstanceId; } catch (IllegalArgumentException e) { throw new ProcessDefinitionNotFoundException(e.getMessage()); } }
Source:
@Test public void concurrentLazyAccess() throws Exception { final List<Future<Integer>> futures = new ArrayList<Future<Integer>>(); final ObjectGraph graph = ObjectGraph.create(new LatchingModule(latch)); final LazyEntryPoint lep = graph.get(LazyEntryPoint.class); for (int i = 0 ; i < PERCALE ; i++) { futures.add(es.submit(new Callable<Integer>() { @Override public Integer call() { latch.countDown(); return lep.lazy.get(); } })); } latch.countDown(); for (Future<Integer> future : futures) { assertThat(future.get(1, TimeUnit.SECONDS)) .overridingErrorMessage("Lock failure - count should never increment") .isEqualTo(0); } }

Target:
@Test public void concurrentLazyAccess() throws Exception { final List<Future<Integer>> futures = new ArrayList<Future<Integer>>(); final ObjectGraph graph = ObjectGraph.create(new LatchingModule(latch)); final LazyEntryPoint lep = graph.get(LazyEntryPoint.class); for (int i = 0; i < THREAD_COUNT; i++) { futures.add(es.submit(new Callable<Integer>() { @Override public Integer call() { latch.countDown(); return lep.lazy.get(); } })); } latch.countDown(); for (Future<Integer> future : futures) { assertThat(future.get(1, TimeUnit.SECONDS)) .overridingErrorMessage("Lock failure - count should never increment") .isEqualTo(0); } }
Source:
protected void modified(Map<String, Object> config) { if (config != null) { this.keyword = config.containsKey("keyword") ? config.get("keyword").toString() : "Wakeup"; this.defaultSource = config.containsKey("defaultSource") ? config.get("defaultSource").toString() : null; this.defaultSink = config.containsKey("defaultSink") ? config.get("defaultSink").toString() : null; this.defaultTTS = config.containsKey("defaultTTS") ? config.get("defaultTTS").toString() : null; this.defaultSTT = config.containsKey("defaultSTT") ? config.get("defaultSTT").toString() : null; this.defaultKS = config.containsKey("defaultKS") ? config.get("defaultKS").toString() : null; this.defaultHLI = config.containsKey("defaultHLI") ? config.get("defaultHLI").toString() : null; for (String key : config.keySet()) { if (key.startsWith("defaultVoice.")) { String tts = key.substring("defaultVoice.".length()); defaultVoices.put(tts, config.get(key).toString()); } } } }

Target:
protected void modified(Map<String, Object> config) { if (config != null) { this.keyword = config.containsKey(CONFIG_KEYWORD) ? config.get(CONFIG_KEYWORD).toString() : DEFAULT_KEYWORD; this.defaultSource = config.containsKey(CONFIG_DEFAULT_SOURCE) ? config.get(CONFIG_DEFAULT_SOURCE).toString() : null; this.defaultSink = config.containsKey(CONFIG_DEFAULT_SINK) ? config.get(CONFIG_DEFAULT_SINK).toString() : null; this.defaultTTS = config.containsKey(CONFIG_DEFAULT_TTS) ? config.get(CONFIG_DEFAULT_TTS).toString() : null; this.defaultSTT = config.containsKey(CONFIG_DEFAULT_STT) ? config.get(CONFIG_DEFAULT_STT).toString() : null; this.defaultKS = config.containsKey(CONFIG_DEFAULT_KS) ? config.get(CONFIG_DEFAULT_KS).toString() : null; this.defaultHLI = config.containsKey(CONFIG_DEFAULT_HLI) ? config.get(CONFIG_DEFAULT_HLI).toString() : null; for (String key : config.keySet()) { if (key.startsWith(CONFIG_PREFIX_DEFAULT_VOICE)) { String tts = key.substring(CONFIG_PREFIX_DEFAULT_VOICE.length()); defaultVoices.put(tts, config.get(key).toString()); } } } }
Source:
public boolean equals(Object obj) { if (obj == null || obj.getClass() != getClass()) { return false; } final Attribute attribute = (Attribute) obj; return CompareUtils.areEqual(key, attribute.getKey()) && CompareUtils.areEqual(value, attribute.getValue()); }

Target:
public boolean equals(Object obj) { if (obj instanceof Attribute) { final Attribute attribute = (Attribute) obj; return CompareUtils.areEqual(key, attribute.getKey()) && CompareUtils.areEqual(value, attribute.getValue()); } return false; }
Source:
public static Set<String> getBrokers(Set<String> zkHost){ ZkClient zkclient = new ZkClient(StringUtils.join(zkHost, ',') ,30000, 30000, ZKStringSerializer$.MODULE$); Set<String> brokerHosts = new HashSet<String>(); for (Broker b : JavaConversions.asJavaIterable(ZkUtils.getAllBrokersInCluster(zkclient))) { brokerHosts.add(b.connectionString()); } zkclient.close(); return brokerHosts; }

Target:
public static Set<String> getBrokers(Set<String> zkHost){ ZkClient zkclient = new ZkClient(zkHost.iterator().next(), 30000, 30000, ZKStringSerializer$.MODULE$); Set<String> brokerHosts = new HashSet<String>(); for (Broker b : JavaConversions.asJavaIterable(ZkUtils.getAllBrokersInCluster(zkclient))) { brokerHosts.add(b.connectionString()); } zkclient.close(); return brokerHosts; }