auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testTraceSessionTree() { fProxy.setTestFile(fTestFile); fProxy.setScenario(INIT_SCENARIO_NAME); testConnectToNode(); fProxy.setScenario(CREATE_SESSION_SPECIFIC_KERNEL_EVENT_SCENARIO_NAME); testCreateSession(); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_SWITCH_EVENT_NAME), false); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_WAKEUP_EVENT_NAME, ControlViewSwtBotUtil.SCHED_PROCESSWAIT_EVENT_NAME), false); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_PROCESSFORK_EVENT_NAME), true); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.ALL_TREE_NODE), true); testStartStopTracing(TraceSessionState.ACTIVE); testStartStopTracing(TraceSessionState.INACTIVE); testDestroySession(); testDisconnectFromNode(); }

Target:
public void testTraceSessionTree() { fProxy.setTestFile(fTestFile); fProxy.setScenario(INIT_SCENARIO_NAME); testConnectToNode(); fProxy.setScenario(CREATE_SESSION_SPECIFIC_KERNEL_EVENT_SCENARIO_NAME); testCreateSession(); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_SWITCH_EVENT_NAME), false, true); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_WAKEUP_EVENT_NAME, ControlViewSwtBotUtil.SCHED_PROCESSWAIT_EVENT_NAME), false, true); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_PROCESSFORK_EVENT_NAME), true, true); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_PROCESSEXEC_EVENT_NAME), true, false); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.ALL_TREE_NODE), true, true); testStartStopTracing(TraceSessionState.ACTIVE); testStartStopTracing(TraceSessionState.INACTIVE); testDestroySession(); testDisconnectFromNode(); }
Source:
public void toStringWithExceptionContainsOnlyImageNameFuture() throws Exception { Future<String> imageNameFuture = Mockito.mock(Future.class); when(imageNameFuture.get()).thenThrow(new ExecutionException(new RuntimeException("arbitrary"))); RemoteDockerImage remoteDockerImage = new RemoteDockerImage(imageNameFuture); assertThat(remoteDockerImage.toString(), containsString("imageNameFuture")); }

Target:
public void toStringWithExceptionContainsOnlyImageNameFuture() { CompletableFuture<String> imageNameFuture = new CompletableFuture<>(); imageNameFuture.completeExceptionally(new RuntimeException("arbitrary")); RemoteDockerImage remoteDockerImage = new RemoteDockerImage(imageNameFuture); String toString = remoteDockerImage.toString(); assertThat(toString, containsString("imageName=" + RemoteDockerImage.class.getName())); }
Source:
public void done() { Sources sources = null; try { sources = get(); } catch (InterruptedException | ExecutionException ex) { Throwable cause = ex.getCause(); if (cause != null) { logger.log(Level.SEVERE, cause.getMessage(), cause); } else { logger.log(Level.SEVERE, ex.getMessage(), ex); } } if (sources != null) { for (Pair<String, DataSource> source : sources.dataSources) { dsCheckboxPanel.addElement(source.getKey(), null, source.getValue()); } for (Map.Entry<ARTIFACT_TYPE, Long> entry : sources.artifactTypes.entrySet()) { String dispName = entry.getKey().getDisplayName() + " (" + entry.getValue() + ")"; String iconPath = "/" + IconsUtil.getIconFilePath(entry.getKey().getTypeID()); Icon icon = new ImageIcon(getClass().getResource(iconPath)); atCheckboxPanel.addElement(dispName, icon, entry.getKey()); } } GeoFilterPanel.this.firePropertyChange(INITPROPERTY, false, true); }

Target:
public void done() { Sources sources = null; try { sources = get(); } catch (InterruptedException | ExecutionException ex) { Throwable cause = ex.getCause(); if (cause != null) { logger.log(Level.SEVERE, cause.getMessage(), cause); } else { logger.log(Level.SEVERE, ex.getMessage(), ex); } } if (sources != null) { for (Pair<String, DataSource> source : sources.dataSources) { dsCheckboxPanel.addElement(source.getKey(), null, source.getValue()); } for (Map.Entry<ARTIFACT_TYPE, Long> entry : sources.artifactTypes.entrySet()) { String dispName = entry.getKey().getDisplayName() + " (" + entry.getValue() + ")"; String iconPath = IconsUtil.getIconFilePath(entry.getKey().getTypeID()); Icon icon = new ImageIcon(getClass().getResource(iconPath)); atCheckboxPanel.addElement(dispName, icon, entry.getKey()); } } GeoFilterPanel.this.firePropertyChange(INITPROPERTY, false, true); }
Source:
private StringBuilder format() { StringBuilder sb = new StringBuilder(String.valueOf(tip)); if (distance > 0) sb.append('~').append(distance); return sb; }

Target:
private StringBuilder format() { StringBuilder sb = new StringBuilder(tip); if (distance > 0) sb.append('~').append(distance); return sb; }
Source:
private static ColumnHandle toColumnHandle(Map<Symbol, ColumnHandle> assignments, Symbol symbol) { if (symbol instanceof SymbolWithSubfieldPath) { SubfieldPath path = ((SymbolWithSubfieldPath) symbol).getPath(); return assignments.get(path.getColumnName()).createSubfieldColumnHandle(path); } return assignments.get(symbol); }

Target:
private static ColumnHandle toColumnHandle(Map<Symbol, ColumnHandle> assignments, Symbol symbol) { if (symbol instanceof SymbolWithSubfieldPath) { SubfieldPath path = ((SymbolWithSubfieldPath) symbol).getSubfieldPath(); return assignments.get(path.getColumnName()).createSubfieldColumnHandle(path); } return assignments.get(symbol); }
Source:
public TmfXmlTraceStub() { try (InputStream in = TmfXmlTraceStub.class.getResourceAsStream(DEVELOPMENT_TRACE_PARSER_PATH);) { CustomXmlTraceDefinition[] definitions = CustomXmlTraceDefinition.loadAll(in); if (definitions.length == 0) { throw new IllegalStateException("The custom trace definition does not exist"); } fTrace = new CustomXmlTrace(definitions[0]); TmfSignalManager.deregister(fTrace); this.setParser(fTrace); @SuppressWarnings("null") @NonNull Collection<ITmfEventAspect> criteria = TmfTrace.BASE_ASPECTS; fAspect = criteria; } catch (IOException e) { throw new IllegalStateException("Cannot open the trace parser for development traces"); } }

Target:
public TmfXmlTraceStub() { try (InputStream in = TmfXmlTraceStub.class.getResourceAsStream(DEVELOPMENT_TRACE_PARSER_PATH);) { CustomXmlTraceDefinition[] definitions = CustomXmlTraceDefinition.loadAll(in); if (definitions.length == 0) { throw new IllegalStateException("The custom trace definition does not exist"); } fTrace = new CustomXmlTrace(definitions[0]); TmfSignalManager.deregister(fTrace); this.setParser(fTrace); Collection<ITmfEventAspect> aspects = TmfTrace.BASE_ASPECTS; fAspects = aspects; } catch (IOException e) { throw new IllegalStateException("Cannot open the trace parser for development traces"); } }
Source:
public Collector<T, ImmutableSet.Builder<T>, ImmutableSet<T>> newCollector(Class<ImmutableSet<T>> type) { return Collector.of(ImmutableSet.Builder::new, ImmutableSet.Builder::add, (first, second) -> first, ImmutableSet.Builder::build, Collector.Characteristics.UNORDERED); }

Target:
public Collector<T, ImmutableSet.Builder<T>, ImmutableSet<T>> newCollector(Class<ImmutableSet<T>> type) { return Collector.of(ImmutableSet.Builder::new, ImmutableSet.Builder::add, (first, second) -> { throw new UnsupportedOperationException("Parallel collecting is not supported"); }, ImmutableSet.Builder::build, Collector.Characteristics.UNORDERED); }
Source:
public void initialise() { summonOreonBuilderCommand = find("summonOreonBuilderCommand", UIButton.class); summonOreonGuardCommand = find("summonOreonGuardCommand", UIButton.class); summonOreonKingCommand = find("summonOreonKingCommand", UIButton.class); summonOreonBuilderCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab("Oreons:OreonBuilder")); }); summonOreonGuardCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab("Oreons:OreonGuard")); }); summonOreonKingCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab("Oreons:OreonKing")); }); }

Target:
public void initialise() { summonOreonBuilderCommand = find(Constants.OREON_BUILDER_UI_ID, UIButton.class); summonOreonGuardCommand = find(Constants.OREON_GUARD_UI_ID, UIButton.class); summonOreonKingCommand = find(Constants.OREON_KING_UI_ID, UIButton.class); builderResourceRequired = find(Constants.OREON_BUILDER_RESOURCES_LABEL_ID, UILabel.class); guardResourceRequired = find(Constants.OREON_GUARD_RESOURCES_LABEL_ID, UILabel.class); kingResourceRequired = find(Constants.OREON_KING_RESOURCES_LABEL_ID, UILabel.class); populateUiLabels(Constants.OREON_BUILDER_PREFAB, builderResourceRequired); populateUiLabels(Constants.OREON_GUARD_PREFAB, guardResourceRequired); populateUiLabels(Constants.OREON_KING_PREFAB, kingResourceRequired); summonOreonBuilderCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab(Constants.OREON_BUILDER_PREFAB)); }); summonOreonGuardCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab(Constants.OREON_GUARD_PREFAB)); }); summonOreonKingCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab(Constants.OREON_KING_PREFAB)); }); }
Source:
private PlanNodeStatsEstimate estimateLogicalOr(Expression left, Expression right) { PlanNodeStatsEstimate leftEstimate = process(left); if (leftEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } PlanNodeStatsEstimate rightEstimate = process(right); if (rightEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } PlanNodeStatsEstimate andEstimate = new FilterExpressionStatsCalculatingVisitor(leftEstimate, session, types).process(right); if (andEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } return capStats( subtractStats( addStatsAndSumDistinctValues(leftEstimate, rightEstimate), andEstimate), input); }

Target:
private PlanNodeStatsEstimate estimateLogicalOr(Expression left, Expression right) { PlanNodeStatsEstimate leftEstimate = process(left); if (leftEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } PlanNodeStatsEstimate rightEstimate = process(right); if (rightEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } PlanNodeStatsEstimate andEstimate = new FilterExpressionStatsCalculatingVisitor(leftEstimate, session, types).process(right); if (andEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } return capStats( subtractSubsetStats( addStatsAndSumDistinctValues(leftEstimate, rightEstimate), andEstimate), input); }
Source:
void onExecute() throws Exception { result.setTestName("readTable"); PreparedStatement ps = connection.prepareStatement("SELECT * FROM " + FQ_TABLE_NAME+" WHERE INSERT_DATE = ?"); ps.setTimestamp(1,timestamp); ResultSet rs = ps.executeQuery(); int totalRows = 0; while (rs.next()) { totalRows += 1; Integer myKey = rs.getInt(1); String myColumn = rs.getString(2); if (myKey != 1 || !myColumn.equals("Hello World")) { throw new Exception("Retrieved values do not " + "match the inserted " + "values"); } } if (totalRows != 1) { throw new Exception(totalRows + " rows fetched instead of just one."); } ps.close(); rs.close(); }

Target:
void onExecute() throws Exception { result.setTestName("readTable"); PreparedStatement ps = connection.prepareStatement("SELECT * FROM " + FQ_TABLE_NAME+" WHERE INSERT_DATE = ?"); ps.setTimestamp(1,timestamp); ResultSet rs = ps.executeQuery(); int totalRows = 0; while (rs.next()) { totalRows += 1; Integer myKey = rs.getInt(1); String myColumn = rs.getString(2); if (myKey != 1 || !myColumn.equals("Hello World")) { throw new Exception("Retrieved values do not " + "match the inserted values"); } } if (totalRows != 1) { throw new Exception(totalRows + " rows fetched instead of just one."); } ps.close(); rs.close(); }
Source:
private int removeModule(IModule[] module, IProgressMonitor monitor) throws CoreException { IControllableServerBehavior beh = JBossServerBehaviorUtils.getControllableBehavior(getServer()); if( beh != null ) { IPublishController pc = (IPublishController)beh.getController(IPublishController.SYSTEM_ID); if( pc instanceof IPrimaryPublishController) { return ((IPrimaryPublishController)pc).removeModule(module, monitor); } } return IServer.PUBLISH_STATE_UNKNOWN; }

Target:
private int removeModule(IModule[] module, IProgressMonitor monitor) throws CoreException { IPrimaryPublishController pc = JBossServerBehaviorUtils.getController(getServer(), IPublishController.SYSTEM_ID, IPrimaryPublishController.class); if( pc != null) { return pc.removeModule(module, monitor); } return IServer.PUBLISH_STATE_UNKNOWN; }
Source:
private @Nullable RetryHolder getNextRerun() { long cursor = outSubSequence.next(); if (cursor < 0) { return null; } try { return outQueue.get(cursor); } finally { outSubSequence.done(cursor); } }

Target:
private @Nullable Retry getNextRerun() { long cursor = outSubSequence.next(); if (cursor < 0) { return null; } RetryHolder retryHolder = outQueue.get(cursor); Retry r = retryHolder.retry; retryHolder.retry = null; outSubSequence.done(cursor); return r; }
Source:
public void setup() { try { testFieldDefinition = DummyFieldDefinitions.getComplexRecordDefinition(); testRecordReader = new DummyRecordReader(10); } catch(Exception e) { Assert.fail("Test setup failed with error: " + e.getMessage()); } }

Target:
public void setup() { try { testFieldDefinition = TestFieldDefinitions.getComplexRecordDefinition(); testRecordReader = new TestRecordReader(10); } catch (Exception e) { Assert.fail("Test setup failed with error: " + e.getMessage()); } }
Source:
public void paint(Graphics g) { if (System.currentTimeMillis() - lastCheck > 1000L) { lastCheck = System.currentTimeMillis(); cached = GroundItems.getGroundItems().length; } PaintDebugger p = Context.getInstance().getPaintDebugger(); p.addLine("Close Ground Items: " + cached); }

Target:
public void paint(Graphics g) { PaintDebugger p = Context.getInstance().getPaintDebugger(); p.addLine("Close Ground Items: " + GroundItems.getGroundItems().length); }
Source:
private IAction createHierarchicalAction() { IAction action = new Action(Messages.ControlFlowView_hierarchicalViewLabel, IAction.AS_PUSH_BUTTON) { @Override public void run() { ITmfTrace parentTrace = getTrace(); for (ITmfTrace trace : TmfTraceManager.getTraceSet(parentTrace)) { final ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); List<ControlFlowEntry> currentRootList = (List<ControlFlowEntry>)(Object)getEntryList(ss); addEntriesToHierarchicalTree(currentRootList, parentTrace, ss); refresh(); } } }; action.setToolTipText(Messages.ControlFlowView_hierarchicalViewToolTip); action.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(IControlflowImageConstants.IMG_UI_HIERARCHICAL_VIEW)); return action; }

Target:
private IAction createHierarchicalAction() { IAction action = new Action(Messages.ControlFlowView_hierarchicalViewLabel, IAction.AS_RADIO_BUTTON) { @Override public void run() { ITmfTrace parentTrace = getTrace(); fFlatTraces.remove(parentTrace); for (ITmfTrace trace : TmfTraceManager.getTraceSet(parentTrace)) { final ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); List<ControlFlowEntry> currentRootList = (List<ControlFlowEntry>) (Object) getEntryList(ss); addEntriesToHierarchicalTree(currentRootList, parentTrace, ss); refresh(); } } }; action.setChecked(true); action.setToolTipText(Messages.ControlFlowView_hierarchicalViewToolTip); action.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(IControlflowImageConstants.IMG_UI_HIERARCHICAL_VIEW)); return action; }
Source:
public static Schema getAttributeKeySchema(final Set<Integer> keys, final Schema schema) { Schema keySchema = Schema.EMPTY_SCHEMA; for (int key : keys) { keySchema = Schema.appendColumn(keySchema, schema.getColumnType(key), schema.getColumnName(key)); } return keySchema; }

Target:
public static Schema getAttributeKeySchema(final Set<Integer> keys, final Schema schema) { return schema.getSubSchema(Ints.toArray(keys)); }
Source:
public void testProcessQueryJsonApi() { String query = "/group?sort=commonName&fields%5Bgroup%5D=commonName,description"; ElideResponse response = mock(ElideResponse.class); when(queryObj.getQuery()).thenReturn(query); when(queryObj.getQueryType()).thenReturn(QueryType.JSONAPI_V1_0); when(elide.get(anyString(), any(), any(), anyString())).thenReturn(response); when(response.getResponseCode()).thenReturn(200); String testStr = "{\"data\": []}"; String testStr1 = "responseBody"; when(response.getBody()).thenReturn(testStr); queryThread.processQuery(); verify(asyncQueryDao, times(1)).updateStatus(queryObj, QueryStatus.PROCESSING); verify(asyncQueryDao, times(1)).updateStatus(queryObj, QueryStatus.COMPLETE); verify(asyncQueryDao, times(1)).updateAsyncQueryResult(any(), any()); }

Target:
public void testProcessQueryJsonApi() { String query = "/group?sort=commonName&fields%5Bgroup%5D=commonName,description"; ElideResponse response = mock(ElideResponse.class); when(queryObj.getQuery()).thenReturn(query); when(queryObj.getQueryType()).thenReturn(QueryType.JSONAPI_V1_0); when(elide.get(anyString(), any(), any(), anyString())).thenReturn(response); when(response.getResponseCode()).thenReturn(200); when(response.getBody()).thenReturn("responseBody"); queryThread.processQuery(); verify(asyncQueryDao, times(1)).updateStatus(queryObj, QueryStatus.PROCESSING); verify(asyncQueryDao, times(1)).updateStatus(queryObj, QueryStatus.COMPLETE); verify(asyncQueryDao, times(1)).updateAsyncQueryResult(any(), any()); }
Source:
public boolean supports(List<String> uriList, String method) { if (!allowedRequestMethods.contains(RequestMethod.valueOf(method))) { return false; } for (String string : uriList) { if (!(StringUtils.contains(string, "api/integration/externalsources") && StringUtils.contains(string, "entryValues"))) { return false; } } return true; }

Target:
public boolean supports(List<String> uriList, String method) { if (!allowedRequestMethods.contains(RequestMethod.valueOf(method))) { return false; } for (String string : uriList) { if (!(StringUtils.contains(string, ExternalSourceRest.CATEGORY + "/" + ExternalSourceRest.PLURAL_NAME) && StringUtils.contains(string, "entryValues"))) { return false; } } return true; }
Source:
public void shouldCreateCorrectPayload() { String payload = stripeTransferInRequest.getGatewayOrder().getPayload(); assertThat(payload, containsString("destination=" + stripePlatformAccountId)); assertThat(payload, containsString("amount=" + refundAmount)); assertThat(payload, containsString("transfer_group=" + chargeExternalId)); }

Target:
public void shouldCreateCorrectPayload() { String payload = stripeTransferInRequest.getGatewayOrder().getPayload(); assertThat(payload, containsString("destination=" + stripePlatformAccountId)); assertThat(payload, containsString("amount=" + refundAmount)); assertThat(payload, containsString("transfer_group=" + chargeExternalId)); assertThat(payload, containsString("expand%5B%5D=balance_transaction")); assertThat(payload, containsString("expand%5B%5D=destination_payment")); assertThat(payload, containsString("currency=GBP")); }
Source:
public boolean equals(final Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (this.getClass() != obj.getClass()) { return false; } final DeviceConverter other = (DeviceConverter) obj; if (this.helper == null) { if (other.helper != null) { return false; } } else if (!this.helper.equals(other.helper)) { return false; } return true; }

Target:
public boolean equals(final Object obj) { return super.equals(obj) && Objects.equals(this.helper, ((DeviceConverter) obj).helper); }
Source:
public void simplePoll() throws Exception { DefaultSchedulerMessageSource schedulerMessageSource = createMessageSource(); SensingNullMessageProcessor flow = getSensingNullMessageProcessor(); schedulerMessageSource.setListener(flow); schedulerMessageSource.setAnnotations(singletonMap(LOCATION_KEY, TEST_CONNECTOR_LOCATION)); doAnswer(invocationOnMock -> { CoreEvent inputEvent = invocationOnMock.getArgument(0); flow.process(inputEvent); return null; }).when(sourcePolicy).process(any(CoreEvent.class), any(), any()); schedulerMessageSource.trigger(); new PollingProber(120000, 100).check(new Probe() { @Override public boolean isSatisfied() { return flow.event != null; } @Override public String describeFailure() { return "flow event never set by the source flow"; } }); }

Target:
public void simplePoll() throws Exception { DefaultSchedulerMessageSource schedulerMessageSource = createMessageSource(); SensingNullMessageProcessor flow = getSensingNullMessageProcessor(); schedulerMessageSource.setListener(flow); schedulerMessageSource.setAnnotations(singletonMap(LOCATION_KEY, TEST_CONNECTOR_LOCATION)); doAnswer(invocationOnMock -> { CoreEvent inputEvent = invocationOnMock.getArgument(0); flow.process(inputEvent); return null; }).when(sourcePolicy).process(any(CoreEvent.class), any(), any()); schedulerMessageSource.trigger(); new PollingProber(RECEIVE_TIMEOUT, 100).check(new Probe() { @Override public boolean isSatisfied() { return flow.event != null; } @Override public String describeFailure() { return "flow event never set by the source flow"; } }); }
Source:
public void initialize() { channelListView.setOnMouseClicked(event -> { preferencesService.getPreferences().getChat().removeAutoJoinChannel((channelListView.getSelectionModel().getSelectedItem())); channelListView.getSelectionModel().clearSelection(); preferencesService.storeInBackground(); }); channelListView.setItems(preferencesService.getPreferences().getChat().getAutoJoinChannels()); }

Target:
public void initialize() { channelListView.setItems(preferencesService.getPreferences().getChat().getAutoJoinChannels()); removeButton.visibleProperty().bind(channelListView.getSelectionModel().selectedItemProperty().isNotNull()); }
Source:
byte[] toBytes() { int size = VERSION_SIZE + STORE_ID_SIZE + storeId.length() + INCARNATION_ID_SIZE + ((incarnationId == null) ? 0 : incarnationId.toString().getBytes().length); byte[] buf = new byte[size]; ByteBuffer bufWrap = ByteBuffer.wrap(buf); bufWrap.putShort((short) VERSION); bufWrap.putInt(storeId.length()); bufWrap.put(storeId.getBytes()); byte[] incarnationIdInBytes = incarnationId == null ? null : incarnationId.toString().getBytes(); bufWrap.putInt(incarnationIdInBytes == null ? 0 : incarnationIdInBytes.length); if (incarnationIdInBytes != null) { bufWrap.put(incarnationIdInBytes); } return buf; }

Target:
private byte[] toBytes() { byte[] incarnationIdBytes = incarnationId.toString().getBytes(); int size = VERSION_SIZE + INCARNATION_ID_LENGTH_SIZE + incarnationIdBytes.length; byte[] buf = new byte[size]; ByteBuffer bufWrap = ByteBuffer.wrap(buf); bufWrap.putShort(VERSION_0); bufWrap.putInt(incarnationIdBytes.length); bufWrap.put(incarnationIdBytes); return buf; }
Source:
public ClassAttributeLink(LineAssociation layout, Association assoc, Classifier fromClass, Classifier toClass) throws UnexpectedEndException { super(layout); type = "attribute"; name = assoc.getLabel(); from = null; to = null; for (Property end : assoc.getMemberEnds()) { Class endClass = (Class) end.getType(); if (endClass == toClass && to == null) { to = new AssociationEnd(end); } else if (endClass == fromClass && from == null) { from = new AssociationEnd(end); } else { throw new UnexpectedEndException(end.getName()); } } }

Target:
public ClassAttributeLink(LineAssociation layout, Association assoc, Classifier fromClass, Classifier toClass) throws UnexpectedEndException { super(layout); name = assoc.getLabel(); from = null; to = null; for (Property end : assoc.getMemberEnds()) { Class endClass = (Class) end.getType(); if (endClass == toClass && to == null) { to = new AssociationEnd(end); } else if (endClass == fromClass && from == null) { from = new AssociationEnd(end); } else { throw new UnexpectedEndException(end.getName()); } } }
Source:
private void addBranchItemsForRemote(String remote) throws IOException, URISyntaxException { RemoteConfig remoteConfig = new RemoteConfig(myConfig, remote); List<RefSpec> fetchSpecs = remoteConfig.getFetchRefSpecs(); if (fetchSpecs.isEmpty()) { addBranchItemsForLocal(); return; } Collection<Ref> allRefs = myRepository.getRefDatabase() .getRefs(Constants.R_REFS).values(); for (Ref ref : allRefs) { for (RefSpec fetchSpec : fetchSpecs) { if (fetchSpec.matchDestination(ref)) { RefSpec source = fetchSpec.expandFromDestination(ref); String refNameOnRemote = source.getSource(); branchText.add(refNameOnRemote); } } } }

Target:
private void addBranchItemsForRemote(String remote) throws IOException, URISyntaxException { RemoteConfig remoteConfig = new RemoteConfig(myConfig, remote); List<RefSpec> fetchSpecs = remoteConfig.getFetchRefSpecs(); if (fetchSpecs.isEmpty()) { return; } Collection<Ref> allRefs = myRepository.getRefDatabase() .getRefs(Constants.R_REFS).values(); for (Ref ref : allRefs) { for (RefSpec fetchSpec : fetchSpecs) { if (fetchSpec.matchDestination(ref)) { RefSpec source = fetchSpec.expandFromDestination(ref); String refNameOnRemote = source.getSource(); branchText.add(refNameOnRemote); } } } }
Source:
private void close(final boolean clean) { if (state() == State.CREATED || state() == State.RUNNING) { if (clean) { stateMgr.checkpoint(Collections.emptyMap()); offsetSnapshotSinceLastCommit = new HashMap<>(stateMgr.changelogOffsets()); } executeAndMaybeSwallow( clean, () -> StateManagerUtil.closeStateManager( log, logPrefix, clean, eosEnabled, stateMgr, stateDirectory, TaskType.STANDBY ), "state manager close", log ); } else if (state() == State.CLOSED) { log.trace("Skip closing since state is {}", state()); return; } else { throw new IllegalStateException("Illegal state " + state() + " while closing standby task " + id); } closeTaskSensor.record(); transitionTo(State.CLOSED); }

Target:
private void close(final boolean clean) { switch (state()) { case CREATED: case RUNNING: if (clean) { stateMgr.checkpoint(Collections.emptyMap()); offsetSnapshotSinceLastCommit = new HashMap<>(stateMgr.changelogOffsets()); } executeAndMaybeSwallow( clean, () -> StateManagerUtil.closeStateManager( log, logPrefix, clean, eosEnabled, stateMgr, stateDirectory, TaskType.STANDBY ), "state manager close", log ); break; case CLOSED: log.trace("Skip closing since state is {}", state()); return; case RESTORING: case SUSPENDED: throw new IllegalStateException("Illegal state " + state() + " while closing standby task " + id); default: throw new IllegalStateException("Unknown state " + state() + " while closing standby task " + id); } closeTaskSensor.record(); transitionTo(State.CLOSED); }
Source:
private void initiateChunkDeletesIfAny(final String blobId) { Callback<GetBlobResultInternal> callback = new Callback<GetBlobResultInternal>() { @Override public void onCompletion(GetBlobResultInternal result, Exception exception) { if (exception != null) { logger.error( "Encountered exception when attempting to get chunks of a possibly composite deleted blob" + blobId, exception); } else if (result.getBlobResult != null) { logger.error("Unexpected result returned by background get operation to fetch chunk ids."); } else if (result.storeKeys != null) { List<String> idsToDelete = new ArrayList<>(); for (StoreKey key : result.storeKeys) { idsToDelete.add(key.getID()); } initiateBackgroundDeletes(idsToDelete); } currentBackgroundOperationsCount.decrementAndGet(); } }; currentOperationsCount.incrementAndGet(); currentBackgroundOperationsCount.incrementAndGet(); GetBlobOptionsInternal options = new GetBlobOptionsInternal(new GetBlobOptions(GetBlobOptions.OperationType.Data, GetOption.Include_All, null), true); backgroundDeleter.getBlob(blobId, options, callback); }

Target:
private void initiateChunkDeletesIfAny(final String blobId) { Callback<GetBlobResultInternal> callback = new Callback<GetBlobResultInternal>() { @Override public void onCompletion(GetBlobResultInternal result, Exception exception) { if (exception != null) { logger.error( "Encountered exception when attempting to get chunks of a possibly composite deleted blob" + blobId, exception); } else if (result.getBlobResult != null) { logger.error("Unexpected result returned by background get operation to fetch chunk ids."); } else if (result.storeKeys != null) { initiateBackgroundDeletes(result.storeKeys); } currentBackgroundOperationsCount.decrementAndGet(); } }; currentOperationsCount.incrementAndGet(); currentBackgroundOperationsCount.incrementAndGet(); GetBlobOptionsInternal options = new GetBlobOptionsInternal(new GetBlobOptions(GetBlobOptions.OperationType.Data, GetOption.Include_All, null), true); backgroundDeleter.getBlob(blobId, options, callback); }
Source:
protected void addOriginEntriesForCorpCardPersonalExpenseDebitLines(Consumer<OriginEntryFull> entryConsumer) { if (consolidatedCorpCardPersonalExpenseDebits.isEmpty()) { return; } KualiDecimal netCashAmount = calculateTotalCashAmountNotOffsetByCashAdvances(); KualiDecimal currentReimbursableCashAmount = netCashAmount; for (List<ConcurStandardAccountingExtractDetailLine> corpCardPersonalDebits : consolidatedCorpCardPersonalExpenseDebits.values()) { KualiDecimal totalSubGroupAmount = calculateTotalAmountForLines(corpCardPersonalDebits); if (totalSubGroupAmount.isZero()) { continue; } ConcurStandardAccountingExtractDetailLine firstDebitLine = corpCardPersonalDebits.get(0); KualiDecimal newReimbursableCashAmount = currentReimbursableCashAmount.subtract(totalSubGroupAmount); KualiDecimal cashOffsetAdjustment = totalSubGroupAmount; KualiDecimal personalOffsetAdjustment = KualiDecimal.ZERO; if (newReimbursableCashAmount.isNegative()) { if (currentReimbursableCashAmount.isPositive()) { cashOffsetAdjustment = currentReimbursableCashAmount; personalOffsetAdjustment = newReimbursableCashAmount.negated(); } else { cashOffsetAdjustment = KualiDecimal.ZERO; personalOffsetAdjustment = totalSubGroupAmount; } } if (cashOffsetAdjustment.isNonZero()) { addOriginEntryForCorpCardPersonalExpense( entryConsumer, firstDebitLine, collectorHelper.getCashOffsetObjectCode(), cashOffsetAdjustment); } if (personalOffsetAdjustment.isNonZero()) { addOriginEntryForCorpCardPersonalExpense( entryConsumer, firstDebitLine, collectorHelper.getPersonalOffsetObjectCode(), personalOffsetAdjustment); } currentReimbursableCashAmount = newReimbursableCashAmount; } }

Target:
protected void addOriginEntriesForCorpCardPersonalExpenseDebitLines(Consumer<OriginEntryFull> entryConsumer) { if (consolidatedCorpCardPersonalExpenseDebits.isEmpty()) { return; } KualiDecimal netCashAmount = calculateTotalCashAmountNotOffsetByCashAdvances(); KualiDecimal currentReimbursableCashAmount = netCashAmount; for (List<ConcurStandardAccountingExtractDetailLine> corpCardPersonalDebits : consolidatedCorpCardPersonalExpenseDebits.values()) { KualiDecimal totalSubGroupAmount = calculateTotalAmountForLines(corpCardPersonalDebits); if (totalSubGroupAmount.isZero()) { continue; } KualiDecimal newReimbursableCashAmount = currentReimbursableCashAmount.subtract(totalSubGroupAmount); KualiDecimal cashOffsetAdjustment = calculateCashOffsetAdjustmentForCorpCardPersonalExpenseSubGroup( totalSubGroupAmount, currentReimbursableCashAmount, newReimbursableCashAmount); KualiDecimal personalOffsetAdjustment = calculatePersonalOffsetAdjustmentForCorpCardPersonalExpenseSubGroup( totalSubGroupAmount, currentReimbursableCashAmount, newReimbursableCashAmount); addOriginEntriesForCorpCardPersonalExpenseDebitLinesIfNecessary( entryConsumer, corpCardPersonalDebits, cashOffsetAdjustment, personalOffsetAdjustment); currentReimbursableCashAmount = newReimbursableCashAmount; } }
Source:
public List<CertificationCriterionEntity> getRetiredTestTools(Long cpId) { Query query = entityManager.createQuery( "SELECT c FROM CertificationCriterionEntity c " + "LEFT JOIN c.certificationResult cr " + "LEFT JOIN cr.certifiedProduct cp " + "LEFT JOIN cr.certificationResultTestTool crtt " + "LEFT JOIN crtt.testTool tt " + "WHERE (tt.retired = true AND cp.icsCode = '1') AND c.deleted = false AND cp.id = :cpId)" , CertificationCriterionEntity.class); query.setParameter("cpId", cpId); List<CertificationCriterionEntity> result = query.getResultList(); return result; }

Target:
public List<CertificationCriterionEntity> getRetiredTestTools(Long cpId) { Query query = entityManager.createQuery( "SELECT c FROM CertificationCriterionEntity c " + "LEFT JOIN c.certificationResult cr " + "LEFT JOIN cr.certifiedProduct cp " + "LEFT JOIN cr.certificationResultTestTool crtt " + "LEFT JOIN crtt.testTool tt " + "WHERE (tt.retired = true AND CAST(cp.icsCode as integer) >= 1) AND c.deleted = false AND cp.id = :cpId)" , CertificationCriterionEntity.class); query.setParameter("cpId", cpId); List<CertificationCriterionEntity> result = query.getResultList(); return result; }
Source:
public static void unwindCraftPreview(InventoryPacketContext context) { final EntityPlayerMP player = context.getPacketPlayer(); ((ContainerBridge) player.openContainer).bridge$setFirePreview(true); Inventory craftInv = ((Inventory) player.openContainer).query(QueryOperationTypes.INVENTORY_TYPE.of(CraftingInventory.class)); if (craftInv instanceof CraftingInventory) { SlotTransaction previewTransaction = ((ContainerBridge) player.openContainer).bridge$getPreviewTransaction(); if (previewTransaction != null) { CraftingRecipe recipe = SpongeCraftingRecipeRegistry .getInstance().findMatchingRecipe(((CraftingInventory) craftInv).getCraftingGrid(), ((World) player.world)).orElse(null); SpongeCommonEventFactory.callCraftEventPre(player, ((CraftingInventory) craftInv), previewTransaction, recipe, player.openContainer, ImmutableList.of(previewTransaction)); ((ContainerBridge) player.openContainer).bridge$setPreviewTransaction(null); } } }

Target:
public static void unwindCraftPreview(InventoryPacketContext context) { final EntityPlayerMP player = context.getPacketPlayer(); ((ContainerBridge) player.openContainer).bridge$setFirePreview(true); Inventory craftInv = ((Inventory) player.openContainer).query(QueryOperationTypes.INVENTORY_TYPE.of(CraftingInventory.class)); if (craftInv instanceof CraftingInventory) { final SlotTransaction previewTransaction = ((ContainerBridge) player.openContainer).bridge$getPreviewTransaction(); if (previewTransaction != null) { CraftingRecipe recipe = SpongeCraftingRecipeRegistry .getInstance().findMatchingRecipe(((CraftingInventory) craftInv).getCraftingGrid(), ((World) player.world)).orElse(null); SpongeCommonEventFactory.callCraftEventPre(player, ((CraftingInventory) craftInv), previewTransaction, recipe, player.openContainer, ImmutableList.of(previewTransaction)); ((ContainerBridge) player.openContainer).bridge$setPreviewTransaction(null); } } }
Source:
public void excludeAll() { Set<Class<?>> types = new HashSet<Class<?>>(); if (isCollection(getRootClass())) types.addAll(getElementTypes()); else types.add(getRootClass()); for (Class<?> type : types) for (Field field : new Mirror().on(type).reflectAll().fields()) getExcludes().putAll(field.getName(), getParentTypes(field.getName(), type)); }

Target:
public void excludeAll() { Set<Class<?>> types = new HashSet<>(); if (isCollection(getRootClass())) { types.addAll(getElementTypes()); } else { types.add(getRootClass()); } for (Class<?> type : types) { for (Field field : new Mirror().on(type).reflectAll().fields()) { getExcludes().putAll(field.getName(), getParentTypes(field.getName(), type)); } } }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } DateTimeType other = (DateTimeType) obj; if (calendar == null) { if (other.calendar != null) { return false; } } else if (!calendar.equals(other.calendar)) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } DateTimeType other = (DateTimeType) obj; if (calendar == null) { if (other.calendar != null) { return false; } } else if (calendar.compareTo(other.calendar) != 0) { return false; } return true; }
Source:
private void updateOptionPointsMapping( Map<String, List<Integer>> optionPoints, String optionReceivingPoints, int pointsReceived) { List<Integer> points = optionPoints.computeIfAbsent(optionReceivingPoints, key -> new ArrayList<>()); points.add(pointsReceived); }

Target:
private void updateOptionPointsMapping( Map<String, List<Integer>> optionPoints, String optionReceivingPoints, int pointsReceived) { optionPoints.computeIfAbsent(optionReceivingPoints, key -> new ArrayList<>()).add(pointsReceived); }
Source:
public void setMessageSender_shouldSetMessageSender() throws MessageException { MessageSender messageSender = new MailMessageSender(); MessageService messageService = Context.getMessageService(); messageService.setMessageSender(messageSender); assertEquals(messageSender, messageService.getMessageSender()); }

Target:
public void setMessageSender_shouldSetMessageSender() throws MessageException { MessageSender messageSender = new MailMessageSender(); ms.setMessageSender(messageSender); assertEquals(messageSender, ms.getMessageSender()); }
Source:
public void testCreateShouldIgnoreNonShareableMetacards() throws Exception { ShareableMetacardPreIngestPlugin wpip = makePlugin(ImmutableMap.of()); Metacard metacard = new MetacardImpl(); wpip.process(new CreateRequestImpl(metacard)); assertThat(metacard.getAttribute(Core.METACARD_OWNER), nullValue()); }

Target:
public void testCreateShouldIgnoreNonShareableMetacards() throws Exception { ShareableMetacardPreIngestPlugin plugin = makePlugin(); Metacard metacard = new MetacardImpl(); plugin.process(new CreateRequestImpl(metacard)); assertThat(metacard.getAttribute(Core.METACARD_OWNER), nullValue()); }
Source:
public void done(IJobChangeEvent event) { Map<Repository, Object> res = new HashMap<Repository, Object>( this.results); for (Repository repo : res.keySet()) { Object result = res.get(repo); if (result instanceof PullResult) { PullResult pullResult = (PullResult) result; if (pullResult.getRebaseResult() != null && RebaseResult.Status.UNCOMMITTED_CHANGES == pullResult .getRebaseResult().getStatus()) { handleUncommittedChanges(repo, pullResult .getRebaseResult().getUncommittedChanges()); this.results.remove(repo); } } } if (this.results.isEmpty()) return; PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); showResults(shell); } }); }

Target:
public void done(IJobChangeEvent event) { final Map<Repository, Object> res = new HashMap<Repository, Object>( PullOperationUI.this.results); PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); for (Entry<Repository, Object> entry : res.entrySet()) { Object result = entry.getValue(); if (result instanceof PullResult) { PullResult pullResult = (PullResult) result; if (pullResult.getRebaseResult() != null && RebaseResult.Status.UNCOMMITTED_CHANGES == pullResult .getRebaseResult().getStatus()) { boolean handledSeparately = handleUncommittedChanges( entry.getKey(), pullResult .getRebaseResult() .getUncommittedChanges(), shell); if (handledSeparately) tasksToWaitFor.incrementAndGet(); } } } if (tasksToWaitFor.decrementAndGet() == 0 && !results.isEmpty()) showResults(shell); } }); }
Source:
public void testInvalidIndex() { BeanIdentifierIndex index = new BeanIdentifierIndex(); index.build(Collections.<Bean<?>>emptySet()); try { index.getIdentifier(-10); fail(); } catch (IllegalStateException e) { e.printStackTrace(); } try { index.getIdentifier(0); fail(); } catch (IllegalStateException e) { } try { index.getIdentifier(10); fail(); } catch (IllegalStateException e) { } }

Target:
public void testInvalidIndex() { BeanIdentifierIndex index = new BeanIdentifierIndex(); index.build(Collections.<Bean<?>>emptySet()); try { index.getIdentifier(-10); fail(); } catch (IllegalStateException e) { } try { index.getIdentifier(0); fail(); } catch (IllegalStateException e) { } try { index.getIdentifier(10); fail(); } catch (IllegalStateException e) { } }
Source:
private int getOrientation(InputStream is) { if (hasImaging == null) { hasImaging = isImagingOnClasspath(); } if (!hasImaging) { return 0; } try { IImageMetadata metadata = Imaging.getMetadata(is, null); TiffImageMetadata tiffMetaData; if (metadata instanceof JpegImageMetadata) { JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata; tiffMetaData = jpegMetadata.getExif(); } else if (metadata instanceof TiffImageMetadata) { tiffMetaData = (TiffImageMetadata) metadata; } else { return 0; } TiffField orientationField = tiffMetaData.findField(TiffTagConstants.TIFF_TAG_ORIENTATION); if (orientationField != null) { int orientationValue = orientationField.getIntValue(); switch (orientationValue) { case 3: return 180; case 6: return 90; case 8: return -90; } } } catch (IOException ignored) { } catch (ImageReadException ignored) { } return 0; }

Target:
private int getOrientation(InputStream is) { if (!hasImaging) { return 0; } try { IImageMetadata metadata = Sanselan.getMetadata(is, null); TiffImageMetadata tiffMetaData; if (metadata instanceof JpegImageMetadata) { JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata; tiffMetaData = jpegMetadata.getExif(); } else if (metadata instanceof TiffImageMetadata) { tiffMetaData = (TiffImageMetadata) metadata; } else { return 0; } TiffField orientationField = tiffMetaData.findField(TiffTagConstants.TIFF_TAG_ORIENTATION); if (orientationField != null) { int orientationValue = orientationField.getIntValue(); switch (orientationValue) { case ORIENTATION_VALUE_ROTATE_180: return 180; case ORIENTATION_VALUE_ROTATE_90_CW: return 90; case ORIENTATION_VALUE_ROTATE_270_CW: return 270; default: return 0; } } } catch (IOException ignored) { } catch (ImageReadException ignored) { } return 0; }
Source:
public void shutdown() { LOG.info("Shutting down"); stopping = true; submittedRequests.add(Request.requestOfDeath); try { this.join(ZooKeeperServer.getShutdownTimeout()); } catch (InterruptedException e) { LOG.warn("Interrupted while waiting for to finish", this); } killed = true; try { this.join(); } catch (InterruptedException e) { LOG.warn("Interrupted while waiting for to finish", this); System.exit(1); } }

Target:
public void shutdown() { LOG.info("Shutting down"); stopping = true; submittedRequests.add(Request.requestOfDeath); try { this.join(shutdownTimeout); } catch (InterruptedException e) { LOG.warn("Interrupted while waiting for to finish", this); } killed = true; try { this.join(); } catch (InterruptedException e) { LOG.warn("Interrupted while waiting for to finish", this); System.exit(ExitCode.UNEXPECTED_ERROR.getValue()); } }
Source:
public void setConf(Configuration configuration) { conf = configuration; Dataset<E> dataset = loadDataset(configuration); String partitionDir = conf.get(KITE_PARTITION_DIR); if (dataset.getDescriptor().isPartitioned() && partitionDir != null) { PartitionKey key = Accessor.getDefault().fromDirectoryName(dataset, new Path(partitionDir)); if (key != null) { dataset = dataset.getPartition(key, true); } } if (dataset instanceof AbstractDataset) { delegate = ((AbstractDataset<E>) dataset).getDelegateInputFormat(); } else { throw new UnsupportedOperationException("No input format for dataset " + dataset); } }

Target:
public void setConf(Configuration configuration) { conf = configuration; Dataset<E> dataset = loadDataset(configuration); String partitionDir = conf.get(KITE_PARTITION_DIR); if (dataset.getDescriptor().isPartitioned() && partitionDir != null) { PartitionKey key = Accessor.getDefault().fromDirectoryName(dataset, new Path(partitionDir)); if (key != null) { dataset = dataset.getPartition(key, true); } } if (dataset instanceof AbstractDataset) { delegate = ((AbstractDataset<E>) dataset).getDelegateInputFormat(); } else { throw new UnsupportedOperationException("Incompatible Dataset: implementation " + "does not provide InputFormat support. Dataset: " + dataset); } }
Source:
protected void deleteExpiredVMSnapshots() { String displayTime = DateUtil.displayDateInTimezone(DateUtil.GMT_TIMEZONE, _currentTimestamp); Date now = new Date(); List<VMSnapshotVO> vmSnapshots = _vmSnapshotDao.listAll(); for (VMSnapshotVO vmSnapshot : vmSnapshots) { long accountId = vmSnapshot.getAccountId(); int expiration_interval_hours = VMSnapshotManager.VMSnapshotExpireInterval.valueIn(accountId); if (expiration_interval_hours < 0 ) { continue; } Date creationTime = vmSnapshot.getCreated(); long diffInHours = TimeUnit.MILLISECONDS.toHours(now.getTime() - creationTime.getTime()); if (diffInHours > expiration_interval_hours) { _vmSnaphostManager.deleteVMSnapshot(vmSnapshot.getId()); } } }

Target:
protected void deleteExpiredVMSnapshots() { Date now = new Date(); List<VMSnapshotVO> vmSnapshots = _vmSnapshotDao.listAll(); for (VMSnapshotVO vmSnapshot : vmSnapshots) { long accountId = vmSnapshot.getAccountId(); int expiration_interval_hours = VMSnapshotManager.VMSnapshotExpireInterval.valueIn(accountId); if (expiration_interval_hours < 0 ) { continue; } Date creationTime = vmSnapshot.getCreated(); long diffInHours = TimeUnit.MILLISECONDS.toHours(now.getTime() - creationTime.getTime()); if (diffInHours >= expiration_interval_hours) { if (s_logger.isDebugEnabled()){ s_logger.debug("Deleting expired VM snapshot id: " + vmSnapshot.getId()); } _vmSnaphostManager.deleteVMSnapshot(vmSnapshot.getId()); } } }
Source:
public Neo4jItemReader<T> build() { if (this.saveState) { Assert.hasText(this.name, "A name is required when saveState is set to true"); } Assert.notNull(this.sessionFactory, "sessionFactory is required."); Assert.notNull(this.targetType, "targetType is required."); Assert.hasText(this.startStatement, "startStatement is required."); Assert.hasText(this.returnStatement, "returnStatement is required."); Assert.hasText(this.orderByStatement, "orderByStatement is required."); Neo4jItemReader<T> reader = new Neo4jItemReader<>(); reader.setMatchStatement(this.matchStatement); reader.setOrderByStatement(this.orderByStatement); reader.setPageSize(this.pageSize); reader.setParameterValues(this.parameterValues); reader.setSessionFactory(this.sessionFactory); reader.setTargetType(this.targetType); reader.setStartStatement(this.startStatement); reader.setReturnStatement(this.returnStatement); reader.setWhereStatement(this.whereStatement); reader.setName(this.name); reader.setSaveState(this.saveState); reader.setCurrentItemCount(this.currentItemCount); reader.setMaxItemCount(this.maxItemCount); return reader; }

Target:
public Neo4jItemReader<T> build() { if (this.saveState) { Assert.hasText(this.name, "A name is required when saveState is set to true"); } Assert.notNull(this.sessionFactory, "sessionFactory is required."); Assert.notNull(this.targetType, "targetType is required."); Assert.hasText(this.startStatement, "startStatement is required."); Assert.hasText(this.returnStatement, "returnStatement is required."); Assert.hasText(this.orderByStatement, "orderByStatement is required."); Assert.isTrue(this.pageSize > 0, "pageSize must be greater than zero"); Assert.isTrue(this.maxItemCount > 0, "maxItemCount must be greater than zero"); Assert.isTrue(this.maxItemCount > this.currentItemCount , "maxItemCount must be greater than currentItemCount"); Neo4jItemReader<T> reader = new Neo4jItemReader<>(); reader.setMatchStatement(this.matchStatement); reader.setOrderByStatement(this.orderByStatement); reader.setPageSize(this.pageSize); reader.setParameterValues(this.parameterValues); reader.setSessionFactory(this.sessionFactory); reader.setTargetType(this.targetType); reader.setStartStatement(this.startStatement); reader.setReturnStatement(this.returnStatement); reader.setWhereStatement(this.whereStatement); reader.setName(this.name); reader.setSaveState(this.saveState); reader.setCurrentItemCount(this.currentItemCount); reader.setMaxItemCount(this.maxItemCount); return reader; }