auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void flush() { Thread thread = Thread.currentThread(); boolean queued = false; while (true) { ControlEntry entry = null; synchronized (this) { if (flushing != null && flushing != thread) return; flushing = thread; Slot slot = slots.peek(); if (slot != null) entry = slot.entry; if (entry == null) <START> { <END> flushing = null; break; } slots.poll(); } queued |= flusher.append(entry); } if (queued) flusher.iterate(); }</code><technical_language>I prefer style of fields starting _ viewing code of IDE better. Jetty stopped this a hostile takeover of style @sbordet @joakime :) Anyway, do need flushing a Thread? a boolean is changed sync block? In fact do need all? thread flushing hold lock queue is empty sees a null entry. other thread calling flush poll checking flushing</technical_language>

Target:
private void flush() { Thread thread = Thread.currentThread(); boolean queued = false; while (true) { ControlEntry entry; synchronized (this) { if (flushing == null) flushing = thread; else if (flushing != thread) return; Slot slot = slots.peek(); entry = slot == null ? null : slot.entry; if (entry == null) { flushing = null; break; } slots.poll(); } queued |= flusher.append(entry); } if (queued) flusher.iterate(); }
Source:
<code><START> public SiteIsolationHeaderScanner(Supplier<AlertBuilder> newAlert) { <END> this.newAlert = newAlert; }</code><technical_language>Worth normalising accessibility, this is public, some methods protected others package</technical_language>

Target:
SiteIsolationHeaderScanner(Supplier<AlertBuilder> newAlert) { this.newAlert = newAlert; }
Source:
<code><START> private boolean isUniqueAst(DetailAST ast) { <END> boolean isOnly = true; final DetailAST identAst = ast.findFirstToken(TokenTypes.IDENT); if (identAst == null) { DetailAST cur; if (ast.getParent() == null) { cur = ast; while (cur.getPreviousSibling() != null) { cur = cur.getPreviousSibling(); } } else { cur = ast.getParent().getFirstChild(); } for (; cur != null; cur = cur.getNextSibling()) { if (cur != ast && cur.getType() == ast.getType()) { isOnly = false; break; } } } return isOnly; }</code><technical_language>This method static</technical_language>

Target:
private static boolean isUniqueAst(DetailAST ast) { return ast.findFirstToken(TokenTypes.IDENT) != null || !hasAtLeastOneSiblingWithSameTokenType(ast); }
Source:
<code>public void run() { for (int i = 0; i < getsPerThread; i++) { final Set<LongRange> rangeSet = partitionManager.getRangeSet(EVAL_ID, KEY); if (rangeSet == null) { continue; } <START> for (final LongRange longRange : rangeSet) { <END> } } countDownLatch.countDown(); }</code><technical_language>Do some trivial work. Compiler ignore this for loop if empty</technical_language>

Target:
public void run() { for (int i = 0; i < getsPerThread; i++) { final Set<LongRange> rangeSet = partitionManager.getRangeSet(EVAL_ID, DATA_TYPE); if (rangeSet == null) { continue; } for (final LongRange longRange : rangeSet) { longRange.getMinimumLong(); } } countDownLatch.countDown(); }
Source:
<code>public void sphereBrush(Player player, LocalSession session, @Arg(desc = "The pattern of blocks to set") Pattern pattern, @Arg(desc = "The radius of the sphere", def = "2") double radius, @Switch(name = 'h', desc = "Create hollow spheres instead") boolean hollow) throws WorldEditException { worldEdit.checkMaxBrushRadius(radius); BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); tool.setFill(pattern); tool.setSize(radius); if (hollow) { tool.setBrush(new HollowSphereBrush(), "worldedit.brush.sphere"); } else { tool.setBrush(new SphereBrush(), "worldedit.brush.sphere"); } <START> player.printInfo(TranslatableComponent.of("worldedit.brush.sphere.equip", TextComponent.of((int) radius))); <END> }</code><technical_language>intend lose precision here? code format a one-digit decimal well, this is integers</technical_language>

Target:
public void sphereBrush(Player player, LocalSession session, @Arg(desc = "The pattern of blocks to set") Pattern pattern, @Arg(desc = "The radius of the sphere", def = "2") double radius, @Switch(name = 'h', desc = "Create hollow spheres instead") boolean hollow) throws WorldEditException { worldEdit.checkMaxBrushRadius(radius); BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); tool.setFill(pattern); tool.setSize(radius); if (hollow) { tool.setBrush(new HollowSphereBrush(), "worldedit.brush.sphere"); } else { tool.setBrush(new SphereBrush(), "worldedit.brush.sphere"); } player.printInfo(TranslatableComponent.of("worldedit.brush.sphere.equip", TextComponent.of(String.format("%.0f", radius)))); }
Source:
<code>public void free() { logger.fine("Free ICE agent"); shutdown = true; if (stunKeepAliveThread != null) stunKeepAliveThread.interrupt(); <START> synchronized (terminationThreadSyncRoot) <END> { if (terminationThread != null) { terminationThread.interrupt(); terminationThread = null; } } connCheckServer.stop(); IceProcessingState state = getState(); if (!IceProcessingState.FAILED.equals(state) && !IceProcessingState.TERMINATED.equals(state)) { terminate(IceProcessingState.TERMINATED); } boolean interrupted = false; logger.fine("remove streams"); for (IceMediaStream stream : getStreams()) { try { removeStream(stream); logger.fine("remove stream " + stream.getName()); } catch (Throwable t) { logger.fine( "remove stream " + stream.getName() + " failed: " + t); if (t instanceof InterruptedException) interrupted = true; else if (t instanceof ThreadDeath) throw (ThreadDeath) t; } } if (interrupted) Thread.currentThread().interrupt(); getStunStack().shutDown(); logger.fine("ICE agent freed"); }</code><technical_language>If thread is alive, is in call wait. If case, interrupting result in executing terminate(TERMINATED), is want. is problem solve? This solve problem of terminate executing agent is freed, leak 3 seconds (the default termination delay)</technical_language>

Target:
public void free() { logger.fine("Free ICE agent"); shutdown = true; if (stunKeepAliveThread != null) stunKeepAliveThread.interrupt(); synchronized (terminationFutureSyncRoot) { if (terminationFuture != null) { terminationFuture.cancel(true); terminationFuture = null; } } connCheckServer.stop(); IceProcessingState state = getState(); if (!IceProcessingState.FAILED.equals(state) && !IceProcessingState.TERMINATED.equals(state)) { terminate(IceProcessingState.TERMINATED); } boolean interrupted = false; logger.fine("remove streams"); for (IceMediaStream stream : getStreams()) { try { removeStream(stream); logger.fine("remove stream " + stream.getName()); } catch (Throwable t) { logger.fine( "remove stream " + stream.getName() + " failed: " + t); if (t instanceof InterruptedException) interrupted = true; else if (t instanceof ThreadDeath) throw (ThreadDeath) t; } } if (interrupted) Thread.currentThread().interrupt(); getStunStack().shutDown(); logger.fine("ICE agent freed"); }
Source:
<code>public NewsCard(@NonNull List<NewsItem> news, int age, @NonNull WikiSite wiki) { super(wiki); this.news = news; this.date = new UtcDate(age); <START> this.wiki = wiki; <END> }</code><technical_language>This necessary extended WikiSiteCard. Please #1632</technical_language>

Target:
public NewsCard(@NonNull List<NewsItem> news, int age, @NonNull WikiSite wiki) { super(wiki); this.news = news; this.date = new UtcDate(age); }
Source:
<code>void invalidate(Object connection) { Reference<Object> connReference = new Reference<>(connection); <START> lock.lock(); <END> try { int count = getConnectionRefCount(connReference) - 1; ConnectionHandler<Object> connectionHandler = connections.get(connReference).getSecond(); if (count > 0) { connections.put(connReference, new Pair(count, connectionHandler)); return; } if (connectionHandler != null) { connectionHandler.invalidate(); } connections.remove(connReference); } finally { lock.unlock(); } }</code><technical_language>ConcurrentUtils.withLock()</technical_language>

Target:
void invalidate(Object connection) { decreaseConnectionReferenceCount(new Reference<>(connection), connHandler -> { if (connHandler != null) connHandler.invalidate(); }); }
Source:
<code>public RefUpdate.Result modifyMessage(ChangeEdit edit, String msg) throws AuthException, InvalidChangeOperationException, IOException, UnchangedCommitMessage { checkState(!Strings.isNullOrEmpty(msg), "message cannot be null"); if (!currentUser.get().isIdentifiedUser()) { throw new AuthException("Authentication required"); } RevCommit prevEdit = edit.getEditCommit(); if (prevEdit.getParentCount() == 0) { throw new InvalidChangeOperationException( "Modify edit against root commit not supported"); } if (prevEdit.getFullMessage().equals(msg)) { throw new UnchangedCommitMessage( <START> "New commit message cannot be same as existing commit message"); <END> } IdentifiedUser me = (IdentifiedUser) currentUser.get(); Repository repo = gitManager.openRepository(edit.getChange().getProject()); try { RevWalk rw = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter(); try { String refName = edit.getRefName(); ObjectId commit = createCommit(me, inserter, prevEdit, rw.parseCommit(prevEdit.getParent(0)), prevEdit.getTree(), msg); inserter.flush(); return update(repo, me, refName, rw, prevEdit, commit); } finally { rw.release(); inserter.release(); } } finally { repo.close(); } }</code><technical_language>Do need this? InvalidChangeOperationException, message useful distinguish error was. UnchangedCommitMessage, is descriptive of exact problem. Or, passing in message here, put in constructor itself</technical_language>

Target:
public RefUpdate.Result modifyMessage(ChangeEdit edit, String msg) throws AuthException, InvalidChangeOperationException, IOException, UnchangedCommitMessageException { checkState(!Strings.isNullOrEmpty(msg), "message cannot be null"); if (!currentUser.get().isIdentifiedUser()) { throw new AuthException("Authentication required"); } RevCommit prevEdit = edit.getEditCommit(); if (prevEdit.getParentCount() == 0) { throw new InvalidChangeOperationException( "Modify edit against root commit not supported"); } if (prevEdit.getFullMessage().equals(msg)) { throw new UnchangedCommitMessageException(); } IdentifiedUser me = (IdentifiedUser) currentUser.get(); Repository repo = gitManager.openRepository(edit.getChange().getProject()); try { RevWalk rw = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter(); try { String refName = edit.getRefName(); ObjectId commit = createCommit(me, inserter, prevEdit, rw.parseCommit(prevEdit.getParent(0)), prevEdit.getTree(), msg); inserter.flush(); return update(repo, me, refName, rw, prevEdit, commit); } finally { rw.release(); inserter.release(); } } finally { repo.close(); } }
Source:
<code>public @Nullable ChannelTypeUID getChannelTypeUID(ChannelUID channelUID) { if (!channelUID.isInGroup()) { for (ChannelDefinition channelDefinition : this.getChannelDefinitions()) { if (channelDefinition.getId().equals(channelUID.getId())) { return channelDefinition.getChannelTypeUID(); } } } else { List<ChannelGroupDefinition> channelGroupDefinitions = this.getChannelGroupDefinitions(); BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext(); @SuppressWarnings("rawtypes") ServiceReference ref = bundleContext.getServiceReference(ChannelTypeRegistry.class.getName()); ChannelTypeRegistry channelTypeRegistry = null; if (ref != null) { channelTypeRegistry = (ChannelTypeRegistry) bundleContext.getService(ref); } for (ChannelGroupDefinition channelGroupDefinition : channelGroupDefinitions) { if (channelGroupDefinition.getId().equals(channelUID.getGroupId())) { ChannelGroupType channelGroupType = null; if (channelTypeRegistry != null) { channelGroupType = channelTypeRegistry.getChannelGroupType(channelGroupDefinition.getTypeUID()); } if (channelGroupType != null) { for (ChannelDefinition channelDefinition : channelGroupType.getChannelDefinitions()) { if (channelDefinition.getId().equals(channelUID.getIdWithoutGroup())) { return channelDefinition.getChannelTypeUID(); } } } } } if (ref != null) { <START> bundleContext.ungetService(ref); <END> } } return null; }</code><technical_language>a final block ensure service reference is released</technical_language>

Target:
public @Nullable ChannelTypeUID getChannelTypeUID(ChannelUID channelUID) { if (!channelUID.isInGroup()) { for (ChannelDefinition channelDefinition : this.getChannelDefinitions()) { if (channelDefinition.getId().equals(channelUID.getId())) { return channelDefinition.getChannelTypeUID(); } } } else { List<ChannelGroupDefinition> channelGroupDefinitions = this.getChannelGroupDefinitions(); BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext(); @SuppressWarnings("rawtypes") ServiceReference ref = bundleContext.getServiceReference(ChannelTypeRegistry.class.getName()); try { ChannelTypeRegistry channelTypeRegistry = null; if (ref != null) { channelTypeRegistry = (ChannelTypeRegistry) bundleContext.getService(ref); } for (ChannelGroupDefinition channelGroupDefinition : channelGroupDefinitions) { if (channelGroupDefinition.getId().equals(channelUID.getGroupId())) { ChannelGroupType channelGroupType = null; if (channelTypeRegistry != null) { channelGroupType = channelTypeRegistry .getChannelGroupType(channelGroupDefinition.getTypeUID()); } if (channelGroupType != null) { for (ChannelDefinition channelDefinition : channelGroupType.getChannelDefinitions()) { if (channelDefinition.getId().equals(channelUID.getIdWithoutGroup())) { return channelDefinition.getChannelTypeUID(); } } } } } } finally { if (ref != null) { bundleContext.ungetService(ref); } } } return null; }
Source:
<code>public IndexedInts getRow() { <START> return new IndexedInts() <END> { @Override public int size() { return 1; } @Override public int get(int index) { return 0; } @Override public Iterator<Integer> iterator() { return Iterators.singletonIterator(0); } }; }</code><technical_language>faster instantiating row single time</technical_language>

Target:
public IndexedInts getRow() { return SINGLETON; }
Source:
<code>protected void onActivityResult(int requestCode, int resultCode, Intent data) { List<Fragment> fragments; switch (requestCode) { <START> case REQUEST_CODE_FOR_STARTED_VISIT: <END> fragments = getSupportFragmentManager().getFragments(); recreateFragmentView(fragments.get(TabHost.VISITS_TAB_POS)); break; case REQUEST_CODE_FOR_VISIT: fragments = getSupportFragmentManager().getFragments(); recreateFragmentView(fragments.get(TabHost.VISITS_TAB_POS)); break; default: break; } }</code><technical_language>Is difference cases</technical_language>

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { List<Fragment> fragments; switch (requestCode) { case REQUEST_CODE_FOR_VISIT: fragments = getSupportFragmentManager().getFragments(); recreateFragmentView(fragments.get(TabHost.VISITS_TAB_POS)); break; default: break; } }
Source:
<code>public void shouldCreateFileWithParamName() throws IOException, URISyntaxException { Path path = Files.createTempFile("temp", ".tmp"); path.toFile().deleteOnExit(); String fileName = path.getFileName().toString(); String uri = path.toUri().toString().replace(fileName, "[fileName]"); Config config = new Config("conf159", false, null, null, null, null, null, null, HttpMethod.GET, false, uri, false, null); configService.updateConfigs(Arrays.asList(config)); Map<String, String> params = new HashMap<>(); params.put("api_key", "qwerty123"); params.put("message_id", "123123"); params.put("channel", "ivr"); params.put("status_callback_url", "<LINK_0>"); params.put("subscribers", "[{\"phone\":\"48700123123\",\"language\":null}]"); <START> List<String> result = new ArrayList<>(); <END> for(Map.Entry<String, String> entry: params.entrySet()){ result.add(String.format("%s: %s", entry.getKey(), entry.getValue())); } params.put("fileName", fileName); outboundCallService.initiateCall(config.getName(), params); List<String> fileOutput = Files.readAllLines(path); assertTrue(fileOutput.containsAll(result)); }</code><technical_language>This is pretty previous test. this test</technical_language>

Target:
public void shouldCreateFileWithParamName() throws IOException, URISyntaxException { Path path = Files.createTempFile("temp", ".tmp"); path.toFile().deleteOnExit(); String fileName = path.getFileName().toString(); String uri = path.toUri().toString().replace(fileName, "[fileName]"); Config config = new Config("conf159", false, null, null, null, null, null, null, HttpMethod.GET, false, uri, false, null); configService.updateConfigs(Arrays.asList(config)); Map<String, String> params = new HashMap<>(); params.put("api_key", "qwerty123"); params.put("message_id", "123123"); params.put("channel", "ivr"); params.put("status_callback_url", "<LINK_0>"); params.put("subscribers", "[{\"phone\":\"48700123123\",\"language\":null}]"); List<String> result = new ArrayList<>(); for(Map.Entry<String, String> entry: params.entrySet()){ result.add(String.format("%s: %s", entry.getKey(), entry.getValue())); } params.put("fileName", fileName); String fileNameParam = String.format("%s: %s", "fileName", fileName); outboundCallService.initiateCall(config.getName(), params); List<String> fileOutput = Files.readAllLines(path); assertTrue(fileOutput.containsAll(result)); assertTrue(!fileOutput.contains(fileNameParam)); }
Source:
<code>public boolean incrementToken() throws IOException { if (!input.incrementToken()) { return false; } String thisToken = <START> termAtt.toString(); <END> if (thisToken.length() == 1 && Character.isHighSurrogate(termAtt.buffer()[0])) { char highSurrogate = termAtt.buffer()[0]; int highSurrogateStart = offsetAtt.startOffset(); if (!input.incrementToken()) { return true; } thisToken = termAtt.toString(); if (thisToken.length() == 1 && Character.isLowSurrogate(termAtt.buffer()[0])) { termAtt.setEmpty(); termAtt.append(highSurrogate).append(thisToken); offsetAtt.setOffset(highSurrogateStart, offsetAtt.endOffset()); posIncr.setPositionIncrement(1); } } return true; }</code><technical_language>avoid calling toString() necessary try work char array possible. String (being immutable) is a class is convenient/efficient manipulate chars. length of actual String stored in buffer() termAtt.length()</technical_language>

Target:
public boolean incrementToken() throws IOException { if (!input.incrementToken()) { return false; } if (termAtt.length() == 1) { while (lowSurrogateCheck(termAtt)) { if (!input.incrementToken()) { return false; } } char highSurrogate = 0; int highSurrogateStart = 0; int highSurrogatePosIncr = 0; while (highSurrogateCheck(termAtt)) { highSurrogate = termAtt.buffer()[0]; highSurrogateStart = offsetAtt.startOffset(); highSurrogatePosIncr = posIncr.getPositionIncrement(); if (!input.incrementToken()) { return false; } } if (lowSurrogateCheck(termAtt)) { char thisToken = termAtt.buffer()[0]; termAtt.setEmpty(); termAtt.append(highSurrogate).append(thisToken); offsetAtt.setOffset(highSurrogateStart, offsetAtt.endOffset()); posIncr.setPositionIncrement(highSurrogatePosIncr); } } return true; }
Source:
<code>protected HiveMetaStoreClient createClient() throws Exception { boolean gotException = false; MetastoreConf.setVar(conf, ConfVars.THRIFT_URIS, "thrift://localhost:" + port); MetastoreConf.setBoolVar(conf, ConfVars.METASTORE_CLIENT_USE_PLAIN_AUTH, true); String tmpDir = System.getProperty("build.dir"); String credentialsPath = "jceks://file" + tmpDir + "/test-classes/creds/hms_plain_auth_test.jceks"; conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, credentialsPath); try { MetastoreConf.setVar(conf, ConfVars.METASTORE_CLIENT_PLAIN_USERNAME, wrongUser); HiveMetaStoreClient tmpClient = new HiveMetaStoreClient(conf); <START> } catch (Exception e) { <END> gotException = true; } Assert.assertTrue(gotException); MetastoreConf.setVar(conf, ConfVars.METASTORE_CLIENT_PLAIN_USERNAME, correctUser); return new HiveMetaStoreClient(conf); }</code><technical_language>some specific exception class validate. exception string checked</technical_language>

Target:
protected HiveMetaStoreClient createClient() throws Exception { MetastoreConf.setVar(conf, ConfVars.THRIFT_URIS, "thrift://localhost:" + port); MetastoreConf.setVar(conf, ConfVars.METASTORE_CLIENT_AUTH_MODE, "PLAIN"); String credsCUWP = createCredFile(correctUser, wrongPassword); conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, credsCUWP); String exceptionMessage = null; try { MetastoreConf.setVar(conf, ConfVars.METASTORE_CLIENT_PLAIN_USERNAME, correctUser); HiveMetaStoreClient tmpClient = new HiveMetaStoreClient(conf); } catch (MetaException e) { exceptionMessage = e.getMessage(); } Assert.assertNotNull(exceptionMessage); Assert.assertTrue(exceptionMessage.contains("Error validating the login")); exceptionMessage = null; try { MetastoreConf.setVar(conf, ConfVars.METASTORE_CLIENT_PLAIN_USERNAME, wrongUser); HiveMetaStoreClient tmpClient = new HiveMetaStoreClient(conf); } catch (MetaException e) { exceptionMessage = e.getMessage(); } Assert.assertNotNull(exceptionMessage); Assert.assertTrue(exceptionMessage.contains("No password found for user")); exceptionMessage = null; String credsWUWP = createCredFile(wrongUser, wrongPassword); conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, credsWUWP); try { MetastoreConf.setVar(conf, ConfVars.METASTORE_CLIENT_PLAIN_USERNAME, wrongUser); HiveMetaStoreClient tmpClient = new HiveMetaStoreClient(conf); } catch (MetaException e) { exceptionMessage = e.getMessage(); } Assert.assertNotNull(exceptionMessage); Assert.assertTrue(exceptionMessage.contains("Error validating the login")); String credsCUCP = createCredFile(correctUser, correctPassword); conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, credsCUCP); MetastoreConf.setVar(conf, ConfVars.METASTORE_CLIENT_PLAIN_USERNAME, correctUser); return new HiveMetaStoreClient(conf); }
Source:
<code><START> private void validateUser(User user) throws BadRequestException, NotFoundException, InternalServerErrorException { <END> if (user == null || user.getUserId() == null || user.getUserId().isEmpty()) { throw new BadRequestException(ValidationMessageEnums.USER_GOOGLE_ENDPOINT_NULL.message()); } final TechGalleryUser techUser = getUserByGoogleId(user.getUserId()); if (techUser == null) { throw new NotFoundException(ValidationMessageEnums.USER_NOT_EXIST.message()); } }</code><technical_language>@tsr-thulio GooglePlusCommunicationServiceImpl method. reuse this</technical_language>

Target:
public TechGalleryUser validateUser(User user) throws BadRequestException, NotFoundException, InternalServerErrorException { if (user == null || user.getUserId() == null || user.getUserId().isEmpty()) { throw new BadRequestException(ValidationMessageEnums.USER_GOOGLE_ENDPOINT_NULL.message()); } final TechGalleryUser techUser = getUserByGoogleId(user.getUserId()); if (techUser == null) { throw new NotFoundException(ValidationMessageEnums.USER_NOT_EXIST.message()); } return techUser; }
Source:
<code>public void screencastFrameAck(JsonRpcPeer peer, JSONObject params) { <START> LogUtil.i("screencastFrameAck()"); <END> }</code><technical_language>Prefer drop this :)</technical_language>

Target:
public void screencastFrameAck(JsonRpcPeer peer, JSONObject params) { }
Source:
<code>public void switchUserWhenUsernameIsMissingThenThrowException() { final MockServerWebExchange exchange = MockServerWebExchange .from(MockServerHttpRequest.post("/login/impersonate")); final WebFilterChain chain = mock(WebFilterChain.class); final SecurityContextImpl securityContext = new SecurityContextImpl(mock(Authentication.class)); assertThatIllegalArgumentException() <START> .isThrownBy(() -> this.switchUserWebFilter.filter(exchange, chain) <END> .subscriberContext( ReactiveSecurityContextHolder.withSecurityContext(Mono.just(securityContext))) .block()) .withMessage("The userName can not be null."); verifyNoInteractions(chain); }</code><technical_language>This is another spot confused line wrapping. Compare this line 220 221 content is identical, separated lines</technical_language>

Target:
public void switchUserWhenUsernameIsMissingThenThrowException() { final MockServerWebExchange exchange = MockServerWebExchange .from(MockServerHttpRequest.post("/login/impersonate")); final WebFilterChain chain = mock(WebFilterChain.class); final SecurityContextImpl securityContext = new SecurityContextImpl(mock(Authentication.class)); assertThatIllegalArgumentException().isThrownBy(() -> { Context securityContextHolder = ReactiveSecurityContextHolder .withSecurityContext(Mono.just(securityContext)); this.switchUserWebFilter.filter(exchange, chain).subscriberContext(securityContextHolder).block(); }).withMessage("The userName can not be null."); verifyNoInteractions(chain); }
Source:
<code>public void invalidUrlIsNotSavedOnConvertedAlert() { int feedId = 1; HealthMapAlert healthMapAlert = mock(HealthMapAlert.class); when(healthMapAlert.getFeedId()).thenReturn(feedId); <START> when(healthMapAlert.getOriginalUrl()).thenReturn("invalid/url.com"); <END> HealthMapLookupData lookupData = mock(HealthMapLookupData.class); HashMap<Integer, Feed> feedMap = new HashMap<>(); feedMap.put(feedId, new Feed("Test feed", null, 0, "zh", 1)); when(lookupData.getFeedMap()).thenReturn(feedMap); HealthMapAlertConverter alertConverter = new HealthMapAlertConverter( mock(AlertService.class), mock(DiseaseService.class), mock(EmailService.class), lookupData); DiseaseOccurrence occurrence = alertConverter.convert(healthMapAlert, mock(Location.class)); Alert newAlert = occurrence.getAlert(); assertThat(newAlert).isNotNull(); assertThat(newAlert.getUrl()).isNull(); }</code><technical_language>a test case for scenario seen, leading / for a relative url</technical_language>

Target:
public void invalidUrlIsNotSavedOnConvertedAlert() { testInvalidUrl("/invalid/url.com"); testInvalidUrl("article.aspx?articleNO=21162&?????? 10 ?????? ????? ??\"??????\" ?29 ???? ?????? ??? ????? ??? ????? ?????-21162"); testInvalidUrl("gx.php?id=XX_ALERT_ID_XX&t=Single+Patient+Report+from+the+GeoSentinel+Surveillance+Network"); testInvalidUrl("onm.php?id=XX_ALERT_ID_XX<LINK_0>"); testInvalidUrl("www.phac-aspc.gc.ca/phn-asp/2013/measles-0325-eng.php"); testInvalidUrl("file://www.phac-aspc.gc.ca/phn-asp/2013/measles-0325-eng.php"); testInvalidUrl("scp://www.phac-aspc.gc.ca/phn-asp/2013/measles-0325-eng.php"); testInvalidUrl("ftp://www.phac-aspc.gc.ca/phn-asp/2013/measles-0325-eng.php"); testInvalidUrl("ssh://www.phac-aspc.gc.ca/phn-asp/2013/measles-0325-eng.php"); testInvalidUrl("smb://www.phac-aspc.gc.ca/phn-asp/2013/measles-0325-eng.php"); }
Source:
<code>public void testDepth() { DataCenter dataCenter = createDataCenter(); for (int i = 1; i <= 5; ++i) { dataCenter = getDataCenter(dataCenter.id(), new DepthOptions().depth(i)); <START> assertNotNull(dataCenter); <END> } deleteDataCenter(dataCenter.id()); }</code><technical_language>Verify depth changes in returned datacenter? Verify entities</technical_language>

Target:
public void testDepth() { DataCenter dataCenter = createDataCenter(); for (int i = 1; i <= 5; ++i) { dataCenter = getDataCenter(dataCenter.id(), new DepthOptions().depth(i)); assertNotNull(dataCenter); switch(i) { case 1: assertNotNull(dataCenter.entities()); assertNotNull(dataCenter.entities().servers().items()); assertNotNull(dataCenter.entities().volumes().items()); assertNotNull(dataCenter.entities().loadbalancers().items()); assertNotNull(dataCenter.entities().lans().items()); break; } } deleteDataCenter(dataCenter.id()); }
Source:
<code>public void addSessionFactory(String key, SessionFactory<F> factory) { <START> this.factories.put(key, factory); <END> }</code><technical_language>I opinion deprecated API call a new for coverage. This need a change in target logic, a deprecated API affected is meant for removal eventually anyway</technical_language>

Target:
public void addSessionFactory(String key, SessionFactory<F> factory) { addSessionFactory((Object) key, factory); }
Source:
<code>protected Collection<String> getTableDefinitions() { return Collections.singleton( "CREATE TABLE test (" + " k int," + " c1 'DynamicCompositeType(s => UTF8Type, i => Int32Type)'," + " c2 'ReversedType(CompositeType(UTF8Type, Int32Type))'," <START> + " c3 'ListType(Int32Type)'," END> + " PRIMARY KEY (k, c1, c2)" + ")" ); }</code><technical_language>ah, I forgot primary key components part of system.schema_columnfamilies, columns, a problem</technical_language>

Target:
protected Collection<String> getTableDefinitions() { return Collections.singleton( "CREATE TABLE test (" + " k int," + " c1 'DynamicCompositeType(s => UTF8Type, i => Int32Type)'," + " c2 'ReversedType(CompositeType(UTF8Type, Int32Type))'," + " c3 'Int32Type'," + " PRIMARY KEY (k, c1, c2)" + ") WITH COMPACT STORAGE" ); }
Source:
<code>public List<CellWithTimestamp> getTimestampsWithinRow( TableReference tableRef, byte[] row, byte[] startColumnInclusive, long startTimestampExclusive, int limit) { long invertedTimestamp = ~startTimestampExclusive; CqlQuery query = new CqlQuery( <START> "SELECT column1, column2 FROM %s WHERE key = %s AND (column1, column2) > (%s, %s) LIMIT %s;", <END> quotedTableName(tableRef), key(row), column1(startColumnInclusive), column2(invertedTimestamp), limit(limit)); return query.executeAndGetCells(row, result -> getCellForColumn1Column2(result, row)); }</code><technical_language>do this? :mindblown:</technical_language>

Target:
public List<CellWithTimestamp> getTimestampsWithinRow( TableReference tableRef, byte[] row, byte[] startColumnInclusive, long startTimestampExclusive, int limit) { long invertedTimestamp = ~startTimestampExclusive; CqlQuery query = new CqlQuery( "SELECT column1, column2 FROM %s WHERE key = %s AND (column1, column2) > (%s, %s) LIMIT %s;", quotedTableName(tableRef), key(row), column1(startColumnInclusive), column2(invertedTimestamp), limit(limit)); return query.executeAndGetCells(row, result -> getCellFromKeylessRow(result, row)); }
Source:
<code>public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_ENTITYLESS_ATTR_DEF); attr.setFriendlyName("namespace_GIDRanges"); attr.setDisplayName("GID ranges in namespace"); attr.setType(List.class.getName()); <START> attr.setDescription("Manageable GID ranges in namespace."); <END> return attr; }</code><technical_language>Please add note description correct (syntax)</technical_language>

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_ENTITYLESS_ATTR_DEF); attr.setFriendlyName("namespace_GIDRanges"); attr.setDisplayName("GID ranges in namespace"); attr.setType(LinkedHashMap.class.getName()); attr.setDescription("Manageable GID ranges in a namespace - key of map is minimum and assigned value is maximum of one range, minimum and maximum can be equal"); return attr; }
Source:
<code>protected void executeCommand() { AuthenticationProfile profile = sessionDataContainer.getProfile(getParameters().getSessionId()); if (profile == null) { setSucceeded(false); } else { sessionId = getParameters().getSessionId(); <START> sourceIp = sessionDataContainer.getSourceIp(getParameters().getSessionId()); <END> sessionDataContainer.setSessionValid(getParameters().getSessionId(), false); setSucceeded(true); } }</code><technical_language>initialized for failures</technical_language>

Target:
protected void executeCommand() { AuthenticationProfile profile = sessionDataContainer.getProfile(getParameters().getSessionId()); sessionId = getParameters().getSessionId(); sourceIp = sessionDataContainer.getSourceIp(getParameters().getSessionId()); if (profile == null) { setSucceeded(false); } else { sessionDataContainer.setSessionValid(getParameters().getSessionId(), false); setSucceeded(true); } }
Source:
<code><START> void onItemSelected(int position) { <END> if (mAnimationEnabledCheckBox.isChecked()) { if (mDurationList.get(position) == 0) { mExpandableAdapter.setParentClickableViewAnimationDuration(-1); } else { mExpandableAdapter.setParentClickableViewAnimationDuration(mDurationList.get(position)); } } else { mExpandableAdapter.setParentClickableViewAnimationDuration(mDurationList.get(position)); } mExpandableAdapter.notifyDataSetChanged(); }</code><technical_language>lifecycle methods follow logical flow more</technical_language>

Target:
void onItemSelected(int position) { if (mAnimationEnabledCheckBox.isChecked()) { if (mDurationList.get(position) == 0) { mExpandableAdapter.setParentClickableViewAnimationDuration( mExpandableAdapter.CUSTOM_ANIMATION_DURATION_NOT_SET); } else { mExpandableAdapter.setParentClickableViewAnimationDuration(mDurationList.get(position)); } mExpandableAdapter.setParentAndIconExpandOnClick(false); } else { if (mDurationList.get(position) == 0) { mExpandableAdapter.setParentClickableViewAnimationDuration( mExpandableAdapter.CUSTOM_ANIMATION_DURATION_NOT_SET); mExpandableAdapter.setParentAndIconExpandOnClick(false); } else { mExpandableAdapter.setParentClickableViewAnimationDuration(mDurationList.get(position)); mExpandableAdapter.setCustomParentAnimationViewId(R.id.recycler_item_arrow_parent); mExpandableAdapter.setParentAndIconExpandOnClick(true); } } mExpandableAdapter.notifyDataSetChanged(); }
Source:
<code><START> public static Alias getNewFilmAlias(String id) { <END> return new Alias(NEW_PA_BASE_ALIAS + "prog_id", id); }</code><technical_language>need new here. getFilmAlias is enough getLegacyFilmAlias is next</technical_language>

Target:
public static Alias getNewFilmAlias(String id) { return new Alias(PA_BASE_ALIAS_V2 + "prog_id", id); }
Source:
<code>LocalSymbolTableImports(List<SymbolTable> importTables) { int importTablesSize = importTables.size(); myImports = new SymbolTable[importTablesSize]; for(int i = 0; i < importTables.size(); i++) { SymbolTable symbolTable = importTables.get(i); if(symbolTable.isLocalTable()) { <START> myImports[i] = LocalSymbolTableImportAdapter.of((LocalSymbolTable) symbolTable); <END> } else { myImports[i] = symbolTable; } } myBaseSids = new int[importTablesSize]; myMaxId = prepBaseSids(myBaseSids, myImports); }</code><technical_language>In this case, import. enforce that</technical_language>

Target:
LocalSymbolTableImports(List<SymbolTable> importTables) { validateImports(importTables); int importTablesSize = importTables.size(); myImports = new SymbolTable[importTablesSize]; for(int i = 0; i < importTables.size(); i++) { SymbolTable symbolTable = importTables.get(i); if(symbolTable.isLocalTable()) { myImports[i] = LocalSymbolTableImportAdapter.of((LocalSymbolTable) symbolTable); } else { myImports[i] = symbolTable; } } myBaseSids = new int[importTablesSize]; myMaxId = prepBaseSids(myBaseSids, myImports); }
Source:
<code><START> static <E extends Enum<E>> Gen<E> choose(Class<E> clazz) { <END> return random -> Gen.choose(clazz.getEnumConstants()).apply(random); }</code><technical_language>For objects provide human readable NullPointerExceptions. Please add a java Objects.requireNonNull(clazz, "clazz is null");</technical_language>

Target:
static <E extends Enum<E>> Gen<E> choose(Class<E> clazz) { Objects.requireNonNull(clazz, "clazz is null"); return random -> Gen.choose(clazz.getEnumConstants()).apply(random); }
Source:
<code>private Object[] createDataProviders(SpockExecutionContext context) { if (context.getErrorInfoCollector().hasErrors()) { return null; } List<DataProviderInfo> dataProviderInfos = context.getCurrentFeature().getDataProviders(); Object[] dataProviders = new Object[dataProviderInfos.size()]; if (!dataProviderInfos.isEmpty()) { for (int i = 0; i < dataProviderInfos.size(); i++) { DataProviderInfo dataProviderInfo = dataProviderInfos.get(i); MethodInfo method = dataProviderInfo.getDataProviderMethod(); List<String> dataProviderVariables = dataProviderInfos .stream() .map(DataProviderInfo::getDataVariables) .flatMap(List::stream) .collect(toList()); List<Object> arguments = new ArrayList<>(); outerLoop: <START> for (String previousDataTableVariable : dataProviderInfo.getPreviousDataTableVariables()) { <END> for (int j = 0; j < dataProviderVariables.size(); j++) { String dataProviderVariable = dataProviderVariables.get(j); if (previousDataTableVariable.equals(dataProviderVariable)) { arguments.add(dataProviders[j]); continue outerLoop; } } throw new IllegalStateException(String.format("Variable name not defined (%s not in %s)!", previousDataTableVariable, dataProviderVariables)); } Object provider = invokeRaw(context, context.getCurrentInstance(), method, arguments.toArray()); if (context.getErrorInfoCollector().hasErrors()) { return null; } else if (provider == null) { SpockExecutionException error = new SpockExecutionException("Data provider is null!"); supervisor.error(context.getErrorInfoCollector(), new ErrorInfo(method, error)); return null; } dataProviders[i] = provider; } } return dataProviders; }</code><technical_language>extract this a separate method</technical_language>

Target:
private Object[] createDataProviders(SpockExecutionContext context) { if (context.getErrorInfoCollector().hasErrors()) { return null; } List<DataProviderInfo> dataProviderInfos = context.getCurrentFeature().getDataProviders(); if (dataProviderInfos.isEmpty()) { return new Object[0]; } List<String> dataProviderVariables = dataProviderInfos .stream() .map(DataProviderInfo::getDataVariables) .flatMap(List::stream) .collect(toList()); Object[] dataProviders = new Object[dataProviderInfos.size()]; for (int i = 0, size = dataProviderInfos.size(); i < size; i++) { DataProviderInfo dataProviderInfo = dataProviderInfos.get(i); MethodInfo method = dataProviderInfo.getDataProviderMethod(); Object provider = invokeRaw( context, context.getCurrentInstance(), method, getPreviousDataTableProviders(dataProviderVariables, dataProviders, dataProviderInfo)); if (context.getErrorInfoCollector().hasErrors()) { if (provider != null) { dataProviders[i] = provider; } break; } else if (provider == null) { SpockExecutionException error = new SpockExecutionException("Data provider is null!"); supervisor.error(context.getErrorInfoCollector(), new ErrorInfo(method, error)); break; } dataProviders[i] = provider; } return dataProviders; }
Source:
<code>private void persistProject(final Project project, final FlowLoader loader, final File archive, final User uploader) throws ProjectManagerException { synchronized (project) { final int newVersion = this.projectLoader.getLatestProjectVersion(project) + 1; final Map<String, Flow> flows = loader.getFlowMap(); for (final Flow flow : flows.values()) { flow.setProjectId(project.getId()); flow.setVersion(newVersion); } this.storageManager.uploadProject(project, newVersion, archive, uploader); <START> log.info("Uploading flow to db " + archive.getName()); <END> this.projectLoader.uploadFlows(project, newVersion, flows.values()); log.info("Changing project versions " + archive.getName()); this.projectLoader.changeProjectVersion(project, newVersion, uploader.getUserId()); project.setFlows(flows); if (loader instanceof DirectoryFlowLoader) { final DirectoryFlowLoader directoryFlowLoader = (DirectoryFlowLoader) loader; log.info("Uploading Job properties"); this.projectLoader.uploadProjectProperties(project, new ArrayList<>( directoryFlowLoader.getJobPropsMap().values())); log.info("Uploading Props properties"); this.projectLoader.uploadProjectProperties(project, directoryFlowLoader.getPropsList()); } else if (loader instanceof DirectoryYamlFlowLoader) { } else { throw new ProjectManagerException("Invalid type of flow loader."); } this.projectLoader.postEvent(project, EventType.UPLOADED, uploader.getUserId(), "Uploaded project files zip " + archive.getName()); } }</code><technical_language>"Uploading flow" + archive.getName + " db"</technical_language>

Target:
private void persistProject(final Project project, final FlowLoader loader, final File archive, final User uploader) throws ProjectManagerException { synchronized (project) { final int newVersion = this.projectLoader.getLatestProjectVersion(project) + 1; final Map<String, Flow> flows = loader.getFlowMap(); for (final Flow flow : flows.values()) { flow.setProjectId(project.getId()); flow.setVersion(newVersion); } this.storageManager.uploadProject(project, newVersion, archive, uploader); log.info("Uploading flow to db for project " + archive.getName()); this.projectLoader.uploadFlows(project, newVersion, flows.values()); log.info("Changing project versions for project " + archive.getName()); this.projectLoader.changeProjectVersion(project, newVersion, uploader.getUserId()); project.setFlows(flows); if (loader instanceof DirectoryFlowLoader) { final DirectoryFlowLoader directoryFlowLoader = (DirectoryFlowLoader) loader; log.info("Uploading Job properties"); this.projectLoader.uploadProjectProperties(project, new ArrayList<>( directoryFlowLoader.getJobPropsMap().values())); log.info("Uploading Props properties"); this.projectLoader.uploadProjectProperties(project, directoryFlowLoader.getPropsList()); } else if (loader instanceof DirectoryYamlFlowLoader) { } else { throw new ProjectManagerException("Invalid type of flow loader."); } this.projectLoader.postEvent(project, EventType.UPLOADED, uploader.getUserId(), "Uploaded project files zip " + archive.getName()); } }
Source:
<code>public void normalize(CertifiedProductSearchDetails listing) { if (listing.getCertificationResults() != null && listing.getCertificationResults().size() > 0) { listing.getCertificationResults().stream() <START> .forEach(certResult -> lookupTestProcedureIds(certResult.getCriterion(), certResult.getTestProcedures())); <END> } }</code><technical_language>previous class. note this anymore</technical_language>

Target:
public void normalize(CertifiedProductSearchDetails listing) { if (listing.getCertificationResults() != null && listing.getCertificationResults().size() > 0) { listing.getCertificationResults().stream() .forEach(certResult -> populateTestProcedureIds(certResult.getCriterion(), certResult.getTestProcedures())); } }
Source:
<code>public FoundViewHolder getFoundViewHolder(JFieldRef idRef, AbstractJClass viewClass) { String idRefString = idRef.name(); FoundViewHolder foundViewHolder = (FoundViewHolder) foundHolders.get(idRefString); if (foundViewHolder == null) { foundViewHolder = createFoundViewAndIfNotNullBlock(idRef, viewClass); <START> foundHolders.put(idRefString, foundViewHolder); <END> } return foundViewHolder; }</code><technical_language>do handle this now</technical_language>

Target:
public FoundViewHolder getFoundViewHolder(JFieldRef idRef, AbstractJClass viewClass) { return getFoundViewHolder(idRef, viewClass, null); }
Source:
<code>public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException { if (c.getEnvironment().getRegion().getRegionInfo().getTable().isSystemTable()) { return; } for (int i = 0; i < miniBatchOp.size(); i++) { Mutation m = miniBatchOp.getOperation(i); if (!(m instanceof Delete)) { continue; } byte[] sourceOpAttr = m.getAttribute(TEST_ATTR); if (sourceOpAttr == null) { continue; } Tag sourceOpTag = new ArrayBackedTag(TEST_TAG_TYPE, sourceOpAttr); List<Cell> updatedCells = new ArrayList<>(); for (CellScanner cellScanner = m.cellScanner(); cellScanner.advance(); ) { Cell cell = cellScanner.current(); List<Tag> tags = PrivateCellUtil.getTags(cell); tags.add(sourceOpTag); Cell updatedCell = PrivateCellUtil.createCell(cell, tags); updatedCells.add(updatedCell); } m.getFamilyCellMap().clear(); for (Cell cell : updatedCells) { <START> if (m instanceof Delete) { <END> Delete d = (Delete) m; d.add(cell); } } } }</code><technical_language>This is true of if (!(m instanceof Delete)) { continue; }</technical_language>

Target:
public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException { if (c.getEnvironment().getRegion().getRegionInfo().getTable().isSystemTable()) { return; } for (int i = 0; i < miniBatchOp.size(); i++) { Mutation m = miniBatchOp.getOperation(i); if (!(m instanceof Delete)) { continue; } byte[] sourceOpAttr = m.getAttribute(TEST_ATTR); if (sourceOpAttr == null) { continue; } Tag sourceOpTag = new ArrayBackedTag(TEST_TAG_TYPE, sourceOpAttr); List<Cell> updatedCells = new ArrayList<>(); for (CellScanner cellScanner = m.cellScanner(); cellScanner.advance(); ) { Cell cell = cellScanner.current(); List<Tag> tags = PrivateCellUtil.getTags(cell); tags.add(sourceOpTag); Cell updatedCell = PrivateCellUtil.createCell(cell, tags); updatedCells.add(updatedCell); } m.getFamilyCellMap().clear(); for (Cell cell : updatedCells) { Delete d = (Delete) m; d.add(cell); } } }
Source:
<code>public void methodInterceptorShouldBeRunOnceWhenCustomisedListenerImplementsITestListenerAndIMethodInterceptor() { TestNG tng = create(LSampleTest.class); InterceptorInvokeTwiceSimulateListener interceptor = new InterceptorInvokeTwiceSimulateListener(); <START> tng.addListener((ITestNGListener) interceptor); <END> tng.run(); Assert.assertEquals(interceptor.getCount(), 1); }</code><technical_language>ITestNGListener cast useless now. confirm</technical_language>

Target:
public void methodInterceptorShouldBeRunOnceWhenCustomisedListenerImplementsITestListenerAndIMethodInterceptor() { TestNG tng = create(LSampleTest.class); InterceptorInvokeTwiceSimulateListener interceptor = new InterceptorInvokeTwiceSimulateListener(); tng.addListener(interceptor); tng.run(); Assert.assertEquals(interceptor.getCount(), 1); }
Source:
<code>public BaseStation(String port, int baud, SerialEventWorker sew) { bindingEventWorker = sew; serialDevice = new SerialDevice(port, baud); serialDevice.setEventWorker(this); try { serialDevice.initialize(); } catch (InitializationException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>Please logger.error(message, e) instead of e.printStackTrace()</technical_language>

Target:
public BaseStation(String port, int baud, SerialEventWorker sew) { bindingEventWorker = sew; serialDevice = new SerialDevice(port, baud); serialDevice.setEventWorker(this); try { serialDevice.initialize(); } catch (InitializationException e) { logger.error("Port cannot be opened. Port: {}", port); logger.error("initialization exception", e); } }
Source:
<code>public void testSearchAgreement() throws PayPalRESTException { Date startDate = new GregorianCalendar(2014, 10, 1).getTime(); Date endDate = new GregorianCalendar(2014, 10, 14).getTime(); <START> AgreementTransactions transactions = Agreement.transactions(SANDBOXCONTEXTBILLING, "I-9STXMKR58UNN", startDate, endDate); <END> Assert.assertNotNull(transactions); Assert.assertNotNull(transactions.getAgreementTransactionList()); }</code><technical_language>This test fail if accidently deletes this Agreement. Generally, agreement Id of created in testCreateAgreement</technical_language>

Target:
public void testSearchAgreement() throws PayPalRESTException { Date startDate = new GregorianCalendar(2014, 10, 1).getTime(); Date endDate = new GregorianCalendar(2014, 10, 14).getTime(); AgreementTransactions transactions = Agreement.transactions(TestConstants.SANDBOX_CONTEXT, "I-9STXMKR58UNN", startDate, endDate); Assert.assertNotNull(transactions); Assert.assertNotNull(transactions.getAgreementTransactionList()); }
Source:
<code>public Response getNoteParagraphJobStatus(@PathParam("noteId") String noteId, @PathParam("paragraphId") String paragraphId) throws IOException, IllegalArgumentException { <START> LOG.info("get notebook paragraph job status."); <END> Note note = notebook.getNote(noteId); if (note == null) { return new JsonResponse<>(Status.NOT_FOUND, "note not found.").build(); } Paragraph paragraph = note.getParagraph(paragraphId); if (paragraph == null) { return new JsonResponse<>(Status.NOT_FOUND, "paragraph not found.").build(); } return new JsonResponse<>(Status.OK, null, note.generateSingleParagraphInfo(paragraphId)). build(); }</code><technical_language>here. Instead of notebook, note more correct</technical_language>

Target:
public Response getNoteParagraphJobStatus(@PathParam("noteId") String noteId, @PathParam("paragraphId") String paragraphId) throws IOException, IllegalArgumentException { LOG.info("get note paragraph job status."); Note note = notebook.getNote(noteId); if (note == null) { return new JsonResponse<>(Status.NOT_FOUND, "note not found.").build(); } Paragraph paragraph = note.getParagraph(paragraphId); if (paragraph == null) { return new JsonResponse<>(Status.NOT_FOUND, "paragraph not found.").build(); } return new JsonResponse<>(Status.OK, null, note.generateSingleParagraphInfo(paragraphId)). build(); }