auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void dispose() { super.dispose(); if (fWaitCursor != null) { fWaitCursor.dispose(); } for (Job j : getUpdateJobsGlobal().values()) { j.cancel(); } for (Job j : getUpdateJobsPartial().values()) { j.cancel(); } TmfStatisticsTreeManager.removeStatTreeRoot(getTreeID()); <START> fModel.clear(); <END> }</code><technical_language>remove call reinitializeCharts viewer instead</technical_language>

Target:
public void dispose() { super.dispose(); if (fWaitCursor != null) { fWaitCursor.dispose(); } for (Job j : fUpdateJobsGlobal.values()) { j.cancel(); } for (Job j : fUpdateJobsPartial.values()) { j.cancel(); } TmfStatisticsTreeManager.removeStatTreeRoot(getTreeID()); fPieChartViewer.reinitializeCharts(); }
Source:
<code>public QueryDataIterator() { <START> this.cctxsIter = cctxs.iterator(); this.nodeQryIter = Collections.emptyIterator(); this.qriesIter = Collections.emptyIterator(); this.localQryIter = Collections.emptyIterator(); <END> }</code><technical_language>'this' is unnecessary in this context</technical_language>

Target:
public QueryDataIterator() { cctxsIter = cctxs.iterator(); nodeQryIter = Collections.emptyIterator(); qriesIter = Collections.emptyIterator(); localQryIter = Collections.emptyIterator(); }
Source:
<code>protected int getScanProgress(int contextId) { AccessControlScannerThread scannerThread = threadManager.getScannerThread(contextId); if (scannerThread.isRunning() || scannerThread.hasRun()) { double progress = scannerThread.getScanProgress() * 1.0 / scannerThread.getScanMaximumProgress() * 100; return (int) Math.round(progress); } else { <START> log.error("Access control scan not running for context: " + contextId); <END> throw new IllegalStateException("A scan is not running for context: " + contextId); } }</code><technical_language>log error, reserved for issues/bugs in code</technical_language>

Target:
protected int getScanProgress(int contextId) { AccessControlScannerThread scannerThread = threadManager.getScannerThread(contextId); if (scannerThread.isRunning() || scannerThread.hasRun()) { double progress = scannerThread.getScanProgress() * 1.0 / scannerThread.getScanMaximumProgress() * 100; return (int) Math.round(progress); } else { throw new IllegalStateException("A scan is not running for context: " + contextId); } }
Source:
<code>CompletableFuture<Void> getFailureOp(CommitData cd) { return CompletableFuture.runAsync(() -> { <START> cd.commitObserver.commitFailed(cd.getShortCollisionMessage()); <END> }, env.getSharedResources().getSyncCommitExecutor()); }</code><technical_language>This operation block, do need run in sync commit executor. call commit failed return a completed future</technical_language>

Target:
CompletableFuture<Void> getFailureOp(CommitData cd) { cd.commitObserver.commitFailed(cd.getShortCollisionMessage()); return CompletableFuture.completedFuture(NULLS.get()); }
Source:
<code>public SecurityConfig(String[] authIdsForHooks, String[] authIdsForRoots) { <START> super(); <END> this.authIdsForHookExecution = authIdsForHooks; this.authIdsForRootInstallation = authIdsForRoots; }</code><technical_language>needed</technical_language>

Target:
public SecurityConfig(String[] authIdsForHooks, String[] authIdsForRoots) { this.authIdsForHookExecution = authIdsForHooks; this.authIdsForRootInstallation = authIdsForRoots; }
Source:
<code>private Slice toSlice(Object object) { kryo.writeClassAndObject(serializationBuffer, object); <START> serializationBuffer.close(); <END> return serializationBuffer.toSlice(); }</code><technical_language>close</technical_language>

Target:
private Slice toSlice(Object object) { kryo.writeClassAndObject(serializationBuffer, object); return serializationBuffer.toSlice(); }
Source:
<code>private String generateCreateViewDDL(String columnInfoString, String baseTableFullName, String whereClause, String pSchemaName, String pTableName) { String viewFullName = SchemaUtil.getQualifiedTableName(pSchemaName, pTableName); <START> if(Character.isDigit(pTableName.charAt(0))) { <END> viewFullName = pSchemaName+".\""+pTableName+"\""; } StringBuilder outputBuilder = new StringBuilder(String.format(CREATE_VIEW, viewFullName, columnInfoString, baseTableFullName, whereClause)); return outputBuilder.toString(); }</code><technical_language>Is this a bug in SchemaUtil.getQualfiedTableName? This repeat everywhere</technical_language>

Target:
private String generateCreateViewDDL(String columnInfoString, String baseTableFullName, String whereClause, String pSchemaName, String pTableName) { String viewFullName = SchemaUtil.getPTableFullNameWithQuotes(pSchemaName, pTableName); StringBuilder outputBuilder = new StringBuilder(String.format(CREATE_VIEW, viewFullName, columnInfoString, baseTableFullName, whereClause)); return outputBuilder.toString(); }
Source:
<code>public static void initPageToken(final String token) { self.attributes.addValue(ATTRIBUTE_TOKEN, token); <START> Window.Location.replace("?" + UrlSerializer.serialize(self.attributes)); <END> }</code><technical_language>I : '#?' instead of '?'. I '?' replace query string if is (for example tenant id removed)</technical_language>

Target:
public static void initPageToken(final String token) { self.attributes.addValue(ATTRIBUTE_TOKEN, token); Window.Location.replace("#?" + UrlSerializer.serialize(self.attributes)); }
Source:
<code>private List<Map<String, Object>> jsonToMap(String json) { try { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue((String) json, new TypeReference<List<Map<String, Object>>>() { }); <START> } catch (Exception e) { <END> return null; } }</code><technical_language>is this a good idea? this lead is a null pointer exception on. throw a descriptive exception here</technical_language>

Target:
private List<Map<String, Object>> jsonToMap(String json) throws FormInstanceBuilderException { try { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue(json, new TypeReference<List<Map<String, Object>>>() { }); } catch (IOException e) { throw new FormInstanceBuilderException("Unable to parse JSON", e); } }
Source:
<code>private void initializeTerminologyToShortnameCache() { for (final IConfigurationElement terminology : Platform.getExtensionRegistry().getConfigurationElementsFor(TERMINOLOGY_EXTENSION_POINT_ID)) { <START> final List<String> affectedCodeSystems = Lists.newArrayList(); <END> final String id = terminology.getAttribute(ID_ATTRIBUTE); affectedCodeSystems.addAll( Arrays.stream(terminology.getChildren(DEPENDENCY_ATTRIBUTE)) .map(configurationElement -> configurationElement.getAttribute(SHORT_NAME_ATTRIBUTE)) .collect(Collectors.toList()) ); TERMINOLOGY_ID_TO_SHORTNAMES_CACHE.put(id, ImmutableSortedSet.copyOf(affectedCodeSystems)); } }</code><technical_language>Remove this unnecessary ArrayList instance</technical_language>

Target:
private void initializeTerminologyToShortnameCache() { for (final IConfigurationElement terminology : Platform.getExtensionRegistry().getConfigurationElementsFor(TERMINOLOGY_EXTENSION_POINT_ID)) { final ImmutableSortedSet.Builder<String> affectedCodeSystems = ImmutableSortedSet.naturalOrder(); final String id = terminology.getAttribute(ID_ATTRIBUTE); affectedCodeSystems.addAll( Arrays.stream(terminology.getChildren(DEPENDENCY_ATTRIBUTE)) .map(configurationElement -> configurationElement.getAttribute(SHORT_NAME_ATTRIBUTE)) .collect(Collectors.toList()) ); TERMINOLOGY_ID_TO_SHORTNAMES_CACHE.put(id, affectedCodeSystems.build()); } }
Source:
<code>public <Q, I, U> SubscriptionQueryResult<I, U> subscriptionQuery(String queryName, Q query, ResponseType<I> initialResponseType, ResponseType<U> updateResponseType, int updateBufferSize) { SubscriptionQueryMessage<?, I, U> subscriptionQueryMessage = new GenericSubscriptionQueryMessage<>( asMessage(query), queryName, initialResponseType, updateResponseType ); SubscriptionQueryMessage<?, I, U> interceptedQuery = processInterceptors(subscriptionQueryMessage); SubscriptionQueryResult<QueryResponseMessage<I>, SubscriptionQueryUpdateMessage<U>> result = queryBus.subscriptionQuery(interceptedQuery, updateBufferSize); return new DefaultSubscriptionQueryResult<>( result.initialResult() <START> .filter(initialResult -> Objects.nonNull(initialResult.getPayload())) <END> .map(Message::getPayload) .onErrorMap(e -> e instanceof IllegalPayloadAccessException ? e.getCause() : e), result.updates() .filter(update -> Objects.nonNull(update.getPayload())) .map(SubscriptionQueryUpdateMessage::getPayload), result ); }</code><technical_language>Guessing setting axon_code_style.xml, changes reverted</technical_language>

Target:
public <Q, I, U> SubscriptionQueryResult<I, U> subscriptionQuery(String queryName, Q query, ResponseType<I> initialResponseType, ResponseType<U> updateResponseType, int updateBufferSize) { SubscriptionQueryMessage<?, I, U> interceptedQuery = getSubscriptionQueryMessage( queryName, query, initialResponseType, updateResponseType); SubscriptionQueryResult<QueryResponseMessage<I>, SubscriptionQueryUpdateMessage<U>> result = queryBus.subscriptionQuery(interceptedQuery, updateBufferSize); return getSubscriptionQueryResult(result); }
Source:
<code>private Optional<ComponentDto> searchProject(DbSession dbSession, AddRequest request) { Optional<ComponentDto> project = request.getProject() == null ? empty() : Optional.of(componentFinder.getByKey(dbSession, request.getProject())); project.ifPresent(p -> checkRequest(Qualifiers.PROJECT.equals(p.qualifier()) && Scopes.PROJECT.equals(p.scope()), "Component '%s' must be a project", request.getProject())); project.ifPresent(p -> { <START> if (p.isPrivate()) { <END> userSession.checkComponentPermission(UserRole.USER, p); } }); return project; }</code><technical_language>is need handle visibility in action. This logic is responsibility of UserSession</technical_language>

Target:
private Optional<ComponentDto> searchProject(DbSession dbSession, AddRequest request) { Optional<ComponentDto> project = request.getProject() == null ? empty() : Optional.of(componentFinder.getByKey(dbSession, request.getProject())); project.ifPresent(p -> checkRequest(Qualifiers.PROJECT.equals(p.qualifier()) && Scopes.PROJECT.equals(p.scope()), "Component '%s' must be a project", request.getProject())); project.ifPresent(p -> userSession.checkComponentPermission(UserRole.USER, p)); return project; }
Source:
<code>protected void createMemoryTabsFromMemento(String memento, final Object context) throws Exception { Element root = DebugPlugin.parseDocument(memento); if (!root.getNodeName().equalsIgnoreCase(MEMORY_TABS_LIST)) { IStatus status = new Status(IStatus.ERROR, MemoryBrowserPlugin.PLUGIN_ID, DebugPlugin.INTERNAL_ERROR, "Memory tabs initialization: invalid memento", null); throw new CoreException(status); } NodeList memoryTabsList = root.getChildNodes(); int length = memoryTabsList.getLength(); for (int i = 0; i < length; ++i) { Node node = memoryTabsList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { Element entry = (Element) node; if (entry.getNodeName().equalsIgnoreCase(MEMORY_TAB)) { String memorySpace = entry.getAttribute(ATTR_MEMORY_SPACE); if (memorySpace != null && memorySpace.length() == 0) { memorySpace = null; } final String finalMemorySpace = memorySpace; final String address = entry.getAttribute(ATTR_ADDRESS); final String renderingTypeId = entry.getAttribute(ATTR_RENDERING); <START> runOnUIThread(new Callable<Object>(){ <END> public Object call() throws Exception { String oldRenderingTypeId = getDefaultRenderingTypeId(); setDefaultRenderingTypeId(renderingTypeId); fGotoAddressBar.addExpressionToHistory(context, address, finalMemorySpace); performGo(true, address, finalMemorySpace); setDefaultRenderingTypeId(oldRenderingTypeId); return null; } }); } } } }</code><technical_language>is a runOnUIThread in this class takes a Runnable. this callable do result I recommend changing rid of unused runOnUIThread(Callable)</technical_language>

Target:
protected void createMemoryTabsFromMemento(String memento, final Object context) throws Exception { Element root = DebugPlugin.parseDocument(memento); if (!root.getNodeName().equalsIgnoreCase(MEMORY_TABS_LIST)) { IStatus status = new Status(IStatus.ERROR, MemoryBrowserPlugin.PLUGIN_ID, DebugPlugin.INTERNAL_ERROR, "Memory tabs initialization: invalid memento", null); throw new CoreException(status); } NodeList memoryTabsList = root.getChildNodes(); int length = memoryTabsList.getLength(); for (int i = 0; i < length; ++i) { Node node = memoryTabsList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { Element entry = (Element) node; if (entry.getNodeName().equalsIgnoreCase(MEMORY_TAB)) { String memorySpace = entry.getAttribute(ATTR_MEMORY_SPACE); if (memorySpace != null && memorySpace.length() == 0) { memorySpace = null; } final String finalMemorySpace = memorySpace; final String address = entry.getAttribute(ATTR_ADDRESS); final String renderingTypeId = entry.getAttribute(ATTR_RENDERING); runOnUIThread(new Callable<Object>(){ public Object call() throws Exception { String oldRenderingTypeId = getDefaultRenderingTypeId(); setDefaultRenderingTypeId(renderingTypeId); fGotoAddressBar.addExpressionToHistory(context, address, finalMemorySpace); if (!performGo(true, address, finalMemorySpace)) { IStatus status = new Status(IStatus.ERROR, MemoryBrowserPlugin.PLUGIN_ID, DebugPlugin.INTERNAL_ERROR, "Memory tabs initialization: failed to go to address", null); throw new CoreException(status); } setDefaultRenderingTypeId(oldRenderingTypeId); return null; } }); } } } }
Source:
<code>public static boolean isEmpty(Path path) { Objects.requireNonNull(path, "The given path must not be null"); Path normalized = path.normalize(); <START> return normalized.getNameCount() == 1 && normalized.toString().equals(""); <END> }</code><technical_language>normalized.toString().isEmpty() working</technical_language>

Target:
public static boolean isEmpty(Path path) { Objects.requireNonNull(path, "The given path must not be null"); Path normalized = path.normalize(); return normalized.getNameCount() == 1 && normalized.toString().isEmpty(); }
Source:
<code>public void testInvalidDateTimerStart() throws Exception { try { createKnowledgeBase("timer/BPMN2-StartTimerDateInvalid.bpmn2"); fail("Should fail as timer expression is not valid"); } catch (RuntimeException e) { <START> Assertions.assertThat(e.getMessage().contains("Could not parse date 'abcdef'")).isTrue(); <END> } }</code><technical_language>@mswiderski said, this replaced feature of AssertJ</technical_language>

Target:
public void testInvalidDateTimerStart() throws Exception { Assertions.assertThatExceptionOfType(RuntimeException.class).isThrownBy(() -> { createKnowledgeBase("timer/BPMN2-StartTimerDateInvalid.bpmn2"); }) .withMessageContaining("Could not parse date 'abcdef'"); }
Source:
<code>protected Object handleRequestMessage(Message<?> requestMessage) { final Object result; if (OutboundGatewayType.RETRIEVING.equals(this.gatewayType)) { int firstRecord = 0; if(firstRecordExpression != null) { Object firstRecordEvaluationResult = firstRecordExpression.getValue(evaluationContext, requestMessage); if(firstRecordEvaluationResult != null) { if(firstRecordEvaluationResult instanceof Number) { firstRecord = ((Number)firstRecordEvaluationResult).intValue(); } else { throw new IllegalArgumentException("Expected the value of the firstRecord to be a Number" + " got " + firstRecordEvaluationResult.getClass().getName()); } } <START> } <END> result = this.jpaExecutor.poll(requestMessage, firstRecord); } else if (OutboundGatewayType.UPDATING.equals(this.gatewayType)) { result = this.jpaExecutor.executeOutboundJpaOperation(requestMessage); } else { throw new IllegalArgumentException(String.format("GatewayType '%s' is not supported.", this.gatewayType)); } if (result == null || !producesReply) { return null; } return MessageBuilder.withPayload(result).copyHeaders(requestMessage.getHeaders()).build(); }</code><technical_language>reason this if...else. enough use: firstRecordExpression.getValue(evaluationContext, requestMessage, Number.class)</technical_language>

Target:
protected Object handleRequestMessage(Message<?> requestMessage) { final Object result; if (OutboundGatewayType.RETRIEVING.equals(this.gatewayType)) { result = this.jpaExecutor.poll(requestMessage); } else if (OutboundGatewayType.UPDATING.equals(this.gatewayType)) { result = this.jpaExecutor.executeOutboundJpaOperation(requestMessage); } else { throw new IllegalArgumentException(String.format("GatewayType '%s' is not supported.", this.gatewayType)); } if (result == null || !producesReply) { return null; } return MessageBuilder.withPayload(result).copyHeaders(requestMessage.getHeaders()).build(); }
Source:
<code>public void testCreatePointStyle(){ PointSymbolizer pointsym = sf.createPointSymbolizer(); pointsym.setGraphic(sf.getDefaultGraphic()); NumberRange<Double> scaleRange = NumberRange.create( 1.0,50000.0); Style2D style = sld.createPointStyle(null, pointsym, scaleRange); assertNotNull( style ); PointStyle2D ps = (PointStyle2D) style; assertEquals(0.0f, ps.getAnchorPointX(), 0.0f); <START> assertEquals(0.5f, ps.getAnchorPointY(), 0.0f); <END> }</code><technical_language>this covered, need for AnchorPointTest above</technical_language>

Target:
public void testCreatePointStyle(){ PointSymbolizer pointsym = sf.createPointSymbolizer(); pointsym.setGraphic(sf.getDefaultGraphic()); NumberRange<Double> scaleRange = NumberRange.create( 1.0,50000.0); Style2D style = sld.createPointStyle(null, pointsym, scaleRange); assertNotNull( style ); }
Source:
<code>public void testHandles() { <START> assertTrue(classUnderTest.handles(ANONYMOUS_USERS)); <END> assertTrue(classUnderTest.handles(PROJECT_OWNERS)); assertFalse(classUnderTest.handles(OTHER_UUID)); }</code><technical_language>[optional] I is a kind of pattern classUnderTest name for tested instance. However, readability. For me, this: assertTrue(backend.handles(ANONYMOUS_USERS)); is more readable than: assertTrue(classUnderTest.handles(ANONYMOUS_USERS));</technical_language>

Target:
public void testHandles() { assertTrue(backend.handles(ANONYMOUS_USERS)); assertTrue(backend.handles(PROJECT_OWNERS)); assertFalse(backend.handles(OTHER_UUID)); }
Source:
<code>public void receiveMessage(IMessage message) { sync(() -> { if (message.version() > MessagingService.current_version) { throw new IllegalStateException(String.format("Node%d received message version %d but current version is %d", this.config.num(), message.version(), MessagingService.current_version)); } Message<?> messageIn = deserializeMessage(message); Message.Header header = messageIn.header; TraceState state = Tracing.instance.initializeFromMessage(header); if (state != null) state.trace("{} message received from {}", header.verb, header.from); <START> header.verb.stage.execute(ThrowingRunnable.toRunnable(() -> MessagingService.instance().inboundSink.accept(messageIn)), <END> ExecutorLocals.create(state)); }).run(); }</code><technical_language>wrap in a ThrowingRunnable</technical_language>

Target:
public void receiveMessage(IMessage message) { sync(() -> { if (message.version() > MessagingService.current_version) { throw new IllegalStateException(String.format("Node%d received message version %d but current version is %d", this.config.num(), message.version(), MessagingService.current_version)); } Message<?> messageIn = deserializeMessage(message); Message.Header header = messageIn.header; TraceState state = Tracing.instance.initializeFromMessage(header); if (state != null) state.trace("{} message received from {}", header.verb, header.from); header.verb.stage.execute(() -> MessagingService.instance().inboundSink.accept(messageIn), ExecutorLocals.create(state)); }).run(); }
Source:
<code>@Test public void customSampler() throws Exception { closeClient(client); RpcTracing rpcTracing = RpcTracing.newBuilder(tracing).clientSampler(RpcRuleSampler.newBuilder() .putRule(methodEquals("SayHelloWithManyReplies"), Sampler.NEVER_SAMPLE) .build()).build(); grpcTracing = GrpcTracing.create(rpcTracing); client = newClient(); assertThat(GreeterGrpc.newBlockingStub(client).sayHelloWithManyReplies(HELLO_REQUEST)) <START> .hasNext(); END> GreeterGrpc.newBlockingStub(client).sayHello(HELLO_REQUEST); assertThat(takeSpan().name()).isEqualTo("helloworld.greeter/sayhello"); }</code><technical_language>this testing, need assertThat call hasNext directly</technical_language>

Target:
@Test public void customSampler() throws Exception { closeClient(client); RpcTracing rpcTracing = RpcTracing.newBuilder(tracing).clientSampler(RpcRuleSampler.newBuilder() .putRule(methodEquals("SayHelloWithManyReplies"), NEVER_SAMPLE) .putRule(serviceEquals("helloworld.greeter"), ALWAYS_SAMPLE) .build()).build(); grpcTracing = GrpcTracing.create(rpcTracing); client = newClient(); GreeterGrpc.newBlockingStub(client).sayHelloWithManyReplies(HELLO_REQUEST).hasNext(); GreeterGrpc.newBlockingStub(client).sayHello(HELLO_REQUEST); assertThat(takeSpan().name()).isEqualTo("helloworld.greeter/sayhello"); }
Source:
<code>protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsReadable(HAPLOTYPE_MAP); IOUtil.assertFileIsWritable(OUTPUT); IOUtil.assertFileIsReadable(referenceSequence.getReferenceFile()); final FingerprintChecker checker = new FingerprintChecker(HAPLOTYPE_MAP); <START> if (!EXTRACT_CONTAMINATION) CONTAMINATION = 1 - CONTAMINATION; <END> checker.setLocusMaxReads(LOCUS_MAX_READS); checker.setValidationStringency(VALIDATION_STRINGENCY); if (SAMPLE_ALIAS != null) { checker.setDefaultSampleID(SAMPLE_ALIAS); } final Map<String, Fingerprint> fingerprintMap = checker.identifyContaminant(INPUT.toPath(), CONTAMINATION); if (fingerprintMap.size() != 1) { log.error("Expected exactly 1 fingerprint, found " + fingerprintMap.size()); throw new IllegalArgumentException("Expected exactly 1 fingerprint in Input file, found " + fingerprintMap.size()); } final Map.Entry<String, Fingerprint> soleEntry = fingerprintMap.entrySet().iterator().next(); final String sampleToUse = getSampleToUse(soleEntry.getKey()); try { FingerprintUtils.writeFingerPrint(soleEntry.getValue(), OUTPUT, referenceSequence.getReferenceFile(), sampleToUse, "PLs derived from " + INPUT + " using an assumed contamination of " + this.CONTAMINATION); } catch (Exception e) { log.error(e); } return 0; }</code><technical_language>please { } for ifs suggestion if (!EXTRACT_CONTAMINATION) { CONTAMINATION = 1 - CONTAMINATION; }</technical_language>

Target:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsReadable(HAPLOTYPE_MAP); IOUtil.assertFileIsWritable(OUTPUT); IOUtil.assertFileIsReadable(referenceSequence.getReferenceFile()); final FingerprintChecker checker = new FingerprintChecker(HAPLOTYPE_MAP); if (!EXTRACT_CONTAMINATION) { CONTAMINATION = 1 - CONTAMINATION; } checker.setLocusMaxReads(LOCUS_MAX_READS); checker.setValidationStringency(VALIDATION_STRINGENCY); if (SAMPLE_ALIAS != null) { checker.setDefaultSampleID(SAMPLE_ALIAS); } final Map<String, Fingerprint> fingerprintMap = checker.identifyContaminant(INPUT.toPath(), CONTAMINATION); if (fingerprintMap.size() != 1) { log.error("Expected exactly 1 fingerprint, found " + fingerprintMap.size()); throw new IllegalArgumentException("Expected exactly 1 fingerprint in Input file, found " + fingerprintMap.size()); } final Map.Entry<String, Fingerprint> soleEntry = fingerprintMap.entrySet().iterator().next(); final String sampleToUse = getSampleToUse(soleEntry.getKey()); try { FingerprintUtils.writeFingerPrint(soleEntry.getValue(), OUTPUT, referenceSequence.getReferenceFile(), sampleToUse, "PLs derived from " + INPUT + " using an assumed contamination of " + this.CONTAMINATION); } catch (Exception e) { log.error(e); } return 0; }
Source:
<code><START> private void toHtmlForAnthology(StringBuilder result) { <END> appendNames(creators, result); appendYear(result); appendArticle(result); if (Objects.nonNull(part)) { result.append(' '); result.append(part); } appendContainedIn(result); appendTitle(result); if (Objects.nonNull(subseries)) { result.append(' '); result.append(subseries); } if (Objects.nonNull(volume)) { result.append(' '); result.append(volume); } if (Objects.nonNull(published)) { result.append(" ("); result.append(published.toString(PUBLICATION_DATE_FORMAT)); result.append(')'); } if (Objects.nonNull(number)) { result.append(' '); result.append(number); } appendPagerange(result); if (Objects.nonNull(accessed)) { result.append(" ("); appendAccessed(result); result.append(')'); } appendURL(result); }</code><technical_language>toHtmlForPeriodical. mixed up</technical_language>

Target:
private void toHtmlForAnthology(StringBuilder result) { appendNames(creators, result); appendYear(result); appendArticle(result); appendContainedIn(result); appendNames(contributors, result); appendTitle(result); appendVolumeInformation(result); appendEdition(result, true); appendPlaceAndPublisher(result); appendOverallTitleAndNumber(result); appendPagerange(result); }
Source:
<code>private void showSetADFNameDialog() { Bundle bundle = new Bundle(); <START> bundle.putString("name", "New ADF"); <END> bundle.putString("id", ""); FragmentManager manager = getFragmentManager(); SetADFNameDialog setADFNameDialog = new SetADFNameDialog(); setADFNameDialog.setArguments(bundle); setADFNameDialog.show(manager, "ADFNameDialog"); }</code><technical_language>"New ADF" hard-coded string resources. e.g. getResources().getString(R.string.default_adf_name)</technical_language>

Target:
private void showSetADFNameDialog() { Bundle bundle = new Bundle(); bundle.putString("name",getResources().getString(R.string.default_adf_name) ); bundle.putString("id", ""); FragmentManager manager = getFragmentManager(); SetADFNameDialog setADFNameDialog = new SetADFNameDialog(); setADFNameDialog.setArguments(bundle); setADFNameDialog.show(manager, "ADFNameDialog"); }
Source:
<code>protected long handleObject(Object object) { Class<?> objClass = object.getClass(); if (objClass == MarshalledValue.class) { MarshalledValue marshalledValue = (MarshalledValue)object; long size = OBJECT_SIZE + POINTER_SIZE; size = roundUpToNearest8(size + POINTER_SIZE * 2 + 4 * 2); MarshalledValueByteStream mvbs = marshalledValue.getRaw(); long mvbsSize; if (mvbs instanceof ImmutableMarshalledValueByteStream) { mvbsSize = OBJECT_SIZE + POINTER_SIZE; <START> mvbsSize = roundUpToNearest8(mvbsSize + POINTER_SIZE); <END> } else if (mvbs instanceof ExpandableMarshalledValueByteStream) { mvbsSize = OBJECT_SIZE + POINTER_SIZE; mvbsSize = roundUpToNearest8(mvbsSize + POINTER_SIZE + 4 * 2); } else { throw new IllegalArgumentException(getClass() + " doesn't support counting for " + mvbs.getClass()); } byte[] bytes = mvbs.getRaw(); size += mvbsSize + roundUpToNearest8(Unsafe.ARRAY_BYTE_BASE_OFFSET + Unsafe.ARRAY_BYTE_INDEX_SCALE * bytes.length); return size; } return super.handleObject(object); }</code><technical_language>Interesting! calculate mvbsSize in steps one</technical_language>

Target:
protected long handleObject(Object object) { Class<?> objClass = object.getClass(); if (objClass == MarshalledValue.class) { MarshalledValue marshalledValue = (MarshalledValue)object; long size = OBJECT_SIZE + POINTER_SIZE; size = roundUpToNearest8(size + POINTER_SIZE * 2 + 4 * 2); MarshalledValueByteStream mvbs = marshalledValue.getRaw(); long mvbsSize; if (mvbs instanceof ImmutableMarshalledValueByteStream) { mvbsSize = OBJECT_SIZE + POINTER_SIZE; mvbsSize += POINTER_SIZE; mvbsSize = roundUpToNearest8(mvbsSize); } else if (mvbs instanceof ExpandableMarshalledValueByteStream) { mvbsSize = OBJECT_SIZE + POINTER_SIZE; mvbsSize += POINTER_SIZE; mvbsSize += 4; mvbsSize += 4; mvbsSize = roundUpToNearest8(mvbsSize); } else { throw new IllegalArgumentException(getClass() + " doesn't support counting for " + mvbs.getClass()); } byte[] bytes = mvbs.getRaw(); size += mvbsSize + roundUpToNearest8(Unsafe.ARRAY_BYTE_BASE_OFFSET + Unsafe.ARRAY_BYTE_INDEX_SCALE * bytes.length); return size; } return super.handleObject(object); }
Source:
<code><START> public long getWaitFactor() { <END> return waitFactor; }</code><technical_language>need a public getter for this, this internally only</technical_language>

Target:
public double getWaitFactor() { return backOffFactor; }
Source:
<code>public Dialog onCreateDialog(Bundle savedInstance) { <START> <END> String externalCode = ""; if (savedInstance != null) { externalCode = (String) savedInstance.getSerializable("external_code"); } LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.keyword_add, null); externalCodeEdit = (EditText) view.findViewById( R.id.keyword_external_code_edit); externalCodeEdit.addTextChangedListener(new TextWatcher() { @Override public void afterTextChanged(Editable s) { if (positiveButton != null) { final boolean valid = isInputValid(); positiveButton.setEnabled(valid); message.setVisibility( valid ? View.INVISIBLE : View.VISIBLE); } } @Override public void beforeTextChanged( CharSequence s, int start, int count, int after) { } @Override public void onTextChanged( CharSequence s, int start, int before, int count) { } }); externalCodeEdit.setText(externalCode); externalCodeEdit.setSelection(externalCode.length()); final EditText externalCodeEditFinal = externalCodeEdit; message = (TextView) view.findViewById(R.id.keyword_add_message); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.keyword_add_dialog_title) .setView(view) .setPositiveButton( android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { if (isInputValid()) { listener.onKeywordAdded( externalCodeEditFinal.getText().toString()); } } }) .setNegativeButton(android.R.string.cancel, null); final Dialog dialog = builder.create(); dialog.getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); return dialog; }</code><technical_language>long</technical_language>

Target:
public Dialog onCreateDialog(Bundle savedInstance) { String externalCode = ""; if (savedInstance != null) { externalCode = (String) savedInstance.getSerializable("external_code"); } LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.keyword_add, null); externalCodeEdit = (EditText) view.findViewById( R.id.keyword_external_code_edit); externalCodeEdit.addTextChangedListener(new ExternalCodeWatcher()); externalCodeEdit.setText(externalCode); externalCodeEdit.setSelection(externalCode.length()); message = (TextView) view.findViewById(R.id.keyword_add_message); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.keyword_add_dialog_title) .setView(view) .setPositiveButton(android.R.string.ok, new OkListener()) .setNegativeButton(android.R.string.cancel, null); final Dialog dialog = builder.create(); dialog.getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); return dialog; }
Source:
<code>public @NonNull TmfModelResponse<@NonNull List<@NonNull ITimeGraphRowModel>> fetchRowModel(@NonNull SelectionTimeQueryFilter filter, @Nullable IProgressMonitor monitor) { IGraphWorker graphWorker = getCurrent(); HorizontalLinksVisitor visitor = fCurrentVisitor; if (visitor == null || !Objects.equals(graphWorker, visitor.fCurrentWorker)) { return new TmfModelResponse<>(null, Status.COMPLETED, CommonStatusMessage.COMPLETED); } List<@NonNull ITimeGraphRowModel> rowModels = new ArrayList<>(); for (Long id : filter.getSelectedItems()) { <START> Collection<ITimeGraphState> states = visitor.fStates.asMap().get(id); <END> if (states != null) { List<ITimeGraphState> filteredStates = new ArrayList<>(states); rowModels.add(new TimeGraphRowModel(id, filteredStates)); } } return new TmfModelResponse<>(rowModels, Status.COMPLETED, CommonStatusMessage.COMPLETED); }</code><technical_language>Do return states range? states? resolution? I remember written originally, if work do improve this (large traces large critical paths), please add a todo. I mistaken</technical_language>

Target:
public @NonNull TmfModelResponse<@NonNull List<@NonNull ITimeGraphRowModel>> fetchRowModel(@NonNull SelectionTimeQueryFilter filter, @Nullable IProgressMonitor monitor) { IGraphWorker graphWorker = getCurrent(); HorizontalLinksVisitor visitor = fHorizontalVisitorCache.getIfPresent(graphWorker); if (visitor == null) { return new TmfModelResponse<>(null, Status.COMPLETED, CommonStatusMessage.COMPLETED); } List<@NonNull ITimeGraphRowModel> rowModels = new ArrayList<>(); for (Long id : filter.getSelectedItems()) { Collection<ITimeGraphState> states = visitor.fStates.asMap().get(id); if (states != null) { List<ITimeGraphState> filteredStates = new ArrayList<>(); for (ITimeGraphState state : states) { if (overlaps(state.getStartTime(), state.getDuration(), filter.getTimesRequested())) { filteredStates.add(state); } } rowModels.add(new TimeGraphRowModel(id, filteredStates)); } } return new TmfModelResponse<>(rowModels, Status.COMPLETED, CommonStatusMessage.COMPLETED); }
Source:
<code>public boolean isEnabled() { <START> return !(Jenkins.get()).getDisabledAdministrativeMonitors().contains(id); <END> }</code><technical_language>suggestion return !Jenkins.get().getDisabledAdministrativeMonitors().contains(id);</technical_language>

Target:
public boolean isEnabled() { return !Jenkins.get().getDisabledAdministrativeMonitors().contains(id); }
Source:
<code><START> public boolean equals(Object o) { <END> if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; JPAMessageId that = (JPAMessageId) o; return value == that.value; }</code><technical_language>overriding equals() hashCode(), write a test verify work well? EqualVerifier, for example of usage in James project</technical_language>

Target:
public boolean equals(Object o) { if (this == o) {return true;} if (o == null || getClass() != o.getClass()) {return false;} JPAMessageId that = (JPAMessageId) o; return value == that.value; }
Source:
<code>public Collection<ArtifactToken> getArtifactsFromQuery(String query, Object... data) { List<ArtifactId> ids = new LinkedList<>(); <START> jdbcService.getClient().runQuery(stmt -> ids.add(ArtifactId.valueOf(stmt.getInt("art_id"))), query, data); <END> return services.getQueryService().getArtifacts(ids, services.getAtsBranch()); }</code><technical_language>this consistent line 40 (getInt getLong)</technical_language>

Target:
public Collection<ArtifactToken> getArtifactsFromQuery(String query, Object... data) { List<ArtifactId> ids = new LinkedList<>(); jdbcService.getClient().runQuery(stmt -> ids.add(ArtifactId.valueOf(stmt.getLong("art_id"))), query, data); return services.getQueryService().getArtifacts(ids, services.getAtsBranch()); }
Source:
<code>public static void setupBeforeClass() { try { new File(tempOutputDirFromShp).mkdirs(); new File(tempOutputDirFromPbf).mkdirs(); <START> System.out.println("Building from shapefile"); <END> hopperShp = initHopper(new GraphhopperShp(), shapefile, tempOutputDirFromShp); System.out.println("Building from pbf"); hopperPbf = initHopper(new GraphHopperOSM(), pbf, tempOutputDirFromPbf); System.out.println("Finished building"); } catch (Exception e) { BEFORE_CLASS_EXCEPTION = e; } }</code><technical_language>logging necessary in tests IMO</technical_language>

Target:
public static void setupBeforeClass() { try { new File(tempOutputDirFromShp).mkdirs(); new File(tempOutputDirFromPbf).mkdirs(); hopperShp = initHopper(new GraphhopperSHP(), shapefile, tempOutputDirFromShp); hopperPbf = initHopper(new GraphHopperOSM(), pbf, tempOutputDirFromPbf); } catch (Exception e) { BEFORE_CLASS_EXCEPTION = e; } }
Source:
<code><START> public static ANSSRegionsFactory getFactory() { <END> if (SINGLETON == null) { SINGLETON = new ANSSRegionsFactory(); SINGLETON.startup(); Runtime.getRuntime().addShutdownHook(new Thread(() -> { SINGLETON.shutdown(); })); } return SINGLETON; }</code><technical_language>this synchronized</technical_language>

Target:
public static synchronized ANSSRegionsFactory getFactory() { return getFactory(true); }
Source:
<code>public void initialise() { infoArea = find("infoArea", UIText.class); <START> infoArea.setText(LatinQuotes[random.nextInt(LatinQuotes.length-1)]); <END> updateInfoButton = find("updateInfoButton", UIButton.class); if (updateInfoButton != null) { updateInfoButton.subscribe(button -> { infoArea.setText(LatinQuotes[random.nextInt(LatinQuotes.length-1)]); }); } }</code><technical_language>do want do this if a hardcoded string in .ui file</technical_language>

Target:
public void initialise() { infoArea = find("infoArea", UIText.class); updateInfoButton = find("updateInfoButton", UIButton.class); if (updateInfoButton != null) { updateInfoButton.subscribe(button -> { infoArea.setText(LatinQuotes[random.nextInt(LatinQuotes.length)]); }); } }
Source:
<code>public static Set<Annotation> getQualifiers(AnnotatedElement... elements) { return Arrays.stream(elements) .filter(Objects::nonNull) <START> .flatMap(element -> Stream.of(element.getAnnotations())) <END> .filter(anno -> anno.annotationType().isAnnotationPresent(Qualifier.class)) .collect(toSet()); }</code><technical_language>a fan of breaking lambdas method refs: .map(AnnotatedElement::getAnnotations) .flatMap(Stream::of)</technical_language>

Target:
public static Set<Annotation> getQualifiers(AnnotatedElement... elements) { return Arrays.stream(elements) .filter(Objects::nonNull) .map(AnnotatedElement::getAnnotations) .flatMap(Arrays::stream) .filter(anno -> anno.annotationType().isAnnotationPresent(Qualifier.class)) .collect(toSet()); }
Source:
<code>protected void onConfigure() { super.onConfigure(); getModel().getObject().setTarget(getMarkupId()); <START> if (getModel().getObject().getLayers() != null) { <END> for (Layer layer : getModel().getObject().getLayers()) { if (layer instanceof Vector) { final Vector vectorLayer = (Vector) layer; VectorFeatureDataLoadedListener vectorFeatureDataLoadedListener = new VectorFeatureDataLoadedListener() { @Override public void handleDataLoaded(AjaxRequestTarget target) { vectorLayer.notifyFeaturesLoadedListeners(target); } }; add(vectorFeatureDataLoadedListener); layerDataLoadedMap.put(layer, vectorFeatureDataLoadedListener); } } } }</code><technical_language>cache of getModel().getObject(). I suppose, expensive calculate in some cases</technical_language>

Target:
protected void onConfigure() { super.onConfigure(); Map map = getModelObject(); map.setTarget(getMarkupId()); if (map.getLayers() != null) { for (Layer layer : map.getLayers()) { if (layer instanceof Vector) { final Vector vectorLayer = (Vector) layer; VectorFeatureDataLoadedListener vectorFeatureDataLoadedListener = new VectorFeatureDataLoadedListener() { @Override public void handleDataLoaded(AjaxRequestTarget target) { vectorLayer.notifyFeaturesLoadedListeners(target); } }; add(vectorFeatureDataLoadedListener); layerDataLoadedMap.put(layer, vectorFeatureDataLoadedListener); } } } }
Source:
<code><START> public EditingDomain <END> getEditingDomainForContainment() { return actionContext.getEditingDomain(); }</code><technical_language>this protected well</technical_language>

Target:
protected EditingDomain getEditingDomainForContainment() { return actionContext.getEditingDomain(); }
Source:
<code>public void detectSingleTextLanguage() { DetectedLanguage primaryLanguage = new DetectedLanguage("English", "en", 1.0); StepVerifier.create(client.detectLanguage("This is a test English Text")) <START> .assertNext(response -> validateDetectedLanguages(Collections.singletonList(primaryLanguage), <END> Collections.singletonList(response))) .verifyComplete(); }</code><technical_language>Consider validatePrimaryLanguage for testing results, converting lists comparison</technical_language>

Target:
public void detectSingleTextLanguage() { DetectedLanguage primaryLanguage = new DetectedLanguage("English", "en", 1.0); StepVerifier.create(client.detectLanguage("This is a test English Text")) .assertNext(response -> validatePrimaryLanguage(primaryLanguage, response)) .verifyComplete(); }
Source:
<code>private boolean parsePackageInformation( Bundle bundle, URL resourceUrl ) { try { URLConnection urlConnection = resourceUrl.openConnection(); RequireJsGenerator gen = RequireJsGenerator.parseJsonPackage( urlConnection.getInputStream() ); if ( gen != null ) { RequireJsGenerator.ArtifactInfo artifactInfo = new RequireJsGenerator.ArtifactInfo( "osgi-bundles", bundle.getSymbolicName(), bundle.getVersion().toString() ); final RequireJsGenerator.ModuleInfo moduleInfo = gen.getConvertedConfig( artifactInfo ); Map<String, Object> requireJsonObject = moduleInfo.getRequireJs(); putInConfigMap( bundle.getBundleId(), requireJsonObject ); return true; } } catch ( Exception ignored ) { <START> ignored.printStackTrace(); <END> } return false; }</code><technical_language>do this. Please replace a proper log statement if feel necessary</technical_language>

Target:
private boolean parsePackageInformation( Bundle bundle, URL resourceUrl ) { try { URLConnection urlConnection = resourceUrl.openConnection(); RequireJsGenerator gen = RequireJsGenerator.parseJsonPackage( urlConnection.getInputStream() ); if ( gen != null ) { RequireJsGenerator.ArtifactInfo artifactInfo = new RequireJsGenerator.ArtifactInfo( "osgi-bundles", bundle.getSymbolicName(), bundle.getVersion().toString() ); final RequireJsGenerator.ModuleInfo moduleInfo = gen.getConvertedConfig( artifactInfo ); Map<String, Object> requireJsonObject = moduleInfo.getRequireJs(); putInConfigMap( bundle.getBundleId(), requireJsonObject ); return true; } } catch ( Exception ignored ) { } return false; }
Source:
<code>public static boolean eligibleForLoad(Period period, Interval interval, DateTime referenceTimestamp) { final Interval currInterval = new Interval(period, referenceTimestamp); <START> return currInterval.overlaps(interval); <END> }</code><technical_language>nit: call eligibleForLoad(currInterval, interval) for easier code maintenance</technical_language>

Target:
public static boolean eligibleForLoad(Period period, Interval interval, DateTime referenceTimestamp) { final Interval currInterval = new Interval(period, referenceTimestamp); return eligibleForLoad(currInterval, interval); }
Source:
<code>public String getValue() { <START> return content.orNull(); <END> }</code><technical_language>returning a Optional<String></technical_language>

Target:
public String getValue() { return content; }
Source:
<code>protected List<FileStatus> listStatus(Path... dirs) throws IOException { List<FileStatus> result = new ArrayList<FileStatus>(); if (dirs.length == 0) { throw new IOException("No input paths specified in job"); } List<IOException> errors = new ArrayList<IOException>(); List<PathFilter> filters = new ArrayList<PathFilter>(); filters.add(hiddenFileFilter); PathFilter inputFilter = new MultiPathFilter(filters); for (int i = 0; i < dirs.length; ++i) { Path p = dirs[i]; FileStatus[] matches = fs.globStatus(p, inputFilter); if (matches == null) { errors.add(new IOException("Input path does not exist: " + p)); } else if (matches.length == 0) { <START> errors.add(new IOException("Input Pattern " + p + " matches 0 files")); <END> } else { for (FileStatus globStat : matches) { if (globStat.isDirectory()) { for (FileStatus stat : fs.listStatus(globStat.getPath(), inputFilter)) { result.add(stat); } } else { result.add(globStat); } } } } if (!errors.isEmpty()) { throw new InvalidInputException(errors); } LOG.info("Total input paths to process : " + result.size()); return result; }</code><technical_language>cases errors</technical_language>

Target:
protected List<FileStatus> listStatus(Path... dirs) throws IOException { List<FileStatus> result = new ArrayList<FileStatus>(); if (dirs.length == 0) { throw new IOException("No input paths specified in job"); } List<IOException> errors = new ArrayList<IOException>(); List<PathFilter> filters = new ArrayList<PathFilter>(); filters.add(hiddenFileFilter); PathFilter inputFilter = new MultiPathFilter(filters); for (int i = 0; i < dirs.length; ++i) { Path p = dirs[i]; FileStatus[] matches = fs.globStatus(p, inputFilter); if (matches == null) { LOG.warn("Input path does not exist: " + p); } else if (matches.length == 0) { LOG.warn("Input Pattern " + p + " matches 0 files"); } else { for (FileStatus globStat : matches) { if (globStat.isDirectory()) { for (FileStatus stat : fs.listStatus(globStat.getPath(), inputFilter)) { result.add(stat); } } else { result.add(globStat); } } } } if (!errors.isEmpty()) { throw new InvalidInputException(errors); } LOG.info("Total input paths to process : " + result.size()); return result; }
Source:
<code>public DeathlessAncient(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.subtype.add("Vampire"); this.subtype.add("Knight"); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); <START> this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnToHandSourceEffect(), new TapTargetCost(new TargetControlledPermanent(3, 3, filter, false)))); <END> }</code><technical_language>TargetControlledPermanent needs notTarget set true target anything</technical_language>

Target:
public DeathlessAncient(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.subtype.add("Vampire"); this.subtype.add("Knight"); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnToHandSourceEffect(), new TapTargetCost(new TargetControlledPermanent(3, 3, filter, true)))); }
Source:
<code>public ServiceIntegrationView(final ServiceDescriptor serviceDescriptor, final long configurationsCount) { <START> this.serviceKey = serviceDescriptor.getServiceKey(); <END> this.name = serviceDescriptor.getName(); this.description = serviceDescriptor.getDescription(); this.iconUrl = serviceDescriptor.getIconUrl(); this.configurationsCount = configurationsCount; }</code><technical_language>Rename key please</technical_language>

Target:
public ServiceIntegrationView(final ServiceDescriptor serviceDescriptor, final long configurationsCount) { this.key = serviceDescriptor.getKey(); this.name = serviceDescriptor.getName(); this.description = serviceDescriptor.getDescription(); this.iconUrl = serviceDescriptor.getIconUrl(); this.configurationsCount = configurationsCount; this.sites = null; }
Source:
<code>protected void executeQueryCommand() { <START> VmDeviceDAO dao = DbFacade.getInstance().getVmDeviceDAO(); <END> List<VmDevice> disks = dao.getVmDeviceByVmIdAndType(getParameters().getId(), VmDeviceType.DISK.getName()); for (VmDevice disk: disks) { if (VmPayload.isPayload(disk.getSpecParams())) { VmPayload payload = new VmPayload(VmDeviceType.valueOf(disk.getType().toUpperCase()), disk.getSpecParams()); payload.setType(VmDeviceType.valueOf(disk.getDevice().toUpperCase())); payload.setContent(new String(Base64.decodeBase64(payload.getContent()))); getQueryReturnValue().setReturnValue(payload); } } }</code><technical_language>please replace with: VmDeviceDAO dao = getDbFacade().getVmDeviceDAO();</technical_language>

Target:
protected void executeQueryCommand() { VmDeviceDAO dao = getDbFacade().getVmDeviceDAO(); List<VmDevice> disks = dao.getVmDeviceByVmIdAndType(getParameters().getId(), VmDeviceType.DISK.getName()); for (VmDevice disk: disks) { if (VmPayload.isPayload(disk.getSpecParams())) { VmPayload payload = new VmPayload(VmDeviceType.valueOf(disk.getType().toUpperCase()), disk.getSpecParams()); payload.setType(VmDeviceType.valueOf(disk.getDevice().toUpperCase())); payload.setContent(new String(Base64.decodeBase64(payload.getContent()))); getQueryReturnValue().setReturnValue(payload); } } }
Source:
<code>private void collectParentTestInstances(ExtensionContext context, Set<Object> testInstances) { Optional<ExtensionContext> parent = context.getParent(); <START> boolean firstParent = true; <END> while (parent.isPresent() && parent.get() != context.getRoot()) { ExtensionContext parentContext = parent.get(); parent = parentContext.getParent(); if (firstParent) { firstParent = false; continue; } Object testInstance = parentContext.getStore(MOCKITO).remove(TEST_INSTANCE); if (testInstance != null) { testInstances.add(testInstance); } } }</code><technical_language>Sadly I working computer. I do a push Monday if prefer</technical_language>

Target:
private void collectParentTestInstances(ExtensionContext context, Set<Object> testInstances) { Optional<ExtensionContext> initialParent = context.getParent(); initialParent.ifPresent(parent -> collectParentTestInstance(parent.getParent(), context, testInstances)); }