auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void init() { super.init(); if (getDiskImage().getVmEntityType().isTemplateType()) { initVmTemplateId(); } <START> addCustomValue("DiskAlias", getDiskImage().getDiskAlias()); <END> }</code><technical_language>image null here. add a null-check a more elegant solution imo initialize custom values for audit logs is done in RemoveDiskSnapshotsCommand</technical_language>

Target:
protected void init() { super.init(); if (getDiskImage().getVmEntityType().isTemplateType()) { initVmTemplateId(); } }
Source:
<code>public Object[] getElements(Object inputElement) { ILaunchConfiguration[] all = null; try { all = LaunchConfigurationManager.filterConfigs(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations()); } catch (CoreException e) { DebugUIPlugin.log(e); return new ILaunchConfiguration[0]; } List<ILaunchConfiguration> list = new ArrayList<>(all.length); ViewerFilter filter = new LaunchGroupFilter(fHistory.getLaunchGroup()); for (ILaunchConfiguration <START> a : <END> all) { if (filter.select(null, null, a)) { list.add(a); } } list.removeAll(fCurrentFavoriteSet); Object[] objs = list.toArray(); new WorkbenchViewerComparator().sort(getCheckBoxTableViewer(), objs); return objs; }</code><technical_language>rename launch config</technical_language>

Target:
public Object[] getElements(Object inputElement) { ILaunchConfiguration[] all = null; try { all = LaunchConfigurationManager.filterConfigs(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations()); } catch (CoreException e) { DebugUIPlugin.log(e); return new ILaunchConfiguration[0]; } List<ILaunchConfiguration> list = new ArrayList<>(all.length); ViewerFilter filter = new LaunchGroupFilter(fHistory.getLaunchGroup()); for (ILaunchConfiguration config : all) { if (filter.select(null, null, config)) { list.add(config); } } list.removeAll(fCurrentFavoriteSet); Object[] objs = list.toArray(); new WorkbenchViewerComparator().sort(getCheckBoxTableViewer(), objs); return objs; }
Source:
<code>public List<WorkerLostStorageInfo> getWorkerLostStorage() throws IOException { return retryRPC(() -> mClient .getWorkerLostStorage(GetWorkerLostStoragePOptions.getDefaultInstance()) .getWorkerLostStorageInfoList(), <START> LOG, "GetWorkerLostStorage", "options=%s", ""); <END> }</code><technical_language>args</technical_language>

Target:
public List<WorkerLostStorageInfo> getWorkerLostStorage() throws IOException { return retryRPC(() -> mClient .getWorkerLostStorage(GetWorkerLostStoragePOptions.getDefaultInstance()) .getWorkerLostStorageInfoList(), RPC_LOG, "GetWorkerLostStorage", ""); }
Source:
<code>public void setUp() { logoutIfNecessary(); stubFor(get(urlEqualTo("/rest/v1.1/me/")) .inScenario("Sign up") <START> .whenScenarioStateIs(Scenario.STARTED)); <END> }</code><technical_language>WireMock Java API this do for iOS. do this JSON files</technical_language>

Target:
public void setUp() { logoutIfNecessary(); }
Source:
<code>protected void run() throws UnloggedFailure { nw = columns - 50; Date now = new Date(); stdout.format( "%-25s %-20s now %16s\n", "Gerrit Code Review", Version.getVersion() != null ? Version.getVersion() : "", new SimpleDateFormat("HH:mm:ss zzz").format(now)); stdout.format( "%-25s %-20s uptime %16s\n", "", "", uptime(now.getTime() - serverStarted)); stdout.print('\n'); stdout.print(String.format( "%1s %-"+nw+"s|%-21s| %-5s |%-9s|\n" , "" , "Name" , "Entries" , "AvgGet" , "Hit Ratio" )); stdout.print(String.format( "%1s %-"+nw+"s|%6s %6s %7s| %-5s |%-4s %-4s|\n" , "" , "" , "Mem" , "Disk" , "Space" , "" , "Mem" , "Disk" )); stdout.print("--"); for (int i = 0; i < nw; i++) { stdout.print('-'); } stdout.print("+---------------------+---------+---------+\n"); Collection<CacheInfo> caches = getCaches(); printMemoryCoreCaches(caches); printMemoryPluginCaches(caches); printDiskCaches(caches); stdout.print('\n'); sshSummary(); SummaryInfo summary = getSummary.get().setGc(gc).setJvm(showJVM).apply(new ConfigResource()); taskSummary(summary.taskSummary); memSummary(summary.memSummary); threadSummary(summary.threadSummary); if <START> (summary.jvmSummary != null) { <END> jvmSummary(summary.jvmSummary); } stdout.flush(); }</code><technical_language>showJVM</technical_language>

Target:
protected void run() throws UnloggedFailure { nw = columns - 50; Date now = new Date(); stdout.format( "%-25s %-20s now %16s\n", "Gerrit Code Review", Version.getVersion() != null ? Version.getVersion() : "", new SimpleDateFormat("HH:mm:ss zzz").format(now)); stdout.format( "%-25s %-20s uptime %16s\n", "", "", uptime(now.getTime() - serverStarted)); stdout.print('\n'); stdout.print(String.format( "%1s %-"+nw+"s|%-21s| %-5s |%-9s|\n" , "" , "Name" , "Entries" , "AvgGet" , "Hit Ratio" )); stdout.print(String.format( "%1s %-"+nw+"s|%6s %6s %7s| %-5s |%-4s %-4s|\n" , "" , "" , "Mem" , "Disk" , "Space" , "" , "Mem" , "Disk" )); stdout.print("--"); for (int i = 0; i < nw; i++) { stdout.print('-'); } stdout.print("+---------------------+---------+---------+\n"); Collection<CacheInfo> caches = getCaches(); printMemoryCoreCaches(caches); printMemoryPluginCaches(caches); printDiskCaches(caches); stdout.print('\n'); sshSummary(); SummaryInfo summary = getSummary.get().setGc(gc).setJvm(showJVM).apply(new ConfigResource()); taskSummary(summary.taskSummary); memSummary(summary.memSummary); threadSummary(summary.threadSummary); if (showJVM && summary.jvmSummary != null) { jvmSummary(summary.jvmSummary); } stdout.flush(); }
Source:
<code>public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof EntitlementDTO && super.equals(obj)) { EntitlementDTO that = (EntitlementDTO) obj; String thisOwnerId = this.getOwner() != null ? this.getOwner().getId() : null; String thatOwnerId = that.getOwner() != null ? that.getOwner().getId() : null; String thisPoolId = this.getPool() != null ? this.getPool().getId() : null; String thatPoolId = that.getPool() != null ? that.getPool().getId() : null; String thisConsumerId = this.getConsumer() != null ? this.getConsumer().getUuid() : null; String thatConsumerId = that.getConsumer() != null ? that.getConsumer().getUuid() : null; EqualsBuilder builder = new EqualsBuilder() .append(this.getId(), that.getId()) .append(thisOwnerId, thatOwnerId) .append(thisPoolId, thatPoolId) .append(thisConsumerId, thatConsumerId) .append(this.getQuantity(), that.getQuantity()) .append(this.isDirty(), that.isDirty()) .append(this.getEndDateOverride(), that.getEndDateOverride()) .append(this.isUpdatedOnStart(), that.isUpdatedOnStart()) .append(this.isDeletedFromPool(), that.isDeletedFromPool()) .append(this.getEndDate(), that.getEndDate()) .append(this.getStartDate(), that.getStartDate()); boolean equals = builder.isEquals(); <START> equals = equals && Util.collectionsAreEqual(this.getCertificates(), that.getCertificates()); <END> return equals; } return false; }</code><technical_language>implementation other nested objects, change this examine certificate IDs certificate objects. do tossing a comparator pulls IDs sides that</technical_language>

Target:
public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof EntitlementDTO && super.equals(obj)) { EntitlementDTO that = (EntitlementDTO) obj; String thisOwnerId = this.getOwner() != null ? this.getOwner().getId() : null; String thatOwnerId = that.getOwner() != null ? that.getOwner().getId() : null; String thisPoolId = this.getPool() != null ? this.getPool().getId() : null; String thatPoolId = that.getPool() != null ? that.getPool().getId() : null; String thisConsumerId = this.getConsumer() != null ? this.getConsumer().getUuid() : null; String thatConsumerId = that.getConsumer() != null ? that.getConsumer().getUuid() : null; EqualsBuilder builder = new EqualsBuilder() .append(this.getId(), that.getId()) .append(thisOwnerId, thatOwnerId) .append(thisPoolId, thatPoolId) .append(thisConsumerId, thatConsumerId) .append(this.getQuantity(), that.getQuantity()) .append(this.isDeletedFromPool(), that.isDeletedFromPool()) .append(this.getEndDate(), that.getEndDate()) .append(this.getStartDate(), that.getStartDate()); boolean equals = builder.isEquals(); equals = equals && Util.collectionsAreEqual(this.getCertificates(), that.getCertificates(), new Comparator<CertificateDTO>() { @Override public int compare(CertificateDTO c1, CertificateDTO c2) { if (c1 == c2) { return 0; } if (c1 != null && c1.getId() != null) { return c1.getId().compareTo(c2.getId()); } return 1; } }); return equals; } return false; }
Source:
<code>public String toString() { StringBuilder builder = new StringBuilder(); <START> builder.append(this.command + "\n"); <END> for (String key: this.headers.keySet()){ builder.append(key + ":" + this.headers.get(key) + "\n"); } builder.append("\n"); if (Command.SEND.toString().equals(this.command)) { JsonRpcRequest request = JsonRpcRequest.fromByteArray(this.content); builder.append(request.toString()); } else if (Command.MESSAGE.toString().equals(this.command)) { JsonRpcResponse response = JsonRpcResponse.fromByteArray(this.content); builder.append(response.toString()); } return builder.toString(); }</code><technical_language>builder.append(this.command).append("\n");</technical_language>

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(this.command).append("\n"); for (String key : this.headers.keySet()) { builder.append(key).append(":").append(this.headers.get(key)).append("\n"); } builder.append("\n"); if (Command.SEND.toString().equals(this.command)) { JsonRpcRequest request = JsonRpcRequest.fromByteArray(this.content); builder.append(request.toString()); } else if (Command.MESSAGE.toString().equals(this.command)) { JsonRpcResponse response = JsonRpcResponse.fromByteArray(this.content); builder.append(response.toString()); } return builder.toString(); }
Source:
<code>private byte[] toBytes(long checkpointId) throws Exception { EnumChkT enumCkpt = enumerator.snapshotState(); try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(baos)) { out.writeInt(enumCheckpointSerializer.getVersion()); out.writeObject(enumCheckpointSerializer.serialize(enumCkpt)); context.snapshotState(checkpointId, splitSerializer, out); <START> out.flush(); <END> return baos.toByteArray(); } }</code><technical_language>Do want enforce this? want reset checkpoint scheduler decides do a global failover. Global failovers scheduler's "safety net". common failover (pipelined region) unexpected (bug, inconsistency, so) a global failover (reset latest checkpoint). a high chance of fixing inconsistencies. is costly, unavailable. a situation happens, I reset enumerator, subtaskFailed()-based bookkeeping inconsistent well</technical_language>

Target:
private byte[] toBytes(long checkpointId) throws Exception { EnumChkT enumCkpt = enumerator.snapshotState(); try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputViewStreamWrapper(baos)) { writeCoordinatorSerdeVersion(out); out.writeInt(enumCheckpointSerializer.getVersion()); byte[] serialziedEnumChkpt = enumCheckpointSerializer.serialize(enumCkpt); out.writeInt(serialziedEnumChkpt.length); out.write(serialziedEnumChkpt); context.snapshotState(checkpointId, splitSerializer, out); out.flush(); return baos.toByteArray(); } }
Source:
<code>public void onNext(T t) { SwitchMapSingleObserver<R> current = inner.get(); if (current != null) { current.dispose(); } <START> SingleSource<? extends R> ms; <END> try { ms = ObjectHelper.requireNonNull(mapper.apply(t), "The mapper returned a null SingleSource"); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); upstream.dispose(); inner.getAndSet((SwitchMapSingleObserver)INNER_DISPOSED); onError(ex); return; } SwitchMapSingleObserver<R> observer = new SwitchMapSingleObserver<R>(this); for (;;) { current = inner.get(); if (current == INNER_DISPOSED) { break; } if (inner.compareAndSet(current, observer)) { ms.subscribe(observer); break; } } }</code><technical_language>ss</technical_language>

Target:
public void onNext(T t) { SwitchMapSingleObserver<R> current = inner.get(); if (current != null) { current.dispose(); } SingleSource<? extends R> ss; try { ss = ObjectHelper.requireNonNull(mapper.apply(t), "The mapper returned a null SingleSource"); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); upstream.dispose(); inner.getAndSet((SwitchMapSingleObserver)INNER_DISPOSED); onError(ex); return; } SwitchMapSingleObserver<R> observer = new SwitchMapSingleObserver<R>(this); for (;;) { current = inner.get(); if (current == INNER_DISPOSED) { break; } if (inner.compareAndSet(current, observer)) { ss.subscribe(observer); break; } } }
Source:
<code>public boolean equals(Object o) { if (o instanceof Bounds) { Bounds other = (Bounds) o; <START> return ((null != ul) ? ul.equals(other.ul) : null == other.ul) && <END> ((null != lr) ? lr.equals(other.lr) : null == other.lr); } return false; }</code><technical_language>simplified: java return Objects.equals(ul, other.ul) && Objects.equals(lr, other.lr);;</technical_language>

Target:
public boolean equals(Object o) { if (o instanceof Bounds) { Bounds other = (Bounds) o; return Objects.equals(ul, other.ul) && Objects.equals(lr, other.lr); } return false; }
Source:
<code>private void initEnvironmentMasterKeyService() { if (environmentMasterKeyService == null) { <START> Configuration configuration = new Configuration(); <END> try { environmentMasterKeyService = MasterKeyServiceImpl.getMasterKeyService(null, configuration.getMasterKeyLocation(), configuration.isMasterKeyPersisted()); } catch (AmbariException e) { throw new SecurityException("You are trying to use a persisted master key but its initialization has been failed!", e); } } }</code><technical_language>injected version of this</technical_language>

Target:
private void initEnvironmentMasterKeyService() { if (environmentMasterKeyService == null) { environmentMasterKeyService = new MasterKeyServiceImpl(configuration); if (!environmentMasterKeyService.isMasterKeyInitialized()) { throw new SecurityException("You are trying to use a persisted master key but its initialization has been failed!"); } } }
Source:
<code><START> public void before() throws Exception { <END> Map<String, Object> config = new HashMap<>(); config.put(ROOT_PATH_KEY, ROOT_PATH); localFileSystemBackend = spy(new LocalFileSystemStorage()); localFileSystemBackend.init(config); PhysicalPlans.InstanceInfo info = PhysicalPlans.InstanceInfo.newBuilder() .setTaskId(TASK_ID) .setComponentIndex(COMPONENT_INDEX) .setComponentName(COMPONENT_NAME) .build(); instance = PhysicalPlans.Instance.newBuilder() .setInstanceId(INSTANCE_ID) .setStmgrId(STMGR_ID) .setInfo(info) .build(); checkpoint = InstanceStateCheckpoint.newBuilder() .setCheckpointId(CHECKPOINT_ID) .setState(ByteString.copyFrom(BYTES)) .build(); saveInstanceStateRequest = SaveInstanceStateRequest.newBuilder() .setInstance(instance) .setCheckpoint(checkpoint) .build(); getInstanceStateRequest = GetInstanceStateRequest.newBuilder() .setInstance(instance) .setCheckpointId(CHECKPOINT_ID) .build(); }</code><technical_language>lots of duplication of boilerplate constants before() logic in of stateful storage tests in CheckpointManagerServerTest. share this code in some test helpers</technical_language>

Target:
public void before() throws Exception { Map<String, Object> config = new HashMap<>(); config.put(StatefulStorageTestContext.ROOT_PATH_KEY, StatefulStorageTestContext.ROOT_PATH); localFileSystemStorage = spy(new LocalFileSystemStorage()); localFileSystemStorage.init(config); instance = StatefulStorageTestContext.getInstance(); checkpoint = StatefulStorageTestContext.getInstanceStateCheckpoint(); }
Source:
<code>private void processClientHello(final ClientHello clientHello, final Record record, final Connection connection) throws HandshakeException { if (LOGGER.isDebugEnabled()) { StringBuilder msg = new StringBuilder("Processing CLIENT_HELLO from peer [").append(record.getPeerAddress()).append("]"); if (LOGGER.isTraceEnabled()) { msg.append(":").append(StringUtil.lineSeparator()).append(record); } LOGGER.debug(msg.toString()); } if (record.getEpoch() > 0) { DTLSSession session = connection.getEstablishedSession(); send(new AlertMessage(AlertLevel.WARNING, AlertDescription.NO_RENEGOTIATION, clientHello.getPeer()), session); <START> } else <END> if (isClientInControlOfSourceIpAddress(clientHello, record)) { if (isHandshakeAlreadyStartedForMessage(clientHello, connection)) { processOngoingHandshakeMessage(clientHello, record, connection); } else if (clientHello.hasSessionId()) { resumeExistingSession(clientHello, record); } else { terminateConnection(connection); startNewHandshake(clientHello, record); } } }</code><technical_language>limit changes comply source formatter: return; } instead of } else</technical_language>

Target:
private void processClientHello(final ClientHello clientHello, final Record record, final Connection connection) throws HandshakeException { if (LOGGER.isDebugEnabled()) { StringBuilder msg = new StringBuilder("Processing CLIENT_HELLO from peer [").append(record.getPeerAddress()).append("]"); if (LOGGER.isTraceEnabled()) { msg.append(":").append(StringUtil.lineSeparator()).append(record); } LOGGER.debug(msg.toString()); } if (record.getEpoch() > 0) { DTLSSession session = connection.getEstablishedSession(); send(new AlertMessage(AlertLevel.WARNING, AlertDescription.NO_RENEGOTIATION, clientHello.getPeer()), session); return; } if (isClientInControlOfSourceIpAddress(clientHello, record)) { if (isHandshakeAlreadyStartedForMessage(clientHello, connection)) { processOngoingHandshakeMessage(clientHello, record, connection); } else if (clientHello.hasSessionId()) { resumeExistingSession(clientHello, record); } else { terminateConnection(connection); startNewHandshake(clientHello, record); } } }
Source:
<code>public Chart generateChart(BarData data) { BarChart chart = new BarChart(StatisticsScreen.this); chart.setDrawGridBackground(false); chart.getLegend().setTextColor(Color.WHITE); chart.getXAxis().setTextColor(Color.WHITE); chart.getAxisLeft().setTextColor(Color.WHITE); chart.getAxisRight().setTextColor(Color.WHITE); <START> chart.getAxisLeft().setValueFormatter(new ChartYAxisValueFormatter()); <END> chart.getAxisRight().setValueFormatter(new ChartYAxisValueFormatter()); chart.setData(data); chart.setDescription(""); return chart; }</code><technical_language>I a static variable for formatter instead of creating a instance time it. privat static ChartYAxisValueFormatter yAxisValueFormatter = new ChartYAxisValueFormatter(); in places. I work saves a bit memory</technical_language>

Target:
public Chart generateChart(BarData data) { BarChart chart = new BarChart(StatisticsScreen.this); chart.setDrawGridBackground(false); chart.getLegend().setTextColor(Color.WHITE); chart.getXAxis().setTextColor(Color.WHITE); chart.getAxisLeft().setTextColor(Color.WHITE); chart.getAxisRight().setTextColor(Color.WHITE); chart.getAxisLeft().setValueFormatter(yAxisValueFormatter); chart.getAxisRight().setValueFormatter(yAxisValueFormatter); chart.setData(data); chart.setDescription(""); return chart; }
Source:
<code>public void testLoadOrderedPublicEvents_9() throws Throwable { UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24") .withAuthorization(Group.FREE_GROUP_NAME, "tempRole", Permission.BACKOFFICE).build(); String accessToken = mockOAuthInterceptor(user); ResultActions result = mockMvc .perform(get("/plugins/cms/contents") .param("status", IContentService.STATUS_ONLINE) .param("sort", "status") .param("direction", FieldSearchFilter.ASC_ORDER) .param("filters[0].attribute", IContentManager.ENTITY_TYPE_CODE_FILTER_KEY) .param("filters[0].operator", "eq") .param("filters[0].value", "EVN") .sessionAttr("user", user) .header("Authorization", "Bearer " + accessToken)); <START> String bodyResult = result.andReturn().getResponse().getContentAsString(); result.andExpect(status().isOk()); String[] expectedFreeContentsId = {"EVN193", "EVN194", "EVN191", "EVN25", "EVN21", "EVN24", "EVN23", "EVN192", "EVN20"}; int payloadSize = JsonPath.read(bodyResult, "$.payload.size()"); Assert.assertEquals(expectedFreeContentsId.length, payloadSize); for (int i = 0; i < expectedFreeContentsId.length; i++) { String expectedId = expectedFreeContentsId[i]; String extractedId = JsonPath.read(bodyResult, "$.payload[" + i + "].id"); Assert.assertEquals(expectedId, extractedId); } <END> }</code><technical_language>Code style</technical_language>

Target:
public void testLoadOrderedPublicEvents_9() throws Throwable { UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24") .withAuthorization(Group.FREE_GROUP_NAME, "tempRole", Permission.BACKOFFICE).build(); String accessToken = mockOAuthInterceptor(user); ResultActions result = mockMvc .perform(get("/plugins/cms/contents") .param("status", IContentService.STATUS_ONLINE) .param("sort", "status") .param("direction", FieldSearchFilter.ASC_ORDER) .param("filters[0].attribute", IContentManager.ENTITY_TYPE_CODE_FILTER_KEY) .param("filters[0].operator", "eq") .param("filters[0].value", "EVN") .sessionAttr("user", user) .header("Authorization", "Bearer " + accessToken)); result.andDo(print()) .andExpect(status().isOk()) .andExpect(jsonPath("$.payload.size()", is(9))) .andExpect(jsonPath("$.payload[0].id", is("EVN193"))) .andExpect(jsonPath("$.payload[1].id", is("EVN194"))) .andExpect(jsonPath("$.payload[2].id", is("EVN191"))) .andExpect(jsonPath("$.payload[3].id", is("EVN25"))) .andExpect(jsonPath("$.payload[4].id", is("EVN21"))) .andExpect(jsonPath("$.payload[5].id", is("EVN24"))) .andExpect(jsonPath("$.payload[6].id", is("EVN23"))) .andExpect(jsonPath("$.payload[7].id", is("EVN192"))) .andExpect(jsonPath("$.payload[8].id", is("EVN20"))); }
Source:
<code>void setContents(InputStream stream) throws CoreException { try { fArch = null; fContainers = null; fImplicit = null; fJREContainer = null; fIncluded = null; fName = null; fNL = null; fOS = null; fProgramArgs = null; fVMArgs = null; fWS = null; fSequenceNumber = 0; fDocument = null; fRoot = null; TargetDefinitionPersistenceHelper.initFromXML(this, stream); <START> } catch (ParserConfigurationException e) { setDocument(createNewDocument()); abort(Messages.TargetDefinition_0, e); } catch (SAXException e) { setDocument(createNewDocument()); abort(Messages.TargetDefinition_0, e); } catch (IOException e) { setDocument(createNewDocument()); abort(Messages.TargetDefinition_0, e); } <END> }</code><technical_language>Multi-catch please</technical_language>

Target:
void setContents(InputStream stream) throws CoreException { try { fArch = null; fContainers = null; fImplicit = null; fJREContainer = null; fIncluded = null; fName = null; fNL = null; fOS = null; fProgramArgs = null; fVMArgs = null; fWS = null; fSequenceNumber = 0; fDocument = null; fRoot = null; TargetDefinitionPersistenceHelper.initFromXML(this, stream); } catch (ParserConfigurationException | SAXException | IOException e) { setDocument(createNewDocument()); abort(Messages.TargetDefinition_0, e); } }
Source:
<code>public XML read() throws IOException { <START> final String memo = this.item.get(DyRepo.ATTR_MEMO).getS(); <END> return new StrictXML( Memo.CLEANUP.transform( new XMLDocument(memo) ), Memo.SCHEMA ); }</code><technical_language>inline memo</technical_language>

Target:
public XML read() throws IOException { return new StrictXML( Memo.CLEANUP.transform( new XMLDocument(this.item.get(DyRepo.ATTR_MEMO).getS()) ), Memo.SCHEMA ); }
Source:
<code>public void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException { checkParameterCount(parameters, 0, 4); Object[] values = parameters.toArray(); format = ((CompoundVariable) values[0]).execute(); dateToShift = ((CompoundVariable) values[1]).execute(); <START> amountToShift = ((CompoundVariable) values[2]).execute(); <END> variableName = ((CompoundVariable) values[3]).execute().trim(); }</code><technical_language>other fields trimmed variableName</technical_language>

Target:
public void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException { checkParameterCount(parameters, 0, 4); Object[] values = parameters.toArray(); format = ((CompoundVariable) values[0]).execute().trim(); dateToShift = ((CompoundVariable) values[1]).execute().trim(); amountToShift = ((CompoundVariable) values[2]).execute().trim(); variableName = ((CompoundVariable) values[3]).execute().trim(); if (dateTimeFormatterCache == null) { dateTimeFormatterCache = buildCache(); } }
Source:
<code>private TableEventRequest tableRequest(int queryCount, long queryIndex, Map<Long, ITmfEventAspect<?>> aspects, @Nullable ITmfFilter searchFilter, boolean forwardSearch, @Nullable ITmfFilter collapseFilter, @Nullable IProgressMonitor monitor) { return new TableEventRequest(queryIndex) { private long rank = queryIndex; @Override public void handleData(ITmfEvent event) { super.handleData(event); if (monitor != null && monitor.isCanceled()) { cancel(); return; } List<EventTableLine> events = getEventLines(); if ((searchFilter == null || searchFilter.matches(event)) && (collapseFilter == null || collapseFilter.matches(event))) { if (events.size() < queryCount) { EventTableLine eventLine = buildEventTableLine(aspects, event, rank, rank); <START> events.add(eventLine); <END> } } else if (collapseFilter != null && !events.isEmpty()) { int lastIndex = events.size() - 1; EventTableLine prevLine = events.get(lastIndex); long prevRepeatCount = prevLine.getRepeatCount(); events.set(lastIndex, new EventTableLine(prevLine.getLine(), prevLine.getIndex(), prevLine.getTimestamp(), prevLine.getRank(), prevRepeatCount++)); } if ((searchFilter != null && !forwardSearch && getNbRead() == queryCount) || events.size() == queryCount) { done(); return; } rank++; } }; }</code><technical_language>inline</technical_language>

Target:
private TableEventRequest tableRequest(int queryCount, long queryIndex, Map<Long, ITmfEventAspect<?>> aspects, @Nullable ITmfFilter searchFilter, boolean forwardSearch, @Nullable ITmfFilter collapseFilter, @Nullable IProgressMonitor monitor) { return new TableEventRequest(queryIndex) { private long rank = queryIndex; @Override public void handleData(ITmfEvent event) { super.handleData(event); if (monitor != null && monitor.isCanceled()) { cancel(); return; } List<EventTableLine> events = getEventLines(); if ((searchFilter == null || searchFilter.matches(event)) && (collapseFilter == null || collapseFilter.matches(event))) { if (events.size() < queryCount) { events.add(buildEventTableLine(aspects, event, rank, rank)); } } else if (collapseFilter != null && !events.isEmpty()) { int lastIndex = events.size() - 1; EventTableLine prevLine = events.get(lastIndex); long prevRepeatCount = prevLine.getRepeatCount(); events.set(lastIndex, new EventTableLine(prevLine.getLine(), prevLine.getIndex(), prevLine.getTimestamp(), prevLine.getRank(), prevRepeatCount++)); } if ((searchFilter != null && !forwardSearch && getNbRead() == queryCount) || events.size() == queryCount) { done(); return; } rank++; } }; }
Source:
<code>protected void drawForeground(final int mouseX, final int mouseY) { super.drawForeground(mouseX, mouseY); FluidInstance fluid = tankEntity.getTank().getFluidInstance(); if (fluid.isEmpty()) { font.draw("Empty", 10, 20, 4210752); } else { <START> font.draw("Fluid Type:", 10, 20, 4210752); <END> font.draw(FluidUtil.getFluidName(fluid).replace("_", " "), 10, 30, 4210752); font.draw("Fluid Amount:", 10, 50, 4210752); font.draw(fluid.getAmount().toString(), 10, 60, 4210752); String percentFilled = String.valueOf((int) ((double) fluid.getAmount().getRawValue() / (double) tankEntity.getTank().getCapacity().getRawValue() * 100)); font.draw("Used: " + percentFilled + "%", 10, 70, 4210752); font.draw("Wrench unit to retain contents", 10, 80, 16711680); } }</code><technical_language>add translation, please</technical_language>

Target:
protected void drawForeground(final int mouseX, final int mouseY) { super.drawForeground(mouseX, mouseY); FluidInstance fluid = tankEntity.getTank().getFluidInstance(); if (fluid.isEmpty()) { font.draw(StringUtils.t("techreborn.tooltip.unit.empty"), 10, 20, 4210752); } else { font.draw(StringUtils.t("gui.techreborn.tank.type"), 10, 20, 4210752); font.draw(FluidUtil.getFluidName(fluid).replace("_", " "), 10, 30, 4210752); font.draw(StringUtils.t("gui.techreborn.tank.amount"), 10, 50, 4210752); font.draw(fluid.getAmount().toString(), 10, 60, 4210752); String percentFilled = String.valueOf((int) ((double) fluid.getAmount().getRawValue() / (double) tankEntity.getTank().getCapacity().getRawValue() * 100)); font.draw(StringUtils.t("gui.techreborn.unit.used") + percentFilled + "%", 10, 70, 4210752); font.draw(StringUtils.t("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680); } }
Source:
<code>public void prepareRun(BatchSourceContext context) throws DatasetManagementException { super.prepareRun(context); <START> String schemaString = tableConfig.getSchemaStr(); <END> if (schemaString != null) { try { Schema schema = Schema.parseJson(schemaString); if (schema.getFields() != null) { FieldOperation operation = new FieldReadOperation("Read", "Read from Table dataset", EndPoint.of(context.getNamespace(), tableConfig.getName()), schema.getFields().stream().map(Schema.Field::getName) .collect(Collectors.toList())); context.record(Collections.singletonList(operation)); } } catch (IOException e) { throw new IllegalStateException("Failed to parse schema.", e); } } }</code><technical_language>introduced LineageRecorder lineage recording require code. Please consider that</technical_language>

Target:
public void prepareRun(BatchSourceContext context) throws DatasetManagementException { super.prepareRun(context); Schema schema = tableConfig.getSchema(); if (schema != null && schema.getFields() != null) { FieldOperation operation = new FieldReadOperation("Read", "Read from Table dataset", EndPoint.of(context.getNamespace(), tableConfig.getName()), schema.getFields().stream().map(Schema.Field::getName) .collect(Collectors.toList())); context.record(Collections.singletonList(operation)); } }
Source:
<code>public static Interface findInterfaceOfNodeTemplate(Map<String, Interface> nodeTemplateInterfaces, <START> List<String> validInterfaceNames) { <END> if (nodeTemplateInterfaces != null) { for (String interfaceName : validInterfaceNames) { if (nodeTemplateInterfaces.containsKey(interfaceName)) { return nodeTemplateInterfaces.get(interfaceName); } } } return null; }</code><technical_language>Indentation prefer format it</technical_language>

Target:
public static Optional<Interface> findInterfaceOfNodeTemplate(Map<String, Interface> nodeTemplateInterfaces, List<String> validInterfaceNames) { if (nodeTemplateInterfaces != null) { for (String interfaceName : validInterfaceNames) { if (nodeTemplateInterfaces.containsKey(interfaceName)) { return Optional.of(nodeTemplateInterfaces.get(interfaceName)); } } } return Optional.absent(); }
Source:
<code>private void addCloudEventTracePlaceHolder(Iterable<CloudEvent> events) { if (TracerProxy.isTracingEnabled()) { for (CloudEvent event : events) { if (event.getExtensionAttributes() == null || (event.getExtensionAttributes().get(Constants.TRACE_PARENT) == null && event.getExtensionAttributes().get(Constants.TRACE_STATE) == null)) { <START> event.addExtensionAttribute(Constants.TRACE_PARENT, Constants.TRACE_PARENT_PLACEHOLDER); event.addExtensionAttribute(Constants.TRACE_STATE, Constants.TRACE_STATE_PLACEHOLDER); <END> } } } }</code><technical_language>Do need both</technical_language>

Target:
private void addCloudEventTracePlaceHolder(Iterable<CloudEvent> events) { if (TracerProxy.isTracingEnabled()) { for (CloudEvent event : events) { if (event.getExtensionAttributes() == null || (event.getExtensionAttributes().get(Constants.TRACE_PARENT) == null && event.getExtensionAttributes().get(Constants.TRACE_STATE) == null)) { event.addExtensionAttribute(Constants.TRACE_PARENT, Constants.TRACE_PARENT_PLACEHOLDER_UUID); event.addExtensionAttribute(Constants.TRACE_STATE, Constants.TRACE_STATE_PLACEHOLDER_UUID); } } } }
Source:
<code>protected void configure() { <START> bind(EventBus.class).toInstance(eventBus); <END> bind(ApplicationEventPublisher.class).to(GuavaApplicationEventPublisher.class); bindListener(Matchers.any(), subscribingTypeListener); }</code><technical_language>Instead of binding instance here, create eventBus instance @ Provides @ Named evenBus instance for injection GuavaApplicationEventPublisher</technical_language>

Target:
protected void configure() { com.google.inject.Provider<ApplicationEventDispatcher> dispatcherProvider = binder().getProvider(ApplicationEventDispatcher.class); bindListener(Matchers.any(), new ApplicationEventSubscribingTypeListener(dispatcherProvider)); bindListener(Matchers.any(), new ApplicationEventSubscribingProvisionListener(dispatcherProvider)); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } DataNode other = (DataNode) obj; if (nodeId != other.nodeId) { return false; } <START> if (!content.equals(other.content)) { <END> return false; } if (refEndPoint != other.refEndPoint) { return false; } if (refStartPoint != other.refStartPoint) { return false; } if (!Arrays.equals(source, other.source)) { return false; } return true; }</code><technical_language>assume content other fields equal nodeId is equal</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } DataNode other = (DataNode) obj; return this.getId() == other.getId(); }
Source:
<code>public boolean hasSameConfigOrigin(PipelineConfig other) { if (!(isConfigDefinedRemotely())) return false; RepoConfigOrigin otherOrigin = (RepoConfigOrigin) other.getOrigin(); RepoConfigOrigin repoConfigOrigin = (RepoConfigOrigin) this.origin; <START> return repoConfigOrigin == otherOrigin; <END> }</code><technical_language>== check reference equality. call equals</technical_language>

Target:
public boolean hasSameConfigOrigin(PipelineConfig other) { if (!(isConfigDefinedRemotely())) return false; return this.origin.equals(other.getOrigin()); }
Source:
<code>public void getGroupObjectNotFoundTest() throws Exception { GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); Group adminGroup = null; try { context.turnOffAuthorisationSystem(); adminGroup = groupService.create(context); context.commit(); <START> adminGroup = context.reloadEntity(adminGroup); <END> String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform( get("/api/eperson/groups/" + adminGroup.getID() + "/object") ).andExpect(status().isNotFound()); } finally { if (adminGroup != null) { GroupBuilder.deleteGroup(adminGroup.getID()); } } }</code><technical_language>above. GroupBuilder, missing a context.restoreAuthSystemState(); question commit() reloadEntity() above</technical_language>

Target:
public void getGroupObjectNotFoundTest() throws Exception { context.turnOffAuthorisationSystem(); Group adminGroup = GroupBuilder.createGroup(context) .withName("test group") .build(); context.restoreAuthSystemState(); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform( get("/api/eperson/groups/" + adminGroup.getID() + "/object") ).andExpect(status().isNoContent()); }
Source:
<code>private void configureAdminUser() { <START> logger().debug("Configuring couchbase admin user with username: \"" + username + "\""); <END> Response response = doHttpRequest(MGMT_PORT, "/settings/web", "POST", new FormBody.Builder() .add("username", username) .add("password", password) .add("port", Integer.toString(MGMT_PORT)) .build(), false); checkSuccessfulResponse(response, "Could not configure couchbase admin user"); }</code><technical_language>suggestion logger().debug("Configuring couchbase admin user username: \"{}\"", username);</technical_language>

Target:
private void configureAdminUser() { logger().debug("Configuring couchbase admin user with username: \"{}\"", username); Response response = doHttpRequest(MGMT_PORT, "/settings/web", "POST", new FormBody.Builder() .add("username", username) .add("password", password) .add("port", Integer.toString(MGMT_PORT)) .build(), false); checkSuccessfulResponse(response, "Could not configure couchbase admin user"); }
Source:
<code>public void withLabelAndChannelTypeUID_shouldCreateChannelType() { ChannelType channelType = stateBuilder.build(); <START> assertThat(channelType.getUID(), is(CHANNEL_TYPE_UID)); <END> assertThat(channelType.getItemType(), is(ITEM_TYPE)); assertThat(channelType.getLabel(), is(LABEL)); }</code><technical_language>assertion for channel kind added</technical_language>

Target:
public void withLabelAndChannelTypeUID_shouldCreateChannelType() { ChannelType channelType = stateBuilder.build(); assertThat(channelType.getUID(), is(CHANNEL_TYPE_UID)); assertThat(channelType.getItemType(), is(ITEM_TYPE)); assertThat(channelType.getLabel(), is(LABEL)); assertThat(channelType.getKind(), is(ChannelKind.STATE)); }
Source:
<code>private boolean isMapTask(TaskAttemptImpl taskAttempt) { boolean isMapTask = false; <START> for(TezCounter counter : taskAttempt.getCounters().getGroup("HIVE")) { <END> if(counter.getName().startsWith("RECORDS_IN_Map")) { isMapTask = true; } } return isMapTask; }</code><technical_language>I sure, more efficient ways figure out, if this is a Map task. CounterGroupBase for example a findCounter, iterating counters of a group find a specific one, is necessary. Maybe, instead of counters, other indicators (i.e. attached Vertex), giving if this a Map task</technical_language>

Target:
private boolean isMapTask(TaskAttemptImpl taskAttempt) { return taskAttempt.getCounters().getGroup("HIVE").findCounter("RECORDS_IN_Map") == null; }
Source:
<code>} catch (Throwable t) { <START> LOGGER.info("Could not load JNR LibC Library, native calls will not be available"); <END> }</code><technical_language>nice include throwable stack (maybe DEBUG though?) easier understand loaded. In case I a classloader issue obvious good a expose exception</technical_language>

Target:
} catch (Throwable t) { if (LOGGER.isDebugEnabled()) LOGGER.debug("Could not load JNR LibC Library, native calls will not be available", t); else LOGGER.info("Could not load JNR LibC Library, native calls will not be available (set this logger level to DEBUG to see the full stack trace)"); }
Source:
<code>private Mono<Void> authenticate(ServerWebExchange exchange, WebFilterChain chain, Authentication token) { WebFilterExchange webFilterExchange = new WebFilterExchange(exchange, chain); ReactiveAuthenticationManager authenticationManager = this.authenticationManagerResolver .resolve(exchange.getRequest()) <START> .block(); <END> return authenticationManager.authenticate(token) .switchIfEmpty(Mono.defer(() -> Mono.error(new IllegalStateException("No provider found for " + token.getClass())))) .flatMap(authentication -> onAuthenticationSuccess(authentication, webFilterExchange)) .onErrorResume(AuthenticationException.class, e -> this.authenticationFailureHandler .onAuthenticationFailure(webFilterExchange, e)); }</code><technical_language>introduce blocking operations reactive code. Instead, want map result of this: java return this.authenticationManagerResolver.resolve(exchange.getRequest()) .map(authenticationManager -> authenticationManager.authenticate(token)) .switchIfEmpty(..</technical_language>

Target:
private Mono<Void> authenticate(ServerWebExchange exchange, WebFilterChain chain, Authentication token) { WebFilterExchange webFilterExchange = new WebFilterExchange(exchange, chain); return this.authenticationManagerResolver.resolve(exchange.getRequest()) .flatMap(authenticationManager -> authenticationManager.authenticate(token)) .switchIfEmpty(Mono.defer(() -> Mono.error(new IllegalStateException("No provider found for " + token.getClass())))) .flatMap(authentication -> onAuthenticationSuccess(authentication, webFilterExchange)) .onErrorResume(AuthenticationException.class, e -> this.authenticationFailureHandler .onAuthenticationFailure(webFilterExchange, e)); }
Source:
<code>public GdbAutoTerminateAction() { super(ConsoleMessages.ConsoleAutoTerminateAction_name, IAction.AS_CHECK_BOX); <START> setText(ConsoleMessages.ConsoleAutoTerminateAction_name); <END> setToolTipText(ConsoleMessages.ConsoleAutoTerminateAction_description); setChecked(readState()); }</code><technical_language>needed in constructor</technical_language>

Target:
public GdbAutoTerminateAction() { super(ConsoleMessages.ConsoleAutoTerminateAction_name, IAction.AS_CHECK_BOX); setToolTipText(ConsoleMessages.ConsoleAutoTerminateAction_description); setChecked(readState()); }
Source:
<code>public VALUE get(KEY key) throws IOException { CacheValue<VALUE> cacheValue = Optional.fromNullable(cache.get(new CacheKey<>(key))).orNull(); if (cacheValue != null) { return cacheValue.getCacheValue(); } <START> if (cacheCleanupPolicy == TableCacheImpl.CacheCleanupPolicy.AFTER_FLUSH) { <END> return getFromTable(key); } else { return null; } }</code><technical_language>here.. checks here</technical_language>

Target:
public VALUE get(KEY key) throws IOException { CacheResult<CacheValue<VALUE>> cacheResult = cache.lookup(new CacheKey<>(key)); if (cacheResult.getCacheStatus() == EXISTS) { return cacheResult.getValue().getCacheValue(); } else if (cacheResult.getCacheStatus() == NOT_EXIST) { return null; } else { return getFromTable(key); } }
Source:
<code>private void stop() { if ((sessionManagerProxy != 0) && (clientObjectPath != null)) { long error = new long [1]; long clientInfo = <START> OS.g_dbus_proxy_call_sync( <END> sessionManagerProxy, Converter.javaStringToCString("UnregisterClient"), composeVariantTupleO(clientObjectPath), OS.G_DBUS_CALL_FLAGS_NONE, dbusTimeoutMsec, 0, error); if (error[0] != 0) { System.err.format( "SWT SessionManagerDBus: Failed to UnregisterClient: %s%n", extractFreeGError(error[0])); } clientObjectPath = null; } if (clientProxy != 0) { OS.g_object_unref(clientProxy); clientProxy = 0; } if (sessionManagerProxy != 0) { OS.g_object_unref(sessionManagerProxy); sessionManagerProxy = 0; } shutdownHook.remove(); }</code><technical_language>reason this call synchronous? implementing WebKit2 port, ran a lot of deadlocks synchronous DBus calls</technical_language>

Target:
private void stop() { if ((sessionManagerProxy != 0) && (clientObjectPath != null)) { long args = OS.g_variant_new( Converter.javaStringToCString("(o)"), Converter.javaStringToCString(clientObjectPath)); long error = new long [1]; OS.g_dbus_proxy_call_sync( sessionManagerProxy, Converter.javaStringToCString("UnregisterClient"), args, OS.G_DBUS_CALL_FLAGS_NONE, dbusTimeoutMsec, 0, error); if (error[0] != 0) { System.err.format( "SWT SessionManagerDBus: Failed to UnregisterClient: %s%n", extractFreeGError(error[0])); } clientObjectPath = null; } if (clientProxy != 0) { OS.g_object_unref(clientProxy); clientProxy = 0; } if (sessionManagerProxy != 0) { OS.g_object_unref(sessionManagerProxy); sessionManagerProxy = 0; } g_signal_callback.dispose(); shutdownHook.remove(); }
Source:
<code>public void setCanceled(boolean cancel) { if (!isCancelable()) { throw new UnsupportedOperationException( <START> "Attempted to modify the unmodifiable canceled state of a non-cancelable event of type: " <END> + this.getClass().getCanonicalName() ); } isCanceled = cancel; }</code><technical_language>I original wording is more clear. add class name end</technical_language>

Target:
public void setCanceled(boolean cancel) { if (!isCancelable()) { throw new UnsupportedOperationException( "Attempted to call Event#setCanceled() on a non-cancelable event of type: " + this.getClass().getCanonicalName() ); } isCanceled = cancel; }
Source:
<code>public Query visitOrExpression(OrFilterExpression expression) { <START> Query query = builder.bool() <END> .should(expression.getLeft().accept(this)) .should(expression.getRight().accept(this)) .createQuery(); return query; }</code><technical_language>return builder.bool() ... for consistancy</technical_language>

Target:
public Query visitOrExpression(OrFilterExpression expression) { return builder.bool() .should(expression.getLeft().accept(this)) .should(expression.getRight().accept(this)) .createQuery(); }
Source:
<code>private void loadChildEntities(LibraryDilution dilution) throws IOException { if (dilution.getLibrary() != null) { dilution.setLibrary(libraryDao.get(dilution.getLibrary().getId())); } <START> if (dilution.getTargetedSequencing() != null && dilution.getTargetedSequencing().getId() != null) { <END> dilution.setTargetedSequencing(targetedSequencingDao.get(dilution.getTargetedSequencing().getId())); } }</code><technical_language>Is a reason targeted sequencing is set id isn't? exception thrown for</technical_language>

Target:
private void loadChildEntities(LibraryDilution dilution) throws IOException { if (dilution.getLibrary() != null) { dilution.setLibrary(libraryDao.get(dilution.getLibrary().getId())); } if (dilution.getTargetedSequencing() != null) { dilution.setTargetedSequencing(targetedSequencingDao.get(dilution.getTargetedSequencing().getId())); } }
Source:
<code>public void testNativeQueryExecuteUpdate() throws Exception { OgmSession session = (OgmSession) openSession(); Transaction transaction = session.beginTransaction(); <START> String findQueryString = "MATCH (n:UPDATE) RETURN n"; <END> Query findQuery = session.createNativeQuery( findQueryString ); String createQuery = "CREATE (n:UPDATE { author:'Giorgio Faletti' })"; int updates = session.createNativeQuery( createQuery ).executeUpdate(); if ( TestHelper.getCurrentDatastoreProviderType() != DatastoreProviderType.NEO4J_HTTP ) { assertThat( updates ).isEqualTo( 3 ); } Object createdNode = findQuery.uniqueResult(); assertThat( createdNode ).isNotNull(); String deleteQuery = "MATCH (n:UPDATE) DELETE n "; int deletes = session.createNativeQuery( deleteQuery ).executeUpdate(); if ( TestHelper.getCurrentDatastoreProviderType() != DatastoreProviderType.NEO4J_HTTP ) { assertThat( deletes ).isEqualTo( 1 ); } Object uniqueResult = findQuery.uniqueResult(); assertThat( uniqueResult ).isNull(); transaction.commit(); session.clear(); session.close(); }</code><technical_language>UPDATE_TABLE_NAME instead of UPDATE? some time understand table name :)</technical_language>

Target:
public void testNativeQueryExecuteUpdate() throws Exception { OgmSession session = (OgmSession) openSession(); Transaction transaction = session.beginTransaction(); String findQueryString = "MATCH (n:" + UPDATE_LABEL + ") RETURN n"; Query findQuery = session.createNativeQuery( findQueryString ); String createQuery = "CREATE (n:" + UPDATE_LABEL + " { author:'Giorgio Faletti' })"; int updates = session.createNativeQuery( createQuery ).executeUpdate(); if ( TestHelper.getCurrentDatastoreProviderType() != DatastoreProviderType.NEO4J_HTTP ) { assertThat( updates ).isEqualTo( 3 ); } Object createdNode = findQuery.uniqueResult(); assertThat( createdNode ).isNotNull(); String deleteQuery = "MATCH (n:" + UPDATE_LABEL + ") DELETE n "; int deletes = session.createNativeQuery( deleteQuery ).executeUpdate(); if ( TestHelper.getCurrentDatastoreProviderType() != DatastoreProviderType.NEO4J_HTTP ) { assertThat( deletes ).isEqualTo( 1 ); } Object uniqueResult = findQuery.uniqueResult(); assertThat( uniqueResult ).isNull(); transaction.commit(); session.clear(); session.close(); }
Source:
<code>protected Date convertStartDateToUnspecifiedDateTime(String value) { return convertDateStringToDate(value, false); <START> } <END></code><technical_language>I suggest methods removed. developer forced decide if is UTC String (in opinion). convertDateStringToDate renamed convertUniversalDateTimeStringToDate I think</technical_language>

Target:
protected Date convertStartDateToUnspecifiedDateTime(String value) throws ParseException { if (value == null || value.isEmpty()) { return null; } else { DateFormat df = new SimpleDateFormat("yyyy-MM-dd'Z'"); return df.parse(value); } }