auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void flush() { if (!_pendingCheckpoint) { return; } try { _sendFlushLock.writeLock().lock(); if (LOG.isDebugEnabled()) { LOG.debug(String.format("Staring transport flush, tasks = [%s].", _tasks)); } _transportProvider.flush(); if (LOG.isDebugEnabled()) { LOG.debug("Transport has been successfully flushed."); } if (_checkpointPolicy == CheckpointPolicy.DATASTREAM) { try { LOG.info(String.format("Start committing checkpoints = %s, tasks = [%s].", _latestCheckpoints, _tasks)); Map<DatastreamTask, String> committed = new HashMap<>(); _latestCheckpoints.forEach((task, cpMap) -> committed.put(task, JsonUtils.toJson(cpMap))); _checkpointProvider.commit(committed); _latestCheckpoints.forEach((task, cpMap) -> _safeCheckpoints.put(task, new HashMap<>(cpMap))); LOG.info("Checkpoints have been successfully committed: " + _safeCheckpoints); } catch (Throwable t) { String errorMessage = String.format("Checkpoint commit failed, tasks = [%s].", _tasks); LOG.error(errorMessage, t); throw new DatastreamRuntimeException(errorMessage, t); } } _pendingCheckpoint = false; } catch (Throwable t) { String errorMessage = String.format("Failed to flush transport, tasks = [%s].", _tasks); LOG.error(errorMessage, t); throw new DatastreamRuntimeException(errorMessage, t); } finally { _sendFlushLock.writeLock().unlock(); } }

Target:
public void flush() { if (!_pendingCheckpoint) { return; } try { _sendFlushLock.writeLock().lock(); if (LOG.isDebugEnabled()) { LOG.debug(String.format("Staring transport flush, tasks = [%s].", _tasks)); } _transportProvider.flush(); if (LOG.isDebugEnabled()) { LOG.debug("Transport has been successfully flushed."); } if (_checkpointPolicy == CheckpointPolicy.DATASTREAM) { try { LOG.info(String.format("Start committing checkpoints = %s, tasks = [%s].", _latestCheckpoints, _tasks)); Map<DatastreamTask, String> committed = new HashMap<>(); _latestCheckpoints.forEach((task, cpMap) -> committed.put(task, JsonUtils.toJson(cpMap))); _checkpointProvider.commit(committed); _latestCheckpoints.forEach((task, cpMap) -> _safeCheckpoints.put(task, new HashMap<>(cpMap))); LOG.info("Checkpoints have been successfully committed: " + _safeCheckpoints); } catch (Throwable t) { String errorMessage = String.format("Checkpoint commit failed, tasks = [%s].", _tasks); ErrorLogger.logAndThrowDatastreamRuntimeException(LOG, errorMessage, t); } } _pendingCheckpoint = false; } catch (Throwable t) { String errorMessage = String.format("Failed to flush transport, tasks = [%s].", _tasks); ErrorLogger.logAndThrowDatastreamRuntimeException(LOG, errorMessage, t); } finally { _sendFlushLock.writeLock().unlock(); } }
Source:
public void run() { while (true) { try { rs.cleanNotificationEvents(ttl); rs.cleanWriteNotificationEvents(ttl); } catch (Exception ex) { LOG.warn("Exception received while cleaning notifications. More details can be found in debug mode", ex); } LOG.debug("Cleaner thread done"); try { Thread.sleep(sleepTime); } catch (InterruptedException e) { LOG.info("Cleaner thread sleep interrupted", e); } } }

Target:
public void run() { while (true) { try { rs.cleanNotificationEvents(ttl); rs.cleanWriteNotificationEvents(ttl); } catch (Exception ex) { LOG.warn("Exception received while cleaning notifications: ", ex); } LOG.debug("Cleaner thread done"); try { Thread.sleep(sleepTime); } catch (InterruptedException e) { LOG.info("Cleaner thread sleep interrupted", e); } } }
Source:
private static void indexTweeterDocument(String indexType, int id, Date date) { try { client.prepareIndex(indexName, indexType).setSource(buildTweeterJson(id, date)) .setId("tweet_" + indexType + "_" + id).execute().actionGet(); } catch (Exception ex) { System.out.println("Exception indexing documents!!!!!"); } }

Target:
private static void indexTweeterDocument(String indexType, int id, Date date) { client.prepareIndex(indexName, indexType).setSource(buildTweeterJson(id, date)) .setId("tweet_" + indexType + "_" + id).execute().actionGet(); }
Source:
protected CompletableFuture<Void> doResolve(ITextViewer viewer, IProgressMonitor monitor) { return CompletableFuture.runAsync(() -> { try { monitor.isCanceled(); refCount= countReferences(getElement(), monitor); monitor.isCanceled(); if (refCount == 0 && showReferencesAtLeastOne) { super.setLabel(""); } else { super.setLabel(refCount + " references"); } } catch (JavaModelException e) { } catch (CoreException e) { } }); }

Target:
protected CompletableFuture<Void> doResolve(ITextViewer viewer, IProgressMonitor monitor) { return CompletableFuture.runAsync(() -> { try { monitor.isCanceled(); long refCount= countReferences(getElement(), monitor); monitor.isCanceled(); action= refCount > 0 ? e -> new FindReferencesAction(editor).run(super.getElement()) : null; if (refCount == 0 && showReferencesAtLeastOne) { super.setLabel(""); } else { super.setLabel(MessageFormat.format(JavaCodeMiningMessages.JavaReferenceCodeMining_label, refCount)); } } catch (JavaModelException e) { } catch (CoreException e) { } }); }
Source:
public void testCustomProvider() { ResteasyProviderFactory provider = new ResteasyProviderFactoryImpl(null, true); provider.registerProvider(IIOImageProvider.class); RestClientBuilderImpl.setProviderFactory(provider); RestClientBuilderImpl builder = (RestClientBuilderImpl) RestClientBuilder.newBuilder(); Assert.assertTrue(builder.getBuilderDelegate().getProviderFactory().getProviderClasses().contains(IIOImageProvider.class)); Assert.assertFalse(builder.getBuilderDelegate().getProviderFactory().getProviderClasses().contains(DefaultTextPlain.class)); }

Target:
public void testCustomProvider() { try { ResteasyProviderFactory provider = new ResteasyProviderFactoryImpl(null, true); provider.registerProvider(IIOImageProvider.class); RestClientBuilderImpl.setProviderFactory(provider); RestClientBuilderImpl builder = (RestClientBuilderImpl) RestClientBuilder.newBuilder(); Assert.assertTrue(builder.getBuilderDelegate().getProviderFactory().getProviderClasses().contains(IIOImageProvider.class)); Assert.assertFalse(builder.getBuilderDelegate().getProviderFactory().getProviderClasses().contains(DefaultTextPlain.class)); } finally { RestClientBuilderImpl.setProviderFactory(null); } }
Source:
public EnumPluginBundle() { super(Arrays.asList( (Class<? extends Plugin>) EnumFieldPlugin.class, EnumViewPropertyPlugin.class, EnumInheritedPropertyPlugin.class)); }

Target:
public EnumPluginBundle() { super(Arrays.<Class<? extends Plugin>>asList( EnumFieldPlugin.class, EnumViewPropertyPlugin.class, EnumInheritedPropertyPlugin.class)); }
Source:
private void checkGroupByAliasFeature(String sql1, String sql2, boolean exact) { List<AbstractPlanNode> pns; String explainStr1; String explainStr2; pns = compileToFragments(sql1); explainStr1 = buildExplainPlan(pns); pns = compileToFragments(sql2); explainStr2 = buildExplainPlan(pns); if (! exact) { explainStr1 = explainStr1.replaceAll("TEMP_TABLE_\\$\\$\\.column#[\\d]", "TEMP_TABLE_\\$\\$.column#[Index]"); explainStr2 = explainStr2.replaceAll("TEMP_TABLE_\\$\\$\\.column#[\\d]", "TEMP_TABLE_\\$\\$.column#[Index]"); assertEquals(explainStr1, explainStr2); } assertEquals(explainStr1, explainStr2); }

Target:
private void checkGroupByAliasFeature(String sql1, String sql2, boolean exact) { List<AbstractPlanNode> pns; String explainStr1; String explainStr2; pns = compileToFragments(sql1); explainStr1 = buildExplainPlan(pns); pns = compileToFragments(sql2); explainStr2 = buildExplainPlan(pns); if (! exact) { explainStr1 = explainStr1.replaceAll("\\$\\$_VOLT_TEMP_TABLE_\\$\\$\\.column#[\\d]", "\\$\\$_VOLT_TEMP_TABLE_\\$\\$\\.column#[Index]"); explainStr2 = explainStr2.replaceAll("\\$\\$_VOLT_TEMP_TABLE_\\$\\$\\.column#[\\d]", "\\$\\$_VOLT_TEMP_TABLE_\\$\\$\\.column#[Index]"); assertEquals(explainStr1, explainStr2); } assertEquals(explainStr1, explainStr2); }
Source:
protected void onInitUI() { final FlowPanel me = (FlowPanel) getWidget(); me.add(header = new Grid(1, Cols.values().length)); me.add(body = new FlowPanel()); FlowPanel title = new FlowPanel(); title.add(headerText = new InlineLabel()); title.setStyleName(Gerrit.RESOURCES.css().screenHeader()); header.setWidget(0, Cols.Title.num, title); header.setStyleName(Gerrit.RESOURCES.css().screenHeader()); header.getCellFormatter().setHorizontalAlignment(0, Cols.FarEast.num, HasHorizontalAlignment.ALIGN_RIGHT); header.getCellFormatter().setWidth(0, Cols.FarEast.num, "99%"); }

Target:
protected void onInitUI() { final FlowPanel me = (FlowPanel) getWidget(); me.add(header = new Grid(1, Cols.values().length)); me.add(body = new FlowPanel()); FlowPanel title = new FlowPanel(); title.add(headerText = new InlineLabel()); title.setStyleName(Gerrit.RESOURCES.css().screenHeader()); header.setWidget(0, Cols.Title.ordinal(), title); header.setStyleName(Gerrit.RESOURCES.css().screenHeader()); header.getCellFormatter().setHorizontalAlignment(0, Cols.FarEast.ordinal(), HasHorizontalAlignment.ALIGN_RIGHT); header.getCellFormatter().setWidth(0, Cols.FarEast.ordinal(), "100%"); }
Source:
public String createEntityExtractUrl(DataStore store, String installPath, ImageFormat format, DataObject dataObject) { SwiftTO swiftTO = (SwiftTO)store.getTO(); String tempKey = UUID.randomUUID().toString(); boolean result = SwiftUtil.setTempKey(swiftTO, tempKey); if (!result) { s_logger.error("Unable to set Temp-Key: " + tempKey); return ""; } String containerName = SwiftUtil.getContainerName(dataObject.getType().toString(), dataObject.getId()); String objectName = installPath.split("\\/")[1]; int urlExpirationInterval = Integer.parseInt(_configDao.getValue(Config.ExtractURLExpirationInterval.toString())); URL swiftUrl = SwiftUtil.generateTempUrl(swiftTO, containerName, objectName, tempKey, urlExpirationInterval); if (swiftUrl != null) { s_logger.info("Swift temp-url: " + swiftUrl.toString()); return swiftUrl.toString(); } return null; }

Target:
public String createEntityExtractUrl(DataStore store, String installPath, ImageFormat format, DataObject dataObject) { SwiftTO swiftTO = (SwiftTO)store.getTO(); String tempKey = UUID.randomUUID().toString(); boolean result = SwiftUtil.setTempKey(swiftTO, tempKey); if (!result) { String errMsg = "Unable to set Temp-Key: " + tempKey; s_logger.error(errMsg); throw new CloudRuntimeException(errMsg); } String containerName = SwiftUtil.getContainerName(dataObject.getType().toString(), dataObject.getId()); String objectName = installPath.split("\\/")[1]; int urlExpirationInterval = Integer.parseInt(_configDao.getValue(Config.ExtractURLExpirationInterval.toString())); URL swiftUrl = SwiftUtil.generateTempUrl(swiftTO, containerName, objectName, tempKey, urlExpirationInterval); if (swiftUrl != null) { s_logger.debug("Swift temp-url: " + swiftUrl.toString()); return swiftUrl.toString(); } throw new CloudRuntimeException("Unable to create extraction URL"); }
Source:
public void emitRecord(ByteBuffer record, int targetSubpartition) throws IOException { BufferBuilder buffer = subpartitionBufferBuilders[targetSubpartition]; if (buffer == null) { buffer = getNewEmptySubpartitionBufferBuilderForNewRecord(targetSubpartition); } buffer.appendAndCommit(record); while (record.hasRemaining()) { finishSubpartitionBufferBuilder(targetSubpartition); buffer = getNewEmptySubpartitionBufferBuilderForRecordContinuation(record, targetSubpartition); } if (buffer.isFull()) { finishSubpartitionBufferBuilder(targetSubpartition); } }

Target:
public void emitRecord(ByteBuffer record, int targetSubpartition) throws IOException { BufferBuilder buffer = appendUnicastDataForNewRecord(record, targetSubpartition); while (record.hasRemaining()) { finishUnicastBufferBuilder(targetSubpartition); buffer = appendUnicastDataForRecordContinuation(record, targetSubpartition); } if (buffer.isFull()) { finishUnicastBufferBuilder(targetSubpartition); } }
Source:
private void addUserLibrary(Element element, String entry) { Element pathElement = doc.createElement("path"); IClasspathContainer container = EclipseClasspath.resolveUserLibraryReference(entry); String name = ExportUtil.removePrefixAndSuffix(entry, "${", "}"); pathElement.setAttribute("refid", name); element.appendChild(pathElement); if (visited.add(entry)) { Element userElement = doc.createElement("path"); userElement.setAttribute("id", name); for (IClasspathEntry entrie : container.getClasspathEntries()) { String jarFile = entrie.getPath().toString(); if (EclipseClasspath.isLibraryReference(entry)) { IPath home = JavaCore.getClasspathVariable("ECLIPSE_HOME"); if (home != null && home.isPrefixOf(entrie.getPath())) { variable2valueMap.put("ECLIPSE_HOME", home.toString()); jarFile = "${ECLIPSE_HOME}" + jarFile.substring(home.toString().length()); } else if (!new File(jarFile).exists() && jarFile.startsWith('/' + projectName) && new File(projectRoot, jarFile.substring(('/' + projectName).length())).exists()) { jarFile = jarFile.substring(('/' + projectName).length() + 1); } } jarFile = ExportUtil.getRelativePath(jarFile, projectRoot); Element userPathElement = doc.createElement("pathelement"); userPathElement.setAttribute(IAntModelConstants.ATTR_LOCATION, jarFile); userElement.appendChild(userPathElement); } addToClasspathBlock(userElement); } }

Target:
private void addUserLibrary(Element element, String entry) { Element pathElement = doc.createElement("path"); IClasspathContainer container = EclipseClasspath.resolveUserLibraryReference(entry); String name = ExportUtil.removePrefixAndSuffix(entry, "${", "}"); pathElement.setAttribute("refid", name); element.appendChild(pathElement); if (visited.add(entry)) { Element userElement = doc.createElement("path"); userElement.setAttribute("id", name); for (IClasspathEntry cpentry : container.getClasspathEntries()) { String jarFile = cpentry.getPath().toString(); if (EclipseClasspath.isLibraryReference(entry)) { IPath home = JavaCore.getClasspathVariable("ECLIPSE_HOME"); if (home != null && home.isPrefixOf(cpentry.getPath())) { variable2valueMap.put("ECLIPSE_HOME", home.toString()); jarFile = "${ECLIPSE_HOME}" + jarFile.substring(home.toString().length()); } else if (!new File(jarFile).exists() && jarFile.startsWith('/' + projectName) && new File(projectRoot, jarFile.substring(('/' + projectName).length())).exists()) { jarFile = jarFile.substring(('/' + projectName).length() + 1); } } jarFile = ExportUtil.getRelativePath(jarFile, projectRoot); Element userPathElement = doc.createElement("pathelement"); userPathElement.setAttribute(IAntModelConstants.ATTR_LOCATION, jarFile); userElement.appendChild(userPathElement); } addToClasspathBlock(userElement); } }
Source:
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) { if (RENDITION_DEFINITIONS_EP.equals(extensionPoint)) { RenditionDefinition renditionDefinition = (RenditionDefinition) contribution; renditionDefinitionRegistry.addContribution(renditionDefinition); } else if (RENDITON_DEFINION_PROVIDERS_EP.equals(extensionPoint)) { renditionDefinitionProviderRegistry.addContribution((RenditionDefinitionProviderDescriptor) contribution); } else if (STORED_RENDITION_MANAGERS_EP.equals(extensionPoint)) { storedRenditionManagerDescriptors.add(((StoredRenditionManagerDescriptor) contribution)); } else if (DEFAULT_RENDITION_EP.equals(extensionPoint)) { defaultRenditionDescriptor = ((DefaultRenditionDescriptor) contribution); } }

Target:
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) { if (RENDITION_DEFINITIONS_EP.equals(extensionPoint)) { RenditionDefinition renditionDefinition = (RenditionDefinition) contribution; renditionDefinitionRegistry.addContribution(renditionDefinition); } else if (RENDITON_DEFINION_PROVIDERS_EP.equals(extensionPoint)) { renditionDefinitionProviderRegistry.addContribution((RenditionDefinitionProviderDescriptor) contribution); } else if (STORED_RENDITION_MANAGERS_EP.equals(extensionPoint)) { storedRenditionManagerDescriptors.add(((StoredRenditionManagerDescriptor) contribution)); } else if (DEFAULT_RENDITION_EP.equals(extensionPoint)) { defaultRenditionDescriptor = ((DefaultRenditionDescriptor) contribution); defaultRenditionDescriptors.add((DefaultRenditionDescriptor) contribution); } }
Source:
public List<PersonInterface> toMetadata() { List<PersonInterface> result = new ArrayList<>(1); PersonInterface personInterface; try { personInterface = UghImplementation.INSTANCE.createPerson(metadataType); } catch (MetadataTypeNotAllowedException e) { throw new NullPointerException(e.getMessage()); } String normdataRecord = getField(Field.NORMDATA_RECORD).getValue(); if (normdataRecord != null && normdataRecord.length() > 0 && !normdataRecord.equals(ConfigCore.getParameter(Parameters.AUTHORITY_DEFAULT, ""))) { String[] authorityFile = Metadaten.parseAuthorityFileArgs(normdataRecord); personInterface.setAutorityFile(authorityFile[0], authorityFile[1], authorityFile[2]); } personInterface.setFirstName(getField(Field.FIRSTNAME).getValue()); personInterface.setLastName(getField(Field.LASTNAME).getValue()); result.add(personInterface); return result; }

Target:
public List<PersonInterface> toMetadata() { List<PersonInterface> result = new ArrayList<>(1); PersonInterface person; try { person = UghImplementation.INSTANCE.createPerson(metadataType); } catch (MetadataTypeNotAllowedException e) { throw new NullPointerException(e.getMessage()); } String normdataRecord = getField(Field.NORMDATA_RECORD).getValue(); if (normdataRecord != null && normdataRecord.length() > 0 && !normdataRecord.equals(ConfigCore.getParameter(Parameters.AUTHORITY_DEFAULT, ""))) { String[] authorityFile = Metadaten.parseAuthorityFileArgs(normdataRecord); person.setAutorityFile(authorityFile[0], authorityFile[1], authorityFile[2]); } person.setFirstName(getField(Field.FIRSTNAME).getValue()); person.setLastName(getField(Field.LASTNAME).getValue()); result.add(person); return result; }
Source:
public void testGuessTransformer() throws IOException, CatalogTransformerException { SortedServiceList mockSortedServiceList = mock(SortedServiceList.class); InputTransformer mockInputTransformer = mock(InputTransformer.class); when(mockInputTransformer.transform(mock(InputStream.class))) .thenThrow(new CatalogTransformerException()); when(mockSortedServiceList.stream()).thenReturn(Stream.of(mockInputTransformer)); transformer.setInputTransformers(mockSortedServiceList); Metacard metacard = transformer.transform(new ByteArrayInputStream(samplePointJsonText().getBytes())); assertEquals("ddf.metacard", metacard.getMetacardType().getName()); assertEquals("myTitle", metacard.getTitle()); }

Target:
public void testGuessTransformer() throws IOException, CatalogTransformerException { SortedServiceList mockSortedServiceList = mock(SortedServiceList.class); InputTransformer mockInputTransformer = mock(InputTransformer.class); when(mockInputTransformer.transform(mock(InputStream.class))) .thenThrow(new CatalogTransformerException()); when(mockSortedServiceList.stream()).thenReturn(Stream.of(mockInputTransformer)); transformer.setInputTransformers(mockSortedServiceList); Metacard metacard = transformer.transform(new ByteArrayInputStream(samplePointJsonText().getBytes())); ArgumentCaptor<ByteArrayInputStream> inputStreamCaptor = ArgumentCaptor.forClass(ByteArrayInputStream.class); verify(mockSortedServiceList).stream(); verify(mockInputTransformer).transform(inputStreamCaptor.capture()); assertThat(metacard.getMetacardType().getName(), is("ddf.metacard")); assertThat(metacard.getTitle(), is(DEFAULT_TITLE)); }
Source:
void allocate(File destinationFile, long sizeInBytes) throws IOException { if (!poolInitialized) { LOGGER.debug("Allocating segment before pool is fully initialized to " + destinationFile.getAbsolutePath()); } File reserveFile = reserveFiles.remove(sizeInBytes); if (reserveFile == null) { LOGGER.info("Segment of size not found in pool; attempting to create a new preallocated file", sizeInBytes); reserveFile = createReserveFile(sizeInBytes); } if (destinationFile.exists() || !reserveFile.renameTo(destinationFile)) { reserveFiles.add(sizeInBytes, reserveFile); throw new IOException("Error while moving reserve file: " + reserveFile.getAbsolutePath() + " to location: " + destinationFile.getAbsolutePath()); } }

Target:
void allocate(File destinationFile, long sizeInBytes) throws IOException { if (enablePooling && poolState != PoolState.INITIALIZED) { logger.info("Allocating segment of size to before pool is fully initialized", sizeInBytes, destinationFile.getAbsolutePath()); metrics.diskSpaceAllocatorAllocBeforeInitCount.inc(); } else { logger.debug("Allocating segment of size to {}", sizeInBytes, destinationFile.getAbsolutePath()); } if (destinationFile.exists()) { throw new IOException("Destination file already exists: " + destinationFile.getAbsolutePath()); } File reserveFile = null; if (poolState != PoolState.NOT_INVENTORIED) { reserveFile = reserveFiles.remove(sizeInBytes); } if (reserveFile == null) { if (enablePooling) { logger.info("Segment of size not found in pool; attempting to create a new preallocated file; poolState: {}", sizeInBytes, poolState); metrics.diskSpaceAllocatorSegmentNotFoundCount.inc(); } Utils.preAllocateFileIfNeeded(destinationFile, sizeInBytes); } else { try { Files.move(reserveFile.toPath(), destinationFile.toPath()); } catch (Exception e) { reserveFiles.add(sizeInBytes, reserveFile); throw e; } } }
Source:
private CosmosException logAndWrapExceptionWithLastRetryWithException(Exception exception) { RetryWithException lastRetryWithException = this.request.getLastRetryWithException(); String exceptionType; if (exception instanceof GoneException) { exceptionType = "GoneException"; } else if (exception instanceof PartitionKeyRangeGoneException) { exceptionType = "PartitionKeyRangeGoneException"; } else if (exception instanceof InvalidPartitionException) { exceptionType = "InvalidPartitionException"; } else if (exception instanceof PartitionKeyRangeIsSplittingException) { exceptionType = "PartitionKeyRangeIsSplittingException"; } else if (exception instanceof CosmosException) { logger.warn("Received CosmosException after backoff/retry. Will fail the request.", exception); return (CosmosException)exception; } else { throw new IllegalStateException("Invalid exception type", exception); } if (lastRetryWithException != null) { logger.warn( "Received after backoff/retry including at least one RetryWithException. " + "Will fail the request with RetryWithException. {}: {}. RetryWithException: {}", exceptionType, exceptionType, exception, lastRetryWithException); return lastRetryWithException; } logger.warn( "Received after backoff/retry. Will fail the request. {}", exceptionType, exception); return BridgeInternal.createServiceUnavailableException(exception); }

Target:
private CosmosException logAndWrapExceptionWithLastRetryWithException(Exception exception) { String exceptionType; if (exception instanceof GoneException) { exceptionType = "GoneException"; } else if (exception instanceof PartitionKeyRangeGoneException) { exceptionType = "PartitionKeyRangeGoneException"; } else if (exception instanceof InvalidPartitionException) { exceptionType = "InvalidPartitionException"; } else if (exception instanceof PartitionKeyRangeIsSplittingException) { exceptionType = "PartitionKeyRangeIsSplittingException"; } else if (exception instanceof CosmosException) { logger.warn("Received CosmosException after backoff/retry. Will fail the request.", exception); return (CosmosException)exception; } else { throw new IllegalStateException("Invalid exception type", exception); } RetryWithException lastRetryWithExceptionSnapshot = GoneAndRetryWithRetryPolicy.this.lastRetryWithException; if (lastRetryWithExceptionSnapshot != null) { logger.warn( "Received after backoff/retry including at least one RetryWithException. " + "Will fail the request with RetryWithException. {}: {}. RetryWithException: {}", exceptionType, exceptionType, exception, lastRetryWithExceptionSnapshot); return lastRetryWithExceptionSnapshot; } logger.warn( "Received after backoff/retry. Will fail the request. {}", exceptionType, exception); return BridgeInternal.createServiceUnavailableException(exception); }
Source:
public CapabilityIndex(Iterator<IInstallableUnit> itor) { nameMap = new HashMap<>(300); namespaceMap = new HashMap<>(10); while (itor.hasNext()) { IInstallableUnit iu = itor.next(); Collection<IProvidedCapability> pcs = iu.getProvidedCapabilities(); for (IProvidedCapability pc : pcs) { namespaceMap.computeIfAbsent(pc.getNamespace(), n -> new HashSet<>()).add(iu); nameMap.compute(pc.getName(), (n, v) -> { if (v == null || v == iu) { return iu; } else if (v instanceof IInstallableUnit) { Collection<IInstallableUnit> list = new HashSet<>(); list.add((IInstallableUnit) v); list.add(iu); return list; } else { ((Collection<IInstallableUnit>) v).add(iu); return v; } }); } } }

Target:
public CapabilityIndex(Iterator<IInstallableUnit> itor) { nameMap = new HashMap<>(300); namespaceMap = new HashMap<>(10); while (itor.hasNext()) { IInstallableUnit iu = itor.next(); Collection<IProvidedCapability> pcs = iu.getProvidedCapabilities(); for (IProvidedCapability pc : pcs) { namespaceMap.computeIfAbsent(pc.getNamespace(), namespace -> new HashSet<>()).add(iu); nameMap.compute(pc.getName(), (name, prev) -> { if (prev == null || prev == iu) { return iu; } else if (prev instanceof IInstallableUnit) { Collection<IInstallableUnit> ius = new HashSet<>(); ius.add((IInstallableUnit) prev); ius.add(iu); return ius; } else { ((Collection<IInstallableUnit>) prev).add(iu); return prev; } }); } } }
Source:
private void registerCleanupTimer( KeyedProcessFunction<K, RowData, RowData>.Context ctx, long timestamp) throws Exception { long cleanupTimestamp = timestamp + precedingOffset + 1; Long curCleanupTimestamp = cleanupTsState.value(); if (curCleanupTimestamp == null || curCleanupTimestamp < cleanupTimestamp) { ctx.timerService().registerEventTimeTimer(cleanupTimestamp); cleanupTsState.update(cleanupTimestamp); } }

Target:
private void registerCleanupTimer( KeyedProcessFunction<K, RowData, RowData>.Context ctx, long timestamp) throws Exception { long minCleanupTimestamp = timestamp + precedingOffset + 1; long maxCleanupTimestamp = timestamp + (long) (precedingOffset * 1.5) + 1; Long curCleanupTimestamp = cleanupTsState.value(); if (curCleanupTimestamp == null || curCleanupTimestamp < minCleanupTimestamp) { ctx.timerService().registerEventTimeTimer(maxCleanupTimestamp); cleanupTsState.update(maxCleanupTimestamp); } }
Source:
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { if (verticalOffset > -appBarLayout.getTotalScrollRange() && showOverflowMenu) { showOverflowMenu = false; toolBarLayout.setTitle(""); getAppCompatActivity().supportInvalidateOptionsMenu(); toolbarExpanded = true; } else if (verticalOffset <= -appBarLayout.getTotalScrollRange() && !showOverflowMenu) { showOverflowMenu = true; toolBarLayout.setTitle(readingList != null ? readingList.title() : null); getAppCompatActivity().supportInvalidateOptionsMenu(); toolbarExpanded = false; } DeviceUtil.updateStatusBarTheme(requireActivity(), toolbar, (appBarLayout.getTotalScrollRange() + verticalOffset) > appBarLayout.getTotalScrollRange() / 2); swipeRefreshLayout.setEnabled(verticalOffset == 0); }

Target:
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { if (verticalOffset > -appBarLayout.getTotalScrollRange() && showOverflowMenu) { showOverflowMenu = false; toolBarLayout.setTitle(""); getAppCompatActivity().supportInvalidateOptionsMenu(); toolbarExpanded = true; } else if (verticalOffset <= -appBarLayout.getTotalScrollRange() && !showOverflowMenu) { showOverflowMenu = true; toolBarLayout.setTitle(readingList != null ? readingList.title() : null); getAppCompatActivity().supportInvalidateOptionsMenu(); toolbarExpanded = false; } DeviceUtil.updateStatusBarTheme(requireActivity(), toolbar, actionMode == null && (appBarLayout.getTotalScrollRange() + verticalOffset) > appBarLayout.getTotalScrollRange() / 2); swipeRefreshLayout.setEnabled(verticalOffset == 0); }
Source:
public void generatePasswordAndAccountWhenExternalIdMissing() { ExternalIdentifier externalIdentifier = ExternalIdentifier.create(study.getStudyIdentifier(), EXTERNAL_ID); externalIdentifier.setHealthCode("someoneElsesHealthCode"); study.setExternalIdValidationEnabled(true); when(externalIdService.getExternalId(study.getStudyIdentifier(), EXTERNAL_ID)) .thenThrow(new EntityNotFoundException(ExternalIdentifier.class)); when(participantService.createParticipant(eq(study), participantCaptor.capture(), eq(false))) .thenThrow(new EntityAlreadyExistsException(Account.class, "id", "asdf")); try { service.generatePassword(study, EXTERNAL_ID, true); fail("Should have thrown an exception"); } catch(EntityNotFoundException e) { } verify(accountDao, never()).getAccount(any()); verify(participantService, never()).createParticipant(any(), any(), anyBoolean()); verify(accountDao, never()).changePassword(any(), any(), any()); }

Target:
public void generatePasswordAndAccountWhenExternalIdMissing() { ExternalIdentifier externalIdentifier = ExternalIdentifier.create(study.getStudyIdentifier(), EXTERNAL_ID); externalIdentifier.setHealthCode("someoneElsesHealthCode"); study.setExternalIdValidationEnabled(true); when(externalIdService.getExternalId(study.getStudyIdentifier(), EXTERNAL_ID)) .thenReturn(Optional.empty()); when(participantService.createParticipant(eq(study), participantCaptor.capture(), eq(false))) .thenThrow(new EntityAlreadyExistsException(Account.class, "id", "asdf")); try { service.generatePassword(study, EXTERNAL_ID, true); fail("Should have thrown an exception"); } catch(EntityNotFoundException e) { } verify(accountDao, never()).getAccount(any()); verify(participantService, never()).createParticipant(any(), any(), anyBoolean()); verify(accountDao, never()).changePassword(any(), any(), any()); }
Source:
public OffheapBufferPool(final int computationBufferSize) { super( new FileChannelAppendableBufferPool(computationBufferSize) ); }

Target:
public OffheapBufferPool(final int computationBufferSize) { super( new Supplier<ByteBuffer>() { final AtomicLong count = new AtomicLong(0); @Override public ByteBuffer get() { log.info( "Allocating new intermediate processing buffer[%,d] of size[%,d]", count.getAndIncrement(), computationBufferSize ); return ByteBuffer.allocateDirect(computationBufferSize); } } ); }
Source:
public DateTimeZone deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if(json.isJsonNull()) return null; String tz = json.getAsString(); if (tz.isEmpty()) return DateTimeZone.getDefault(); DateTimeZone timeZone; try { timeZone = DateTimeZone.forID(tz); } catch (IllegalArgumentException e) { throw new ContextualJsonSyntaxException(tz, "is not a valid time zone, must be one of " + DateTimeZone.getAvailableIDs()); } return timeZone; }

Target:
public DateTimeZone deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if(json.isJsonNull()) return null; String tz = json.getAsString(); if (tz.isEmpty()) return DateTimeZone.UTC; DateTimeZone timeZone; try { timeZone = DateTimeZone.forID(tz); } catch (IllegalArgumentException e) { throw new ContextualJsonSyntaxException(tz, "is not a valid time zone, must be one of " + DateTimeZone.getAvailableIDs()); } return timeZone; }
Source:
public static String insertIntoListColumnIndexTable(IdAndVersion tableIdAndVersion, ColumnModel columnInfo, boolean filterRows){ String columnName = getColumnNameForId(columnInfo.getId()); String unnestedColumnName = getUnnestedColumnNameForId(columnInfo.getId()); String rowIdRefColumnName = getRowIdRefColumnNameForId(columnInfo.getId()); String columnIndexTableName = getTableNameForMultiValueColumnIndex(tableIdAndVersion, columnInfo.getId()); String tableName = getTableNameForId(tableIdAndVersion, TableType.INDEX); MySqlColumnType mySqlColumnType = ColumnTypeInfo.getInfoForType(ColumnTypeListMappings.nonListType(columnInfo.getColumnType())).getMySqlType(); String columnExpandTypeSQl = mySqlColumnType.name() + (mySqlColumnType.hasSize() && columnInfo.getMaximumSize() != null ? "(" + columnInfo.getMaximumSize() + ")" : ""); String rowFilter = ""; if(filterRows) { rowFilter = " WHERE "+tableName+"."+ROW_ID+" IN (:"+ID_PARAMETER_NAME+")"; } return "INSERT INTO " + columnIndexTableName + " (" + rowIdRefColumnName + "," + INDEX_NUM + ","+ unnestedColumnName +") " + "SELECT " + ROW_ID + " , TEMP_JSON_TABLE.ORDINAL - 1 , TEMP_JSON_TABLE.COLUMN_EXPAND" + " FROM "+ tableName + ", JSON_TABLE(" + columnName + ", '$[*]'" + " COLUMNS (" + " ORDINAL FOR ORDINALITY, " + " COLUMN_EXPAND " + columnExpandTypeSQl + " PATH '$'" + " )" + ") TEMP_JSON_TABLE"+rowFilter+ " ON DUPLICATE KEY UPDATE " + unnestedColumnName + "=" + "TEMP_JSON_TABLE.COLUMN_EXPAND"; }

Target:
public static String insertIntoListColumnIndexTable(IdAndVersion tableIdAndVersion, ColumnModel columnInfo, boolean filterRows){ String columnName = getColumnNameForId(columnInfo.getId()); String unnestedColumnName = getUnnestedColumnNameForId(columnInfo.getId()); String rowIdRefColumnName = getRowIdRefColumnNameForId(columnInfo.getId()); String columnIndexTableName = getTableNameForMultiValueColumnIndex(tableIdAndVersion, columnInfo.getId()); String tableName = getTableNameForId(tableIdAndVersion, TableType.INDEX); MySqlColumnType mySqlColumnType = ColumnTypeInfo.getInfoForType(ColumnTypeListMappings.nonListType(columnInfo.getColumnType())).getMySqlType(); String columnExpandTypeSQl = mySqlColumnType.name() + (mySqlColumnType.hasSize() && columnInfo.getMaximumSize() != null ? "(" + columnInfo.getMaximumSize() + ")" : ""); String rowFilter = ""; if(filterRows) { rowFilter = " WHERE "+tableName+"."+ROW_ID+" IN (:"+ID_PARAMETER_NAME+")"; } return "INSERT INTO " + columnIndexTableName + " (" + rowIdRefColumnName + "," + INDEX_NUM + ","+ unnestedColumnName +") " + "SELECT " + ROW_ID + " , TEMP_JSON_TABLE.ORDINAL - 1 , TEMP_JSON_TABLE.COLUMN_EXPAND" + " FROM "+ tableName + ", JSON_TABLE(" + columnName + ", '$[*]'" + " COLUMNS (" + " ORDINAL FOR ORDINALITY, " + " COLUMN_EXPAND " + columnExpandTypeSQl + " PATH '$'" + " )" + ") TEMP_JSON_TABLE"+rowFilter; }
Source:
public void setInstallLocation(File installLocation) { if (installLocation != null && !installLocation.equals(fInstallLocation)) { fInstallLocation= installLocation; } }

Target:
public void setInstallLocation(File installLocation) { fInstallLocation = installLocation; }
Source:
public void handleGetFirmwareVersionDeviceResponse(final DeviceResponse deviceResponse, final ResponseMessageSender responseMessageSender, final String domain, final String domainVersion, final String messageType, final int retryCount) { ResponseMessageResultType result = ResponseMessageResultType.OK; String firmwareVersion = ""; OsgpException osgpException = null; try { final GetFirmwareVersionDeviceResponse response = (GetFirmwareVersionDeviceResponse) deviceResponse; firmwareVersion = response.getFirmwareVersion(); } catch (final Exception e) { LOGGER.error("Device Response Exception", e); result = ResponseMessageResultType.NOT_OK; osgpException = new TechnicalException(ComponentType.UNKNOWN, "Unexpected exception while retrieving response message", e); } final ProtocolResponseMessage responseMessage = new ProtocolResponseMessage(domain, domainVersion, messageType, deviceResponse.getCorrelationUid(), deviceResponse.getOrganisationIdentification(), deviceResponse.getDeviceIdentification(), result, osgpException, firmwareVersion, retryCount); responseMessageSender.send(responseMessage); }

Target:
private void handleGetFirmwareVersionDeviceResponse(final DeviceResponse deviceResponse, final ResponseMessageSender responseMessageSender, final String domain, final String domainVersion, final String messageType, final int retryCount) { ResponseMessageResultType result = ResponseMessageResultType.OK; String firmwareVersion = ""; OsgpException osgpException = null; try { final GetFirmwareVersionDeviceResponse response = (GetFirmwareVersionDeviceResponse) deviceResponse; firmwareVersion = response.getFirmwareVersion(); } catch (final Exception e) { LOGGER.error("Device Response Exception", e); result = ResponseMessageResultType.NOT_OK; osgpException = new TechnicalException(ComponentType.UNKNOWN, "Unexpected exception while retrieving response message", e); } final ProtocolResponseMessage responseMessage = new ProtocolResponseMessage(domain, domainVersion, messageType, deviceResponse.getCorrelationUid(), deviceResponse.getOrganisationIdentification(), deviceResponse.getDeviceIdentification(), result, osgpException, firmwareVersion, retryCount); responseMessageSender.send(responseMessage); }
Source:
public boolean valueEquals( C t ) { if ( t.length == length ) { final Iterator< T > a = iterator(); final Iterator< T > b = iterator(); while ( a.hasNext() ) if ( !a.next().valueEquals( b.next() ) ) return false; return true; } else return false; }

Target:
public boolean valueEquals( C t ) { if ( t.length == length ) { final Iterator< T > a = iterator(); final Iterator< T > b = t.iterator(); while ( a.hasNext() ) if ( !a.next().valueEquals( b.next() ) ) return false; return true; } else return false; }
Source:
private void presentNewPageNoticeIfNeeded() { if (mIsPreview || !mIsPage || !mModalLayoutPickerFeatureConfig.isEnabled() || !mEditPostRepository.isLocalDraft()) { return; } String message = mEditPostRepository.getContent().isEmpty() ? getString(R.string.mlp_notice_blank_page_created) : getString(R.string.mlp_notice_page_created); mEditorFragment.showNotice(message); }

Target:
private void presentNewPageNoticeIfNeeded() { if (mIsPreview || !mIsPage || !mIsNewPost || !mModalLayoutPickerFeatureConfig.isEnabled()) { return; } String message = mEditPostRepository.getContent().isEmpty() ? getString(R.string.mlp_notice_blank_page_created) : getString(R.string.mlp_notice_page_created); mEditorFragment.showNotice(message); }
Source:
private static boolean downloadMinecraft(Path base, boolean autoDownload) throws IOException, NoSuchAlgorithmException { Path path = base.resolve(MINECRAFT_SERVER_LOCAL); if (Files.notExists(path)) { if (!autoDownload) { return false; } System.out.println("Downloading the versions manifest..."); JsonValue versions = downloadJson(MINECRAFT_MANIFEST_REMOTE); String versionManifestRemote = null; for (JsonValue versionInfo : versions.asObject().get("versions").asArray()) { JsonObject obj = versionInfo.asObject(); String versionId = obj.get("id").asString(); if (versionId.equals(MINECRAFT_SERVER_VERSION)) { versionManifestRemote = obj.get("url").asString(); break; } } if (versionManifestRemote == null) { throw new RuntimeException("Could not find " + MINECRAFT_SERVER_VERSION + "'s manifest URL"); } JsonValue versionManifest = downloadJson(versionManifestRemote); JsonObject serverObj = versionManifest.asObject() .get("downloads").asObject() .get("server").asObject(); String serverRemote = serverObj.get("url").asString(); String sha1 = serverObj.get("sha1").asString(); downloadAndVerify(serverRemote, path, sha1); } path = base.resolve(LAUNCHWRAPPER_LOCAL); if (!Files.exists(path)) { if (!autoDownload) { return false; } download(LAUNCHWRAPPER_REMOTE, path); } return true; }

Target:
private static boolean downloadMinecraft(Path base, boolean autoDownload) throws IOException, NoSuchAlgorithmException { Path path = base.resolve(MINECRAFT_SERVER_LOCAL); if (Files.notExists(path)) { if (!autoDownload) { return false; } System.out.println("Downloading the versions manifest..."); JsonValue versions = downloadJson(MINECRAFT_MANIFEST_REMOTE); String versionManifestRemote = null; for (JsonValue versionInfo : versions.asObject().get("versions").asArray()) { JsonObject obj = versionInfo.asObject(); String versionId = obj.get("id").asString(); if (versionId.equals(MINECRAFT_SERVER_VERSION)) { versionManifestRemote = obj.get("url").asString(); break; } } if (versionManifestRemote == null) { throw new NoSuchElementException("Could not find " + MINECRAFT_SERVER_VERSION + "'s manifest URL"); } JsonValue versionManifest = downloadJson(versionManifestRemote); JsonObject serverObj = versionManifest.asObject() .get("downloads").asObject() .get("server").asObject(); String serverRemote = serverObj.get("url").asString(); String sha1 = serverObj.get("sha1").asString(); downloadAndVerify(serverRemote, path, sha1); } path = base.resolve(LAUNCHWRAPPER_LOCAL); if (!Files.exists(path)) { if (!autoDownload) { return false; } downloadAndVerify(LAUNCHWRAPPER_REMOTE, path, LAUNCHWRAPPER_SHA1); } return true; }
Source:
private void init(Jdbi db) { db.registerArrayType(SqlArrayTypeFactory.of(UserId.class, "int", UserId::getId)); db.registerColumnMapper(new UserIdColumnMapper()); }

Target:
private void init(Jdbi db) { db.registerArrayType(UserId.class, "int", UserId::getId); db.registerColumnMapper(new UserIdColumnMapper()); }
Source:
public WorkflowVersion.WorkflowVersionPathInfo getWorkflowVersionPathInfoByAlias(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "Alias", required = true) @PathParam("alias") String alias) { final WorkflowVersion workflowVersion = this.workflowVersionDAO.findByAlias(alias); if (workflowVersion == null) { LOG.error("Could not find workflow version using the alias: " + alias); throw new CustomWebApplicationException("Workflow version not found when searching with alias: " + alias, HttpStatus.SC_BAD_REQUEST); } long workflowVersionId = workflowVersion.getId(); long workflowId = AliasHelper.getWorkflowId(workflowDAO, workflowVersionId); Workflow workflow = workflowDAO.findById(workflowId); workflowResource.checkEntry(workflow); workflowResource.optionalUserCheckEntry(user, workflow); return new WorkflowVersion.WorkflowVersionPathInfo(workflow.getWorkflowPath(), workflowVersion.getName()); }

Target:
public WorkflowVersion.WorkflowVersionPathInfo getWorkflowVersionPathInfoByAlias(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "Alias", required = true) @PathParam("alias") String alias) { final WorkflowVersion workflowVersion = this.workflowVersionDAO.findByAlias(alias); if (workflowVersion == null) { LOG.error("Could not find workflow version using the alias: " + alias); throw new CustomWebApplicationException("Workflow version not found when searching with alias: " + alias, HttpStatus.SC_BAD_REQUEST); } long workflowVersionId = workflowVersion.getId(); Workflow workflow = AliasHelper.getWorkflow(workflowDAO, workflowVersionId); workflowResource.optionalUserCheckEntry(user, workflow); return new WorkflowVersion.WorkflowVersionPathInfo(workflow.getWorkflowPath(), workflowVersion.getName()); }
Source:
private CoreEvent removeOriginalError(CoreEvent event, Optional<Error> originalError) { if (!event.getError().isPresent()) { return event; } if (!isOriginalError(event.getError().get(), originalError)) { return event; } return CoreEvent.builder(event).error(null).build(); }

Target:
private CoreEvent removeOriginalError(CoreEvent event, Optional<Error> originalError) { return event.getError().map(err -> isOriginalError(err, originalError) ? CoreEvent.builder(event).error(null).build() : event) .orElse(event); }
Source:
private void init(AphroditeConfig config) throws AphroditeException { this.config = config; executorService = config.getExecutorService(); AphroditeConfig mutableConfig = new AphroditeConfig(config); for (IssueTrackerService is : ServiceLoader.load(IssueTrackerService.class)) { boolean initialised = is.init(mutableConfig); if (initialised) issueTrackers.add(is); } for (RepositoryService rs : ServiceLoader.load(RepositoryService.class)) { boolean initialised = rs.init(mutableConfig); if (initialised) repositories.add(rs); } for (StreamService ss : ServiceLoader.load(StreamService.class)) { boolean initialised = ss.init(mutableConfig); if (initialised) { ss.loadData(this); streams.add(ss); } } if (issueTrackers.isEmpty() && repositories.isEmpty() && streams.isEmpty()) throw new AphroditeException("Unable to initiatilise Aphrodite, as a valid " + IssueTrackerService.class.getName() + " or " + RepositoryService.class.getName() + "or" + StreamService.class.getName() + " does not exist."); }

Target:
private void init(AphroditeConfig config) throws AphroditeException, NotFoundException { this.config = config; executorService = config.getExecutorService(); AphroditeConfig mutableConfig = new AphroditeConfig(config); for (IssueTrackerService is : ServiceLoader.load(IssueTrackerService.class)) { boolean initialised = is.init(mutableConfig); if (initialised) issueTrackers.add(is); } for (RepositoryService rs : ServiceLoader.load(RepositoryService.class)) { boolean initialised = rs.init(mutableConfig); if (initialised) repositories.add(rs); } for (StreamService ss : ServiceLoader.load(StreamService.class)) { Objects.requireNonNull(repositories, "repository must not be null when initial stream service!"); boolean initialised = ss.init(this,mutableConfig); if (initialised) { streams.add(ss); } } if (issueTrackers.isEmpty() && repositories.isEmpty()) throw new AphroditeException("Unable to initiatilise Aphrodite, as a valid " + IssueTrackerService.class.getName() + " or " + RepositoryService.class.getName() + " does not exist."); }
Source:
protected boolean canDoAction() { boolean returnValue = true; synchronized (_lockObject) { if (Guid.Empty.equals(getVmToAttach(getParameters().getVmPoolId()))) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_AVAILABLE_POOL_VMS); returnValue = false; } } if (returnValue) { List<VM> vmsForUser = getVmDAO().getAllForUser(getAdUserId()); int vmCount = 0; for (VM vm : vmsForUser) { if (vm.getVmPoolId() != null && getVmPoolId().equals(vm.getVmPoolId())) { vmCount++; } } int limit = getVmPool().getMaxAssignedVmsPerUser(); if (vmCount >= limit) { addCanDoActionMessage(VdcBllMessages.VM_POOL_CANNOT_ATTACH_TO_MORE_VMS_FROM_POOL); returnValue = false; } } if (!returnValue) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__ALLOCATE_AND_RUN); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM_FROM_VM_POOL); } return returnValue; }

Target:
protected boolean canDoAction() { boolean returnValue = true; synchronized (_lockObject) { if (Guid.Empty.equals(getVmToAttach(getParameters().getVmPoolId()))) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_AVAILABLE_POOL_VMS); returnValue = false; } } if (returnValue) { List<VM> vmsForUser = getVmDAO().getAllForUser(getAdUserId()); int vmCount = 0; for (VM vm : vmsForUser) { if (vm.getVmPoolId() != null && getVmPoolId().equals(vm.getVmPoolId())) { vmCount++; } } int limit = getVmPool().getMaxAssignedVmsPerUser(); if (vmCount >= limit) { addCanDoActionMessage(VdcBllMessages.VM_POOL_CANNOT_ATTACH_TO_MORE_VMS_FROM_POOL); returnValue = false; } } if (!returnValue) { setActionMessageParameters(); } return returnValue; }
Source:
public boolean equals(final Object obj) { if (!(obj instanceof BulkObject)) { return false; } final BulkObject bulkObject = (BulkObject) obj; return nullableEquals(this.getId(), bulkObject.getId()) && nullableEquals(this.getInCache(), bulkObject.getInCache()) && this.getLatest() == bulkObject.getLatest() && this.getLength() == bulkObject.getLength() && nullableEquals(this.getName(), bulkObject.getName()) && this.getOffset() == bulkObject.getOffset() && this.getPhysicalPlacement() == bulkObject.getPhysicalPlacement() && this.getVersionId() == bulkObject.getVersionId(); }

Target:
public boolean equals(final Object obj) { if (!(obj instanceof BulkObject)) { return false; } final BulkObject bulkObject = (BulkObject) obj; return nullableEquals(this.getId(), bulkObject.getId()) && nullableEquals(this.getInCache(), bulkObject.getInCache()) && this.getLatest() == bulkObject.getLatest() && this.getLength() == bulkObject.getLength() && nullableEquals(this.getName(), bulkObject.getName()) && this.getOffset() == bulkObject.getOffset() && this.getPhysicalPlacement() == bulkObject.getPhysicalPlacement() && nullableEquals(this.getVersionId(), bulkObject.getVersionId()); }
Source:
public String toString() { return new ToStringBuilder(this) .append("balancerDecisionRecords", balancerDecision) .toString(); }

Target:
public String toString() { return new ToStringBuilder(this) .append("balancerDecision", balancerDecision) .toString(); }