auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public WiresCanvas.View removeShape( final ShapeView<?> shapeView ) { if ( org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresUtils.isWiresShape( shapeView ) ) { WiresShape wiresShape = ( WiresShape ) shapeView; wiresManager.deregister( wiresShape ); } else if ( org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresUtils.isWiresShape( shapeView ) ) { WiresConnector wiresConnector = ( WiresConnector ) shapeView; wiresManager.deregister( wiresConnector ); } else { super.removeShape( shapeView ); } return this; }

Target:
public WiresCanvas.View removeShape( final ShapeView<?> shapeView ) { if ( WiresUtils.isWiresShape( shapeView ) ) { WiresShape wiresShape = ( WiresShape ) shapeView; wiresManager.deregister( wiresShape ); } else if ( WiresUtils.isWiresShape( shapeView ) ) { WiresConnector wiresConnector = ( WiresConnector ) shapeView; wiresManager.deregister( wiresConnector ); } else { super.removeShape( shapeView ); } return this; }
Source:
public void deleteAllEmailsInTrashBin() throws BlobstoreFailureException{ List<AdminEmailAttributes> emailsInTrashBin = getAdminEmailsInTrashBin(); for (AdminEmailAttributes a : emailsInTrashBin){ if (a.getGroupReceiver() != null && !JDOHelper.isDeleted(a)){ for(String key : a.getGroupReceiver()){ BlobKey blobKey = new BlobKey(key); deleteAdminEmailUploadedFile(blobKey); } } } deleteEntities(emailsInTrashBin); }

Target:
public void deleteAllEmailsInTrashBin() throws BlobstoreFailureException{ List<AdminEmailAttributes> emailsInTrashBin = getAdminEmailsInTrashBin(); for (AdminEmailAttributes a : emailsInTrashBin){ if (a.getGroupReceiver() != null){ for(String key : a.getGroupReceiver()){ BlobKey blobKey = new BlobKey(key); deleteAdminEmailUploadedFile(blobKey); } } } deleteEntities(emailsInTrashBin); }
Source:
public void showDialog() { if (appContext.getResources().length == 1) { Resource resource = appContext.getResource(); if (resource instanceof Container) { view.setMessage(constant.addToIndexFolder(resource.getName())); } else { view.setMessage(constant.addToIndexFile(resource.getName())); } } else { view.setMessage(constant.addToIndexMultiSelect()); } view.setUpdated(false); view.showDialog(); }

Target:
public void showDialog() { Resource[] resources = appContext.getResources(); checkState(resources != null && resources.length > 0); if (resources.length == 1) { Resource resource = appContext.getResource(); if (resource instanceof Container) { view.setMessage(constant.addToIndexFolder(resource.getName())); } else { view.setMessage(constant.addToIndexFile(resource.getName())); } } else { view.setMessage(constant.addToIndexMultiSelect()); } view.setUpdated(false); view.showDialog(); }
Source:
public static <K> Map<K, Object> sanitize(Map<K, ?> input, Set<Object> visited) { Map<K, Object> result = Maps.newLinkedHashMap(); for (Map.Entry<K, ?> e : input.entrySet()) { if (Entities.isSecret("" + e.getKey())) result.put(e.getKey(), "xxxxxxxx"); else if (e.getValue() instanceof Map) { if (visited.contains(e.getValue())) { continue; } visited.add(e.getValue()); result.put(e.getKey(), sanitize((Map<?, ?>) e.getValue(), visited)); } else { result.put(e.getKey(), e.getValue()); } } return result; }

Target:
static <K> Map<K, Object> sanitize(Map<K, ?> input, Set<Object> visited) { return newInstance().apply(input, visited); }
Source:
public Context start(String spanName, Context context, ProcessKind processKind) { Objects.requireNonNull(spanName, "'spanName' cannot be null."); Objects.requireNonNull(context, "'context' cannot be null."); Objects.requireNonNull(processKind, "'processKind' cannot be null."); Span span; Builder spanBuilder; switch (processKind) { case SEND: spanBuilder = getOrDefault(context, SPAN_BUILDER_KEY, null, Builder.class); if (spanBuilder == null) { return Context.NONE; } span = spanBuilder.setSpanKind(Span.Kind.PRODUCER).startSpan(); if (span.isRecording()) { addSpanRequestAttributes(span, context, spanName); } return context.addData(PARENT_SPAN_KEY, span); case MESSAGE: spanBuilder = getSpanBuilder(spanName, context); span = spanBuilder.setSpanKind(Span.Kind.PRODUCER).startSpan(); context = setContextData(span); return context.addData(PARENT_SPAN_KEY, span); case PROCESS: return startScopedSpan(spanName, context); default: return Context.NONE; } }

Target:
public Context start(String spanName, Context context, ProcessKind processKind) { Objects.requireNonNull(spanName, "'spanName' cannot be null."); Objects.requireNonNull(context, "'context' cannot be null."); Objects.requireNonNull(processKind, "'processKind' cannot be null."); Span span; Builder spanBuilder; switch (processKind) { case SEND: spanBuilder = getOrDefault(context, SPAN_BUILDER_KEY, null, Builder.class); if (spanBuilder == null) { return Context.NONE; } span = spanBuilder.setSpanKind(Span.Kind.CLIENT).startSpan(); if (span.isRecording()) { addSpanRequestAttributes(span, context, spanName); } return context.addData(PARENT_SPAN_KEY, span); case MESSAGE: spanBuilder = getSpanBuilder(spanName, context); span = spanBuilder.setSpanKind(Span.Kind.PRODUCER).startSpan(); context = setContextData(span); return context.addData(PARENT_SPAN_KEY, span); case PROCESS: return startScopedSpan(spanName, context); default: return Context.NONE; } }
Source:
public ByReference() { }

Target:
public ByReference() { super(); }
Source:
public void notifyKeyTransferFinished(int segment, boolean expectValues, boolean cancelled) { SegmentState update; if (expectValues) { update = SegmentState.VALUE_TRANSFER; } else if (cancelled) { update = SegmentState.NOT_OWNED; } else { update = SegmentState.OWNED; } SegmentState previous = segmentStates.getAndSet(segment, update); log.tracef("Finished transfer for segment %d = %s -> %s", segment, previous, update); CompletableFuture<Void> blockedFuture = blockedFutures.get(segment); if (blockedFuture != null) { blockedFuture.completeExceptionally(new CacheException("Segment state transition did not complete correctly.")); } if (trace) { if (expectValues) { log.tracef("Node %s, segment %d has all keys in, expects value transfer", rpcManager.getAddress(), segment); } else { log.tracef("Node %s, segment %d did not transfer any keys, segment is owned now", rpcManager.getAddress(), segment); } } }

Target:
public void notifyKeyTransferFinished(int segment, boolean expectValues, boolean cancelled) { SegmentState update; if (cancelled) { update = SegmentState.NOT_OWNED; assert !expectValues; } else if (expectValues) { update = SegmentState.VALUE_TRANSFER; } else { update = SegmentState.OWNED; } SegmentState previous = segmentStates.getAndSet(segment, update); if (trace) { log.tracef("Finished transfer for segment %d = %s -> %s", segment, previous, update); } CompletableFuture<Void> blockedFuture = blockedFutures.get(segment); if (blockedFuture != null) { blockedFuture.completeExceptionally(new CacheException("Segment state transition did not complete correctly.")); } if (trace) { if (expectValues) { log.tracef("Node %s, segment %d has all keys in, expects value transfer", rpcManager.getAddress(), segment); } else { log.tracef("Node %s, segment %d did not transfer any keys, segment is owned now", rpcManager.getAddress(), segment); } } }
Source:
Bitmap execute(Request request) throws IOException { BitmapHunter hunter = BitmapHunter.forRequest(context, this, dispatcher, request, downloader); return hunter.hunt(); }

Target:
Bitmap execute(Request request) throws IOException { return BitmapHunter.forRequest(context, this, dispatcher, request, downloader).hunt(); }
Source:
private Map<String, File> getFileMap(File folder) throws IOException { if (!folder.isDirectory()) { throw new IOException("Supplied path was not a directory"); } Map<String, File> result = new HashMap<>(); for (File file : folder.listFiles()) { if (file.isDirectory()) { result.putAll(getFileMap(file)); continue; } result.put(file.getName(), file); } return result; }

Target:
private Map<String, File> getFileMap(File folder) throws IOException { if (!folder.isDirectory()) { throw new IOException("Supplied path was not a directory"); } Map<String, File> result = new HashMap<>(); for (File file : folder.listFiles()) { if (file.isDirectory()) { result.putAll(getFileMap(file)); continue; } result.put(getFileName(folder.getAbsolutePath(), file), file); } return result; }
Source:
public void testCircularReferencesWithPrototype() { DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(xbf); reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE); reader.loadBeanDefinitions(REFTYPES_CONTEXT); xbf.getBean("jennys"); assertThatExceptionOfType(BeanCreationException.class).isThrownBy(() -> xbf.getBean("jennys")) .matches(ex -> ex.contains(BeanCurrentlyInCreationException.class)); assertThatExceptionOfType(BeanCreationException.class).isThrownBy(() -> xbf.getBean("davids")) .matches(ex -> ex.contains(BeanCurrentlyInCreationException.class)); }

Target:
public void testCircularReferencesWithPrototype() { DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(xbf); reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE); reader.loadBeanDefinitions(REFTYPES_CONTEXT); assertThatExceptionOfType(BeanCreationException.class).isThrownBy(() -> xbf.getBean("jenny_prototype")) .matches(ex -> ex.contains(BeanCurrentlyInCreationException.class)); assertThatExceptionOfType(BeanCreationException.class).isThrownBy(() -> xbf.getBean("david_prototype")) .matches(ex -> ex.contains(BeanCurrentlyInCreationException.class)); }
Source:
public void mouseUp(MouseEvent e) { if (fPendingMenuDetectEvent != null && e.button == 3 && _dragX == _dragX0) { setCapture(false); _dragState = DRAG_NONE; menuDetectedImpl(fPendingMenuDetectEvent); } if (DRAG_NONE != _dragState) { setCapture(false); if (e.button == 1 && DRAG_TRACE_ITEM == _dragState) { _timeProvider.notifyStartFinishTime(); if (_dragX == _dragX0) { long time = getTimeAtX(e.x); _timeProvider.setSelectedTimeNotify(time, false); } _dragState = DRAG_NONE; } else if (e.button == 1 && DRAG_SPLIT_LINE == _dragState) { redraw(); _dragState = DRAG_NONE; } else if (e.button == 3 && DRAG_ZOOM == _dragState) { Point size = getCtrlSize(); int nameWidth = _timeProvider.getNameSpace(); int x = e.x - nameWidth; if (Math.max(_dragX, _dragX0) > nameWidth && _dragX != _dragX0) { long time0 = getTimeAtX(_dragX0); long time1 = getTimeAtX(_dragX); if (time0 < time1) { _timeProvider.setStartFinishTimeNotify(time0, time1); } else { _timeProvider.setStartFinishTimeNotify(time1, time0); } } else { redraw(); } _dragState = DRAG_NONE; } } }

Target:
public void mouseUp(MouseEvent e) { if (fPendingMenuDetectEvent != null && e.button == 3) { menuDetected(fPendingMenuDetectEvent); } if (DRAG_NONE != _dragState) { setCapture(false); if (e.button == 1 && DRAG_TRACE_ITEM == _dragState) { if (_dragX == _dragX0) { long time = getTimeAtX(e.x); _timeProvider.setSelectedTimeNotify(time, false); } else { _timeProvider.notifyStartFinishTime(); } _dragState = DRAG_NONE; } else if (e.button == 1 && DRAG_SPLIT_LINE == _dragState) { redraw(); _dragState = DRAG_NONE; } else if (e.button == 3 && DRAG_ZOOM == _dragState) { int nameWidth = _timeProvider.getNameSpace(); if (Math.max(_dragX, _dragX0) > nameWidth && _dragX != _dragX0) { long time0 = getTimeAtX(_dragX0); long time1 = getTimeAtX(_dragX); if (time0 < time1) { _timeProvider.setStartFinishTimeNotify(time0, time1); } else { _timeProvider.setStartFinishTimeNotify(time1, time0); } } else { redraw(); } _dragState = DRAG_NONE; } } }
Source:
public OMElement serialize(OMElement parent) { OMElement call = fac.createOMElement("call", synNS); saveTracingState(call, this); Endpoint activeEndpoint = getEndpoint(); if (activeEndpoint != null) { call.addChild(EndpointSerializer.getElementFromEndpoint(activeEndpoint)); } call.addAttribute(fac.createOMAttribute("blocking",nullNS,Boolean.toString(getBlocking()))); if (parent != null) { parent.addChild(call); } return call; }

Target:
public OMElement serialize(OMElement parent) { OMElement call = fac.createOMElement("call", synNS); saveTracingState(call, this); Endpoint activeEndpoint = getEndpoint(); if (activeEndpoint != null) { call.addChild(EndpointSerializer.getElementFromEndpoint(activeEndpoint)); } if (blocking==true) { call.addAttribute(fac.createOMAttribute("blocking", nullNS, Boolean.toString(getBlocking()))); } if (parent != null) { parent.addChild(call); } return call; }
Source:
private void checkDayTypeMapping(final DayProfile dayProfile) { assertEquals(new Integer(BigInteger.TEN.intValue()), dayProfile.getDayId()); assertEquals(new Integer(BigInteger.ZERO.intValue()), dayProfile.getDayProfileActionList().get(0) .getScriptSelector()); assertEquals(10, dayProfile.getDayProfileActionList().get(0).getStartTime().getHour()); assertEquals(35, dayProfile.getDayProfileActionList().get(0).getStartTime().getMinute()); assertEquals(2, dayProfile.getDayProfileActionList().get(0).getStartTime().getSecond()); assertEquals(0, dayProfile.getDayProfileActionList().get(0).getStartTime().getHundredths()); }

Target:
private void checkDayTypeMapping(final DayProfile dayProfile) { assertNotNull(dayProfile); assertNotNull(dayProfile.getDayId()); assertNotNull(dayProfile.getDayProfileActionList()); assertNotNull(dayProfile.getDayProfileActionList().get(0)); assertEquals(new Integer(BigInteger.TEN.intValue()), dayProfile.getDayId()); assertEquals(new Integer(BigInteger.ZERO.intValue()), dayProfile.getDayProfileActionList().get(0) .getScriptSelector()); assertNotNull(dayProfile.getDayProfileActionList().get(0).getStartTime()); }
Source:
public RequestStatus updateRelease(Release release, User user, Iterable<Release._Fields> immutableFields) throws SW360Exception { prepareRelease(release); Release actual = releaseRepository.get(release.getId()); assertNotNull(actual, "Could not find release to update"); if (actual.equals(release)) { return RequestStatus.SUCCESS; } DocumentPermissions<Release> permissions = makePermission(actual, user); boolean hasChangesInEccFields = hasChangesInEccFields(release, actual); if ((hasChangesInEccFields && permissions.isActionAllowed(RequestedAction.WRITE_ECC)) || (!hasChangesInEccFields && permissions.isActionAllowed(RequestedAction.WRITE))) { copyFields(actual, release, immutableFields); autosetReleaseClearingState(release, actual); if (hasChangesInEccFields) { autosetEccUpdaterInfo(release, user); } preventDeletionOfAcceptedAttachments(actual.attachments, release.attachments); releaseRepository.update(release); updateReleaseDependentFieldsForComponentId(release.getComponentId()); attachmentConnector.deleteAttachmentDifference(nullToEmptySet(actual.getAttachments()),nullToEmptySet(release.getAttachments())); sendMailNotificationsForReleaseUpdate(release, user.getEmail()); } else { if (hasChangesInEccFields) { return releaseModerator.updateReleaseEccInfo(release, user); } else { return releaseModerator.updateRelease(release, user); } } return RequestStatus.SUCCESS; }

Target:
public RequestStatus updateRelease(Release release, User user, Iterable<Release._Fields> immutableFields) throws SW360Exception { prepareRelease(release); Release actual = releaseRepository.get(release.getId()); assertNotNull(actual, "Could not find release to update"); if (actual.equals(release)) { return RequestStatus.SUCCESS; } DocumentPermissions<Release> permissions = makePermission(actual, user); boolean hasChangesInEccFields = hasChangesInEccFields(release, actual); if ((hasChangesInEccFields && permissions.isActionAllowed(RequestedAction.WRITE_ECC)) || (!hasChangesInEccFields && permissions.isActionAllowed(RequestedAction.WRITE))) { copyFields(actual, release, immutableFields); autosetReleaseClearingState(release, actual); if (hasChangesInEccFields) { autosetEccUpdaterInfo(release, user); } release.setAttachments( getAllAttachmentsToKeep(actual.getAttachments(), release.getAttachments()) ); releaseRepository.update(release); updateReleaseDependentFieldsForComponentId(release.getComponentId()); attachmentConnector.deleteAttachmentDifference(nullToEmptySet(actual.getAttachments()),nullToEmptySet(release.getAttachments())); sendMailNotificationsForReleaseUpdate(release, user.getEmail()); } else { if (hasChangesInEccFields) { return releaseModerator.updateReleaseEccInfo(release, user); } else { return releaseModerator.updateRelease(release, user); } } return RequestStatus.SUCCESS; }
Source:
public Plural getPlural(int resId, int quantity, String qualifiers) { return getPlural(getResourceIndex().getResName(resId), quantity, qualifiers); }

Target:
public Plural getPlural(int resId, int quantity, String qualifiers) { ResName resName = getResourceIndex().getResName(resId); return resName != null ? getPlural(resName, quantity, qualifiers) : null; }
Source:
public ITask refactorTaskId(ITask oldTask, String newTaskId) { TaskTask newTask = new TaskTask(oldTask.getConnectorKind(), oldTask.getRepositoryUrl(), newTaskId); newTask.setSummary(oldTask.getSummary()); newTask.setPriority(oldTask.getPriority()); newTask.setSynchronizationState(oldTask.getSynchronizationState()); newTask.setCompletionDate(oldTask.getCompletionDate()); newTask.setCreationDate(oldTask.getCreationDate()); newTask.setModificationDate(oldTask.getModificationDate()); newTask.setTaskKind(oldTask.getTaskKind()); newTask.setOwnerId(oldTask.getOwnerId()); newTask.setOwner(oldTask.getOwner()); newTask.setTaskKey(oldTask.getTaskKey()); if (oldTask instanceof AbstractTask) { AbstractTask task = (AbstractTask) oldTask; newTask.setSynchronizing(task.isSynchronizing()); newTask.setMarkReadPending(task.isMarkReadPending()); newTask.setNotified(task.isNotified()); newTask.setChanged(task.isChanged()); newTask.setReminded(task.isReminded()); newTask.setStatus(task.getStatus()); newTask.setNotes(task.getNotes()); newTask.setEstimatedTimeHours(task.getEstimatedTimeHours()); addTaskContainers(task, newTask); } Map<String, String> attributeMap = oldTask.getAttributes(); for (String key : attributeMap.keySet()) { newTask.setAttribute(key, attributeMap.get(key)); } deleteTask(oldTask); return newTask; }

Target:
public AbstractTask refactorTaskId(ITask oldTask, String newTaskId) { TaskTask newTask = new TaskTask(oldTask.getConnectorKind(), oldTask.getRepositoryUrl(), newTaskId); newTask.setSummary(oldTask.getSummary()); newTask.setPriority(oldTask.getPriority()); newTask.setSynchronizationState(oldTask.getSynchronizationState()); newTask.setCompletionDate(oldTask.getCompletionDate()); newTask.setCreationDate(oldTask.getCreationDate()); newTask.setModificationDate(oldTask.getModificationDate()); newTask.setTaskKind(oldTask.getTaskKind()); newTask.setOwnerId(oldTask.getOwnerId()); newTask.setOwner(oldTask.getOwner()); newTask.setTaskKey(oldTask.getTaskKey()); if (oldTask instanceof AbstractTask) { AbstractTask task = (AbstractTask) oldTask; newTask.setSynchronizing(task.isSynchronizing()); newTask.setMarkReadPending(task.isMarkReadPending()); newTask.setNotified(task.isNotified()); newTask.setChanged(task.isChanged()); newTask.setReminded(task.isReminded()); newTask.setStatus(task.getStatus()); newTask.setNotes(task.getNotes()); newTask.setEstimatedTimeHours(task.getEstimatedTimeHours()); addTaskContainers(task, newTask); } Map<String, String> attributeMap = oldTask.getAttributes(); for (String key : attributeMap.keySet()) { newTask.setAttribute(key, attributeMap.get(key)); } deleteTask(oldTask); return newTask; }
Source:
public String getUnifiedDiff() { ByteArrayOutputStream out = new ByteArrayOutputStream(); Repository repo = openRepository(); if (repo != null) { DiffFormatter df = new DiffFormatter(out); df.setRepository(repo); df.setDetectRenames(true); try { PatchList patchList = getPatchList(); df.format(patchList.getOldId(), patchList.getNewId()); } catch (IOException e) { log.error("Cannot format patch", e); } finally { df.release(); } } return RawParseUtils.decode(out.toByteArray()); }

Target:
public String getUnifiedDiff() { ByteArrayOutputStream out = new ByteArrayOutputStream(); final Repository repo = getRepository(); if (repo != null) { DiffFormatter df = new DiffFormatter(out); try { final PatchList patchList = getPatchList(); if (patchList != null) { df.setRepository(repo); df.setDetectRenames(true); df.format(patchList.getOldId(), patchList.getNewId()); } } catch (IOException e) { log.error("Cannot format patch", e); } finally { df.release(); repo.close(); } } return RawParseUtils.decode(out.toByteArray()); }
Source:
public static long nanosElapsed(long startNanos) { return nanos() - startNanos; }

Target:
public static long nanosElapsed(long startNanos) { return System.nanoTime() - startNanos; }
Source:
public String call(@HeaderParam("clientURL") String clientURL) throws Exception { ResteasyClient client = (ResteasyClient) ResteasyClientBuilder.newBuilder().build(); WebTarget target = client.target(clientURL); Response response = target.request().get(); if (response.getStatus() != HttpResponseCodes.SC_OK) { throw new Exception("Client in deployment received wrong response code"); } String responseText = response.readEntity(String.class); return responseText; }

Target:
public String call(@HeaderParam("clientURL") String clientURL) throws Exception { Client client = ClientBuilder.newClient(); try { WebTarget target = client.target(clientURL); Response response = target.request().get(); if (response.getStatus() != HttpResponseCodes.SC_OK) { throw new Exception("Client in deployment received wrong response code"); } String responseText = response.readEntity(String.class); return responseText; } finally { client.close(); } }
Source:
public void onRegistered(int imsRadioTech) { if (DBG) { log("onRegistered ::"); } synchronized (mRegistrationListeners) { mRegistrationListeners.forEach(l -> l.onRegistered(imsRadioTech)); } }

Target:
public void onRegistered(int imsRadioTech) { if (DBG) log("onRegistered ::"); synchronized (mRegistrationListeners) { mRegistrationListeners.forEach(l -> l.onRegistered(imsRadioTech)); } }
Source:
public void testStopMigrate() throws Exception { GlusterBrick brick = new GlusterBrick(); GlusterVolume volume = new GlusterVolume(); brick.setId(GUIDS[0].toString()); brick.setBrickDir(brickDir); brick.setServerId(serverId.toString()); volume.setId(volumeId.toString()); brick.setGlusterVolume(volume); GlusterBricks bricks = control.createMock(GlusterBricks.class); expect(bricks.getGlusterBricks()).andReturn(Collections.singletonList(brick)).anyTimes(); setUriInfo(setUpActionExpectations(VdcActionType.StopRemoveGlusterVolumeBricks, GlusterVolumeRemoveBricksParameters.class, new String[] {}, new Object[] {}, true, true)); Action action = new Action(); action.setBricks(bricks); collection.stopMigrate(action); }

Target:
public void testStopMigrate() throws Exception { GlusterBrick brick = new GlusterBrick(); GlusterVolume volume = new GlusterVolume(); brick.setName(serverName + ":" + brickDir); volume.setId(volumeId.toString()); brick.setGlusterVolume(volume); GlusterBricks bricks = control.createMock(GlusterBricks.class); expect(bricks.getGlusterBricks()).andReturn(Collections.singletonList(brick)).anyTimes(); setUriInfo(setUpActionExpectations(VdcActionType.StopRemoveGlusterVolumeBricks, GlusterVolumeRemoveBricksParameters.class, new String[] {}, new Object[] {}, true, true)); Action action = new Action(); action.setBricks(bricks); collection.stopMigrate(action); }
Source:
protected void createAdvancedControls(Composite parent) { super.createAdvancedControls(parent); Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); GridData sd = new GridData(GridData.FILL_HORIZONTAL); separator.setLayoutData(sd); List<String> versions = new ArrayList<String>(); for (CDIVersion v: CDIVersion.ALL_VERSIONS) { versions.add(v.toString()); } versionEditor = SwtFieldEditorFactory.INSTANCE.createComboEditor("version", CDIUIMessages.VERSION_LABEL, versions, versions.get(versions.size() - 1), false, ""); Composite c = new Composite(parent, 0); c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); GridLayout gl = new GridLayout(3, false); gl.marginWidth = 5; gl.marginHeight = 5; gl.verticalSpacing = 0; gl.horizontalSpacing = 5; c.setLayout(gl); versionEditor.doFillIntoGrid(c); }

Target:
protected void createAdvancedControls(Composite parent) { Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); GridData sd = new GridData(GridData.FILL_HORIZONTAL); separator.setLayoutData(sd); List<String> versions = new ArrayList<String>(); for (CDIVersion v: CDIVersion.ALL_VERSIONS) { versions.add(v.toString()); } versionEditor = SwtFieldEditorFactory.INSTANCE.createComboEditor("version", CDIUIMessages.VERSION_LABEL, versions, getInitialCDIVersion(), false, ""); Composite c = new Composite(parent, 0); c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); GridLayout gl = new GridLayout(3, false); gl.marginWidth = 5; gl.marginHeight = 5; gl.verticalSpacing = 0; gl.horizontalSpacing = 5; c.setLayout(gl); versionEditor.doFillIntoGrid(c); }
Source:
public static Optional<Integer> getPort() { if (jmxServer == null) { return Optional.empty(); } else { return Optional.of(jmxServer.getPort()); } }

Target:
public static Optional<Integer> getPort() { return Optional.ofNullable(jmxServer).map(JMXServer::getPort); }
Source:
public SslConnection accept(StreamConnection tcpConnection, SSLEngine engine) { SslConnection connection = new JsseSslStreamConnection(tcpConnection, engine, socketBufferPool, applicationBufferPool, startTls); if(sslEngineCallback != null) { sslEngineCallback.acceptCallback(connection, engine); } return connection; }

Target:
public SslConnection accept(StreamConnection tcpConnection, SSLEngine engine) { return new JsseSslStreamConnection(tcpConnection, engine, socketBufferPool, applicationBufferPool, startTls); }
Source:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.MODULO, ctx -> { BinaryExpression expression = (BinaryExpression) ctx.syntaxNode(); StringLiteral formatString = extractStringLiteral(expression.leftOperand()); if (formatString == null) { return; } Optional<StringFormat> formatOptional = StringFormat.createFromPrintfStyle(ctx, expression.leftOperand(), formatString, formatString.trimmedQuotesValue()); if (!formatOptional.isPresent()) { return; } StringFormat format = formatOptional.get(); Expression rhs = expression.rightOperand(); if (format.hasNamedFields()) { checkNamed(ctx, format, rhs); } else { checkPositional(ctx, format, rhs); } }); }

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.MODULO, ctx -> { BinaryExpression expression = (BinaryExpression) ctx.syntaxNode(); StringLiteral formatString = extractStringLiteral(expression.leftOperand()); if (formatString == null) { return; } Optional<StringFormat> formatOptional = StringFormat.createFromPrintfStyle(ctx, expression.leftOperand(), formatString); if (!formatOptional.isPresent()) { return; } StringFormat format = formatOptional.get(); Expression rhs = expression.rightOperand(); if (format.numExpectedArguments() == 0 && (isMapping(rhs) || rhs.type().canOnlyBe("list"))) { return; } if (format.hasNamedFields()) { checkNamed(ctx, format, rhs); } else { checkPositional(ctx, format, rhs); } }); }
Source:
private void insertEntity() { TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() .connectionString("connectionString") .buildAsyncClient(); TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getClient("OfficeSupplies"); String row = "crayolaMarkers"; String partitionKey = "markers"; tableAsyncClient.insertEntity(new TableEntity(row, partitionKey, null)).subscribe(tableEntity -> { logger.info("Insert Entity Successful. Entity: " + tableEntity); }, error -> { logger.error("There was an error inserting the Entity. Error: " + error); }); }

Target:
private void insertEntity() { TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() .connectionString("connectionString") .buildAsyncClient(); TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getTableAsyncClient("OfficeSupplies"); Map<String, Object> properties = new HashMap<>(); properties.put("RowKey", "crayolaMarkers"); properties.put("PartitionKey", "markers"); tableAsyncClient.createEntity(properties).subscribe(tableEntity -> { System.out.println("Insert Entity Successful. Entity: " + tableEntity); }, error -> { System.err.println("There was an error inserting the Entity. Error: " + error); }); }
Source:
public Response intercept(Chain chain) throws IOException { Request originalRequest = chain.request(); HttpUrl rebasedUrl = urls.redirectToCurrent(originalRequest.url()).orElseThrow(() -> new IOException( "Failed to determine suitable target URL for request URL " + originalRequest.url() + " amongst known base URLs: " + urls.getBaseUrls())); Request request = originalRequest.newBuilder() .url(rebasedUrl) .tag(originalRequest.equals(originalRequest.tag()) ? null : originalRequest.tag()) .build(); return chain.proceed(request); }

Target:
public Response intercept(Chain chain) throws IOException { Request originalRequest = chain.request(); HttpUrl rebasedUrl = urls.redirectToCurrent(originalRequest.url()).orElseThrow(() -> new IOException( "Failed to determine suitable target URL for request URL " + originalRequest.url() + " amongst known base URLs: " + urls.getBaseUrls())); Request request = originalRequest.newBuilder() .url(rebasedUrl) .build(); return chain.proceed(request); }
Source:
protected void addConceptSpecificMetadata(ActivityDTO dto, ActivityMetadata metadata) { if (!(metadata instanceof UserMaintenanceActivityMetadata)) { return; } }

Target:
protected void addConceptSpecificMetadata(ActivityDTO dto, ActivityMetadata metadata) { if (!(metadata instanceof AnnouncementActivityMetadata)) { return; } }
Source:
public ImmutableList<T> init() { return fromBounded(toObjectArray(), 0, this.length - 1); }

Target:
public ImmutableList<T> init() { return fromBounded(this.toObjectArray(), 0, this.length - 1); }
Source:
public String process(String query) { _logger.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, _logger); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { String response = processDatastreamStateRequest(uri); _logger.trace("Query: returns response: {}", query, response); return response; } else if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.TOPICPARTITION_STATS.toString())) { final String response = processTopicPartitionStatsRequest(); _logger.trace("Query: returns response: {}", query, response); return response; } else { _logger.warn("Could not process query with path {}", query, path); } } catch (Exception e) { _logger.warn("Failed to process query {}", query); _logger.debug(String.format("Failed to process query %s", query), e); throw new DatastreamRuntimeException(e); } return null; }

Target:
public String process(String query) { _logger.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, _logger); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { String response = processDatastreamStateRequest(uri); _logger.trace("Query: returns response: {}", query, response); return response; } else if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.PARTITIONS.toString())) { String response = processTopicPartitionStatsRequest(); _logger.trace("Query: returns response: {}", query, response); return response; } else { _logger.warn("Could not process query with path {}", query, path); } } catch (Exception e) { _logger.warn("Failed to process query {}", query); _logger.debug(String.format("Failed to process query %s", query), e); throw new DatastreamRuntimeException(e); } return null; }
Source:
public static void achieveConsensusForNamespace(TimelockNamespaces timelockNamespaces, String namespace) { TimeLockServices timeLockServices = timelockNamespaces.get(namespace); Long timestamp = timeLockServices.getTimelockService().getFreshTimestamp() + 1000000L; timeLockServices.getTimestampManagementService().fastForwardTimestamp(timestamp); }

Target:
public static void achieveConsensusForNamespace(TimelockNamespaces timelockNamespaces, String namespace) { TimeLockServices timeLockServices = timelockNamespaces.get(namespace); long timestamp = timeLockServices.getTimelockService().getFreshTimestamp() + 1000000L; timeLockServices.getTimestampManagementService().fastForwardTimestamp(timestamp); }
Source:
public void testAddWholeRepo() throws Exception { assertTrue(new File(db.getWorkTree(), "sub").mkdir()); File file = new File(db.getWorkTree(), "sub/a.txt"); FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File file2 = new File(db.getWorkTree(), "sub/b.txt"); FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); Git git = new Git(db); git.add().addFilepattern(".").call(); assertEquals( "[sub/a.txt, mode:100644, content:content]" + "[sub/b.txt, mode:100644, content:content b]", indexState(CONTENT)); }

Target:
public void testAddWholeRepo() throws Exception { FileUtils.mkdir(new File(db.getWorkTree(), "sub")); File file = new File(db.getWorkTree(), "sub/a.txt"); FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File file2 = new File(db.getWorkTree(), "sub/b.txt"); FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); Git git = new Git(db); git.add().addFilepattern(".").call(); assertEquals( "[sub/a.txt, mode:100644, content:content]" + "[sub/b.txt, mode:100644, content:content b]", indexState(CONTENT)); }
Source:
public CDOLockState[] getLockStates(int viewID, Collection<CDOID> ids) { throw new UnsupportedOperationException(); }

Target:
public CDOLockState[] getLockStates(int viewID, Collection<CDOID> ids) { return getLockStates(viewID, ids, CDOLockState.DEPTH_NONE); }
Source:
public void clickOnSingleEnabledCategory(){ driver.switchTo().defaultContent(); driver.switchTo().frame(mapFrame); waitForElementByElement(enabledPinTypesCollection.get(0)); enabledPinTypesCollection.get(0).click(); PageObjectLogging.log("clickOnSingleEnabledCategory","Single enabled category was clicked", true); driver.switchTo().activeElement(); }

Target:
public void clickOnSingleEnabledCategory() { driver.switchTo().defaultContent(); driver.switchTo().frame(mapFrame); waitForElementByElement(enabledPinTypesCollection.get(InteractiveMapsContent.pinTypeIndex)); enabledPinTypesCollection.get(InteractiveMapsContent.pinTypeIndex).click(); PageObjectLogging.log("clickOnSingleEnabledCategory", "Single enabled category was clicked", true); driver.switchTo().activeElement(); }
Source:
public ProcessView() { super(); IExtensionPointLimiter extensionPointLimiter = new ExtensionPointLimiterImpl( "org.talend.designer.runprocess.runprocess_view_helper", "runprocess_view_helper"); IExtensionPointLimiter debugextensionPointLimiter = new ExtensionPointLimiterImpl( "org.talend.designer.runprocess.debugprocess_view_helper", "debugprocess_view_helper"); debugViewHelpers = new HashMap<String, IDebugViewHelper>(); ExtensionImplementationProvider.getInstance(debugextensionPointLimiter, null).forEach(e -> { if (e instanceof IDebugViewHelper) { IDebugViewHelper helper = (IDebugViewHelper) e; debugViewHelpers.put(helper.getDebugType(), helper); } }); IProcessViewHelper processViewHelperPrm = ExtensionImplementationProvider.getSingleInstance(extensionPointLimiter, null); if (processViewHelperPrm == null) { processViewHelperPrm = new DefaultProcessViewHelper(); } tabFactory = new HorizontalTabFactory(); setProcessViewHelper(processViewHelperPrm); if(debugViewHelpers.size() == 0) { DefaultDebugviewHelper defaultDebugViewHelper = new DefaultDebugviewHelper(); debugViewHelpers.put(defaultDebugViewHelper.getDebugType(), defaultDebugViewHelper); } rubjobManager = ProcessManager.getInstance(); ProxyRepositoryFactory.getInstance().addPropertyChangeListener(this); }

Target:
public ProcessView() { super(); IExtensionPointLimiter extensionPointLimiter = new ExtensionPointLimiterImpl( "org.talend.designer.runprocess.runprocess_view_helper", "runprocess_view_helper"); IExtensionPointLimiter debugextensionPointLimiter = new ExtensionPointLimiterImpl( "org.talend.designer.runprocess.debugprocess_view_helper", "debugprocess_view_helper"); debugViewHelpers = new HashMap<EDebugProcessType, IDebugViewHelper>(); ExtensionImplementationProvider.getInstance(debugextensionPointLimiter, null).forEach(e -> { if (e instanceof IDebugViewHelper) { IDebugViewHelper helper = (IDebugViewHelper) e; debugViewHelpers.put(helper.getDebugType(), helper); } }); IProcessViewHelper processViewHelperPrm = ExtensionImplementationProvider.getSingleInstance(extensionPointLimiter, null); if (processViewHelperPrm == null) { processViewHelperPrm = new DefaultProcessViewHelper(); } tabFactory = new HorizontalTabFactory(); setProcessViewHelper(processViewHelperPrm); if(!debugViewHelpers.containsKey(EDebugProcessType.DI)) { DefaultDebugviewHelper defaultDebugViewHelper = new DefaultDebugviewHelper(); debugViewHelpers.put(EDebugProcessType.DI, defaultDebugViewHelper); } rubjobManager = ProcessManager.getInstance(); ProxyRepositoryFactory.getInstance().addPropertyChangeListener(this); }
Source:
private void assertNoLongerExposesEmbeddedTimestampService() { TimestampService timestampClient = createEteClientFor(TimestampService.class); softAssertions.assertThat( ((AtlasDbRemoteException) catchThrowable(timestampClient::getFreshTimestamp)).getStatus()) .as("no longer exposes an embedded timestamp service"); }

Target:
private void assertNoLongerExposesEmbeddedTimestampService() { TimestampService timestampClient = createEteClientFor(TimestampService.class); softAssertions.assertThat( ((AtlasDbRemoteException) catchThrowable(timestampClient::getFreshTimestamp)).getStatus()) .isEqualTo(404) .as("no longer exposes an embedded timestamp service"); }
Source:
public String createAction(Element node, IXmlStateSystemContainer container) { String id = TmfXmlActionCu.compileNamedAction(container.getAnalysisCompilationData(), node); if (id == null) { throw new NullPointerException("Named action did not compile correctly"); } return id; }

Target:
public String createAction(Element node, IXmlStateSystemContainer container) { return Objects.requireNonNull(TmfXmlActionCu.compileNamedAction(container.getAnalysisCompilationData(), node), "Named action did not compile correctly"); }
Source:
public void draw(int mouseX, int mouseY, float partialTick) { RenderHelper.enableGUIStandardItemLighting(); GL11.glEnable(GL11.GL_BLEND); RenderUtil.renderQuad2D(8, 8, 0, getXSize() - 11, getYSize() - 11, new Vector4f(0, 0, 0, 1)); RenderUtil.renderQuad2D(10, 10, 0, getXSize() - 15, getYSize() - 15, new Vector4f(0.6, 0.6, 0.6, 1)); RenderItem itemRenderer = mc.getRenderItem(); GL11.glEnable(GL11.GL_DEPTH_TEST); NNList<ItemStack> snapshot = filter.getSnapshot(); int x = 15; int y = 10; int count = 0; for (ItemStack st : snapshot) { if (!st.isEmpty()) { itemRenderer.renderItemAndEffectIntoGUI(st, x, y); } x += 20; count++; if (count % 9 == 0) { x = 15; y += 20; } } }

Target:
public void draw(int mouseX, int mouseY, float partialTick) { RenderHelper.enableGUIStandardItemLighting(); GlStateManager.enableBlend(); RenderUtil.renderQuad2D(8, 8, 0, getXSize() - 11, getYSize() - 11, new Vector4f(0, 0, 0, 1)); RenderUtil.renderQuad2D(10, 10, 0, getXSize() - 15, getYSize() - 15, new Vector4f(0.6, 0.6, 0.6, 1)); RenderItem itemRenderer = mc.getRenderItem(); GlStateManager.enableDepth(); NNList<ItemStack> snapshot = filter.getSnapshot(); int x = 15; int y = 10; int count = 0; for (ItemStack st : snapshot) { if (!st.isEmpty()) { itemRenderer.renderItemAndEffectIntoGUI(st, x, y); } x += 20; count++; if (count % 9 == 0) { x = 15; y += 20; } } }
Source:
public List<FirmwareVersionDto> execute(final ClientConnection conn, final DlmsDevice device, final Void useless) throws ProtocolAdapterException { final List<FirmwareVersionDto> resultList = new ArrayList<>(); final List<GetResult> getResultList = this.dlmsHelperService.getAndCheck(conn, device, "retrieve actual meter reads", ATTRIBUTE_ADDRESSES); resultList.add(new FirmwareVersionDto(ACTIVE_FIRMWARE, this.dlmsHelperService.readString( getResultList.get(INDEX_ACTIVE_FIRMWARE_VERSION).resultData(), ACTIVE_FIRMWARE))); resultList.add(new FirmwareVersionDto(MODULE_ACTIVE_FIRMWARE, this.dlmsHelperService.readString(getResultList .get(INDEX_MODULE_ACTIVE_FIRMWARE_VERSION).resultData(), MODULE_ACTIVE_FIRMWARE))); resultList.add(new FirmwareVersionDto(COMMUNICATION_MODULE_ACTIVE_FIRMWARE, this.dlmsHelperService.readString( getResultList.get(INDEX_COMMUNICATION_MODULE_ACTIVE_FIRMWARE_VERSION).resultData(), COMMUNICATION_MODULE_ACTIVE_FIRMWARE))); return resultList; }

Target:
public List<FirmwareVersionDto> execute(final ClientConnection conn, final DlmsDevice device, final Void useless) throws ProtocolAdapterException { final List<FirmwareVersionDto> resultList = new ArrayList<>(); final List<GetResult> getResultList = this.dlmsHelperService.getAndCheck(conn, device, "retrieve firmware versions", ATTRIBUTE_ADDRESSES); resultList.add(new FirmwareVersionDto(ACTIVE_FIRMWARE, this.dlmsHelperService.readString( getResultList.get(INDEX_ACTIVE_FIRMWARE_VERSION).resultData(), ACTIVE_FIRMWARE))); resultList.add(new FirmwareVersionDto(MODULE_ACTIVE_FIRMWARE, this.dlmsHelperService.readString(getResultList .get(INDEX_MODULE_ACTIVE_FIRMWARE_VERSION).resultData(), MODULE_ACTIVE_FIRMWARE))); resultList.add(new FirmwareVersionDto(COMMUNICATION_MODULE_ACTIVE_FIRMWARE, this.dlmsHelperService.readString( getResultList.get(INDEX_COMMUNICATION_MODULE_ACTIVE_FIRMWARE_VERSION).resultData(), COMMUNICATION_MODULE_ACTIVE_FIRMWARE))); return resultList; }
Source:
doRequest(ConnectionConfig config, HttpUriRequest method, Map<String, String> requestHeaders, Request request, ResponseHandler<Request, Response> handler, int expectedStatusCode) { return doRequest(config, 60000, method, requestHeaders, request, handler, expectedStatusCode); }

Target:
doRequest(ConnectionConfig config, HttpUriRequest method, Map<String, String> requestHeaders, Request request, ResponseHandler<Request, Response> handler, int expectedStatusCode) { return doRequest(config, Defaults.DEFAULT_HTTP_TIMEOUT, method, requestHeaders, request, handler, expectedStatusCode); }
Source:
public void remove(String noteId, String notePath , AuthenticationInfo subject) throws IOException { LOG.info("====remove {}:{}", noteId, notePath); folders.deleteOne(eq(Fields.ID, noteId)); notes.deleteOne(eq(Fields.ID, noteId)); String[] pathArray = toPathArray(notePath, false); for (int i = pathArray.length; i >= 0; i--) { String[] current = Arrays.copyOfRange(pathArray, 0, i); String folderId = findFolder(current); boolean isEmpty = folders.count(eq(Fields.PID, folderId)) <= 0; if (isEmpty) { folders.deleteOne(eq(Fields.ID, folderId)); } else { break; } } }

Target:
public void remove(String noteId, String notePath, AuthenticationInfo subject) throws IOException { LOG.debug("remove note, noteId:{}, notePath:{}", noteId, notePath); try (AutoLock autoLock = lock.lockForWrite()) { folders.deleteOne(eq(Fields.ID, noteId)); notes.deleteOne(eq(Fields.ID, noteId)); String[] pathArray = toPathArray(notePath, false); for (int i = pathArray.length; i >= 0; i--) { String[] current = Arrays.copyOfRange(pathArray, 0, i); String folderId = findFolder(current); boolean isEmpty = folders.count(eq(Fields.PID, folderId)) <= 0; if (isEmpty) { folders.deleteOne(eq(Fields.ID, folderId)); } else { break; } } } }
Source:
protected boolean isTagLoadedOnOasis() { return isElementVisible(elementInVebatim); }

Target:
protected boolean isTagLoadedOnOasis() { throw new NotImplementedException(); }
Source:
private static boolean hasCommonTraceType(TmfExperiment experiment) { String commonTraceType = null; for (final ITmfTrace trace : experiment.getTraces()) { String traceType = trace.getTraceTypeId(); if ((commonTraceType != null) && !commonTraceType.equals(traceType)) { return false; } commonTraceType = traceType; } return commonTraceType != null ? true : false; }

Target:
private static boolean hasCommonTraceType(TmfExperiment experiment) { String commonTraceType = null; for (ITmfTrace trace : experiment.getTraces()) { String traceType = trace.getTraceTypeId(); if (commonTraceType != null && !commonTraceType.equals(traceType)) { return false; } commonTraceType = traceType; } return commonTraceType != null; }
Source:
public Validator validate(Object object, Class<?>... groups) { if (object != null) { Set<ConstraintViolation<Object>> violations = bvalidator.validate(object, groups); for (ConstraintViolation<Object> v : violations) { BeanValidatorContext ctx = new BeanValidatorContext(v); String msg = interpolator.interpolate(v.getMessageTemplate(), ctx, locale); String category = v.getPropertyPath().toString(); add(new SimpleMessage(category, msg)); logger.debug("added message {}={} for contraint violation", category, msg); } } return this; }

Target:
public Validator validate(Object object, Class<?>... groups) { if (object != null) { addAll(bvalidator.validate(object, groups)); } return this; }
Source:
private PlanPhasePriceOverride[] createOverrides(final Plan defaultPlan, final List<CatalogOverridePhaseDefinitionModelDao> phaseDefs, final InternalTenantContext context) { final PlanPhasePriceOverride[] result = new PlanPhasePriceOverride[defaultPlan.getAllPhases().length]; for (int i = 0; i < defaultPlan.getAllPhases().length; i++) { final PlanPhase curPhase = defaultPlan.getAllPhases()[i]; final CatalogOverridePhaseDefinitionModelDao overriddenPhase = Iterables.tryFind(phaseDefs, new Predicate<CatalogOverridePhaseDefinitionModelDao>() { @Override public boolean apply(final CatalogOverridePhaseDefinitionModelDao input) { return input.getParentPhaseName().equals(curPhase.getName()); } }).orNull(); if(overriddenPhase != null){ List<UsagePriceOverride> usagePriceOverrides = getUsagePriceOverrides(curPhase, overriddenPhase, context); result[i] = new DefaultPlanPhasePriceOverride(curPhase.getName(), Currency.valueOf(overriddenPhase.getCurrency()), overriddenPhase.getFixedPrice(), overriddenPhase.getRecurringPrice(), usagePriceOverrides); } else result[i] = null; } return result; }

Target:
private PlanPhasePriceOverride[] createOverrides(final Plan defaultPlan, final List<CatalogOverridePhaseDefinitionModelDao> phaseDefs, final InternalTenantContext context) { final PlanPhasePriceOverride[] result = new PlanPhasePriceOverride[defaultPlan.getAllPhases().length]; for (int i = 0; i < defaultPlan.getAllPhases().length; i++) { final PlanPhase curPhase = defaultPlan.getAllPhases()[i]; final CatalogOverridePhaseDefinitionModelDao overriddenPhase = Iterables.tryFind(phaseDefs, new Predicate<CatalogOverridePhaseDefinitionModelDao>() { @Override public boolean apply(final CatalogOverridePhaseDefinitionModelDao input) { return input.getParentPhaseName().equals(curPhase.getName()); } }).orNull(); if(overriddenPhase != null) { List<UsagePriceOverride> usagePriceOverrides = getUsagePriceOverrides(curPhase, overriddenPhase, context); result[i] = new DefaultPlanPhasePriceOverride(curPhase.getName(), Currency.valueOf(overriddenPhase.getCurrency()), overriddenPhase.getFixedPrice(), overriddenPhase.getRecurringPrice(), usagePriceOverrides); } else { result[i] = null; } } return result; }
Source:
public void updateVmDataChangedTime() { vmDataChangedTime = System.nanoTime(); }

Target:
public final void updateVmDataChangedTime() { vmDataChangedTime = System.nanoTime(); }