auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void start() throws Exception { if (isStarted()) { return; } <START> cleanupTemporaryFilesIfAnyBeforeStart(); <END> server.start(); ActiveMQWebLogger.LOGGER.webserverStarted(webServerConfig.bind); if (consoleUrl != null) { ActiveMQWebLogger.LOGGER.jolokiaAvailable(consoleUrl + "/jolokia"); ActiveMQWebLogger.LOGGER.consoleAvailable(consoleUrl); } }</code><technical_language>rename this cleanupTmp();</technical_language>

Target:
public void start() throws Exception { if (isStarted()) { return; } cleanupTmp(); server.start(); ActiveMQWebLogger.LOGGER.webserverStarted(webServerConfig.bind); if (consoleUrl != null) { ActiveMQWebLogger.LOGGER.jolokiaAvailable(consoleUrl + "/jolokia"); ActiveMQWebLogger.LOGGER.consoleAvailable(consoleUrl); } }
Source:
<code>void applyMigration(I id, Migration<I, T, S> migration) { checkNotNull(id); checkNotNull(migration); checkEntityIsTransactional(); E entity = findOrThrow(id); migration.applyTo((T) entity, (RecordBasedRepository<I, T, S>) this); if (migration.physicallyRemoveRecord()) { delete(id); migration.finishCurrentOperation(); } else { <START> store(entity); <END> } }</code><technical_language>a bit odd finish operation if migration removes a record. is so</technical_language>

Target:
void applyMigration(I id, Migration<I, T, S> migration) { checkNotNull(id); checkNotNull(migration); checkEntityIsTransactional(); E entity = findOrThrow(id); migration.applyTo((T) entity, (RecordBasedRepository<I, T, S>) this); if (migration.physicallyRemoveRecord()) { delete(id, migration); } else { store(entity); } migration.finishCurrentOperation(); }
Source:
<code>void retrievePolicyForService(UUID serviceId) throws Throwable { ServicePolicy policy = client.getServicePolicy(serviceId); <START> currentServicePolicyEntity = policy == null ? null : ServicePolicyEntity.fromServicePolicy(policy); <END> }</code><technical_language>getServicePolicy return null. Based Python SDK functions return a policy object time. In case is in fact empty ({"factors": [], "minimum_requirements": []}), return a policy minimum_factors set false 0</technical_language>

Target:
void retrievePolicyForService(UUID serviceId) throws Throwable { ServicePolicy policy = client.getServicePolicy(serviceId); currentServicePolicyEntity = ServicePolicyEntity.fromServicePolicy(policy); }
Source:
<code>private JavaTypeDefinition getTypeDefinitionOfVariableFromScope(Scope scope, String image, Class<?> accessingClass) { if (accessingClass == null) { return null; } for ( ; scope != null; scope = scope.getParent()) { for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : scope.getDeclarations(VariableNameDeclaration.class).entrySet()) { if (entry.getKey().getImage().equals(image)) { ASTType typeNode = entry.getKey().getDeclaratorId().getTypeNode(); <START> if (typeNode != null) { <END> return null; } if (typeNode.jjtGetChild(0) instanceof ASTReferenceType) { return ((TypeNode) typeNode.jjtGetChild(0)).getTypeDefinition(); } else { return JavaTypeDefinition.build(typeNode.getType()); } } } if (scope instanceof ClassScope) { try { JavaTypeDefinition superClass = getSuperClassTypeDefinition(((ClassScope) scope).getClassDeclaration().getNode(), null); JavaTypeDefinition foundTypeDef = getFieldType(superClass, image, accessingClass); if (foundTypeDef != null) { return foundTypeDef; } } catch (ClassCastException e) { } } } return null; }</code><technical_language>'typeNode == null</technical_language>

Target:
private JavaTypeDefinition getTypeDefinitionOfVariableFromScope(Scope scope, String image, Class<?> accessingClass) { if (accessingClass == null) { return null; } for ( ; scope != null; scope = scope.getParent()) { for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : scope.getDeclarations(VariableNameDeclaration.class).entrySet()) { if (entry.getKey().getImage().equals(image)) { ASTType typeNode = entry.getKey().getDeclaratorId().getTypeNode(); if (typeNode == null) { return null; } if (typeNode.jjtGetChild(0) instanceof ASTReferenceType) { return ((TypeNode) typeNode.jjtGetChild(0)).getTypeDefinition(); } else { return JavaTypeDefinition.build(typeNode.getType()); } } } if (scope instanceof ClassScope) { try { JavaTypeDefinition superClass = getSuperClassTypeDefinition(((ClassScope) scope).getClassDeclaration().getNode(), null); JavaTypeDefinition foundTypeDef = getFieldType(superClass, image, accessingClass); if (foundTypeDef != null) { return foundTypeDef; } } catch (ClassCastException e) { } } } return null; }
Source:
<code>private void blockPartitionLocationChangesOnReplSource(Database db, Table tbl, EnvironmentContext ec) throws InvalidOperationException { if (!ReplChangeManager.isSourceOfReplication(db)) { return; } if (conf.getBoolean(MetastoreConf.ConfVars.STRICT_MANAGED_TABLES.getHiveName(), false)) { return; } boolean isChangingLocation = false; if (ec.isSetProperties()) { String alterType = ec.getProperties().get(ALTER_TABLE_OPERATION_TYPE); <START> if (alterType != null && alterType.equalsIgnoreCase(ALTERLOCATION)) { <END> isChangingLocation = true; } } if (isChangingLocation && tbl.getTableType().equalsIgnoreCase(TableType.MANAGED_TABLE.name())) { throw new InvalidOperationException("Cannot change location of a managed table " + TableName.getQualified(tbl.getCatName(), tbl.getDbName(), tbl.getTableName()) + " as it is enabled for replication."); } }</code><technical_language>add " && tbl.getTableType().equalsIgnoreCase(TableType.MANAGED_TABLE.name() . " throw exception</technical_language>

Target:
private void blockPartitionLocationChangesOnReplSource(Database db, Table tbl, EnvironmentContext ec) throws InvalidOperationException { if (!ReplChangeManager.isSourceOfReplication(db)) { return; } if (ec.isSetProperties()) { String alterType = ec.getProperties().get(ALTER_TABLE_OPERATION_TYPE); if (alterType != null && alterType.equalsIgnoreCase(ALTERLOCATION) && tbl.getTableType().equalsIgnoreCase(TableType.MANAGED_TABLE.name())) { throw new InvalidOperationException("Cannot change location of a managed table " + TableName.getQualified(tbl.getCatName(), tbl.getDbName(), tbl.getTableName()) + " as it is enabled for replication."); } } }
Source:
<code>protected void drawBackground(final float f, final int mouseX, final int mouseY) { super.drawBackground(f, mouseX, mouseY); final Layer layer = Layer.BACKGROUND; <START> drawString("IN", 100, 43, 4210752, layer); <END> drawSlot(100, 53, layer); drawString("OUT", 140, 43, 4210752, layer); drawSlot(140, 53, layer); }</code><technical_language>Translation well</technical_language>

Target:
protected void drawBackground(final float f, final int mouseX, final int mouseY) { super.drawBackground(f, mouseX, mouseY); final Layer layer = Layer.BACKGROUND; drawString(StringUtils.t("gui.techreborn.unit.in"), 100, 43, 4210752, layer); drawSlot(100, 53, layer); drawString(StringUtils.t("gui.techreborn.unit.out"), 140, 43, 4210752, layer); drawSlot(140, 53, layer); }
Source:
<code>public DbUser(DirectoryUser directoryUser) { externalId = directoryUser.getId(); domain = directoryUser.getDirectoryName(); namespace = directoryUser.getNamespace(); loginName = directoryUser.getPrincipal() != null ? directoryUser.getPrincipal() : directoryUser.getName(); this.setFirstName(directoryUser.getFirstName()); this.setLastName(lastName = directoryUser.getLastName()); this.setDepartment(directoryUser.getDepartment()); email = directoryUser.getEmail(); note = ""; groupNames = new HashSet<>(); for (DirectoryGroup directoryGroup : directoryUser.getGroups()) { groupNames.add(directoryGroup.getName()); } <START> userOptions = emptyMap(); <END> }</code><technical_language>Please Collections.emptyMap(), static import code readable</technical_language>

Target:
public DbUser(DirectoryUser directoryUser) { externalId = directoryUser.getId(); domain = directoryUser.getDirectoryName(); namespace = directoryUser.getNamespace(); loginName = directoryUser.getPrincipal() != null ? directoryUser.getPrincipal() : directoryUser.getName(); this.setFirstName(directoryUser.getFirstName()); this.setLastName(lastName = directoryUser.getLastName()); this.setDepartment(directoryUser.getDepartment()); email = directoryUser.getEmail(); note = ""; groupNames = new HashSet<>(); for (DirectoryGroup directoryGroup : directoryUser.getGroups()) { groupNames.add(directoryGroup.getName()); } userOptions = Collections.emptyMap(); }
Source:
<code>public void getConceptByNameOrIdOrMap_shouldFindAConceptByItsConceptName() { String conceptName = "COUGH SYRUP"; <START> Assert.assertEquals("3", conceptService.getConceptByNameOrIdOrMap(conceptName).getConceptId().toString()); <END> }</code><technical_language>i worried of 3 here,did set a conceptId for COUGH SYRUP</technical_language>

Target:
public void getConceptByNameOrIdOrMap_shouldFindAConceptByItsConceptName() { String conceptName = "COUGH SYRUP"; Assert.assertEquals("3", conceptService.getConceptByReference(conceptName).getConceptId().toString()); }
Source:
<code>public static JSONArray walkToJSON(FormEntryModel fem, FormEntryController fec) { try { JSONArray ret = new JSONArray(); FormIndex formIndex = FormIndex.createBeginningOfFormIndex(); Walker walker = new Walker(ret, formIndex, fec, fem); walker.walk(); return ret; } catch (Exception e) { e.printStackTrace(); <START> return null; <END> } }</code><technical_language>tons of wrong in this call, returning null crash break other code, clear semantic meaning. need figure out failing is handled</technical_language>

Target:
public static JSONArray walkToJSON(FormEntryModel fem, FormEntryController fec) { JSONArray ret = new JSONArray(); FormIndex formIndex = FormIndex.createBeginningOfFormIndex(); Walker walker = new Walker(ret, formIndex, fec, fem); walker.walk(); return ret; }
Source:
<code>private Supplier<PartitionProcessor> getPartitionProcessorSupplier() { return () -> new PartitionProcessor() { @Override public Mono<Void> processEvent(PartitionEvent partitionEvent) { return processEvent.apply(partitionEvent); } @Override public Mono<Void> initialize(InitializationContext initializationContext) { if (initializePartition != null) { return initializePartition.apply(initializationContext); } return super.initialize(initializationContext); } @Override public void processError(ErrorContext errorContext) { if (processError != null) { processError.apply(errorContext); <START> return; <END> } super.processError(errorContext); } @Override public Mono<Void> close(CloseContext closeContext) { if (closePartition != null) { return closePartition.apply(closeContext); } return super.close(closeContext); } }; }</code><technical_language>nit: if else this easier read</technical_language>

Target:
private Supplier<PartitionProcessor> getPartitionProcessorSupplier() { return () -> new PartitionProcessor() { @Override public Mono<Void> processEvent(PartitionEvent partitionEvent) { return processEvent.apply(partitionEvent); } @Override public Mono<Void> initialize(InitializationContext initializationContext) { if (initializePartition != null) { return initializePartition.apply(initializationContext); } return super.initialize(initializationContext); } @Override public void processError(EventProcessingErrorContext eventProcessingErrorContext) { if (processError != null) { processError.apply(eventProcessingErrorContext); } else { super.processError(eventProcessingErrorContext); } } @Override public Mono<Void> close(CloseContext closeContext) { if (closePartition != null) { return closePartition.apply(closeContext); } return super.close(closeContext); } }; }
Source:
<code>public void requestWhenPortMapperTwiceInvokedThenDoesNotOverride() throws Exception { this.spring.register(InvokeTwiceDoesNotOverride.class).autowire(); <START> MvcResult result = this.mockMvc.perform(get("http://localhost:543")).andReturn(); <END> assertThat(result.getResponse().getHeader("Location")).isEqualTo("https://localhost:123"); }</code><technical_language>simplified java this.mockMvc.perform(get("http://localhost:543")) .andExpect(redirectedUrl("https://localhost:123"));</technical_language>

Target:
public void requestWhenPortMapperTwiceInvokedThenDoesNotOverride() throws Exception { this.spring.register(InvokeTwiceDoesNotOverride.class).autowire(); this.mockMvc.perform(get("http://localhost:543")) .andExpect(redirectedUrl("https://localhost:123")); }
Source:
<code>public static void smite(final Player player) { TFM_Util.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); player.getInventory().clear(); final Location targetPos = player.getLocation(); final World world = player.getWorld(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(world, targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); world.strikeLightning(strike_pos); } } player.setHealth(0.0); <START> player.sendMessage("You were smited by:" + sender.getName()); <END> }</code><technical_language>necessary. Please remove it</technical_language>

Target:
public static void smite(final Player player) { TFM_Util.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); player.getInventory().clear(); final Location targetPos = player.getLocation(); final World world = player.getWorld(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(world, targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); world.strikeLightning(strike_pos); } } player.setHealth(0.0); }
Source:
<code>public AbstractStringAssert<?> asHexString() { objects.assertNotNull(info, actual); <START> return Assertions.assertThat(Hexadecimals.toHexString(actual)); <END> }</code><technical_language>static imports</technical_language>

Target:
public AbstractStringAssert<?> asHexString() { objects.assertNotNull(info, actual); return Assertions.assertThat(toHexString(actual)); }
Source:
<code>public VisualEditorSaveChangesDialog clickPublishButton() { waitForElementNotPresent(saveButtonDisabled); waitForElementClickableByElement(savePageButton); <START> savePageButton.click(); <END> return new VisualEditorSaveChangesDialog(driver); }</code><technical_language>changed method name clickPublishButton rename button publishButton instead of savePageButton</technical_language>

Target:
public VisualEditorSaveChangesDialog clickPublishButton() { waitForElementNotPresent(publishButtonDisabled); waitForElementClickableByElement(publishPageButton); publishPageButton.click(); return new VisualEditorSaveChangesDialog(driver); }
Source:
<code><START> public static void showRateDialog(final Activity activity) { <END> final RateDialogFragment fragment = RateDialogFragment.newInstance(sIsShoWNeutralButton); fragment.show(activity.getFragmentManager(), TAG); }</code><technical_language>I want method accessor package private :eyes:</technical_language>

Target:
private static void showRateDialog(final Activity activity) { final RateDialogFragment fragment = RateDialogFragment.newInstance(sIsShoWNeutralButton); fragment.show(activity.getFragmentManager(), TAG); }
Source:
<code>public boolean equals(Object obj) { if (!(obj instanceof SetViewportToSizeOf)) return false; SetViewportToSizeOf other = (SetViewportToSizeOf) obj; <START> return getWidth() == other.getWidth() && getHeight() == other.getHeight(); <END> }</code><technical_language>This method converted a single (three-line) boolean statement</technical_language>

Target:
public boolean equals(Object obj) { if (!(obj instanceof SetViewportToSizeOf)) return false; SetViewportToSizeOf other = (SetViewportToSizeOf) obj; return getFbo().width() == other.getFbo().width() && getFbo().height() == other.getFbo().height(); }
Source:
<code>private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", vds.getHostName(), vds.getPort()); <START> vdsProxy = new VdsServerWrapper(vds.getHostName(), vds.getPort()); <END> }</code><technical_language>TransportFactory removed</technical_language>

Target:
private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", vds.getHostName(), vds.getPort()); int clientTimeOut = Config.<Integer> getValue(ConfigValues.vdsTimeout) * 1000; int connectionTimeOut = Config.<Integer> getValue(ConfigValues.vdsConnectionTimeout) * 1000; int heartbeat = Config.<Integer> getValue(ConfigValues.vdsHeartbeatInSeconds) * 1000; int clientRetries = Config.<Integer> getValue(ConfigValues.vdsRetries); vdsProxy = TransportFactory.createVdsServer( vds.getProtocol(), vds.getHostName(), vds.getPort(), clientTimeOut, connectionTimeOut, clientRetries, heartbeat); }
Source:
<code>private boolean createAndStartSupervisorInternal(SupervisorSpec spec, boolean persistSpec) { String id = spec.getId(); if (supervisors.containsKey(id)) { return false; } Supervisor supervisor = spec.createSupervisor(); supervisor.start(); if (persistSpec) { try { metadataSupervisorManager.insert(id, spec); } catch (Exception e) { <START> supervisor.stop(false); <END> Throwables.propagate(e); } } supervisors.put(id, Pair.of(supervisor, spec)); return true; }</code><technical_language>is gracefully true instead of false</technical_language>

Target:
private boolean createAndStartSupervisorInternal(SupervisorSpec spec, boolean persistSpec) { String id = spec.getId(); if (supervisors.containsKey(id)) { return false; } if (persistSpec) { metadataSupervisorManager.insert(id, spec); } Supervisor supervisor = null; try { supervisor = spec.createSupervisor(); supervisor.start(); } catch (Exception e) { if (persistSpec) { metadataSupervisorManager.insert(id, new NoopSupervisorSpec()); } Throwables.propagate(e); } supervisors.put(id, Pair.of(supervisor, spec)); return true; }
Source:
<code>private void getTestProcedureTraceability(BranchId testProcedureBranch) { Map<String, Artifact> testProcedureBranchReqsToReqsBranchMap = new HashMap<>(); List<Artifact> artifacts = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement, testProcedureBranch); if (artifacts != null) { ViewIdUtility.removeExcludedArtifacts(artifacts.iterator(), excludedArtifactIdMap); <START> } if (artifacts != null) { <END> for (Artifact tpRequirement : artifacts) { testProcedureBranchReqsToReqsBranchMap.put(tpRequirement.getName(), tpRequirement); } } Set<String> testProceduresFilter = getAllowedTestProcedures(); for (Entry<String, Artifact> entry : testProcedureBranchReqsToReqsBranchMap.entrySet()) { Artifact requirement = entry.getValue(); Set<Artifact> foundProcedures = new HashSet<Artifact>(requirement.getRelatedArtifacts(CoreRelationTypes.Validation__Validator)); ViewIdUtility.removeExcludedArtifacts(foundProcedures.iterator(), excludedArtifactIdMap); Set<Artifact> toAdd = new HashSet<>(); if (testProceduresFilter.isEmpty() != true) { for (Artifact artifact : foundProcedures) { if (testProceduresFilter.contains(artifact.getName())) { toAdd.add(artifact); } } } else { toAdd = foundProcedures; } requirementNameToTestProcedures.put(entry.getKey(), toAdd); for (Artifact artifact : toAdd) { this.testProcedures.put(artifact.getName(), artifact); } } }</code><technical_language>lines removed</technical_language>

Target:
private void getTestProcedureTraceability(BranchId testProcedureBranch) { Map<String, Artifact> testProcedureBranchReqsToReqsBranchMap = new HashMap<>(); List<Artifact> artifacts = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement, testProcedureBranch); if (artifacts != null) { ViewIdUtility.removeExcludedArtifacts(artifacts.iterator(), excludedArtifactIdMap); for (Artifact tpRequirement : artifacts) { testProcedureBranchReqsToReqsBranchMap.put(tpRequirement.getName(), tpRequirement); } } Set<String> testProceduresFilter = getAllowedTestProcedures(); for (Entry<String, Artifact> entry : testProcedureBranchReqsToReqsBranchMap.entrySet()) { Artifact requirement = entry.getValue(); Set<Artifact> foundProcedures = new HashSet<Artifact>(requirement.getRelatedArtifacts(CoreRelationTypes.Validation__Validator)); ViewIdUtility.removeExcludedArtifacts(foundProcedures.iterator(), excludedArtifactIdMap); Set<Artifact> toAdd = new HashSet<>(); if (testProceduresFilter.isEmpty() != true) { for (Artifact artifact : foundProcedures) { if (testProceduresFilter.contains(artifact.getName())) { toAdd.add(artifact); } } } else { toAdd = foundProcedures; } requirementNameToTestProcedures.put(entry.getKey(), toAdd); for (Artifact artifact : toAdd) { this.testProcedures.put(artifact.getName(), artifact); } } }
Source:
<code>public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.getDimension()) { case -1: break; case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); break; case 1: break; <START> } <END> }</code><technical_language>able configure generation in other worlds, too... Basalt in nether</technical_language>

Target:
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.getDimension()) { case -1: generateNether(world, random, chunkX * 16, chunkZ * 16); break; case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); break; case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); break; } }
Source:
<code>public void testGetStrippedVdsUniqueIdOnlyAllowrdChars() { RegisterVdsParameters paramsMock = getQueryParameters(); when(paramsMock.getVdsUniqueId()).thenReturn("Test_123"); String result = getQuery().getStrippedVdsUniqueId(); <START> assertEquals("Test_123", result); <END> }</code><technical_language>Please add assertion message asserEquals() call</technical_language>

Target:
public void testGetStrippedVdsUniqueIdOnlyAllowrdChars() { RegisterVdsParameters paramsMock = getQueryParameters(); when(paramsMock.getVdsUniqueId()).thenReturn("Test_123"); String result = getQuery().getStrippedVdsUniqueId(); assertEquals("Vds id doesn't equal to the expected value", "Test_123", result); }
Source:
<code><START> public void registerOutput(IAnalysisOutput output) { <END> fOutputs.add(output); }</code><technical_language>output added times. Do need prevent that</technical_language>

Target:
public void registerOutput(IAnalysisOutput output) { if (!fOutputs.contains(output)) { fOutputs.add(output); } }
Source:
<code>public default IVariableBinding[] getSyntheticOuterLocals() { return <START> null; <END> }</code><technical_language>THis return empty array</technical_language>

Target:
public default IVariableBinding[] getSyntheticOuterLocals() { return new IVariableBinding[0]; }
Source:
<code><START> public void fetchImageServingUrl() { <END> try { RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, uploader.getBaseUrl() + "/image_url"); requestBuilder.sendRequest(null, new RequestCallback() { @Override public void onResponseReceived(Request request, Response response) { servingUrl = response.getText(); setStateAfterUpload(); } @Override public void onError(Request request, Throwable exception) { Log.error("Failed to fetch image serving url. ", exception); setStateAfterUpload(); } }); } catch (Exception e) { Log.error("Failed to send request for fetching serving url. ", e); setStateAfterUpload(); } }</code><technical_language>Is neccessary fetch serving url, set <img> src end point, end point respond 303 other</technical_language>

Target:
public void fetchImageServingUrl() { try { RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, uploader.getBaseUrl() + "/imageUrl"); requestBuilder.sendRequest(null, new RequestCallback() { @Override public void onResponseReceived(Request request, Response response) { if (response.getStatusCode() == Http.Status.OK.getCode()) { servingUrl = response.getText(); setState(State.LOADED); } else { setState(State.FAILED); } } @Override public void onError(Request request, Throwable exception) { Log.error("Failed to fetch image serving url. ", exception); setState(State.FAILED); } }); } catch (Exception e) { Log.error("Failed to send request for fetching serving url. ", e); setState(State.FAILED); } }
Source:
<code>public int read() throws IOException { if(isClosed) { return -1; } while(true) { <START> synchronized(currentBB) { <END> if(currentBB.remaining() > 0) { return currentBB.get() & MergedByteBuffers.UNSIGNED_BYTE_MASK; } else { if(c.getReadBufferSize() > 0) { currentBB.add(c.getRead()); } else if(isClosed) { return -1; } else { try { currentBB.wait(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); ExceptionUtils.handleException(e); } } } } } }</code><technical_language>synchronized while loop prevent releasing immediately re-acquiring lock loop</technical_language>

Target:
public int read() throws IOException { if(isClosed) { return -1; } synchronized(currentBB) { while(true) { if(currentBB.remaining() > 0) { return currentBB.get() & MergedByteBuffers.UNSIGNED_BYTE_MASK; } else { if(c.getReadBufferSize() > 0) { currentBB.add(c.getRead()); } else if(isClosed) { return -1; } else { try { currentBB.wait(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); ExceptionUtils.handleException(e); } } } } } }
Source:
<code>public long getPeriod() { <START> return timeUnit.convert(nsPeriod, TimeUnit.NANOSECONDS); <END> }</code><technical_language>matter, check if this behaviour change impact? (The units account originally, checkPeriod passed in construction passed out unchanged considering timeUnit...while converted nanos timeUnit)</technical_language>

Target:
public long getPeriod() { return period; }
Source:
<code>public static boolean isMarkdownEnabled(){ <START> return doesPropertyMatch(MARKDOWN_ENABLED, BuildConfig.DEBUG ? CommCarePreferences.YES : CommCarePreferences.NO, CommCarePreferences.YES); <END> }</code><technical_language>want markdown for debug builds default. reason CSS</technical_language>

Target:
public static boolean isMarkdownEnabled(){ return doesPropertyMatch(MARKDOWN_ENABLED, CommCarePreferences.NO, CommCarePreferences.YES); }
Source:
<code>public PushTagsPage(Repository repository, Collection<String> tagNamesToSelect) { super(UIText.PushTagsPage_PageName); setTitle(UIText.PushTagsPage_PageTitle); setMessage(UIText.PushTagsPage_PageMessage); this.repository = repository; for (String tagName : tagNamesToSelect) { <START> if (tagName.startsWith(Constants.R_TAGS)) { <END> tagRefNamesToSelect.add(tagName); } else { tagRefNamesToSelect.add(Constants.R_TAGS + tagName); } } }</code><technical_language>style nit: braces</technical_language>

Target:
public PushTagsPage(Repository repository, Collection<String> tagNamesToSelect) { super(UIText.PushTagsPage_PageName); setTitle(UIText.PushTagsPage_PageTitle); setMessage(UIText.PushTagsPage_PageMessage); this.repository = repository; for (String tagName : tagNamesToSelect) { if (tagName.startsWith(Constants.R_TAGS)) tagRefNamesToSelect.add(tagName); else tagRefNamesToSelect.add(Constants.R_TAGS + tagName); } }
Source:
<code><START> public static ByteBuf createTaggingContent(ByteBufAllocator allocator, Collection<String> tags) { <END> CompositeByteBuf taggingContent = allocator.compositeBuffer(); tags.stream() .map(tag -> tag.getBytes(StandardCharsets.UTF_8)) .filter(bytes -> bytes.length > 0 && bytes.length < TAG_LENGTH_MAX) .forEach( bytes -> { int capacity = bytes.length + 1; ByteBuf tagByteBuf = allocator.buffer(capacity); tagByteBuf.writeByte(bytes.length); tagByteBuf.writeBytes(bytes); taggingContent.addComponent(true, tagByteBuf); }); return taggingContent; }</code><technical_language>this is 225k+ ops/sec faster java CompositeByteBuf taggingContent = allocator.compositeBuffer(); for (String key : tags) { int length = ByteBufUtil.utf8Bytes(key); if (length > TAG_LENGTH_MAX) { continue; } ByteBuf byteBuf = allocator.buffer().writeByte(length); byteBuf.writeCharSequence(key, StandardCharsets.UTF_8); taggingContent.addComponent(true, byteBuf); } return taggingContent; _Original_ TaggingMetadataFlyweightPerf.benchmarkEncode thrpt 10 678914.817 +- 3637.060 ops/s _Suggestion_ TaggingMetadataFlyweightPerf.benchmarkEncode thrpt 10 903925.613 +- 13036.852 ops/s</technical_language>

Target:
public static ByteBuf createTaggingContent(ByteBufAllocator allocator, Collection<String> tags) { CompositeByteBuf taggingContent = allocator.compositeBuffer(); for (String key : tags) { int length = ByteBufUtil.utf8Bytes(key); if (length == 0 || length > TAG_LENGTH_MAX) { continue; } ByteBuf byteBuf = allocator.buffer().writeByte(length); byteBuf.writeCharSequence(key, StandardCharsets.UTF_8); taggingContent.addComponent(true, byteBuf); } return taggingContent; }
Source:
<code>private Task<? extends Serializable> alterDbTask(Database dbObj) { <START> return alterDbTask(dbObj.getName(), updateDbProps(dbObj, context.dumpDirectory, false), <END> context.hiveConf); }</code><technical_language>Alter case need set it. If is bootstrapping empty Db. remove flag set true always</technical_language>

Target:
private Task<? extends Serializable> alterDbTask(Database dbObj) { return alterDbTask(dbObj.getName(), updateDbProps(dbObj, context.dumpDirectory, !isTableLevelLoad), context.hiveConf); }
Source:
<code>public boolean runCheck() { BukkitTagContext tagContext = new BukkitTagContext(null, null, null, false, null); tagContext.contextSource = source; <START> ObjectTag object = TagManager.tagObject(tag , tagContext); <END> return object.asType(ElementTag.class, tagContext).asBoolean(); }</code><technical_language>extra space this line</technical_language>

Target:
public boolean runCheck() { TagContext tagContext = CoreUtilities.noDebugContext.clone(); tagContext.contextSource = source; ObjectTag object = TagManager.tagObject(tag, tagContext); return object.asType(ElementTag.class, tagContext).asBoolean(); }
Source:
<code>public void addRows(Iterable<InputRow> rows) throws InterruptedException { for (final InputRow row : rows) { boolean added = false; while (!closed && !added) { added = buffer.offer(row, 500, TimeUnit.MILLISECONDS); if (!added) { <START> long currTime = System.currentTimeMillis(); <END> if (currTime - lastBufferAddFailMsgTime.get() > 10000) { lastBufferAddFailMsgTime.set(currTime); log.warn("Failed to add event to buffer with current size [%s] . Retrying...", buffer.size()); } } } if (!added) { throw new IllegalStateException("Cannot add events to closed firehose!"); } } }</code><technical_language>minor race here, as: java long lastTime = lastBufferAddFailMsgTime.get(); if (currTime - lastTime > 10000 && lastBufferAddFailMsgTime.compareAndSet(lastTime, currTime)) { log.warn("Failed add event buffer current size [%s] . Retrying...", buffer.size()); }</technical_language>

Target:
public void addRows(Iterable<InputRow> rows) throws InterruptedException { for (final InputRow row : rows) { boolean added = false; while (!closed && !added) { added = buffer.offer(row, 500, TimeUnit.MILLISECONDS); if (!added) { long currTime = System.currentTimeMillis(); long lastTime = lastBufferAddFailMsgTime.get(); if (currTime - lastTime > 10000 && lastBufferAddFailMsgTime.compareAndSet(lastTime, currTime)) { log.warn("Failed to add event to buffer with current size [%s] . Retrying...", buffer.size()); } } } if (!added) { throw new IllegalStateException("Cannot add events to closed firehose!"); } } }
Source:
<code>public List<URL> findAllRepositories() { for (StreamService ss : streams) { return ss.findAllRepositories(); } <START> return null; <END> }</code><technical_language>if this returned empty list instead of null if repositories exist. applies for other methods well</technical_language>

Target:
public List<URL> findAllRepositories() { checkStreamServiceExists(); List<URL> urls=new ArrayList<>(); for (StreamService ss : streams) { urls.addAll(ss.findAllRepositories()); } return urls; }
Source:
<code>private void validate() { <START> ArgChecker.inRangeInclusive(recoveryRate, 0d, 1d, "recovery rate must be between 0 and 1"); <END> }</code><technical_language>"recoveryRate", "recovery rate 0 1"</technical_language>

Target:
private void validate() { ArgChecker.inRangeInclusive(recoveryRate, 0d, 1d, "recoveryRate"); }
Source:
<code>void disconnect() { running = false; queryExecutor.shutdown(); try { if (!queryExecutor.awaitTermination(5, TimeUnit.SECONDS)) { logger.warn("Awaited Query Bus termination for 5 seconds. Wait period extended by 30 seconds."); } if (!queryExecutor.awaitTermination(20, TimeUnit.SECONDS)) { <START> logger.warn("Awaited Query Bus termination for 35 seconds. Will shutdown forcefully."); <END> queryExecutor.shutdownNow(); } } catch (InterruptedException e) { logger.warn("Awaiting termination of Query Bus got interrupted. Will shutdown immediately", e); queryExecutor.shutdownNow(); Thread.currentThread().interrupt(); } Optional.ofNullable(this.outboundStreamObserver).ifPresent(StreamObserver::onCompleted); }</code><technical_language>25 35</technical_language>

Target:
void disconnect() { if (outboundStreamObserver != null) { outboundStreamObserver.onCompleted(); } running = false; queryExecutor.shutdown(); try { if (!queryExecutor.awaitTermination(5, TimeUnit.SECONDS)) { logger.warn("Awaited Query Bus termination for 5 seconds. Wait period extended by 30 seconds."); } if (!queryExecutor.awaitTermination(30, TimeUnit.SECONDS)) { logger.warn("Awaited Query Bus termination for 35 seconds. Will shutdown forcefully."); queryExecutor.shutdownNow(); } } catch (InterruptedException e) { logger.warn("Awaiting termination of Query Bus got interrupted. Will shutdown immediately", e); queryExecutor.shutdownNow(); Thread.currentThread().interrupt(); } Optional.ofNullable(this.outboundStreamObserver).ifPresent(StreamObserver::onCompleted); }
Source:
<code>private void resetAdminPasswordIfNecessary() { if (config.getControllerProperties().getPropertyBoolean(PROP_CONTROLLER_ADMIN_PASSWORD_RESET)) { User admin = userRepository.findOneByUserId("admin"); if (admin == null) { <START> createUser("admin", "admin", ADMIN, "admin", "admin@nhn.com"); <END> } else { admin.setRole(ADMIN); admin.setPassword(passwordEncoder.encode("admin", "admin")); userRepository.saveAndFlush(admin); } } }</code><technical_language>change admin@nhn.com ngrinder-admin@naver.com</technical_language>

Target:
private void resetAdminPasswordIfNecessary() { if (config.getControllerProperties().getPropertyBoolean(PROP_CONTROLLER_ADMIN_PASSWORD_RESET)) { User admin = userRepository.findOneByUserId("admin"); if (admin == null) { createUser("admin", "admin", ADMIN, "admin", "ngrinder-admin@naver.com"); } else { admin.setRole(ADMIN); admin.setPassword(passwordEncoder.encode("admin", "admin")); userRepository.saveAndFlush(admin); } } }
Source:
<code>public AcknowledgementType auditLog(LogEventRequestType request, AssertionType assertion) { AcknowledgementType result = new AcknowledgementType(); if (request.getAuditMessage() == null) { LOG.error("Audit Request Message is null."); return result; } try { String url = oProxyHelper.getUrlLocalHomeCommunity(NhincConstants.AUDIT_REPO_SERVICE_NAME); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<AuditRepositoryManagerPortType> portDescriptor = new AuditRepositoryUnsecuredServicePortDescriptor(); CONNECTClient<AuditRepositoryManagerPortType> client = CONNECTCXFClientFactory.getInstance() .getCONNECTClientUnsecured(portDescriptor, url, assertion); result = (AcknowledgementType) client.invokePort(AuditRepositoryManagerPortType.class, invokeMethodName, request); } } catch (Exception e) { LOG.error("Failed to call the web service ({}). An unexpected exception occurred. Exception: {}", NhincConstants.AUDIT_REPO_SERVICE_NAME, e.getLocalizedMessage(), e); } LOG.debug("In AuditRepositoryProxyWebServiceUnsecuredImpl.auditLog(...) - completed called to " <START> + "ConnectionManager to retrieve endpoint."); <END> return result; }</code><technical_language>Optional: parameterized log if</technical_language>

Target:
public AcknowledgementType auditLog(LogEventRequestType request, AssertionType assertion) { AcknowledgementType result = new AcknowledgementType(); if (request.getAuditMessage() == null) { LOG.error("Audit Request Message is null."); return result; } try { String url = oProxyHelper.getUrlLocalHomeCommunity(NhincConstants.AUDIT_REPO_SERVICE_NAME); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<AuditRepositoryManagerPortType> portDescriptor = new AuditRepositoryUnsecuredServicePortDescriptor(); CONNECTClient<AuditRepositoryManagerPortType> client = CONNECTCXFClientFactory.getInstance() .getCONNECTClientUnsecured(portDescriptor, url, assertion); result = (AcknowledgementType) client.invokePort(AuditRepositoryManagerPortType.class, invokeMethodName, request); } } catch (Exception e) { LOG.error("Failed to call the web service ({}). An unexpected exception occurred. Exception: {}", NhincConstants.AUDIT_REPO_SERVICE_NAME, e.getLocalizedMessage(), e); } LOG.debug( "In AuditRepositoryProxyWebServiceUnsecuredImpl.auditLog(...) - completed called to ConnectionManager to retrieve endpoint."); return result; }
Source:
<code>public void testBug547691() throws Exception { String projectName = getUniqueString(); IWorkspace workspace = getWorkspace(); IProject project = workspace.getRoot().getProject(projectName); IProjectDescription projectDescription = workspace.newProjectDescription(projectName); project.create(projectDescription, null); project.open(null); FileSystemResourceManager manager = ((Workspace) getWorkspace()).getFileSystemManager(); URI location = manager.locationURIFor(project); assertNotNull("Expected location for accessible project to not be null", location); project.delete(true, null); location = manager.locationURIFor(project); <START> assertNotNull("Expected location for deleted project to not be null", location); <END> }</code><technical_language>check URI is returned earlier? assertEquals(location, manager.locationURIFor(project))</technical_language>

Target:
public void testBug547691() throws Exception { String projectName = getUniqueString(); IWorkspace workspace = getWorkspace(); IProject project = workspace.getRoot().getProject(projectName); IProjectDescription projectDescription = workspace.newProjectDescription(projectName); project.create(projectDescription, null); project.open(null); FileSystemResourceManager manager = ((Workspace) getWorkspace()).getFileSystemManager(); URI location = manager.locationURIFor(project); assertNotNull("Expected location for accessible project to not be null", location); project.delete(true, null); URI locationAfterDelete = manager.locationURIFor(project); assertEquals("Expected location of project to not change after delete", location, locationAfterDelete); }
Source:
<code>public BoxDto createBox(@RequestBody BoxDto box, UriComponentsBuilder uriBuilder, HttpServletResponse response) throws IOException { Box boxObj = Dtos.to(box); ValidationResult validation = new ValidationResult(); boxObj.setUse(boxService.getUse(box.getUseId())); <START> boxObj.setSize(boxService.getSize(box.getSizeId())); <END> boxObj.setStorageLocation(storageLocationService.getByBarcode(box.getStorageLocationBarcode())); validation.throwIfInvalid(); Long id = boxService.save(boxObj); return Dtos.asDto(boxService.get(id), false); }</code><technical_language>Service layer responsible for loading these. e.g. DefaultRunService#loadChildEntities. getUse getSize methods required DAO, Service</technical_language>

Target:
public BoxDto createBox(@RequestBody BoxDto box, UriComponentsBuilder uriBuilder, HttpServletResponse response) throws IOException { Box boxObj = Dtos.to(box); ValidationResult validation = new ValidationResult(); BoxUse use = new BoxUse(); BoxSize size = new BoxSize(); use.setId(box.getUseId()); size.setId(box.getSizeId()); boxObj.setUse(use); boxObj.setSize(size); boxObj.setStorageLocation(storageLocationService.getByBarcode(box.getStorageLocationBarcode())); validation.throwIfInvalid(); Long id = boxService.save(boxObj); return Dtos.asDto(boxService.get(id), false); }
Source:
<code>public void setUp() throws Exception { ProfileGenerator.RulesConfiguration rulesConfiguration = new ProfileGenerator.RulesConfiguration() .add("IllegalTabCheck", "markAll", "true") .add("XPathCheck", "expression", "count( .add("XPathCheck", "message", "Don't do that"); <START> Set<String> excludedRules = Collections.singleton("XmlSchemaCheck"); <END> File profile = ProfileGenerator.generateProfile(orchestrator.getServer().getUrl(), "xml", "xml", rulesConfiguration, excludedRules); orchestrator.getServer().restoreProfile(FileLocation.of(profile)); }</code><technical_language>removed</technical_language>

Target:
public void setUp() throws Exception { ProfileGenerator.RulesConfiguration rulesConfiguration = new ProfileGenerator.RulesConfiguration() .add("IllegalTabCheck", "markAll", "true"); File profile = ProfileGenerator.generateProfile(orchestrator.getServer().getUrl(), LANGUAGE, LANGUAGE, rulesConfiguration, Collections.emptySet()); orchestrator.getServer().restoreProfile(FileLocation.of(profile)); createTemplateRule("XPathCheck", "NumberDependencies", "expression=\"count(/project/dependencies/dependency)>0\";message=\"Don't do that, dammit!\""); }
Source:
<code>private void deleteMail(Account.Id id, final String mailAddress) throws UnloggedFailure { if (mailAddress.equals("ALL")) { ResultSet<AccountExternalId> ids; try { ids = db.accountExternalIds().byAccount(id); } catch (OrmException e) { <START> throw die("Could not query database: " + e.getMessage()); <END> } for (AccountExternalId extId : ids) { if (extId.getEmailAddress() != null) { unlink(id, extId.getEmailAddress()); } } } else { unlink(id, mailAddress); } }</code><technical_language>catch catch of other ormexceptions</technical_language>

Target:
private void deleteMail(Account.Id id, final String mailAddress) throws UnloggedFailure, OrmException { if (mailAddress.equals("ALL")) { ResultSet<AccountExternalId> ids = db.accountExternalIds().byAccount(id); for (AccountExternalId extId : ids) { if (extId.isScheme(AccountExternalId.SCHEME_MAILTO)) { unlink(id, extId.getEmailAddress()); } } } else { AccountExternalId.Key key = new AccountExternalId.Key( AccountExternalId.SCHEME_MAILTO, mailAddress); AccountExternalId extId = db.accountExternalIds().get(key); if (extId != null) { unlink(id, mailAddress); } } }
Source:
<code>public CreateBranchDialog(Shell parentShell, Repository repo) { super(parentShell, repo, SHOW_LOCAL_BRANCHES | SHOW_REMOTE_BRANCHES <START> | SHOW_TAGS | SHOW_REFERENCES); <END> }</code><technical_language>preselection added</technical_language>

Target:
public CreateBranchDialog(Shell parentShell, Repository repo) { super(parentShell, repo, SHOW_LOCAL_BRANCHES | SHOW_REMOTE_BRANCHES | SHOW_TAGS | SHOW_REFERENCES | SELECT_CURRENT_REF); }
Source:
<code>private void _openSession( String server, long hardTimeout, long softTimeout ) throws Exception { log.debug( String.format( "_openSession enter (%1$s, %2$d, %3$d)", server, hardTimeout, softTimeout ) ); try { if (this.client != null) { log.debug("_openSession already has client"); } else { this.client = new SSHClient(); this.client.setHardTimeout(hardTimeout); this.client.setSoftTimeout(softTimeout); this.client.setHost(server, this.port); log.debug("connecting"); this.client.connect(); } } catch(Exception e) { log.debug( String.format( "Could not connect to server %1$s: %2$s", this.client.getDisplayHost(), <START> e.getMessage() <END> ), e ); throw e; } log.debug("_openSession return"); }</code><technical_language>Thanks! Please remove ': %2$s', need for getMessage()</technical_language>

Target:
private void _openSession( String server, long hardTimeout, long softTimeout ) throws Exception { log.debug( String.format( "_openSession enter (%1$s, %2$d, %3$d)", server, hardTimeout, softTimeout ) ); try { if (this.client != null) { log.debug("_openSession already has client"); } else { this.client = new SSHClient(); this.client.setHardTimeout(hardTimeout); this.client.setSoftTimeout(softTimeout); this.client.setHost(server, this.port); log.debug("connecting"); this.client.connect(); } } catch(Exception e) { log.debug( String.format( "Could not connect to server %1$s", this.client.getDisplayHost(), ), e ); throw e; } log.debug("_openSession return"); }
Source:
<code>public Vector<T> drop(int n) { if (n <= 0) { return this; } else if (n >= length()) { return empty(); } <START> throw new UnsupportedOperationException(); <END> }</code><technical_language>I leave this PR open Vector is finished. master branch production ready code</technical_language>

Target:
public Vector<T> drop(int n) { if (n <= 0) { return this; } else if (n >= length()) { return empty(); } else { if (n < leadingLength()) { final int newLeadingOffset = leadingOffset + n; return normalized(type, leading, newLeadingOffset, middle, trailing, trailingLength); } else if (n < trailingStartIndex()) { final VectorTree<T> newMiddle = middle.drop(n - leadingLength()); return normalized(type, emptyArray(), 0, newMiddle, trailing, trailingLength); } else { final int from = n - trailingStartIndex(); final Object newTrailing = copyRange(trailing, from, trailingLength); return normalized(type, emptyArray(), 0, emptyTree(), newTrailing, trailingLength - from); } } }
Source:
<code><START> public void fetchSegmentToLocal(List<URI> uris, File dest) <END> throws Exception { if (uris == null) { throw new IllegalArgumentException("The input uri list is empty"); } Random r = new Random(); fetchSegmentToLocal(uris.get(r.nextInt(uris.size())), dest); }</code><technical_language>Nice. changing this apply retries backoff of uris random ? Sort of similar lines 68-77</technical_language>

Target:
public void fetchSegmentToLocal(List<URI> uris, File dest) throws Exception { if (uris == null) { throw new IllegalArgumentException("The input uri list is empty"); } Random r = new Random(); RetryPolicies.exponentialBackoffRetryPolicy(_retryCount, _retryWaitMs, _retryDelayScaleFactor).attempt(() -> { URI uri = uris.get(r.nextInt(uris.size())); try { fetchSegmentToLocalWithoutRetry(uri, dest); _logger.info("Fetched segment from: to: of size: {}", uri, dest, dest.length()); return true; } catch (Exception e) { _logger.warn("Caught exception while fetching segment from: to: {}", uri, dest, e); return false; } }); }
Source:
<code>private Pod getChePodByContainerId(String containerId) throws IOException { Map<String, String> podLabels = new HashMap<>(); String labelKey = CHE_CONTAINER_IDENTIFIER_LABEL_KEY; podLabels.put(labelKey, containerId.substring(0,12)); PodList pods = openShiftClient.pods() .inNamespace(this.cheOpenShiftProjectName) .withLabel(CHE_CONTAINER_IDENTIFIER_LABEL_KEY,containerId.substring(0,12)) .list(); <START> if (pods.getItems().size() == 0) { <END> LOG.error("An OpenShift Pod with label " + labelKey + "=" + containerId+" could not be found"); throw new IOException("An OpenShift Pod with label " + labelKey + "=" + containerId+" could not be found"); } if (pods.getItems().size() > 1) { LOG.error("There are " + pods.getItems().size() + " pod with label " + labelKey + "=" + containerId+" (just one was expeced)"); throw new IOException("There are " + pods.getItems().size() + " pod with label " + labelKey + "=" + containerId+" (just one was expeced)"); } return pods.getItems().get(0); }</code><technical_language>isEmpty()</technical_language>

Target:
private Pod getChePodByContainerId(String containerId) throws IOException { PodList pods = openShiftClient.pods() .inNamespace(this.openShiftCheProjectName) .withLabel(CHE_CONTAINER_IDENTIFIER_LABEL_KEY, getLabelFromContainerID(containerId)) .list(); List<Pod> items = pods.getItems(); if (items.isEmpty()) { LOG.error("An OpenShift Pod with label {}={} could not be found", CHE_CONTAINER_IDENTIFIER_LABEL_KEY, containerId); throw new IOException("An OpenShift Pod with label " + CHE_CONTAINER_IDENTIFIER_LABEL_KEY + "=" + containerId +" could not be found"); } if (items.size() > 1) { LOG.error("There are pod with label {}={} (just one was expeced)", items.size(), CHE_CONTAINER_IDENTIFIER_LABEL_KEY, containerId ); throw new IOException("There are " + items.size() + " pod with label " + CHE_CONTAINER_IDENTIFIER_LABEL_KEY + "=" + containerId + " (just one was expeced)"); } return items.get(0); }