auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public GroupByQueryResource prepareResource(GroupByQuery query, boolean willMergeRunners) { if (!willMergeRunners) { final int requiredMergeBufferNum = countRequiredMergeBufferNum(query, 1) + <START> (query.getSubtotalsSpec() != null ? 1 : 0); <END> if (requiredMergeBufferNum > mergeBufferPool.maxSize()) { throw new ResourceLimitExceededException( "Query needs " + requiredMergeBufferNum + " merge buffers, but only " + mergeBufferPool.maxSize() + " merge buffers are configured" ); } else if (requiredMergeBufferNum == 0) { return new GroupByQueryResource(); } else { final ResourceHolder<List<ByteBuffer>> mergeBufferHolders; if (QueryContexts.hasTimeout(query)) { mergeBufferHolders = mergeBufferPool.takeBatch(requiredMergeBufferNum, QueryContexts.getTimeout(query)); } else { mergeBufferHolders = mergeBufferPool.takeBatch(requiredMergeBufferNum); } if (mergeBufferHolders == null) { throw new InsufficientResourcesException("Cannot acquire enough merge buffers"); } else { return new GroupByQueryResource(mergeBufferHolders); } } } else { return new GroupByQueryResource(); } }</code><technical_language>Do need extra merge buffer computing subtotals? a requirement subtotals dimensions in order top level dimensions, meaning able compute a big extra buffer. row of scratch space a streaming combine</technical_language>

Target:
public GroupByQueryResource prepareResource(GroupByQuery query, boolean willMergeRunners) { if (!willMergeRunners) { final int requiredMergeBufferNum = countRequiredMergeBufferNum(query, 1) + (query.getSubtotalsSpec() != null ? 1 : 0); if (requiredMergeBufferNum > mergeBufferPool.maxSize()) { throw new ResourceLimitExceededException( "Query needs " + requiredMergeBufferNum + " merge buffers, but only " + mergeBufferPool.maxSize() + " merge buffers were configured" ); } else if (requiredMergeBufferNum == 0) { return new GroupByQueryResource(); } else { final List<ReferenceCountingResourceHolder<ByteBuffer>> mergeBufferHolders; if (QueryContexts.hasTimeout(query)) { mergeBufferHolders = mergeBufferPool.takeBatch(requiredMergeBufferNum, QueryContexts.getTimeout(query)); } else { mergeBufferHolders = mergeBufferPool.takeBatch(requiredMergeBufferNum); } if (mergeBufferHolders.isEmpty()) { throw new InsufficientResourcesException("Cannot acquire enough merge buffers"); } else { return new GroupByQueryResource(mergeBufferHolders); } } } else { return new GroupByQueryResource(); } }
Source:
<code>public void equal_shouldReturnTrueIfPatientIdIsEqualAndStarDateAndEndDateAreBothNull() { <START> int patientId = 12; <END> CohortMembership cohortMembershipOne = new CohortMembership(patientId); CohortMembership cohortMembershipTwo = new CohortMembership(patientId); Date startDate = null; Date endDate = null; cohortMembershipOne.setEndDate(endDate); cohortMembershipOne.setStartDate(startDate); cohortMembershipTwo.setStartDate(startDate); cohortMembershipTwo.setEndDate(endDate); assertTrue(cohortMembershipOne.equals(cohortMembershipTwo)); }</code><technical_language>questions</technical_language>

Target:
public void equal_shouldReturnTrueIfPatientIdIsEqualAndStarDateAndEndDateAreBothNull() { final int PATIENT_ID = 12; CohortMembership cohortMembershipOne = new CohortMembership(PATIENT_ID); CohortMembership cohortMembershipTwo = new CohortMembership(PATIENT_ID); Date startDate = null; Date endDate = null; cohortMembershipOne.setEndDate(endDate); cohortMembershipOne.setStartDate(startDate); cohortMembershipTwo.setStartDate(startDate); cohortMembershipTwo.setEndDate(endDate); assertTrue(cohortMembershipOne.equals(cohortMembershipTwo)); }
Source:
<code>public void serialize(Appender appender, JsonGenerator json, SerializerProvider serializerProvider) throws IOException { json.writeStartObject(); json.writeStringField("name", appender.getName()); <START> Layout<? extends Serializable> layout = appender.getLayout(); <END> json.writeEndObject(); }</code><technical_language>layout used</technical_language>

Target:
public void serialize(Appender appender, JsonGenerator json, SerializerProvider serializerProvider) throws IOException { json.writeStartObject(); json.writeStringField("name", appender.getName()); json.writeEndObject(); }
Source:
<code>public final static InputRow parseInputRow(Writable value, InputRowParser parser) { if(value instanceof Text) { <START> ByteBuffer bb = ByteBuffer.wrap(value.toString().getBytes()); <END> return parser.parse(bb); } else if(value instanceof MapWritable){ return parser.parse(convertMapStringAndObject((MapWritable)value)); } else { throw new RuntimeException("Incompatible input. expected MapWritable or Text"); } }</code><technical_language>Please charset in getBytes (utf8 is general standard) EDIT: actually, yet, java-utils StringUtils converter UTF8 Edit again: a sanity check, parser.parse(...) expect</technical_language>

Target:
public final static InputRow parseInputRow(Writable value, InputRowParser parser) { if(parser instanceof StringInputRowParser && value instanceof Text) { return ((StringInputRowParser)parser).parse(value.toString()); } else { return parser.parse(value); } }
Source:
<code><START> private int handleStart(@NonNull ITmfEvent event, ITmfStateSystemBuilder ss, long timestamp, String processName) { <END> ITmfStateValue functionBeginName = functionEntry(event); if (functionBeginName != null) { int processQuark = ss.getQuarkAbsoluteAndAdd(PROCESSES, processName); String threadName = getThreadName(event); long threadId = getThreadId(event); if (threadName == null) { threadName = Long.toString(threadId); } int threadQuark = ss.getQuarkRelativeAndAdd(processQuark, threadName); int callStackQuark = ss.getQuarkRelativeAndAdd(threadQuark, InstrumentedCallStackAnalysis.CALL_STACK); ITmfStateValue value = functionBeginName; ss.pushAttribute(timestamp, value, callStackQuark); return ss.queryOngoingState(callStackQuark).unboxInt() + callStackQuark; } return -1; }</code><technical_language>void</technical_language>

Target:
private void handleStart(@NonNull ITmfEvent event, ITmfStateSystemBuilder ss, long timestamp, String processName) { ITmfStateValue functionBeginName = functionEntry(event); if (functionBeginName != null) { int processQuark = ss.getQuarkAbsoluteAndAdd(PROCESSES, processName); String threadName = getThreadName(event); long threadId = getThreadId(event); if (threadName == null) { threadName = Long.toString(threadId); } int threadQuark = ss.getQuarkRelativeAndAdd(processQuark, threadName); int callStackQuark = ss.getQuarkRelativeAndAdd(threadQuark, InstrumentedCallStackAnalysis.CALL_STACK); ITmfStateValue value = functionBeginName; ss.pushAttribute(timestamp, value, callStackQuark); } }
Source:
<code>public static void deleteSnapshot(File snpDir, String folderName) { if (!snpDir.exists()) return; assert snpDir.isDirectory() : snpDir; try { List<Path> dirs = new ArrayList<>(); <START> Files.walkFileTree(snpDir.toPath(), new SimpleFileVisitor<Path>() { <END> @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { if (Files.isDirectory(dir) && Files.exists(dir) && folderName.equals(dir.getFileName().toString())) { dirs.add(dir); } return super.preVisitDirectory(dir, attrs); } @Override public FileVisitResult visitFileFailed(Path file, IOException exc) { return FileVisitResult.CONTINUE; } }); dirs.forEach(U::delete); File db = new File(snpDir, DB_DEFAULT_FOLDER); if (!db.exists() || db.list().length == 0) U.delete(snpDir); } catch (IOException e) { U.error(null, "Snapshot deletion failed with an error", e); } }</code><technical_language>U.delete()</technical_language>

Target:
public static void deleteSnapshot(File snpDir, String folderName) { if (!snpDir.exists()) return; assert snpDir.isDirectory() : snpDir; try { List<Path> dirs = new ArrayList<>(); Files.walkFileTree(snpDir.toPath(), new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { if (Files.isDirectory(dir) && Files.exists(dir) && folderName.equals(dir.getFileName().toString())) { dirs.add(dir); } return super.preVisitDirectory(dir, attrs); } @Override public FileVisitResult visitFileFailed(Path file, IOException exc) { return FileVisitResult.CONTINUE; } }); dirs.forEach(U::delete); File db = new File(snpDir, DB_DEFAULT_FOLDER); if (!db.exists() || db.list().length == 0) U.delete(snpDir); } catch (IOException e) { throw new IgniteException(e); } }
Source:
<code>private static boolean isVmRunningOnHost(Guid hostId) { <START> return !DbFacade.getInstance().getVmDao().getAllRunningForVds(hostId).isEmpty(); <END> }</code><technical_language>replacing VmDynamicDAO.getAllRunningForVds(id) save couple of bits db cpu</technical_language>

Target:
private static boolean isVmRunningOnHost(Guid hostId) { return !DbFacade.getInstance().getVmDynamicDao().getAllRunningForVds(hostId).isEmpty(); }
Source:
<code>public void shouldFindChargeWithCaptureUrlAndNoNextUrl_whenChargeInAwaitingCaptureRequest() throws Exception{ Long chargeId = 101L; <START> Long accountId = 10L; <END> GatewayAccountEntity gatewayAccount = new GatewayAccountEntity("sandbox", new HashMap<>(), TEST); gatewayAccount.setId(1L); ChargeEntity newCharge = aValidChargeEntity() .withId(chargeId) .withGatewayAccountEntity(gatewayAccount) .withStatus(AWAITING_CAPTURE_REQUEST) .build(); Optional<ChargeEntity> chargeEntity = Optional.of(newCharge); String externalId = newCharge.getExternalId(); when(mockedChargeDao.findByExternalIdAndGatewayAccount(externalId, accountId)).thenReturn(chargeEntity); Optional<ChargeResponse> chargeResponseForAccount = service.findChargeForAccount(externalId, accountId, mockedUriInfo); verify(mockedTokenDao, never()).persist(any()); ChargeResponseBuilder expectedChargeResponse = chargeResponseBuilderOf(chargeEntity.get()); expectedChargeResponse.withLink("self", GET, new URI(SERVICE_HOST + "/v1/api/accounts/1/charges/" + externalId)); expectedChargeResponse.withLink("refunds", GET, new URI(SERVICE_HOST + "/v1/api/accounts/1/charges/" + externalId + "/refunds")); expectedChargeResponse.withLink("capture", POST, new URI(SERVICE_HOST + "/v1/api/accounts/1/charges/" + externalId + "/capture")); assertThat(chargeResponseForAccount.get(), is(expectedChargeResponse.build())); }</code><technical_language>do accountId of 10 hard-coded account IDs of 1</technical_language>

Target:
public void shouldFindChargeWithCaptureUrlAndNoNextUrl_whenChargeInAwaitingCaptureRequest() throws Exception{ Long chargeId = 101L; ChargeEntity newCharge = aValidChargeEntity() .withId(chargeId) .withGatewayAccountEntity(gatewayAccount) .withStatus(AWAITING_CAPTURE_REQUEST) .build(); Optional<ChargeEntity> chargeEntity = Optional.of(newCharge); String externalId = newCharge.getExternalId(); when(mockedChargeDao.findByExternalIdAndGatewayAccount(externalId, GATEWAY_ACCOUNT_ID)).thenReturn(chargeEntity); Optional<ChargeResponse> chargeResponseForAccount = service.findChargeForAccount(externalId, GATEWAY_ACCOUNT_ID, mockedUriInfo); verify(mockedTokenDao, never()).persist(any()); ChargeResponseBuilder expectedChargeResponse = chargeResponseBuilderOf(chargeEntity.get()); expectedChargeResponse.withLink("self", GET, new URI(SERVICE_HOST + "/v1/api/accounts/10/charges/" + externalId)); expectedChargeResponse.withLink("refunds", GET, new URI(SERVICE_HOST + "/v1/api/accounts/10/charges/" + externalId + "/refunds")); expectedChargeResponse.withLink("capture", POST, new URI(SERVICE_HOST + "/v1/api/accounts/10/charges/" + externalId + "/capture")); assertThat(chargeResponseForAccount.get(), is(expectedChargeResponse.build())); }
Source:
<code>public void start(Stage gameStage) { gameStage.setTitle("Scrumbledore"); gameStage.setHeight(Constants.RESOLUTIONY); gameStage.setWidth(Constants.RESOLUTIONX); gameStage.setResizable(false); BorderPane contentHandler = new BorderPane(); Scene mainScene = new Scene(contentHandler); gameStage.setScene(mainScene); HBox topItems = new HBox(); Label scoreLabel = new Label(Constants.SCORELABEL); Label highScoreLabel = new Label(Constants.HISCORELABEL); Label powerUpLabel = new Label(Constants.POWERUPLABEL); Label levelLabel = new Label(Constants.LEVELLABEL); topItems.getChildren().addAll(scoreLabel, powerUpLabel, levelLabel, highScoreLabel); contentHandler.setTop(topItems); Canvas gameDisplay = new Canvas(Constants.RESOLUTIONX, Constants.CANVASRESOLUTIONY); GraphicsContext gamePainter = gameDisplay.getGraphicsContext2D(); contentHandler.setCenter(gameDisplay); for (int i = 0; i < 620; i = i + Constants.BLOCKSIZE) { <START> for (int j = 0; j < 620; j = j + Constants.BLOCKSIZE) { <END> gamePainter.fillText("CELL", j, i); } } HBox bottomItems = new HBox(); Button startStopButton = new Button(Constants.STARTBTNLABEL); Button settingsButton = new Button(Constants.SETTINGSBTNLABEL); Button exitButton = new Button(Constants.EXITBTNLABEL); bottomItems.getChildren().addAll(startStopButton, settingsButton, exitButton); contentHandler.setBottom(bottomItems); gameStage.show(); }</code><technical_language>values for j in for-loop replaced constants, instead of hardcoded</technical_language>

Target:
public void start(Stage gameStage) { gameStage.setTitle("Scrumbledore"); gameStage.setHeight(Constants.RESOLUTIONY); gameStage.setWidth(Constants.RESOLUTIONX); gameStage.setResizable(false); BorderPane contentHandler = new BorderPane(); Scene mainScene = new Scene(contentHandler); gameStage.setScene(mainScene); HBox topItems = new HBox(); Label scoreLabel = new Label(Constants.SCORELABEL); Label highScoreLabel = new Label(Constants.HISCORELABEL); Label powerUpLabel = new Label(Constants.POWERUPLABEL); Label levelLabel = new Label(Constants.LEVELLABEL); topItems.getChildren().addAll(scoreLabel, powerUpLabel, levelLabel, highScoreLabel); contentHandler.setTop(topItems); Canvas gameDisplay = new Canvas(Constants.RESOLUTIONX, Constants.CANVASRESOLUTIONY); GraphicsContext gamePainter = gameDisplay.getGraphicsContext2D(); contentHandler.setCenter(gameDisplay); for (int i = 0; i < Constants.RESOLUTIONX; i = i + Constants.BLOCKSIZE) { for (int j = 0; j < Constants.RESOLUTIONX; j = j + Constants.BLOCKSIZE) { gamePainter.fillText("CELL", j, i); } } HBox bottomItems = new HBox(); Button startStopButton = new Button(Constants.STARTBTNLABEL); Button settingsButton = new Button(Constants.SETTINGSBTNLABEL); Button exitButton = new Button(Constants.EXITBTNLABEL); bottomItems.getChildren().addAll(startStopButton, settingsButton, exitButton); contentHandler.setBottom(bottomItems); gameStage.show(); }
Source:
<code>public TransactionalObject getTransactionalObject(String serviceName, String name) { checkActive(serviceName, name); if (requiresBackupLogs(serviceName)) { transaction.ensureBackupLogsExist(); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj != null) { return obj; } TransactionalService transactionalService = getTransactionalService(serviceName); <START> nodeEngine.getProxyService().initializeDistributedObject(serviceName, name, source); <END> obj = transactionalService.createTransactionalObject(name, transaction); txnObjectMap.put(key, obj); return obj; }</code><technical_language>need source variable. transaction.getOwnerUuid() source</technical_language>

Target:
public TransactionalObject getTransactionalObject(String serviceName, String name) { checkActive(serviceName, name); if (requiresBackupLogs(serviceName)) { transaction.ensureBackupLogsExist(); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj != null) { return obj; } TransactionalService transactionalService = getTransactionalService(serviceName); nodeEngine.getProxyService().initializeDistributedObject(serviceName, name, transaction.getOwnerUuid()); obj = transactionalService.createTransactionalObject(name, transaction); txnObjectMap.put(key, obj); return obj; }
Source:
<code>public boolean test() { problemsView.open(); <START> <END> List<Problem> problems = problemsView.getProblems(problemType, matchers); return problems.size() == expectedProblemsCount; }</code><technical_language>This local variable hides field problems</technical_language>

Target:
public boolean test() { problemsView.activate(); problems = problemsView.getProblems(problemType, problemMatchers); return problems.size() == expectedProblemsCount; }
Source:
<code>protected void configure() { bind(RequestScopePropagator.class).to(GuiceRequestScopePropagator.class); bind(HttpRequestContext.class); if (wantSSL) { install(new RequireSslFilter.Module()); } install(new RunAsFilter.Module()); switch (authConfig.getAuthType()) { case <START> HTTP_GITHUB: <END> install(new HttpGitHubOAuthModule()); case HTTP: case HTTP_LDAP: install(new HttpAuthModule(authConfig)); break; case CLIENT_SSL_CERT_LDAP: install(new HttpsClientSslCertModule()); break; case LDAP: case LDAP_BIND: install(new LdapAuthModule()); break; case DEVELOPMENT_BECOME_ANY_ACCOUNT: install(new BecomeAnyAccountModule()); break; case OPENID: case OPENID_SSO: case CUSTOM_EXTENSION: break; default: throw new ProvisionException("Unsupported loginType: " + authConfig.getAuthType()); } install(new UrlModule(urlConfig, uiOptions)); install(new UiRpcModule()); install(new GerritRequestModule()); install(new GitOverHttpServlet.Module()); bind(GitWebConfig.class).toInstance(gitWebConfig); if (gitWebConfig.getGitwebCGI() != null) { install(new GitWebModule()); } bind(ContactStore.class).toProvider(ContactStoreProvider.class).in( SINGLETON); bind(GerritConfigProvider.class); bind(GerritConfig.class).toProvider(GerritConfigProvider.class); DynamicSet.setOf(binder(), WebUiPlugin.class); install(new AsyncReceiveCommits.Module()); bind(SocketAddress.class).annotatedWith(RemotePeer.class).toProvider( HttpRemotePeerProvider.class).in(RequestScoped.class); listener().toInstance(registerInParentInjectors()); }</code><technical_language>s/HTTP_GITHUB/OAUTH_GITHUB</technical_language>

Target:
protected void configure() { bind(RequestScopePropagator.class).to(GuiceRequestScopePropagator.class); bind(HttpRequestContext.class); if (wantSSL) { install(new RequireSslFilter.Module()); } install(new RunAsFilter.Module()); switch (authConfig.getAuthType()) { case OAUTH_GITHUB: install(new HttpGitHubOAuthModule()); case HTTP: case HTTP_LDAP: install(new HttpAuthModule(authConfig)); break; case CLIENT_SSL_CERT_LDAP: install(new HttpsClientSslCertModule()); break; case LDAP: case LDAP_BIND: install(new LdapAuthModule()); break; case DEVELOPMENT_BECOME_ANY_ACCOUNT: install(new BecomeAnyAccountModule()); break; case OPENID: case OPENID_SSO: case CUSTOM_EXTENSION: break; default: throw new ProvisionException("Unsupported loginType: " + authConfig.getAuthType()); } install(new UrlModule(urlConfig, uiOptions)); install(new UiRpcModule()); install(new GerritRequestModule()); install(new GitOverHttpServlet.Module()); bind(GitWebConfig.class).toInstance(gitWebConfig); if (gitWebConfig.getGitwebCGI() != null) { install(new GitWebModule()); } bind(ContactStore.class).toProvider(ContactStoreProvider.class).in( SINGLETON); bind(GerritConfigProvider.class); bind(GerritConfig.class).toProvider(GerritConfigProvider.class); DynamicSet.setOf(binder(), WebUiPlugin.class); install(new AsyncReceiveCommits.Module()); bind(SocketAddress.class).annotatedWith(RemotePeer.class).toProvider( HttpRemotePeerProvider.class).in(RequestScoped.class); listener().toInstance(registerInParentInjectors()); }
Source:
<code>private boolean isBAMFile(final InputStream stream) throws IOException { if (!BlockCompressedInputStream.isValidFile(stream)) { return false; } final int buffSize = BlockCompressedStreamConstants.MAX_COMPRESSED_BLOCK_SIZE; stream.mark(buffSize); final byte[] buffer = new byte[buffSize]; readBytes(stream, buffer, 0, buffSize); stream.reset(); final byte[] magicBuf = new byte[4]; <START> BlockCompressedInputStream bcis = new BlockCompressedInputStream(new ByteArrayInputStream(buffer), false); <END> final int magicLength = readBytes(bcis, magicBuf, 0, 4); bcis.close(); return magicLength == BAMFileConstants.BAM_MAGIC.length && Arrays.equals(BAMFileConstants.BAM_MAGIC, magicBuf); }</code><technical_language>bcis final</technical_language>

Target:
private boolean isBAMFile(final InputStream stream) throws IOException { if (!BlockCompressedInputStream.isValidFile(stream)) { return false; } final int buffSize = BlockCompressedStreamConstants.MAX_COMPRESSED_BLOCK_SIZE; stream.mark(buffSize); final byte[] buffer = new byte[buffSize]; readBytes(stream, buffer, 0, buffSize); stream.reset(); final byte[] magicBuf = new byte[4]; final BlockCompressedInputStream bcis = new BlockCompressedInputStream(new ByteArrayInputStream(buffer), false); final int magicLength = readBytes(bcis, magicBuf, 0, 4); bcis.close(); return magicLength == BAMFileConstants.BAM_MAGIC.length && Arrays.equals(BAMFileConstants.BAM_MAGIC, magicBuf); }
Source:
<code>public void teleport(EntityPlayer p) throws GridAccessException { List<TileTeleporter> tps = new ArrayList<TileTeleporter>(); for (IGridNode gn : gridProxy.getGrid().getMachines( TileTeleporter.class)) { TileTeleporter tt = (TileTeleporter) gn.getMachine(); if (freq == tt.freq && tt != this) tps.add(tt); } if (tps.size() > 1 || tps.size() < 1) <START> return; <END> TileTeleporter tt = tps.get(0); boolean dimTravel = p.worldObj != tt.worldObj; double distance = Math.abs(xCoord - tt.xCoord) + Math.abs(yCoord - tt.yCoord) + Math.abs(zCoord - tt.zCoord); double drain = AEConfig.instance.teleporter_getDrain(distance, dimTravel); if (drain > 0 && gridProxy.getEnergy().getStoredPower() >= drain) { System.out.println(gridProxy.getEnergy().extractAEPower(drain, Actionable.MODULATE, PowerMultiplier.CONFIG)); if (p.worldObj != tt.worldObj) p.travelToDimension(tt.worldObj.provider.dimensionId); p.mountEntity(null); p.setPositionAndUpdate(tt.xCoord + 0.5, tt.yCoord + 1, tt.zCoord + 0.5); p.worldObj.playSoundEffect(p.posX, p.posY, p.posZ, "mob.endermen.portal", 1F, 1F); return; } }</code><technical_language>tps.size() != 1 ? is important 1</technical_language>

Target:
public void teleport( EntityPlayer p ) throws GridAccessException { TileTeleporter tt; List<TileTeleporter> tps = new ArrayList<TileTeleporter>(); for (IGridNode gn : gridProxy.getGrid().getMachines( TileTeleporter.class )) { tt = (TileTeleporter) gn.getMachine(); if ( !output && tt != this && tt.output && freq == tt.freq ) { teleportTo( p, tt ); } if ( output && !tt.output && freq == tt.freq ) { tps.add( tt ); } } if ( !tps.isEmpty() ) { tt = tps.get( new Random().nextInt( tps.size() ) ); teleportTo( p, tt ); } }
Source:
<code>public Wiki createWiki(String wikiType, String owner) throws WikiException { Wiki wiki = new Wiki(wikiType, owner); wiki.setPermissions(getWikiDefaultPermissions(wikiType, owner)); WikiPreferences wikiPreferences = new WikiPreferences(); WikiPreferencesSyntax wikiPreferencesSyntax = new WikiPreferencesSyntax(); wikiPreferencesSyntax.setDefaultSyntax(getDefaultWikiSyntaxId()); wikiPreferences.setWikiPreferencesSyntax(wikiPreferencesSyntax); wiki.setPreferences(wikiPreferences); Wiki createdWiki = dataStorage.createWiki(wiki); StringBuilder sb = new StringBuilder("= Welcome to "); <START> String spaceName = owner; <END> if(wikiType.equals(PortalConfig.GROUP_TYPE)) { try { spaceName = getSpaceNameByGroupId(owner); } catch(Exception e) { if (LOG.isDebugEnabled()) { LOG.debug("Can't get Space name by group ID : " + owner, e); } } } sb.append(spaceName).append(" ="); createdWiki.getWikiHome().setContent(sb.toString()); updatePage(createdWiki.getWikiHome(), PageUpdateType.EDIT_PAGE_CONTENT); for(WikiTemplatePagePlugin templatePlugin : templatePagePlugins_) { if (templatePlugin != null && templatePlugin.getTemplates() != null) { for (Template template : templatePlugin.getTemplates()) { try { InputStream templateInputStream = configManager.getInputStream(template.getSourceFilePath()); template.setContent(IOUtils.toString(templateInputStream)); dataStorage.createTemplatePage(createdWiki, template); } catch(Exception e) { log.error("Cannot init template " + template.getName() + " - Cause : " + e.getMessage(), e); } } } } return createdWiki; }</code><technical_language>spaceName is accurate name, is a space, misleading. I prefer wikiLabel for example</technical_language>

Target:
public Wiki createWiki(String wikiType, String owner) throws WikiException { Wiki wiki = new Wiki(wikiType, owner); wiki.setPermissions(getWikiDefaultPermissions(wikiType, owner)); WikiPreferences wikiPreferences = new WikiPreferences(); WikiPreferencesSyntax wikiPreferencesSyntax = new WikiPreferencesSyntax(); wikiPreferencesSyntax.setDefaultSyntax(getDefaultWikiSyntaxId()); wikiPreferences.setWikiPreferencesSyntax(wikiPreferencesSyntax); wiki.setPreferences(wikiPreferences); Wiki createdWiki = dataStorage.createWiki(wiki); StringBuilder sb = new StringBuilder("= Welcome to "); String wikiLabel = owner; if(wikiType.equals(PortalConfig.GROUP_TYPE)) { wikiLabel = getSpaceNameByGroupId(owner); } sb.append(wikiLabel).append(" ="); createdWiki.getWikiHome().setContent(sb.toString()); updatePage(createdWiki.getWikiHome(), null); for(WikiTemplatePagePlugin templatePlugin : templatePagePlugins_) { if (templatePlugin != null && templatePlugin.getTemplates() != null) { for (Template template : templatePlugin.getTemplates()) { try { InputStream templateInputStream = configManager.getInputStream(template.getSourceFilePath()); template.setContent(IOUtils.toString(templateInputStream)); dataStorage.createTemplatePage(createdWiki, template); } catch(Exception e) { log.error("Cannot init template " + template.getName() + " - Cause : " + e.getMessage(), e); } } } } return createdWiki; }
Source:
<code>public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { logger.debug("skip project as configured"); return; } try { DependencyResolver dependencyResolver = new DependencyResolver(project, repositorySession, resolver, system, scopes.stream() .map(Scope::name) <START> .collect(Collectors.toList())); <END> FileSetRepository fileSetRepository = dependencyResolver.getFileSetRepository(project.getName(), bundles.getFiles(project.getBasedir()), useMavenDependencies); if (exporter == null) { exporter = bundlesOnly ? RunbundlesExporter.RUNBUNDLES : ExecutableJarExporter.EXECUTABLE_JAR; } Properties beanProperties = new BeanProperties(); beanProperties.put("project", project); beanProperties.put("settings", settings); Properties mavenProperties = new Properties(beanProperties); mavenProperties.putAll(project.getProperties()); Processor processor = new Processor(mavenProperties, false); for (File runFile : bndruns.getFiles(project.getBasedir(), "*.bndrun")) { export(runFile, fileSetRepository, processor); } } catch (Exception e) { throw new MojoExecutionException(e.getMessage(), e); } if (errors > 0) throw new MojoFailureException(errors + " errors found"); }</code><technical_language>this logic centralized in DependencyResolver a constructor takes a Set<Scope> argument</technical_language>

Target:
public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { logger.debug("skip project as configured"); return; } try { DependencyResolver dependencyResolver = new DependencyResolver(project, repositorySession, resolver, system, scopes); FileSetRepository fileSetRepository = dependencyResolver.getFileSetRepository(project.getName(), bundles.getFiles(project.getBasedir()), useMavenDependencies); if (exporter == null) { exporter = bundlesOnly ? RunbundlesExporter.RUNBUNDLES : ExecutableJarExporter.EXECUTABLE_JAR; } Properties beanProperties = new BeanProperties(); beanProperties.put("project", project); beanProperties.put("settings", settings); Properties mavenProperties = new Properties(beanProperties); mavenProperties.putAll(project.getProperties()); Processor processor = new Processor(mavenProperties, false); for (File runFile : bndruns.getFiles(project.getBasedir(), "*.bndrun")) { export(runFile, fileSetRepository, processor); } } catch (Exception e) { throw new MojoExecutionException(e.getMessage(), e); } if (errors > 0) throw new MojoFailureException(errors + " errors found"); }
Source:
<code>public void testConfigurationCloseImportedProjects() throws Exception { String location = ImportTestUtils.copyDataLocation("ImportExistingProjectsWizardTestRebuildProject"); File file = new File(location); SmartImportWizard wizard = new SmartImportWizard(); wizard.setInitialImportSource(file); proceedSmartImportWizard(wizard, page -> page.setCloseProjectsAfterImport(true)); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); try { assertEquals(2, projects.length); IProject rootProject = ResourcesPlugin.getWorkspace().getRoot() .getProject("ImportExistingProjectsWizardTestRebuildProject"); assertTrue("Missing test project", rootProject.exists()); assertFalse("Test project should be closed after import", <START> rootProject.isAccessible()); <END> } finally { ImportTestUtils.deleteWorkspaceProjects(projects); } }</code><technical_language>precise, test isOpen()</technical_language>

Target:
public void testConfigurationCloseImportedProjects() throws Exception { String location = ImportTestUtils.copyDataLocation("ImportExistingProjectsWizardTestRebuildProject"); File file = new File(location); SmartImportWizard wizard = new SmartImportWizard(); wizard.setInitialImportSource(file); proceedSmartImportWizard(wizard, page -> page.setCloseProjectsAfterImport(true)); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); try { assertEquals(2, projects.length); IProject rootProject = ResourcesPlugin.getWorkspace().getRoot() .getProject("ImportExistingProjectsWizardTestRebuildProject"); assertTrue("Missing test project", rootProject.exists()); assertFalse("Test project should be closed after import", rootProject.isOpen()); } finally { ImportTestUtils.deleteWorkspaceProjects(projects); } }
Source:
<code>public static void stopAll() { IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles(); ScriptConsole console; for(int i=0; i<ic.length; i++) { if (ic[i] instanceof ScriptConsole){ console = (ScriptConsole)ic[i]; if(console.isRunning()) <START> console.stop(); <END> } } }</code><technical_language>{}</technical_language>

Target:
public static void stopAll() { IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles(); ScriptConsole console; for(int i=0; i<ic.length; i++) { if (ic[i] instanceof ScriptConsole){ console = (ScriptConsole)ic[i]; if(console.isRunning()){ console.stop(); } } } }
Source:
<code>private boolean containsSequenceNumber(Collection<Message<?>> messages, Integer messageSequenceNumber) { for (Message<?> member : messages) { Object sequenceNumber = member.getHeaders().get( <START> IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER); <END> if (sequenceNumber instanceof Integer) { Integer memberSequenceNumber = (Integer) sequenceNumber; if (messageSequenceNumber.equals(memberSequenceNumber)) { return true; } } else { throw new IllegalArgumentException("Expected Integer for sequenceNumber header"); } } return false; }</code><technical_language>Yes, I thought time extra object get friendly accessor good idea all... in canAdd() ! member.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, Integer.class) work for here? pretty parallel do manually this if..else</technical_language>

Target:
private boolean containsSequenceNumber(Collection<Message<?>> messages, Integer messageSequenceNumber) { for (Message<?> member : messages) { if (messageSequenceNumber.equals(member.getHeaders().get( IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, Integer.class))) { return true; } } return false; }
Source:
<code>@Override public boolean contains(Object o) { if (!(o instanceof Map.Entry) || ((Map.Entry) o).getKey() == null) return false; Map.Entry that = (Map.Entry) o; <START> for (int i = 0; i < toIndex; i += 2) { <END> if (that.getKey().equals(array[i]) && equal(that.getValue(), array[i + 1])) return true; } return false; }</code><technical_language>arrayIndexOfKey check result + 1 equals that.getValue() a multimap. fix this account filtered keys</technical_language>

Target:
@Override public boolean contains(Object o) { if (!(o instanceof Map.Entry) || ((Map.Entry) o).getKey() == null) return false; Map.Entry that = (Map.Entry) o; int i = arrayIndexOfKey(that.getKey()); if (i == -1) return false; return value(i + 1).equals(that.getValue()); }
Source:
<code>public static boolean isDistinctFrom( @OperatorDependency(operator = EQUAL, returnType = StandardTypes.BOOLEAN, argumentTypes = {"K", "K"}) MethodHandle keyEqualsFunction, @OperatorDependency(operator = HASH_CODE, returnType = StandardTypes.BIGINT, argumentTypes = {"K"}) MethodHandle keyHashcodeFunction, @OperatorDependency(operator = IS_DISTINCT_FROM, returnType = StandardTypes.BOOLEAN, argumentTypes = {"V", "V"}) MethodHandle valueDistinctFromFunction, @TypeParameter("K") Type keyType, @TypeParameter("V") Type valueType, @SqlNullable @SqlType("map(K,V)") Block leftMapBlock, @IsNull boolean leftMapNull, @SqlNullable @SqlType("map(K,V)") Block rightMapBlock, @IsNull boolean rightMapNull) { if (leftMapNull != rightMapNull) { return true; } if (leftMapNull) { return false; } <START> <END> return !MapGenericEquality.genericEqual( keyEqualsFunction, keyHashcodeFunction, keyType, leftMapBlock, rightMapBlock, (leftMapIndex, rightMapIndex) -> { Object leftValue = readNativeValue(valueType, leftMapBlock, leftMapIndex); boolean leftNull = leftValue == null; if (leftNull) { leftValue = defaultValue(valueType.getJavaType()); } Object rightValue = readNativeValue(valueType, rightMapBlock, rightMapIndex); boolean rightNull = rightValue == null; if (rightNull) { rightValue = defaultValue(valueType.getJavaType()); } return !(boolean) valueDistinctFromFunction.invoke(leftValue, leftNull, rightValue, rightNull); }); }</code><technical_language>unrelated change</technical_language>

Target:
public static boolean isDistinctFrom( @OperatorDependency(operator = EQUAL, returnType = StandardTypes.BOOLEAN, argumentTypes = {"K", "K"}) MethodHandle keyEqualsFunction, @OperatorDependency(operator = HASH_CODE, returnType = StandardTypes.BIGINT, argumentTypes = {"K"}) MethodHandle keyHashcodeFunction, @OperatorDependency(operator = IS_DISTINCT_FROM, returnType = StandardTypes.BOOLEAN, argumentTypes = {"V", "V"}) MethodHandle valueDistinctFromFunction, @TypeParameter("K") Type keyType, @TypeParameter("V") Type valueType, @SqlNullable @SqlType("map(K,V)") Block leftMapBlock, @IsNull boolean leftMapNull, @SqlNullable @SqlType("map(K,V)") Block rightMapBlock, @IsNull boolean rightMapNull) { if (leftMapNull != rightMapNull) { return true; } if (leftMapNull) { return false; } return !MapGenericEquality.genericEqual( keyType, leftMapBlock, rightMapBlock, (leftMapIndex, rightMapIndex) -> { Object leftValue = readNativeValue(valueType, leftMapBlock, leftMapIndex); boolean leftNull = leftValue == null; if (leftNull) { leftValue = defaultValue(valueType.getJavaType()); } Object rightValue = readNativeValue(valueType, rightMapBlock, rightMapIndex); boolean rightNull = rightValue == null; if (rightNull) { rightValue = defaultValue(valueType.getJavaType()); } return !(boolean) valueDistinctFromFunction.invoke(leftValue, leftNull, rightValue, rightNull); }); }
Source:
<code>protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(getCacheMode(), true); <START> builder.clustering().stateTransfer().chunkSize(200).sync().replTimeout(45, TimeUnit.SECONDS); <END> createClusteredCaches(4, cacheName(), builder); }</code><technical_language>I I 20 better, exercise key migration code more</technical_language>

Target:
protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(getCacheMode(), true); builder.clustering().stateTransfer().sync().replTimeout(45, TimeUnit.SECONDS); createClusteredCaches(4, cacheName(), builder); }
Source:
<code>public String toString() { return "TimeseriesQuery{" + "dataSource='" + getDataSource() + '\'' + ", querySegmentSpec=" + getQuerySegmentSpec() + <START> ", virtualColumns=" + virtualColumns + <END> ", descending=" + isDescending() + ", dimFilter=" + dimFilter + ", granularity='" + granularity + '\'' + ", aggregatorSpecs=" + aggregatorSpecs + ", postAggregatorSpecs=" + postAggregatorSpecs + ", context=" + getContext() + '}'; }</code><technical_language>virtualColumns descending in order in this class</technical_language>

Target:
public String toString() { return "TimeseriesQuery{" + "dataSource='" + getDataSource() + '\'' + ", querySegmentSpec=" + getQuerySegmentSpec() + ", descending=" + isDescending() + ", virtualColumns=" + virtualColumns + ", dimFilter=" + dimFilter + ", granularity='" + granularity + '\'' + ", aggregatorSpecs=" + aggregatorSpecs + ", postAggregatorSpecs=" + postAggregatorSpecs + ", context=" + getContext() + '}'; }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_add_new_user_brick, container, false); addLabel = view.findViewById(R.id.add_label); addInput = view.findViewById(R.id.add_input); addLabel.setOnClickListener(v -> handleAddLabel()); addInput.setOnClickListener(v -> handleAddInput()); ((AppCompatActivity) getActivity()) <START> .getSupportActionBar().setTitle(R.string.brick_add_new_user_brick); <END> return view; }</code><technical_language>Null-ptr check, please</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_add_new_user_brick, container, false); addLabel = view.findViewById(R.id.add_label); addInput = view.findViewById(R.id.add_input); addLabel.setOnClickListener(v -> handleAddLabel()); addInput.setOnClickListener(v -> handleAddInput()); AppCompatActivity appCompatActivity = (AppCompatActivity) getActivity(); if (appCompatActivity != null && appCompatActivity.getSupportActionBar() != null) { appCompatActivity.getSupportActionBar().setTitle(R.string.brick_add_new_user_brick); } return view; }
Source:
<code>private Integer getPrecedenceLevel(RouterErrorCode routerErrorCode) { switch (routerErrorCode) { case BlobDeleted: return 1; case BlobExpired: return 2; case AmbryUnavailable: return 3; case UnexpectedInternalError: return 4; case OperationTimedOut: return 5; case BlobDoesNotExist: return 6; default: <START> return Integer.MIN_VALUE; <END> } }</code><technical_language>prioritizing unhandled errors rest. Is intended/wise do</technical_language>

Target:
private Integer getPrecedenceLevel(RouterErrorCode routerErrorCode) { switch (routerErrorCode) { case BlobDeleted: return 1; case BlobExpired: return 2; case RangeNotSatisfiable: return 3; case AmbryUnavailable: return 4; case UnexpectedInternalError: return 5; case OperationTimedOut: return 6; case BlobDoesNotExist: return 7; default: return Integer.MIN_VALUE; } }
Source:
<code><START> protected void doRemove(String id) throws ServerException { <END> final EntityManager manager = managerProvider.get(); final UserImpl user = manager.find(UserImpl.class, id); if (user != null) { manager.remove(user); manager.flush(); } }</code><technical_language>this method throw ServerException</technical_language>

Target:
protected void doRemove(String id) { final EntityManager manager = managerProvider.get(); final UserImpl user = manager.find(UserImpl.class, id); if (user != null) { manager.remove(user); manager.flush(); } }
Source:
<code>public AzureCloudInstanceInformation parseCloudInstanceInformation(List<String> responses) { AzureCloudInstanceInformation azureCloudInstanceInformation = null; if (responses.size() > 1) { throw new HelixException("Multiple responses are not supported for Azure now"); } String response = responses.get(0); ObjectMapper mapper = new ObjectMapper(); try { JsonNode jsonNode = mapper.readTree(response); JsonNode computeNode = jsonNode.path(COMPUTE); if (!computeNode.isMissingNode()) { String vmName = computeNode.path(INSTANCE_NAME).getTextValue(); String platformFaultDomain = computeNode.path(DOMAIN).getTextValue(); String vmssName = computeNode.path(INSTANCE_SET_NAME).getValueAsText(); String azureTopology = AzureConstants.AZURE_TOPOLOGY; String[] parts = azureTopology.trim().split("/"); <START> if (parts.length != 2) { throw new HelixException("Invalid Azure topology definition: " + azureTopology); } <END> String domain = parts[0] + "=" + platformFaultDomain + "," + parts[1] + "="; AzureCloudInstanceInformation.Builder builder = new AzureCloudInstanceInformation.Builder(); builder.setInstanceName(vmName).setFaultDomain(domain) .setInstanceSetName(vmssName); azureCloudInstanceInformation = builder.build(); } } catch (IOException e) { throw new HelixException(String.format("Error in parsing cloud instance information: {}", response, e)); } return azureCloudInstanceInformation; }</code><technical_language>This is necessary, right? offer flexibility for user customize it</technical_language>

Target:
public AzureCloudInstanceInformation parseCloudInstanceInformation(List<String> responses) { AzureCloudInstanceInformation azureCloudInstanceInformation = null; if (responses.size() > 1) { throw new HelixException("Multiple responses are not supported for Azure now"); } String response = responses.get(0); ObjectMapper mapper = new ObjectMapper(); try { JsonNode jsonNode = mapper.readTree(response); JsonNode computeNode = jsonNode.path(COMPUTE); if (!computeNode.isMissingNode()) { String vmName = computeNode.path(INSTANCE_NAME).getTextValue(); String platformFaultDomain = computeNode.path(DOMAIN).getTextValue(); String vmssName = computeNode.path(INSTANCE_SET_NAME).getValueAsText(); String azureTopology = AzureConstants.AZURE_TOPOLOGY; String[] parts = azureTopology.trim().split("/"); String domain = parts[0] + "=" + platformFaultDomain + "," + parts[1] + "="; AzureCloudInstanceInformation.Builder builder = new AzureCloudInstanceInformation.Builder(); builder.setInstanceName(vmName).setFaultDomain(domain) .setInstanceSetName(vmssName); azureCloudInstanceInformation = builder.build(); } } catch (IOException e) { throw new HelixException(String.format("Error in parsing cloud instance information: {}", response, e)); } return azureCloudInstanceInformation; }
Source:
<code>public List<PatchSetApproval> copyVetosToLatestPatchSet(Change change) throws OrmException, IOException { PatchSet.Id source; if (change.getNumberOfPatchSets() > 1) { source = new PatchSet.Id(change.getId(), change.getNumberOfPatchSets() - 1); } else { throw new IOException("Previous patch set could not be found"); } PatchSet.Id dest = change.currPatchSetId(); ResultSet<PatchSetApproval> patchSetApprovals = db.patchSetApprovals().byPatchSet(source); <START> for (PatchSetApproval a : patchSetApprovals) { <END> if (!ApprovalCategory.SUBMIT.equals(a.getCategoryId())) { final ApprovalType type = approvalTypes.byId(a.getCategoryId()); if (type.getCategory().isCopyMinScore() && type.isMaxNegative(a)) { db.patchSetApprovals().insert( Collections.singleton(new PatchSetApproval(dest, a))); } } } return patchSetApprovals.toList(); }</code><technical_language>iterate ResultSet twice. need toList set patchSetApprovals here</technical_language>

Target:
public List<PatchSetApproval> copyVetosToLatestPatchSet(Change change) throws OrmException, IOException { PatchSet.Id source; if (change.getNumberOfPatchSets() > 1) { source = new PatchSet.Id(change.getId(), change.getNumberOfPatchSets() - 1); } else { throw new IOException("Previous patch set could not be found"); } PatchSet.Id dest = change.currPatchSetId(); List<PatchSetApproval> patchSetApprovals = db.patchSetApprovals().byPatchSet(source).toList(); for (PatchSetApproval a : patchSetApprovals) { if (!ApprovalCategory.SUBMIT.equals(a.getCategoryId())) { final ApprovalType type = approvalTypes.byId(a.getCategoryId()); if (type.getCategory().isCopyMinScore() && type.isMaxNegative(a)) { db.patchSetApprovals().insert( Collections.singleton(new PatchSetApproval(dest, a))); } } } return patchSetApprovals; }
Source:
<code>private boolean validateKeyTypeIsHashable(TypeInformation<?> type) { try { return (type instanceof PojoTypeInfo) ? !type.getTypeClass().getMethod("hashCode").getDeclaringClass().equals(Object.class) <START> : !(type instanceof PrimitiveArrayTypeInfo || type instanceof BasicArrayTypeInfo || type instanceof ObjectArrayTypeInfo || type instanceof EnumTypeInfo); <END> } catch (NoSuchMethodException ignored) { } return false; }</code><technical_language>Do need extract this logic a separate function</technical_language>

Target:
private boolean validateKeyTypeIsHashable(TypeInformation<?> type) { try { return (type instanceof PojoTypeInfo) ? !type.getTypeClass().getMethod("hashCode").getDeclaringClass().equals(Object.class) : !(isArrayType(type) || isEnumType(type)); } catch (NoSuchMethodException ignored) { } return false; }
Source:
<code>private CoapObserveRelation observeAndWait(Request request, CoapHandler handler) { Endpoint outEndpoint = getEffectiveEndpoint(request); CoapObserveRelation relation = new CoapObserveRelation(request, outEndpoint); ObserveMessageObserverImpl messageObserver = new ObserveMessageObserverImpl(handler, relation); request.addMessageObserver(messageObserver); NotificationListener notificationListener = new Adapter(messageObserver, request); outEndpoint.addNotificationListener(notificationListener); messageObserver.setNotificationListener(notificationListener); <START> relation.setNotificationListener(notificationListener); <END> CoapResponse response = synchronous(request, outEndpoint); if (response == null || !response.advanced().getOptions().hasObserve()) relation.setCanceled(true); relation.setCurrent(response); return relation; }</code><technical_language>I do understand additions good for. explain</technical_language>

Target:
private CoapObserveRelation observeAndWait(Request request, CoapHandler handler) { Endpoint outEndpoint = getEffectiveEndpoint(request); CoapObserveRelation relation = new CoapObserveRelation(request, outEndpoint); ObserveMessageObserverImpl messageObserver = new ObserveMessageObserverImpl(handler, relation); request.addMessageObserver(messageObserver); NotificationListener notificationListener = new Adapter(messageObserver, request); outEndpoint.addNotificationListener(notificationListener); relation.setNotificationListener(notificationListener); CoapResponse response = synchronous(request, outEndpoint); if (response == null || !response.advanced().getOptions().hasObserve()) relation.setCanceled(true); relation.setCurrent(response); return relation; }
Source:
<code>public AxisService findService(MessageContext mc) throws AxisFault { AxisService service = mc.getAxisService(); if (service == null) { String to = mc.getTo().getAddress(); if (to.startsWith(mc.getConfigurationContext().getServiceContextPath())) { int tenantDelimiterIndex = to.indexOf("/t/"); if (tenantDelimiterIndex != -1) { getService(mc); } <START> } else if (to.startsWith("/t/")) { <END> getService(mc); } } return service; }</code><technical_language>a constant defined in a common place refer for "/t/" In lots of places it</technical_language>

Target:
public AxisService findService(MessageContext mc) throws AxisFault { AxisService service = mc.getAxisService(); if (service == null) { String to = mc.getTo().getAddress(); if (to.startsWith(mc.getConfigurationContext().getServiceContextPath())) { int tenantDelimiterIndex = to.indexOf(TENANT_PATH); if (tenantDelimiterIndex != -1) { getService(mc); } } else if (to.startsWith(TENANT_PATH)) { getService(mc); } } return service; }