auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testHandleTransitionValidation__AssigneesUpdate() throws OseeCoreException { AtsTestUtil.cleanupAndReset("TransitionManagerTest-E"); <START> TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf(); <END> List<IAtsUser> assigneesBefore = teamArt.getAssignees(); MockTransitionHelper helper = new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt), AtsTestUtil.getImplementStateDef().getName(), teamArt.getTransitionAssignees(), null, TransitionOption.None); TransitionManager transMgr = new TransitionManager(helper); TransitionResults results = new TransitionResults(); TransitionResults results01 = new TransitionResults(); transMgr.handleTransitionValidation(results); Assert.assertTrue(results.isEmpty()); results01 = transMgr.handleAll(); transMgr.getTransaction().execute(); Assert.assertTrue(results01.isEmpty()); List<IAtsUser> assigneesAfter = teamArt.getAssignees(); Assert.assertTrue(assigneesAfter.containsAll(assigneesBefore)); Assert.assertTrue(assigneesBefore.containsAll(assigneesAfter)); }</code><technical_language>want Assert assignees</technical_language>

Target:
public void testHandleTransitionValidation__AssigneesUpdate() throws OseeCoreException { AtsTestUtil.cleanupAndReset("TransitionManagerTest-E"); TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf(); List<IAtsUser> assigneesBefore = teamArt.getAssignees(); Assert.assertTrue(assigneesBefore.size() > 0); MockTransitionHelper helper = new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt), AtsTestUtil.getImplementStateDef().getName(), teamArt.getAssignees(), null, TransitionOption.None); TransitionManager transMgr = new TransitionManager(helper); TransitionResults results = new TransitionResults(); TransitionResults results01 = new TransitionResults(); transMgr.handleTransitionValidation(results); Assert.assertTrue(results.isEmpty()); results01 = transMgr.handleAll(); transMgr.getTransaction().execute(); Assert.assertTrue(results01.isEmpty()); List<IAtsUser> assigneesAfter = teamArt.getAssignees(); Assert.assertTrue(assigneesAfter.containsAll(assigneesBefore)); Assert.assertTrue(assigneesBefore.containsAll(assigneesAfter)); }
Source:
<code>public Observable<Cursor> createObservable() { <START> try { <END> throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return storIOContentResolver .observeChangesOfUri(query.uri()) .map(MapSomethingToExecuteAsBlocking.newInstance(this)) .startWith(Observable.create(OnSubscribeExecuteAsBlocking.newInstance(this))) .subscribeOn(Schedulers.io()); } catch (Throwable throwable) { throw new StorIOException(throwable); } }</code><technical_language>need in try/catch here</technical_language>

Target:
public Observable<Cursor> createObservable() { throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return storIOContentResolver .observeChangesOfUri(query.uri()) .map(MapSomethingToExecuteAsBlocking.newInstance(this)) .startWith(Observable.create(OnSubscribeExecuteAsBlocking.newInstance(this))) .subscribeOn(Schedulers.io()); }
Source:
<code>private DeploymentProvider getDeploymentProvider() throws DeploymentEnvironmentException { String platform = System.getenv(ENV_DEPLOYMENT_PLATFORM); if (platform == null || platform.equals("")) { throw new DeploymentEnvironmentException("Unable to identify the deployment platform."); } <START> if (platform.equalsIgnoreCase(DEPLOYMENT_KUBERNETES)) { <END> return new KubernetesDeploymentProvider(); } else { throw new DeploymentEnvironmentException("Unsupported deployment platform: " + platform); } }</code><technical_language>this checked in other avoid NPEs</technical_language>

Target:
private DeploymentProvider getDeploymentProvider() throws DeploymentEnvironmentException { String platform = System.getenv(ENV_DEPLOYMENT_PLATFORM); if (platform == null || platform.isEmpty()) { throw new DeploymentEnvironmentException("Unable to identify the deployment platform."); } if (DEPLOYMENT_KUBERNETES.equalsIgnoreCase(platform)) { return new KubernetesDeploymentProvider(); } else { throw new DeploymentEnvironmentException("Unsupported deployment platform: " + platform); } }
Source:
<code>default @Nullable UUID getUUID() { StringBuilder sb = new StringBuilder(); File file = new File(getPath()); if (file.isDirectory()) { for (File childFile : file.listFiles()) { sb.append(childFile.getName()); sb.append(childFile.length()); sb.append(childFile.lastModified()); } } else if (file.exists()) { sb.append(file.getName()); sb.append(file.length()); sb.append(file.lastModified()); } for (ITmfEventProvider child : getChildren()) { if (child instanceof ITmfTrace) { sb.append(String.valueOf(((ITmfTrace) child).getUUID())); } <START> } <END> String base = sb.toString(); int step = base.length() / 4; byte data = new byte[16]; ByteBuffer bb = ByteBuffer.wrap(data); for (int i = 0; i < 4; i++) { bb.putInt(base.substring(i * step, (i + 1) * step).hashCode()); } return UUID.nameUUIDFromBytes(data); }</code><technical_language>In experiment text traces, changing trace names produces a experiment UUID. In experiment CTF traces (with UUID in metadata), changing trace names produces experiment UUID. name out of calculation</technical_language>

Target:
default @Nullable UUID getUUID() { StringBuilder sb = new StringBuilder(); File file = new File(getPath()); if (file.isDirectory()) { for (File childFile : file.listFiles()) { sb.append(childFile.getName()); sb.append(childFile.length()); sb.append(childFile.lastModified()); } } else if (file.exists()) { sb.append(file.getName()); sb.append(file.length()); sb.append(file.lastModified()); } for (ITmfEventProvider child : getChildren()) { if (child instanceof ITmfTrace) { sb.append(String.valueOf(((ITmfTrace) child).getUUID())); } } return UUID.nameUUIDFromBytes(Objects.requireNonNull(sb.toString().getBytes(Charset.defaultCharset()))); }
Source:
<code>public boolean isObjectStorage() { <START> boolean storageHinted = status == NO_ERROR_STATUS_OBJ_STORAGE <END> || status == SUCCESS_WITH_PREVIOUS_OBJ_STORAGE || status == NOT_EXECUTED_WITH_PREVIOUS_OBJ_STORAGE; boolean objectMediaType = keyMediaType != null && keyMediaType.match(MediaType.APPLICATION_OBJECT); return storageHinted || objectMediaType; }</code><technical_language>I checks staying here. moved Codec28 checks done if HR protocol 2.8 (or is HR protocol version them). If leave here, carry checking protocol 2.9 is wasteful server send them</technical_language>

Target:
public boolean isObjectStorage() { return keyMediaType != null && keyMediaType.match(MediaType.APPLICATION_OBJECT); }
Source:
<code>private ResourceInformationReflector() { try { resourceInfoClass = Class.forName(RESOURCE_INFO_CLASS); <START> setResourceInfoMethod = Resource.class.getMethod("setResourceInformation", String.class, resourceInfoClass); getResourceValueMethod = Resource.class.getMethod("getResources"); getInfoNameMethod = resourceInfoClass.getMethod("getName"); getInfoValueMethod = resourceInfoClass.getMethod("getValue"); resourceInfoNewInstance = resourceInfoClass.getMethod("newInstance", String.class, long.class); <END> isYarnResourceTypesAvailable = true; } catch (Exception e) { isYarnResourceTypesAvailable = false; } }</code><technical_language>strictly align variable names method names. methods of Resource ResourceInfo, I suggest include class name. E.g., - resourceSetResourceInformationMethod - resourceInformationGetNameMethod</technical_language>

Target:
private ResourceInformationReflector() { this(Resource.class.getName(), RESOURCE_INFO_CLASS); }
Source:
<code>private static RenderedImage optimizeSampleModel(RenderedImage source) { int w = source.getWidth(); int h = source.getHeight(); ImageLayout layout = new ImageLayout(); layout.setColorModel(source.getColorModel()); layout.setSampleModel(source.getColorModel().createCompatibleSampleModel(w, h)); layout.setTileWidth(w); layout.setTileHeight(h); RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout); LookupTable table = LookupTableFactory.create(IDENTITY_TABLE); ImageWorker worker = new ImageWorker(source); worker.setRenderingHints(hints); <START> worker.looukp(table); <END> return worker.getRenderedImage(); }</code><technical_language>Oops typo, lookup, looukp</technical_language>

Target:
private static RenderedImage optimizeSampleModel(RenderedImage source) { int w = source.getWidth(); int h = source.getHeight(); ImageLayout layout = new ImageLayout(); layout.setColorModel(source.getColorModel()); layout.setSampleModel(source.getColorModel().createCompatibleSampleModel(w, h)); layout.setTileWidth(w); layout.setTileHeight(h); RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout); LookupTable table = LookupTableFactory.create(IDENTITY_TABLE); ImageWorker worker = new ImageWorker(source); worker.setRenderingHints(hints); worker.lookup(table); return worker.getRenderedImage(); }
Source:
<code>protected UserDevfilePermissionImpl getEntity(String userId, String instanceId) throws NotFoundException, ServerException { try { return doGet(userId, instanceId); } catch (NoResultException e) { throw new NotFoundException( format( <START> "User devfile permission for devfile '%s' with id '%s' was not found.", <END> instanceId, userId)); } catch (RuntimeException e) { throw new ServerException(e.getMessage(), e); } }</code><technical_language>I this message reformulated confusing. clear id is supposed be. yeah, pay attention exception exposed users. User ID permissions assigned devfile ID</technical_language>

Target:
protected UserDevfilePermissionImpl getEntity(String userId, String instanceId) throws NotFoundException, ServerException { try { return doGet(userId, instanceId); } catch (NoResultException e) { throw new NotFoundException( format("User %s does not have permissions assigned to devfile %s.", instanceId, userId)); } catch (RuntimeException e) { throw new ServerException(e.getMessage(), e); } }
Source:
<code>public void actionPerformed(ActionEvent e) { final Project project = appContext.getRootProject(); final Resource resource = appContext.getResource(); checkState(project != null, "Null project occurred"); checkState(project.getLocation().isPrefixOf(resource.getLocation()), "Given selected item is not descendant of given project"); final String selectedItemPath = resource.getLocation() .removeFirstSegments(project.getLocation().segmentCount()) .removeTrailingSeparator() .toString(); service.diff(project.getLocation(), selectedItemPath.isEmpty() ? null : singletonList(selectedItemPath), NAME_STATUS, false, 0, REVISION, false) .then(diff -> { if (diff.isEmpty()) { dialogFactory.createMessageDialog(locale.compareMessageIdenticalContentTitle(), locale.compareMessageIdenticalContentText(), null).show(); } else { ChangedItems changedItems = new ChangedItems(project, diff); if (changedItems.getFilesQuantity() == 1) { comparePresenter.showCompareWithLatest(changedItems, null, REVISION); } else { <START> changesListPresenter.show(changedItems, REVISION, null); <END> } } }) .catchError(arg -> { notificationManager.notify(locale.diffFailed(), FAIL, NOT_EMERGE_MODE); }); }</code><technical_language>I personally methods accept null values</technical_language>

Target:
public void actionPerformed(ActionEvent e) { final Project project = appContext.getRootProject(); final Resource resource = appContext.getResource(); checkState(project != null, "Null project occurred"); checkState( project.getLocation().isPrefixOf(resource.getLocation()), "Given selected item is not descendant of given project"); final String selectedItemPath = resource .getLocation() .removeFirstSegments(project.getLocation().segmentCount()) .removeTrailingSeparator() .toString(); service .diff( project.getLocation(), selectedItemPath.isEmpty() ? null : singletonList(selectedItemPath), NAME_STATUS, false, 0, REVISION, false) .then( diff -> { if (diff.isEmpty()) { dialogFactory .createMessageDialog( locale.compareMessageIdenticalContentTitle(), locale.compareMessageIdenticalContentText(), null) .show(); } else { AlteredFiles alteredFiles = new AlteredFiles(project, diff); if (alteredFiles.getFilesQuantity() == 1) { comparePresenter.showCompareWithLatest(alteredFiles, null, REVISION); } else { changesListPresenter.show(alteredFiles, REVISION, null); } } }) .catchError( arg -> { notificationManager.notify(locale.diffFailed(), FAIL, NOT_EMERGE_MODE); }); }
Source:
<code>protected boolean set(IMixinMobSpawner container, Short value) { <START> container.getSpawnerBaseLogic().activatingRangeFromPlayer = checkNotNull(value); <END> return true; }</code><technical_language>need for a checknontnull, superclass for you</technical_language>

Target:
protected boolean set(IMixinMobSpawner container, Short value) { container.getSpawnerBaseLogic().activatingRangeFromPlayer = value; return true; }
Source:
<code>public Obs getRevisionObs(Obs initialObs) { Obs revisedObs = dao.getRevisionObs(initialObs); if (revisedObs != null && revisedObs.getVoided()) { <START> revisedObs = getRevisionObs(revisedObs); <END> } return revisedObs; }</code><technical_language>api recursively fetch revisions, api caller interested in revision for some reason, client code recursively do this</technical_language>

Target:
public Obs getRevisionObs(Obs initialObs) { return dao.getRevisionObs(initialObs); }
Source:
<code>public void testInitCanBeCalledTwice() throws Exception { MacPoolPerDc pool = new MacPoolPerDc(); pool.initialize(); Mockito.verify(dbFacadeMock).getMacPoolDao(); Mockito.verify(macPoolDaoMock).getAll(); <START> Mockito.verifyNoMoreInteractions(storagePoolDaoMock, vmNicDaoMock, macPoolDaoMock, dbFacadeMock); <END> pool.initialize(); }</code><technical_language>I this call, before.. better, there.</technical_language>

Target:
public void testInitCanBeCalledTwice() throws Exception { MacPoolPerDc pool = new MacPoolPerDc(); pool.initialize(); Mockito.verify(dbFacadeMock).getMacPoolDao(); Mockito.verify(macPoolDaoMock).getAll(); pool.initialize(); Mockito.verifyNoMoreInteractions(storagePoolDaoMock, vmNicDaoMock, macPoolDaoMock, dbFacadeMock); }
Source:
<code>private void test(List<byte[]> input) throws IOException { Multipart sender = new Multipart("http://localhost:" + port + "/multipart", "UTF-8"); for (byte[] in : input) <START> sender.addFilePart("file", new NamedStreamable.ByteArrayWrapper(in)); <END> String res = sender.finish(); List<byte[]> result = received.poll(); boolean sameLength = result.size() == input.size(); if (! sameLength) System.out.println(); Assert.assertTrue("Same length on other end", sameLength); List<Integer> differences = IntStream.range(0, input.size()) .filter(i -> !Arrays.equals(input.get(i), result.get(i))) .mapToObj(Integer::valueOf) .collect(Collectors.toList()); Assert.assertTrue("Same result on other end: " + differences, differences.size() == 0); }</code><technical_language>ByteArrayWrapper a top level class</technical_language>

Target:
private void test(List<byte[]> input) throws IOException { Multipart sender = new Multipart("http://localhost:" + port + "/multipart", "UTF-8"); for (byte[] in : input) sender.addFilePart("file", new NamedStreamable.ByteArrayWrapper(in)); String res = sender.finish(); List<byte[]> result = received.poll(); boolean sameLength = result.size() == input.size(); Assert.assertTrue("Same length on other end", sameLength); List<Integer> differences = IntStream.range(0, input.size()) .filter(i -> !Arrays.equals(input.get(i), result.get(i))) .mapToObj(Integer::valueOf) .collect(Collectors.toList()); Assert.assertTrue("Same result on other end: " + differences, differences.size() == 0); }
Source:
<code><START> public void updateCredential(Credential credential) { <END> Assert.checkNotNullParam("credential", credential); stateRef.get().updateCredential(credential); }</code><technical_language>This is a good approach IMO</technical_language>

Target:
public void updateCredential(Credential credential) throws RealmUnavailableException { Assert.checkNotNullParam("credential", credential); stateRef.get().updateCredential(credential); }
Source:
<code><START> private TransportFactory<? extends Channel, ? extends EventLoopGroup> getDomainTransportFactory() { <END> try { return (TransportFactory<? extends Channel, ? extends EventLoopGroup>) Class.forName("org.asynchttpclient.netty.channel.EpollDomainTransportFactory").newInstance(); } catch (Exception e) { try { return (TransportFactory<? extends Channel, ? extends EventLoopGroup>) Class.forName("org.asynchttpclient.netty.channel.KQueueDomainTransportFactory").newInstance(); } catch (Exception e1) { throw new IllegalArgumentException("No suitable native transport (epoll or kqueue) available"); } } }</code><technical_language>refactored getNativeTransportFactory, try reuse/share code</technical_language>

Target:
private TransportFactory<? extends Channel, ? extends EventLoopGroup> getDomainTransportFactory() { String nativeTransportFactoryClassName = null; if (PlatformDependent.isOsx()) { nativeTransportFactoryClassName = "org.asynchttpclient.netty.channel.KQueueDomainTransportFactory"; } else if (!PlatformDependent.isWindows()) { nativeTransportFactoryClassName = "org.asynchttpclient.netty.channel.EpollDomainTransportFactory"; } return loadNativeTransportFactory(nativeTransportFactoryClassName); }
Source:
<code>void checkOne(String workspaceId) { InternalRuntime<?> internalRuntime; try { internalRuntime = workspaceRuntimes.getInternalRuntime(workspaceId); <START> } catch (InfrastructureException | ServerException e) { <END> LOG.error( "Failed to get internal runtime to check consistency. Cause: {}", e.getMessage(), e); return; } RuntimeIdentity runtimeId = internalRuntime.getContext().getIdentity(); if (!(internalRuntime instanceof KubernetesInternalRuntime)) { LOG.error( "Fetched internal runtime '{}:{}' is not Kubernetes, it is not possible to check consistency.", runtimeId.getWorkspaceId(), runtimeId.getOwnerId()); return; } KubernetesInternalRuntime k8sRuntime = (KubernetesInternalRuntime) internalRuntime; try { if (k8sRuntime.isConsistent()) { return; } } catch (InfrastructureException e) { LOG.error("Error occurred during runtime consistency checking. Cause: {}", e.getMessage(), e); return; } LOG.warn( "Found runtime `{}:{}` with inconsistent state. It's going to be stopped automatically", runtimeId.getWorkspaceId(), runtimeId.getOwnerId()); try { eventPublisher.sendAbnormalStoppingEvent(runtimeId, "The runtime has inconsistent state."); k8sRuntime.stop(emptyMap()); eventPublisher.sendAbnormalStoppedEvent(runtimeId, "The runtime has inconsistent state."); } catch (InfrastructureException e) { LOG.error( "Failed to stop the runtime '{}:{}' which has inconsistent state. Error: {}", runtimeId.getWorkspaceId(), runtimeId.getOwnerId(), e.getMessage(), e); } }</code><technical_language>sense debug end of checking process</technical_language>

Target:
void checkOne(String workspaceId) throws InfrastructureException { LOG.debug("Checking consistency of runtime for workspace `{}`", workspaceId); KubernetesInternalRuntime k8sRuntime = getKubernetesInternalRuntime(workspaceId); RuntimeIdentity runtimeId = k8sRuntime.getContext().getIdentity(); try { if (k8sRuntime.isConsistent()) { return; } } catch (InfrastructureException e) { throw new InfrastructureException( format( "Error occurred during runtime '%s:%s' consistency checking. Cause: %s", runtimeId.getWorkspaceId(), runtimeId.getOwnerId(), e.getMessage()), e); } if (!isRunning(k8sRuntime)) { return; } LOG.warn( "Found runtime `{}:{}` with inconsistent state. It's going to be stopped automatically", runtimeId.getWorkspaceId(), runtimeId.getOwnerId()); stopAbnormally(k8sRuntime); LOG.debug("Checking consistency of runtime for workspace `{}` is finished", workspaceId); }
Source:
<code>public void edit(ImportCloneModel object) { if (object.getEntity() instanceof VM) { dialogLabelEditor.setText(constants.sameVmNameExists() <START> .replaceFirst("\\$\\{VmName\\}", ((VM) object.getEntity()).getVmName())); END> cloneEditor.setLabel(constants.cloneImportVm()); suffixEditor.setLabel(constants.cloneImportSuffixVm()); } else { dialogLabelEditor.setText(constants.sameTemplateNameExists() + " (" + ((VmTemplate) object.getEntity()).getname() + ")"); cloneEditor.setLabel(constants.cloneImportTemplate()); suffixEditor.setLabel(constants.cloneImportSuffixTemplate()); } Driver.driver.edit(object); }</code><technical_language>more Messages in case parameters in string</technical_language>

Target:
public void edit(ImportCloneModel object) { if (object.getEntity() instanceof VM) { dialogLabelEditor.setText(messages.sameVmNameExists(((VM) object.getEntity()).getVmName())); cloneEditor.setLabel(templates.twoLinesRadioButtonLabel(constants.cloneImportVm(), constants.cloneImportVmDetails()).asString()); suffixEditor.setLabel(constants.cloneImportSuffixVm()); } else { dialogLabelEditor.setText(constants.sameTemplateNameExists() + " (" + ((VmTemplate) object.getEntity()).getname() + ")"); cloneEditor.setLabel(constants.cloneImportTemplate()); suffixEditor.setLabel(constants.cloneImportSuffixTemplate()); } Driver.driver.edit(object); }
Source:
<code>public ImmutableRatesProviderBuilder iborIndexCurve( IborIndex index, Curve forwardCurve, LocalDateDoubleTimeSeries timeSeries) { <START> ArgChecker.notNull(index, "currency"); <END> ArgChecker.notNull(forwardCurve, "forwardCurve"); ArgChecker.notNull(timeSeries, "timeSeries"); this.indexCurves.put(index, forwardCurve); this.timeSeries.put(index, timeSeries); return this; }</code><technical_language>Argument name</technical_language>

Target:
public ImmutableRatesProviderBuilder iborIndexCurve( IborIndex index, Curve forwardCurve, LocalDateDoubleTimeSeries timeSeries) { ArgChecker.notNull(index, "index"); ArgChecker.notNull(forwardCurve, "forwardCurve"); ArgChecker.notNull(timeSeries, "timeSeries"); this.indexCurves.put(index, forwardCurve); this.timeSeries.put(index, timeSeries); return this; }
Source:
<code>protected void executeQueryCommand() { List<OvfEntityData> entityList = getDbFacade() .getUnregisteredOVFDataDao().getAllForStorageDomainByEntityType(getParameters().getId(), getParameters().getName()); List<VmTemplate> vmTemplates = new ArrayList<>(); OvfHelper ovfHelper = new OvfHelper(); for (OvfEntityData ovf : entityList) { VmTemplate vmTemplate = null; <START> if (getParameters().isFullData()) { <END> try { vmTemplate = ovfHelper.readVmTemplateFromOvf(ovf.getOvfData()); getQueryReturnValue().setSucceeded(true); vmTemplates.add(vmTemplate); } catch (OvfReaderException e) { log.debug("failed to parse a given ovf configuration: \n" + ovf.getOvfData(), e); getQueryReturnValue().setExceptionString("failed to parse a given ovf configuration " + e.getMessage()); } } else { vmTemplate = new VmTemplate(); vmTemplate.setId(ovf.getEntityId()); vmTemplate.setName(ovf.getEntityName()); vmTemplate.setClusterArch(ovf.getArchitecture()); } vmTemplates.add(vmTemplate); } getQueryReturnValue().setReturnValue(vmTemplates); }</code><technical_language>relevant? return full data now</technical_language>

Target:
protected void executeQueryCommand() { List<OvfEntityData> entityList = getOvfEntityList(); List<VmTemplate> vmTemplates = new ArrayList<>(); OvfHelper ovfHelper = getOvfHelper(); for (OvfEntityData ovf : entityList) { VmTemplate vmTemplate = null; try { vmTemplate = ovfHelper.readVmTemplateFromOvf(ovf.getOvfData()); vmTemplates.add(vmTemplate); } catch (OvfReaderException e) { log.debug("failed to parse a given ovf configuration: \n" + ovf.getOvfData(), e); getQueryReturnValue().setExceptionString("failed to parse a given ovf configuration " + e.getMessage()); } } getQueryReturnValue().setSucceeded(true); getQueryReturnValue().setReturnValue(vmTemplates); }
Source:
<code><START> public Boolean onReceivedHttpAuthRequest(CordovaWebView view, ICordovaHttpAuthHandler handler, String host, String realm) { <END> for (CordovaPlugin plugin : this.pluginMap.values()) { if (plugin != null && plugin.onReceivedHttpAuthRequest(view, handler, host, realm)) { return true; } } return false; }</code><technical_language>want this tri-state, "Boolean" "boolean". I need for tristate, "boolean"</technical_language>

Target:
public boolean onReceivedHttpAuthRequest(CordovaWebView view, ICordovaHttpAuthHandler handler, String host, String realm) { for (CordovaPlugin plugin : this.pluginMap.values()) { if (plugin != null && plugin.onReceivedHttpAuthRequest(view, handler, host, realm)) { return true; } } return false; }
Source:
<code>public void updateNumericData_shouldWriteData() { String projectId = spanner.getOptions().getProjectId(); String out = runExample( () -> UpdateNumericDataSample.updateNumericData( spanner.getDatabaseClient(DatabaseId.of(projectId, instanceId, databaseId)))); <START> assertThat(out).contains("Records successfully updated"); <END> }</code><technical_language>suggestion assertThat(out).contains("Venues successfully updated");</technical_language>

Target:
public void updateNumericData_shouldWriteData() { String projectId = spanner.getOptions().getProjectId(); String out = runExample( () -> UpdateNumericDataSample.updateNumericData( spanner.getDatabaseClient(DatabaseId.of(projectId, instanceId, databaseId)))); assertThat(out).contains("Venues successfully updated"); }
Source:
<code>private void waitForOperation(Operation operation) throws IOException { GetOperationRequest request = GetOperationRequest.newBuilder().setName(operation.getName()).build(); Operation currentOperationState = operation; while (true) { if (currentOperationState.getDone()) { switch (currentOperationState.getResultCase()) { case RESPONSE: return; case ERROR: throw new RuntimeException( "Cluster could not be resized: " + currentOperationState.getError()); case RESULT_NOT_SET: throw new IllegalStateException( "System returned invalid response for Operation check: " + currentOperationState); } } try { Thread.sleep(200); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException("Wating for operation was interrupted.", e); } <START> currentOperationState = <END> connection.getSession().getInstanceAdminClient().getOperation(request); } }</code><technical_language>do a info log inform users waiting for operation complete timeout some point</technical_language>

Target:
private void waitForOperation(Operation operation) throws IOException { GetOperationRequest request = GetOperationRequest.newBuilder().setName(operation.getName()).build(); Operation currentOperationState = operation; long startMs = System.currentTimeMillis(); while (true) { if (currentOperationState.getDone()) { switch (currentOperationState.getResultCase()) { case RESPONSE: return; case ERROR: throw new RuntimeException( "Cluster could not be resized: " + currentOperationState.getError()); case RESULT_NOT_SET: throw new IllegalStateException( "System returned invalid response for Operation check: " + currentOperationState); } } long waitMs = 0; long timePassedS = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - startMs); if (timePassedS < 5) { waitMs = 250; } else if (timePassedS < 60){ waitMs = 1000; } else if (timePassedS < 300) { waitMs = 10000; } else { waitMs = 60000; } try { Thread.sleep(waitMs); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException("Wating for operation was interrupted.", e); } currentOperationState = connection.getSession().getInstanceAdminClient().getOperation(request); } }
Source:
<code>private CqlResult executeQueryOnHost(CqlQuery cqlQuery, InetSocketAddress host) { try { return clientPool.runWithRetryOnHost(host, createCqlFunction(cqlQuery)); } catch (UnavailableException e) { <START> throw new InsufficientConsistencyException("This query requires consistency " + consistency); <END> } catch (TException e) { throw Throwables.unwrapAndThrowAtlasDbDependencyException(e); } }</code><technical_language>UnavailableException here. Also, log CqlQuery.queryFormat This query is vague</technical_language>

Target:
private CqlResult executeQueryOnHost(CqlQuery cqlQuery, InetSocketAddress host) { try { return clientPool.runWithRetryOnHost(host, createCqlFunction(cqlQuery)); } catch (UnavailableException e) { throw new InsufficientConsistencyException( "The query [" + cqlQuery.queryFormat + "] requires consistency " + consistency, e); } catch (TException e) { throw Throwables.unwrapAndThrowAtlasDbDependencyException(e); } }
Source:
<code>protected void executeQueryCommand() { List<Disk> allDisksAndSnapshots = diskDao.getAllFromDisksIncludingSnapshots(getUserID(), getParameters().isFiltered()); <START> HashMap<UUID, DiskImage> activeDisks = new HashMap<>(); <END> HashMap<UUID, List<DiskImage>> disksLeftForAggregate = new HashMap<>(); List<Disk> result = new ArrayList<>(); allDisksAndSnapshots.stream() .filter(disk -> { if (disk.isOvfStore()) { result.add(disk); return false; } return true; }) .filter(disk -> { if (disk instanceof LunDisk) { result.add(disk); return false; } return true; }) .map(diskImage -> (DiskImage) diskImage) .forEach(diskImage -> { UUID imageId = diskImage.getId().getUuid(); if (diskImage.getActive()) { diskImage.getSnapshots().add(DiskImage.copyOf(diskImage)); activeDisks.put(imageId, diskImage); if (disksLeftForAggregate.containsKey(imageId)) { activeDisks.get(imageId).getSnapshots().addAll(disksLeftForAggregate.get(imageId)); disksLeftForAggregate.remove(imageId); } } else { if (activeDisks.containsKey(imageId)) { activeDisks.get(imageId).getSnapshots().add(diskImage); } else if (disksLeftForAggregate.containsKey(imageId)) { disksLeftForAggregate.get(imageId).add(diskImage); } else { List<DiskImage> newDiskImageList = new ArrayList<>(); newDiskImageList.add(diskImage); disksLeftForAggregate.put(imageId, newDiskImageList); } } }); result.addAll(new ArrayList<>(activeDisks.values())); getQueryReturnValue().setReturnValue(result); }</code><technical_language>Map instead of concrete type</technical_language>

Target:
protected void executeQueryCommand() { List<Disk> allDisksAndSnapshots = diskDao.getAllFromDisksIncludingSnapshots(getUserID(), getParameters().isFiltered()); List<Disk> result = collectSnapshotsForDisks(allDisksAndSnapshots); getQueryReturnValue().setReturnValue(result); }
Source:
<code>public void put(K key, T val) { if (val.isDirty()) { OrientDBQuery<K, T> dataStoreQuery = new OrientDBQuery<>(this); dataStoreQuery.setStartKey(key); dataStoreQuery.setEndKey(key); dataStoreQuery.populateOrientDBQuery(orientDBMapping, getFieldsToQuery(null), getFields()); ODatabaseDocumentTx selectTx = connectionPool.acquire(); selectTx.activateOnCurrentThread(); try { List<ODocument> result = selectTx.command(dataStoreQuery.getOrientDBQuery()) .execute(dataStoreQuery.getParams()); if (result.size() == 1) { ODocument document = updateOrientDocFromAvroBean(key, val, result.get(0)); docBatch.add(document); } else { ODocument document = convertAvroBeanToOrientDoc(key, val); docBatch.add(document); } } finally { selectTx.close(); } } else { <START> LOG.info("Ignored putting persistent bean in the store as it is neither " <END> + "new, neither dirty.", new Object[]{val}); } }</code><technical_language>this a debug instead of info get overflowed logging ;)</technical_language>

Target:
public void put(K key, T val) { if (val.isDirty()) { OrientDBQuery<K, T> dataStoreQuery = new OrientDBQuery<>(this); dataStoreQuery.setStartKey(key); dataStoreQuery.setEndKey(key); dataStoreQuery.populateOrientDBQuery(orientDBMapping, getFieldsToQuery(null), getFields()); ODatabaseDocumentTx selectTx = connectionPool.acquire(); selectTx.activateOnCurrentThread(); try { List<ODocument> result = selectTx.command(dataStoreQuery.getOrientDBQuery()) .execute(dataStoreQuery.getParams()); if (result.size() == 1) { ODocument document = updateOrientDocFromAvroBean(key, val, result.get(0)); docBatch.add(document); } else { ODocument document = convertAvroBeanToOrientDoc(key, val); docBatch.add(document); } } finally { selectTx.close(); } } else { if (LOG.isDebugEnabled()) { LOG.info("Ignored putting persistent bean in the store as it is neither " + "new, neither dirty.", new Object[]{val}); } } }
Source:
<code>private String getObjectText(IProductModel obj) { IProduct product = obj.getProduct(); String name = preventNull(product.getId()); <START> if (VersionUtil.isEmptyVersion(product.getVersion())) { <END> return name; } return name + ' ' + formatVersion(product.getVersion()); }</code><technical_language>products ID in workspace, fallback name instead of empty string</technical_language>

Target:
private String getObjectText(IProductModel obj) { IProduct product = obj.getProduct(); String name = preventNull(product.getId()); if (name.isEmpty()) { name = preventNull(product.getName()); } if (VersionUtil.isEmptyVersion(product.getVersion())) { return name; } return name + ' ' + formatVersion(product.getVersion()); }
Source:
<code><START> public Object getTableInfo(String tableName) throws GoraException { <END> try { KuduTable openTable = client.openTable(tableName); List<ColumnSchema> columns = openTable.getSchema().getColumns(); HashMap<String, String> columnas = new HashMap(); String pk = ""; for (ColumnSchema esquema : columns) { columnas.put(esquema.getName(), esquema.getType().getName()); if (esquema.isKey()) { pk = esquema.getName(); } } return new KuduTableMetadata(pk, columnas); } catch (KuduException ex) { throw new GoraException(ex); } }</code><technical_language>This return KuduTableMetadata :)</technical_language>

Target:
public KuduTableMetadata getTableInfo(String tableName) throws GoraException { try { KuduTable openTable = client.openTable(tableName); List<ColumnSchema> columns = openTable.getSchema().getColumns(); HashMap<String, String> columnas = new HashMap(); String pk = ""; String pkType = ""; for (ColumnSchema esquema : columns) { if (esquema.isKey()) { pk = esquema.getName(); pkType = esquema.getType().getName(); } else { columnas.put(esquema.getName(), esquema.getType().getName()); } } return new KuduTableMetadata(pk, pkType, columnas); } catch (KuduException ex) { throw new GoraException(ex); } }
Source:
<code>protected void setResultValue(Intent i, boolean success) { if (success) { <START> i.putExtra(IntentCallout.INTENT_RESULT_VALUE, "Wrote value: " + payloadToWrite); <END> } }</code><technical_language>appending Wrote value: here? dangerous/wrong (IE if I parsing this intent response I expect header)</technical_language>

Target:
protected void setResultValue(Intent i, boolean success) { if (success) { i.putExtra(IntentCallout.INTENT_RESULT_VALUE, payloadToWrite); } }
Source:
<code>public Collection<Sample> listBySearch(String querystr) throws IOException { Criteria criteria = currentSession().createCriteria(Sample.class); criteria.add(Restrictions.or(Restrictions.ilike("identificationBarcode", querystr + "%"), Restrictions.ilike("name", querystr + "%"), <START> Restrictions.ilike("alias", querystr + "%"))); <END> @SuppressWarnings("unchecked") List<Sample> records = criteria.list(); return fetchSqlStore(records); }</code><technical_language>Consider adding a wildcard front of string well. Right searching for KGMT match KGMT_0015, searching for 0015 not. query string is escaped, currently SQL wildcards in queries (this is a general user do.) searching for %0015 match KGMT_0015</technical_language>

Target:
public Collection<Sample> listBySearch(String querystr) throws IOException { Criteria criteria = currentSession().createCriteria(Sample.class); criteria.add(Restrictions.or(Restrictions.ilike("identificationBarcode", "%" + querystr + "%"), Restrictions.ilike("name", "%" + querystr + "%"), Restrictions.ilike("alias", "%" + querystr + "%"))); @SuppressWarnings("unchecked") List<Sample> records = criteria.list(); return fetchSqlStore(records); }
Source:
<code>public String pause(Request req, Response res) throws IOException { HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); String pauseCause = null; String pipelineName = req.params("pipeline_name"); <START> if (!StringUtils.isBlank(req.body())) { <END> JsonReader requestBody = GsonTransformer.getInstance().jsonReaderFrom(req.body()); pauseCause = requestBody.optString("pause_cause").orElse(null); } pipelinePauseService.pause(pipelineName, pauseCause, currentUsername(), result); return renderHTTPOperationResult(result, req, res, localizer); }</code><technical_language>handle null in GsonTransformer instead of - avoids similar problem in other cases</technical_language>

Target:
public String pause(Request req, Response res) throws IOException { HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); JsonReader requestBody = GsonTransformer.getInstance().jsonReaderFrom(req.body()); String pipelineName = req.params("pipeline_name"); String pauseCause = requestBody.optString("pause_cause").orElse(null); pipelinePauseService.pause(pipelineName, pauseCause, currentUsername(), result); return renderHTTPOperationResult(result, req, res, localizer); }
Source:
<code>protected void preStart() { final Callable<SshPollValue> getAttributesFromKnife = new Callable<SshPollValue>() { public SshPollValue call() throws Exception { ProcessTaskWrapper<String> taskWrapper = knifeTaskFactory.newTask(); final ExecutionContext executionContext = ((EntityInternal) entity).getManagementSupport().getExecutionContext(); log.debug("START: Running knife to query attributes of Chef node {}", nodeName); executionContext.submit(taskWrapper); taskWrapper.block(); log.debug("DONE: Running knife to query attributes of Chef node {}", nodeName); return new SshPollValue(null, taskWrapper.getExitCode(), taskWrapper.getStdout(), taskWrapper.getStderr()); } }; ((Poller<SshPollValue>) poller).scheduleAtFixedRate( new CallInEntityExecutionContext<SshPollValue>(entity, getAttributesFromKnife), new SendChefAttributesToSensors(entity, chefAttributeSensors), <START> Duration.THIRTY_SECONDS.toMilliseconds()); <END> }</code><technical_language>If builder, need hard-code this poll period</technical_language>

Target:
protected void preStart() { final Callable<SshPollValue> getAttributesFromKnife = new Callable<SshPollValue>() { public SshPollValue call() throws Exception { ProcessTaskWrapper<String> taskWrapper = knifeTaskFactory.newTask(); final ExecutionContext executionContext = ((EntityInternal) entity).getManagementSupport().getExecutionContext(); log.debug("START: Running knife to query attributes of Chef node {}", nodeName); executionContext.submit(taskWrapper); taskWrapper.block(); log.debug("DONE: Running knife to query attributes of Chef node {}", nodeName); return new SshPollValue(null, taskWrapper.getExitCode(), taskWrapper.getStdout(), taskWrapper.getStderr()); } }; ((Poller<SshPollValue>) poller).scheduleAtFixedRate( new CallInEntityExecutionContext<SshPollValue>(entity, getAttributesFromKnife), new SendChefAttributesToSensors(entity, chefAttributeSensors), periodUnits.toMillis(period)); }
Source:
<code>synchronized void closeSockets() { if (serverSockets != null) for (ServerSocket serverSocket : serverSockets) { if (!serverSocket.isClosed()) try { serverSocket.close(); } catch (IOException e) { <START> LOG.warn("Ignoring unexpected exception during close" + serverSocket, e); <END> } } }</code><technical_language>Please built-in message formatter: LOG.warn("Ignoring unexpected exception close {}", serverSocket, e);</technical_language>

Target:
synchronized void closeSockets() { if (serverSockets != null) for (ServerSocket serverSocket : serverSockets) { if (!serverSocket.isClosed()) { try { serverSocket.close(); } catch (IOException e) { LOG.warn("Ignoring unexpected exception during close {}", serverSocket, e); } } } }
Source:
<code>public Optional<Integer> declareManagedMemoryUseCaseAtOperatorScope( ManagedMemoryUseCase managedMemoryUseCase, int weight) { throw new UnsupportedOperationException( <START> "Do not support declare operator scope's managed memory for SinkTransformation."); <END> }</code><technical_language>suggestion "Declaring managed memory cases is supported for SinkTransformation.");</technical_language>

Target:
public Optional<Integer> declareManagedMemoryUseCaseAtOperatorScope( ManagedMemoryUseCase managedMemoryUseCase, int weight) { throw new UnsupportedOperationException( "Declaring managed memory use cases is not supported for SinkTransformation."); }
Source:
<code>public Optional<EntityType> getVal(ItemStack itemStack) { final String name = ItemMonsterPlacer.getEntityIdFromItem(itemStack); if (name != null) { final Class<?> entity = EntityList.NAME_TO_CLASS.get(name); <START> for (EntityType type : SpongeImpl.getRegistry().getAllOf(EntityType.class)) { <END> if (type.getEntityClass().equals(entity)) { return Optional.of(type); } } } return Optional.empty(); }</code><technical_language>change this EntityTypeRegistryModule.getInstance()#getForClass</technical_language>

Target:
public Optional<EntityType> getVal(ItemStack itemStack) { final String name = ItemMonsterPlacer.getEntityIdFromItem(itemStack); if (name != null) { final Class<? extends Entity> entity = EntityList.NAME_TO_CLASS.get(name); return Optional.ofNullable(EntityTypeRegistryModule.getInstance().getForClass(entity)); } return Optional.empty(); }
Source:
<code>public void selectDateReturnsFalseForDatesOutOfRange() { view.init(today.getTime(), minDate, maxDate); Calendar jumpToCal=Calendar.getInstance(); jumpToCal.add(MONTH,1); if (!view.setSelectedDate(jumpToCal.getTime())) { fail("should be able to select this date"); <START> } <END> }</code><technical_language>I lines be: java assertThat(view.setSelectedDate(jumpToCal.getTime()).isTrue();</technical_language>

Target:
public void selectDateReturnsFalseForDatesOutOfRange() { view.init(today.getTime(), minDate, maxDate); Calendar jumpToCal = Calendar.getInstance(); jumpToCal.add(MONTH, 1); boolean wasAbleToSetDate = view.setSelectedDate(jumpToCal.getTime()); assertThat(wasAbleToSetDate).isTrue(); }
Source:
<code>public static Boolean varcharIsJsonScalar(@SqlType("varchar(x)") Slice json) { <START> return isJsonScalar(jsonParse(json)); <END> }</code><technical_language>need call jsonParse here</technical_language>

Target:
public static Boolean varcharIsJsonScalar(@SqlType("varchar(x)") Slice json) { return isJsonScalar(json); }
Source:
<code>protected void handlePrintFromScout(final FormEvent e) { WidgetPrinter wp = null; try { if (m_viewComposite != null) { if (e.getFormField() != null) { for (JComponent c : SwingUtility.findChildComponents(m_viewComposite.getSwingContentPane(), JComponent.class)) { IPropertyObserver scoutModel = SwingScoutComposite.getScoutModelOnWidget(c); if (scoutModel == e.getFormField()) { wp = new WidgetPrinter(c); break; } } } if (wp == null) { Component printComponent; <START> if (this.getScoutForm().getDisplayHint() == IForm.DISPLAY_HINT_VIEW) { <END> printComponent = m_viewComposite.getSwingContentPane(); } else { printComponent = SwingUtilities.getWindowAncestor(m_viewComposite.getSwingContentPane()); } wp = new WidgetPrinter(printComponent); } } if (wp != null) { try { wp.print(e.getPrintDevice(), e.getPrintParameters()); } catch (Throwable ex) { LOG.error(null, ex); } } } finally { File outputFile = null; if (wp != null) { outputFile = wp.getOutputFile(); } final File outputFileFinal = outputFile; Runnable r = new Runnable() { @Override public void run() { getScoutObject().getUIFacade().fireFormPrintedFromUI(outputFileFinal); } }; getSwingEnvironment().invokeScoutLater(r, 0); } }</code><technical_language>this necessary</technical_language>

Target:
protected void handlePrintFromScout(final FormEvent e) { WidgetPrinter wp = null; try { if (m_viewComposite != null) { if (e.getFormField() != null) { for (JComponent c : SwingUtility.findChildComponents(m_viewComposite.getSwingContentPane(), JComponent.class)) { IPropertyObserver scoutModel = SwingScoutComposite.getScoutModelOnWidget(c); if (scoutModel == e.getFormField()) { wp = new WidgetPrinter(c); break; } } } if (wp == null) { Component printComponent; if (getScoutForm().getDisplayHint() == IForm.DISPLAY_HINT_VIEW) { printComponent = m_viewComposite.getSwingContentPane(); } else { printComponent = SwingUtilities.getWindowAncestor(m_viewComposite.getSwingContentPane()); } wp = new WidgetPrinter(printComponent); } } if (wp != null) { try { wp.print(e.getPrintDevice(), e.getPrintParameters()); } catch (Throwable ex) { LOG.error(null, ex); } } } finally { File outputFile = null; if (wp != null) { outputFile = wp.getOutputFile(); } final File outputFileFinal = outputFile; Runnable r = new Runnable() { @Override public void run() { getScoutObject().getUIFacade().fireFormPrintedFromUI(outputFileFinal); } }; getSwingEnvironment().invokeScoutLater(r, 0); } }
Source:
<code>public void run() { runEvent(); todo.doIt(); endEvent(); <START> if (isExecutionLogged()) <END> logExecution(); }</code><technical_language>{ }</technical_language>

Target:
public void run() { runEvent(); todo.doIt(); endEvent(); logExecution(); }
Source:
<code>private void initCreateTxt() { createTxt = new NpTextBox(); createTxt.setVisibleLength(50); createTxt.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { if (!createTxt.getText().trim().isEmpty() && event.getCharCode() == KeyCodes.KEY_ENTER) { doCreateProject(); } } }); createTxt.addKeyUpHandler(new KeyUpHandler() { @Override <START> public void onKeyUp(KeyUpEvent event) { <END> createButton.setEnabled(!createTxt.getText().trim().isEmpty()); } }); }</code><technical_language>I suspect this miss types of pastes, middle clicks (unix)</technical_language>

Target:
private void initCreateTxt() { projectNameTextBox = new NpTextBox(); projectNameTextBox.setVisibleLength(50); projectNameTextBox.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { if (!projectNameTextBox.getText().trim().isEmpty() && event.getCharCode() == KeyCodes.KEY_ENTER) { doCreateProject(); } } }); }
Source:
<code>private void processVmDevices(XmlRpcStruct vm) { if (vm == null || vm.getItem("vmId") == null) { log.errorFormat("Recieved NULL VM or VM id when processing VM devices, abort."); return; } Guid vmId = new Guid((String) vm.getItem("vmId")); HashSet<Guid> processedDevices = new HashSet<Guid>(); Object[] objects = (Object[]) vm.getItem("devices"); for (Object o : objects) { XmlRpcStruct device = new XmlRpcStruct((Map<String, Object>) o); Guid deviceId = getDeviceId(device); if ((device.getItem("address")) == null) { log.infoFormat("Recieved a Device without an address when processing VM {0} devices, skipping device: {1}.", vmId, device.getInnerMap().toString()); continue; <START> } <END> VmDevice vmDevice = DbFacade.getInstance().getVmDeviceDAO().get(new VmDeviceId(deviceId, vmId)); if (deviceId == null || vmDevice == null) { deviceId = addNewVmDevice(vmId, device); } else { vmDevice.setAddress(((Map<String, String>) device.getItem("address")).toString()); addVmDeviceToList(vmDevice); } processedDevices.add(deviceId); } handleRemovedDevices(vmId, processedDevices); }</code><technical_language>retrieve devices here, one. of retrieving devices handleRemovedDevices</technical_language>

Target:
private void processVmDevices(XmlRpcStruct vm) { if (vm == null || vm.getItem("vmId") == null) { log.errorFormat("Recieved NULL VM or VM id when processing VM devices, abort."); return; } Guid vmId = new Guid((String) vm.getItem("vmId")); HashSet<Guid> processedDevices = new HashSet<Guid>(); Object[] objects = (Object[]) vm.getItem("devices"); List<VmDevice> devices = DbFacade.getInstance().getVmDeviceDAO().getVmDeviceByVmId(vmId); Map<VmDeviceId, VmDevice> deviceMap = new HashMap<VmDeviceId, VmDevice>(); for (VmDevice device : devices) { deviceMap.put(device.getId(), device); } for (Object o : objects) { XmlRpcStruct device = new XmlRpcStruct((Map<String, Object>) o); Guid deviceId = getDeviceId(device); if ((device.getItem("address")) == null) { log.infoFormat("Recieved a Device without an address when processing VM {0} devices, skipping device: {1}.", vmId, device.getInnerMap().toString()); continue; } VmDevice vmDevice = deviceMap.get(new VmDeviceId(deviceId, vmId)); if (deviceId == null || vmDevice == null) { deviceId = addNewVmDevice(vmId, device); } else { vmDevice.setAddress(((Map<String, String>) device.getItem("address")).toString()); addVmDeviceToList(vmDevice); } processedDevices.add(deviceId); } handleRemovedDevices(vmId, processedDevices, devices); }