auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public TracingP6SpyOptions(P6OptionsRepository optionsRepository) { <END> super(TracingP6SpyOptionsMBean.class, false); logLoadableOptions = new P6LogOptions(optionsRepository); this.optionsRepository = optionsRepository; }</code><technical_language>revert public here. note: please format files changed I notice some missing spaces around. if diff notice</technical_language>

Target:
TracingP6SpyOptions(P6OptionsRepository optionsRepository) { super(optionsRepository); logLoadableOptions = new P6LogOptions(optionsRepository); this.optionsRepository = optionsRepository; }
Source:
<code>public String toString() { <START> return "TerminalAroundInvokeInvocationContext [method=" + method + "]"; <END> }</code><technical_language>slight character: java return "TerminalAroundInvokeInvocationContext [method=" + method + ']';</technical_language>

Target:
public String toString() { return "TerminalAroundInvokeInvocationContext [method=" + method + ']'; }
Source:
<code>public void execute() { <START> moveRowUp(); <END> }</code><technical_language>delegating</technical_language>

Target:
public void execute() { final Setting setting = getActionContext().getSetting(); final EObject eObject = setting.getEObject(); final EStructuralFeature eStructuralFeature = setting.getEStructuralFeature(); final List<?> containments = (List<?>) eObject.eGet(eStructuralFeature, true); final List<?> moveUpList = Arrays.asList( ((IStructuredSelection) getTableViewer().getSelection()).toArray()); sortSelectionBasedOnIndex(moveUpList, containments); final EditingDomain editingDomain = getActionContext().getEditingDomain(); for (final Object moveUpObject : moveUpList) { final int currentIndex = containments.indexOf(moveUpObject); if (currentIndex <= 0) { return; } editingDomain.getCommandStack() .execute( new MoveCommand( editingDomain, eObject, eStructuralFeature, currentIndex, currentIndex - 1)); } }
Source:
<code>public void visitMethodInvocation(MethodInvocationTree tree) { MethodInvocationTreeImpl mit = (MethodInvocationTreeImpl) tree; <START> if((mit).isTypeSet()) { <END> return; } Tree methodSelect = tree.methodSelect(); Resolve.Env methodEnv = semanticModel.getEnv(tree); scan(tree.arguments()); scan(tree.typeArguments()); List<JavaType> argTypes = getParameterTypes(tree.arguments()); List<JavaType> typeParamTypes = Lists.newArrayList(); if(tree.typeArguments() != null ) { typeParamTypes = getParameterTypes(tree.typeArguments()); } Resolve.Resolution resolution = resolveMethodSymbol(methodSelect, methodEnv, argTypes, typeParamTypes); JavaSymbol symbol = resolution.symbol(); mit.setSymbol(symbol); if(resolution.type() != null && resolution.type().isTagged(JavaType.DEFERRED)) { ((DeferredType) resolution.type()).setTree(mit); } registerType(tree, resolution.type()); inferArgumentTypes(argTypes, symbol); }</code><technical_language>remove extra parentheses</technical_language>

Target:
public void visitMethodInvocation(MethodInvocationTree tree) { MethodInvocationTreeImpl mit = (MethodInvocationTreeImpl) tree; if(mit.isTypeSet()) { return; } Tree methodSelect = tree.methodSelect(); Resolve.Env methodEnv = semanticModel.getEnv(tree); scan(tree.arguments()); scan(tree.typeArguments()); List<JavaType> argTypes = getParameterTypes(tree.arguments()); List<JavaType> typeParamTypes = Lists.newArrayList(); if(tree.typeArguments() != null ) { typeParamTypes = getParameterTypes(tree.typeArguments()); } Resolve.Resolution resolution = resolveMethodSymbol(methodSelect, methodEnv, argTypes, typeParamTypes); JavaSymbol symbol = resolution.symbol(); mit.setSymbol(symbol); if(resolution.type() != null && resolution.type().isTagged(JavaType.DEFERRED)) { ((DeferredType) resolution.type()).setTree(mit); } registerType(tree, resolution.type()); inferArgumentTypes(argTypes, symbol); }
Source:
<code>private Translation returnLatestVersion(UUID languageId, UUID packageId) { Translation highestFoundVersionTranslation = null; List<Translation> translations = selectByLanguageIdPackageId(languageId, packageId); for(Translation translation : translations) <START> { <END> if(highestFoundVersionTranslation == null || translation.getVersionNumber().compareTo(highestFoundVersionTranslation.getVersionNumber()) > 0) { highestFoundVersionTranslation = translation; } } return highestFoundVersionTranslation; }</code><technical_language>this change</technical_language>

Target:
private Translation returnLatestVersion(UUID languageId, UUID packageId) { Translation highestFoundVersionTranslation = null; for(Translation translation : selectByLanguageIdPackageId(languageId, packageId)) { if(highestFoundVersionTranslation == null || translation.getVersionNumber().compareTo(highestFoundVersionTranslation.getVersionNumber()) > 0) { highestFoundVersionTranslation = translation; } } return highestFoundVersionTranslation; }
Source:
<code>public void <START> testIOOB2DQuery() <END> throws IndexOutOfBoundsException, TimeRangeException, StateSystemDisposedException { ITmfStateSystem ss = fStateSystem; assertNotNull(ss); Collection<Long> times = Collections.singleton(Long.valueOf(77)); int stringQuark = Integer.MAX_VALUE; ss.query2D(Collections.singleton(stringQuark), times); }</code><technical_language>if want test exception paths, also: test AttributeNotFoundException quarks out of ss range TimeRangeException for continuous queries</technical_language>

Target:
public void testIOOB2DQuery() throws IndexOutOfBoundsException, TimeRangeException, StateSystemDisposedException { ITmfStateSystem ss = fStateSystem; assertNotNull(ss); Collection<Long> times = Collections.singleton(77L); int stringQuark = Integer.MAX_VALUE; ss.query2D(Collections.singleton(stringQuark), times); }
Source:
<code><START> private String clip(final String src, final int point, final Character replacement, final boolean posStrand) { <END> final int len = src.length(); StringBuilder result = new StringBuilder(posStrand ? src.substring(0, point - 1) : src.substring(len - point + 1)); if (replacement != null) { if (posStrand) { for (int i = point; i <= len; i++) { result.append(replacement); } } else { for (int i = 0; i <= len - point; i++) { result.insert(0, replacement); } } } return result.toString(); }</code><technical_language>this static</technical_language>

Target:
private static String clip(final String src, final int point, final Character replacement, final boolean posStrand) { final int len = src.length(); StringBuilder result = new StringBuilder(posStrand ? src.substring(0, point - 1) : src.substring(len - point + 1)); if (replacement != null) { if (posStrand) { for (int i = point; i <= len; i++) { result.append(replacement); } } else { for (int i = 0; i <= len - point; i++) { result.insert(0, replacement); } } } return result.toString(); }
Source:
<code>private void fillTempFile(File file) throws IOException { file.createNewFile(); FileWriter fileWriter = new FileWriter(file); for (int i = 0; i < 10; i++) { fileWriter.write("Sample text " + i + System.getProperty("line.separator")); } fileWriter.close(); <START> } <END></code><technical_language>a _try-finally_ block ensure writer is closed of success error: java FileWriter writer = new FileWriter() try { ...fill data... } finally { writer.close(); }</technical_language>

Target:
private void fillTempFile(File file) throws IOException { file.createNewFile(); FileWriter fileWriter = new FileWriter(file); try { for (int i = 0; i < 10; i++) { fileWriter.write("Sample line of text"); fileWriter.write(System.getProperty("line.separator")); } } finally { fileWriter.close(); } }
Source:
<code>public QualifiedModuleName convertFromText(String value, Class<?> targetType, String optionContext) { int colonIndex = value.indexOf(':'); if (colonIndex == -1) { logger.warning("Incorrect syntax. Valid syntax is '<ModuleType>:<ModuleName>'."); logger.warning("For example, 'module info source:file' to get 'file' <source> module info."); throw new ShellException(); } <START> RESTModuleType moduleType = validateAndReturnModuleType(colonIndex, value); <END> QualifiedModuleName result = new QualifiedModuleName(value.substring(colonIndex + 1), moduleType); return result; }</code><technical_language>pass a single arg validateAndReturnModuleType(..), e.g.: validateAndReturnModuleType(value.substring(0, colonIndex));</technical_language>

Target:
public QualifiedModuleName convertFromText(String value, Class<?> targetType, String optionContext) { int colonIndex = value.indexOf(':'); if (colonIndex == -1) { logger.warning("Incorrect syntax. Valid syntax is '<ModuleType>:<ModuleName>'."); logger.warning("For example, 'module info source:file' to get 'file' <source> module info."); throw new ShellException(); } RESTModuleType moduleType = validateAndReturnModuleType(value.substring(0, colonIndex)); QualifiedModuleName result = new QualifiedModuleName(value.substring(colonIndex + 1), moduleType); return result; }
Source:
<code>private LegAmounts getNotional(SwapTrade input) { List<LegAmount> legAmounts = input.getProduct().getLegs().stream() .filter(RateCalculationSwapLeg.class::isInstance) .map(RateCalculationSwapLeg.class::cast) <START> .map(l -> getLegAmount(l)) <END> .collect(toList()); return LegAmounts.of(legAmounts); }</code><technical_language>l a variable name. Is is l 1</technical_language>

Target:
private LegAmounts getNotional(SwapTrade input) { List<LegAmount> legAmounts = input.getProduct().getLegs().stream() .filter(RateCalculationSwapLeg.class::isInstance) .map(RateCalculationSwapLeg.class::cast) .map(this::getLegAmount) .collect(toList()); return LegAmounts.of(legAmounts); }
Source:
<code>public void add(int value) { <START> addValueToBuffer(value); <END> nextDoc(); }</code><technical_language>Recommend inline 2 methods for readability (as existing code). Current is readable</technical_language>

Target:
public void add(int value) { _numberValueBuffer.put(_nextDocId, value); _docIdBuffer.put(_nextDocId, _nextDocId); _nextDocId++; }
Source:
<code>public static void setUp() throws Exception { String url = postgres.start(EmbeddedPostgres.cachedRuntimeConfig(Paths.get("target/postgres")), "localhost", SocketUtil.findFreePort(), "keycolumn", "postgres", "root", Collections.emptyList()); Configuration configuration = new Configuration(); Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource( "org.postgresql.Driver", url, null)); configuration.setEnvironment(environment); configuration.addMapper(InsertMapper.class); sqlSessionFactory = new SqlSessionFactoryBuilder().build(configuration); <START> SqlSession session = sqlSessionFactory.openSession(); <END> Connection conn = session.getConnection(); Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/usesjava8/keycolumn/CreateDB.sql"); ScriptRunner runner = new ScriptRunner(conn); runner.setLogWriter(null); runner.runScript(reader); conn.close(); reader.close(); session.close(); }</code><technical_language>I prefer try-with-resources follow: java try(SqlSession session = sqlSessionFactory.openSession(); Connection conn = session.getConnection(); Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/usesjava8/keycolumn/CreateDB.sql")) { ScriptRunner runner = new ScriptRunner(conn); runner.setLogWriter(null); runner.runScript(reader); }</technical_language>

Target:
public static void setUp() throws Exception { String url = postgres.start(EmbeddedPostgres.cachedRuntimeConfig(Paths.get("target/postgres")), "localhost", SocketUtil.findFreePort(), "keycolumn", "postgres", "root", Collections.emptyList()); Configuration configuration = new Configuration(); Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource( "org.postgresql.Driver", url, null)); configuration.setEnvironment(environment); configuration.addMapper(InsertMapper.class); sqlSessionFactory = new SqlSessionFactoryBuilder().build(configuration); try (SqlSession session = sqlSessionFactory.openSession(); Connection conn = session.getConnection(); Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/usesjava8/keycolumn/CreateDB.sql")) { ScriptRunner runner = new ScriptRunner(conn); runner.setLogWriter(null); runner.runScript(reader); } }
Source:
<code>public CompoundNBT write(CompoundNBT tag) { CompoundNBT fluid = new CompoundNBT(); tank.writeToNBT(fluid); <START> tag.put("tank", fluid); <END> return super.write(tag); }</code><technical_language>Move tag name Tags file in library. want avoid error prone string constants possible. good put in data gen well</technical_language>

Target:
public CompoundNBT write(CompoundNBT tag) { CompoundNBT fluid = new CompoundNBT(); tank.writeToNBT(fluid); tag.put(Tags.TANK, fluid); return super.write(tag); }
Source:
<code>public void serialize(XMLExtendedStreamWriter writer, RestStoreConfiguration configuration) throws XMLStreamException { AttributeSet attributes = configuration.attributes(); writer.writeStartElement(Element.REST_STORE); <START> attributes.write(writer, RestStoreConfiguration.KEY2STRING_MAPPER, Attribute.KEY_TO_STRING_MAPPER); <END> attributes.write(writer, RestStoreConfiguration.APPEND_CACHE_NAME_TO_PATH, Attribute.APPEND_CACHE_NAME_TO_PATH); attributes.write(writer, RestStoreConfiguration.PATH, Attribute.PATH); attributes.write(writer, RestStoreConfiguration.RAW_VALUES, Attribute.RAW_VALUES); writeCommonStoreSubAttributes(writer, configuration); writeServer(writer, configuration); writeConnectionPool(writer, configuration.connectionPool()); writeCommonStoreElements(writer, configuration); writer.writeEndElement(); }</code><technical_language>write attributes common store attributes written. If do attributes.write(writer);, configure HOSTand PORT auto-persist false</technical_language>

Target:
public void serialize(XMLExtendedStreamWriter writer, RestStoreConfiguration configuration) throws XMLStreamException { writer.writeStartElement(Element.REST_STORE); configuration.attributes().write(writer); writeCommonStoreSubAttributes(writer, configuration); writeServer(writer, configuration); writeConnectionPool(writer, configuration.connectionPool()); writeCommonStoreElements(writer, configuration); writer.writeEndElement(); }
Source:
<code>protected synchronized void trimToSize(int size) { Map.Entry<T, Y> last; final Iterator<Map.Entry<T, Y>> cacheIterator = cache.entrySet().iterator(); while (currentSize > size) { last = cacheIterator.next(); final Y toRemove = last.getValue(); currentSize -= getSize(toRemove); final T key = last.getKey(); cacheIterator.remove(); <START> onItemEvicted(key, toRemove); <END> } }</code><technical_language>is a chance of ConcurrentModificationException of this line</technical_language>

Target:
protected synchronized void trimToSize(int size) { Map.Entry<T, Y> last; Iterator<Map.Entry<T, Y>> cacheIterator; while (currentSize > size) { cacheIterator = cache.entrySet().iterator(); last = cacheIterator.next(); final Y toRemove = last.getValue(); currentSize -= getSize(toRemove); final T key = last.getKey(); cacheIterator.remove(); onItemEvicted(key, toRemove); } }
Source:
<code><START> public QueryV3Mapper queryV3Mapper() { <END> return new QueryV3Mapper(); }</code><technical_language>annotate QueryV3Mapper @Component instead</technical_language>

Target:
public QueryV3Mapper queryV3Mapper() { return new QueryV3Mapper(rsqlValueParser); }
Source:
<code>protected String addReferenceData() { <START> final boolean caseSensitive = (_caseSensitive != null && _caseSensitive.equals("on")); <END> final SynonymCatalog catalog = new TextFileSynonymCatalog(_name, _filePath, caseSensitive, _encoding); getReferenceDataDao().addSynonymCatalog(getWizardContext().getTenantContext(), catalog); return _name; }</code><technical_language>removed usages of org.w3c.com.Element class, import removed</technical_language>

Target:
protected String addReferenceData() { copyUploadedFileToReferenceDataDirectory(); final boolean caseSensitive = (_caseSensitive != null && _caseSensitive.equals("on")); final SynonymCatalog catalog = new TextFileSynonymCatalog(_name, _filePath, caseSensitive, _encoding); getReferenceDataDao().addSynonymCatalog(getWizardContext().getTenantContext(), catalog); return _name; }
Source:
<code>public void testCassandraHostWithoutPortFailsValidation() { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, "127.0.0.1"); BluefloodServiceStarterException ex = null; try { BluefloodServiceStarter.validateCassandraHosts(); } catch (BluefloodServiceStarterException e) { ex = e; } <START> assertNotNull(ex); <END> assertEquals(-1, ex.getStatus()); }</code><technical_language>@Test(expected = ...), above</technical_language>

Target:
public void testCassandraHostWithoutPortFailsValidation() { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, "127.0.0.1"); BluefloodServiceStarter.validateCassandraHosts(); }
Source:
<code>public InetAddressAndPort deserialize(DataInputPlus in, int version) throws IOException { int size = in.readByte() & 0xFF; switch(size) { case 4: case 16: { <START> byte[] bytes = new byte[size]; <END> in.readFully(bytes, 0, bytes.length); return InetAddressAndPort.getByAddress(bytes); } case 6: case 18: { byte[] bytes = new byte[size - 2]; in.readFully(bytes); int port = in.readShort() & 0xFFFF; return InetAddressAndPort.getByAddressOverrideDefaults(InetAddress.getByAddress(bytes), port); } default: throw new AssertionError("Unexpected size " + size); } }</code><technical_language>This allocation is unavoidable. construct InetAddress it</technical_language>

Target:
public InetAddressAndPort deserialize(DataInputPlus in, int version) throws IOException { int size = in.readByte() & 0xFF; switch(size) { case 4: case 16: { byte[] bytes = new byte[size]; in.readFully(bytes, 0, bytes.length); return InetAddressAndPort.getByAddress(bytes); } case 6: case 18: { byte[] bytes = new byte[size - 2]; in.readFully(bytes); int port = in.readShort() & 0xFFFF; return InetAddressAndPort.getByAddressOverrideDefaults(InetAddress.getByAddress(bytes), bytes, port); } default: throw new AssertionError("Unexpected size " + size); } }
Source:
<code>private IMethodBinding findMethodBindingInHierarchy(ITypeBinding currentTypeBinding, IMethod methodDeclaration) { IMethodBinding[] bindings= currentTypeBinding.getDeclaredMethods(); for (IMethodBinding binding : bindings) { if (methodDeclaration.equals(binding.getJavaElement())) { return binding; } } ITypeBinding superClass= currentTypeBinding.getSuperclass(); if (superClass != null) { IMethodBinding b= findMethodBindingInHierarchy(superClass, methodDeclaration); if (b != null) return b; } ITypeBinding[] interfaces= currentTypeBinding.getInterfaces(); for (ITypeBinding intf : interfaces) { <START> IMethodBinding b = findMethodBindingInHierarchy(intf, methodDeclaration); <END> if (b != null) return b; } return null; }</code><technical_language>fix =</technical_language>

Target:
private IMethodBinding findMethodBindingInHierarchy(ITypeBinding currentTypeBinding, IMethod methodDeclaration) { for (IMethodBinding binding : currentTypeBinding.getDeclaredMethods()) { if (methodDeclaration.equals(binding.getJavaElement())) { return binding; } } ITypeBinding superClass= currentTypeBinding.getSuperclass(); if (superClass != null) { IMethodBinding b= findMethodBindingInHierarchy(superClass, methodDeclaration); if (b != null) return b; } for (ITypeBinding intf : currentTypeBinding.getInterfaces()) { IMethodBinding b= findMethodBindingInHierarchy(intf, methodDeclaration); if (b != null) return b; } return null; }
Source:
<code>public void watchContainers(ContainerEventHandler handler) throws InfrastructureException { if (containerWatch == null) { <START> final Watcher<Event> watcher = <END> new Watcher<Event>() { @Override public void eventReceived(Action action, Event event) { ObjectReference involvedObject = event.getInvolvedObject(); String fieldPath = involvedObject.getFieldPath(); if (POD_OBJECT_KIND.equals(involvedObject.getKind()) && fieldPath != null) { Matcher containerFieldMatcher = CONTAINER_FIELD_PATH_PATTERN.matcher(fieldPath); if (containerFieldMatcher.matches()) { String containerName = containerFieldMatcher.group(CONTAINER_NAME_GROUP); String podName = Names.originalPodName(involvedObject.getName(), workspaceId); ContainerEvent containerEvent = new ContainerEvent( Names.machineName(containerName, podName), event.getMessage()); containerEventsHandlers.forEach(h -> h.handle(containerEvent)); } } } @Override public void onClose(KubernetesClientException ignored) }; try (OpenShiftClient client = clientFactory.create()) { containerWatch = client.events().inNamespace(namespace).watch(watcher); } catch (KubernetesClientException ex) { throw new InfrastructureException(ex.getMessage()); } } containerEventsHandlers.add(handler); }</code><technical_language>This class bigger. Consider moving some code a separate class, watching code</technical_language>

Target:
public void watchContainers(ContainerEventHandler handler) throws InfrastructureException { if (containerWatch == null) { final Watcher<Event> watcher = new Watcher<Event>() { @Override public void eventReceived(Action action, Event event) { ObjectReference involvedObject = event.getInvolvedObject(); String fieldPath = involvedObject.getFieldPath(); if (POD_OBJECT_KIND.equals(involvedObject.getKind()) && fieldPath != null) { Matcher containerFieldMatcher = CONTAINER_FIELD_PATH_PATTERN.matcher(fieldPath); if (containerFieldMatcher.matches()) { String containerName = containerFieldMatcher.group(CONTAINER_NAME_GROUP); String podName = Names.originalPodName(involvedObject.getName(), workspaceId); ContainerEvent containerEvent = new ContainerEvent( Names.machineName(podName, containerName), event.getMessage(), event.getMetadata().getCreationTimestamp()); containerEventsHandlers.forEach(h -> h.handle(containerEvent)); } } } @Override public void onClose(KubernetesClientException ignored) }; try (OpenShiftClient client = clientFactory.create()) { containerWatch = client.events().inNamespace(namespace).watch(watcher); } catch (KubernetesClientException ex) { throw new InfrastructureException(ex.getMessage()); } } containerEventsHandlers.add(handler); }
Source:
<code>static DefaultContainerDescription lookup(final ModelControllerClient client) throws IOException { final ModelNode op = Operations.createReadResourceOperation(new ModelNode().setEmptyList()); op.get(ClientConstants.INCLUDE_RUNTIME).set(true); final ModelNode result = client.execute(op); if (Operations.isSuccessfulOutcome(result)) { final ModelNode model = Operations.readResult(result); final String productName = getValue(model, "product-name", "WildFly"); final String productVersion = getValue(model, "product-version"); final String releaseVersion = getValue(model, "release-version"); final String launchType = getValue(model, "launch-type"); return new DefaultContainerDescription(productName, productVersion, releaseVersion, launchType, "DOMAIN".equalsIgnoreCase(launchType)); } else { <START> Logger.getLogger(DefaultContainerDescription.class).errorf("Failed to read the root resource: ", Operations.getFailureDescription(result)); <END> } return UNKNOWN; }</code><technical_language>I guess UNKNOWN useless in situations. throwing exception instead of returning UNKNOWN</technical_language>

Target:
static DefaultContainerDescription lookup(final ModelControllerClient client) throws IOException, OperationExecutionException { final ModelNode op = Operations.createReadResourceOperation(new ModelNode().setEmptyList()); op.get(ClientConstants.INCLUDE_RUNTIME).set(true); final ModelNode result = client.execute(op); if (Operations.isSuccessfulOutcome(result)) { final ModelNode model = Operations.readResult(result); final String productName = getValue(model, "product-name", "WildFly"); final String productVersion = getValue(model, "product-version"); final String releaseVersion = getValue(model, "release-version"); final String launchType = getValue(model, "launch-type"); return new DefaultContainerDescription(productName, productVersion, releaseVersion, launchType, "DOMAIN".equalsIgnoreCase(launchType)); } throw new OperationExecutionException(op, result); }
Source:
<code>public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getIndexUpsertRuntime( IDataSourceIndex<String, String> dataSourceIndex, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IVariableTypeEnvironment typeEnv, List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys, List<LogicalVariable> additionalFilteringKeys, ILogicalExpression filterExpr, List<LogicalVariable> prevSecondaryKeys, LogicalVariable prevAdditionalFilteringKeys, RecordDescriptor inputDesc, JobGenContext context, JobSpecification spec) throws AlgebricksException { <START> return null; <END> }</code><technical_language>UnsupportedOperationException reasonable here</technical_language>

Target:
public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getIndexUpsertRuntime( IDataSourceIndex<String, String> dataSourceIndex, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IVariableTypeEnvironment typeEnv, List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys, List<LogicalVariable> additionalFilteringKeys, ILogicalExpression filterExpr, List<LogicalVariable> prevSecondaryKeys, LogicalVariable prevAdditionalFilteringKeys, RecordDescriptor inputDesc, JobGenContext context, JobSpecification spec) throws AlgebricksException { throw new UnsupportedOperationException(); }
Source:
<code>public Mono<String> getToken(String... scopes) { String scope = scopes[0]; String resource = scope.substring(0, scope.lastIndexOf('.')); <START> return getTokenFromUri(resource).map(token -> SCHEME + token); <END> }</code><technical_language>This method takes a varargs of String. zero elements in this varargs, bounds-check run exception line 88. curious if is information thrown if multiple scopes provided</technical_language>

Target:
public Mono<AccessToken> getToken(String... scopes) { String resource = ScopeUtil.scopesToResource(scopes); return getTokenFromUri(resource); }
Source:
<code>public final void taskAction() throws IOException { org.gradle.api.plugins.internal.DefaultJavaPluginConvention convention = (org.gradle.api.plugins.internal.DefaultJavaPluginConvention) getProject().getConvention().getPlugin(JavaPluginConvention.class); if (convention.getRawSourceCompatibility() != null) { return; } if (shouldFix.get()) { Files.write( getProject().getBuildFile().toPath(), <START> Collections.singletonList(String.format("%nsourceCompatibility = %s", JavaVersion.current())), <END> StandardCharsets.UTF_8, StandardOpenOption.APPEND, StandardOpenOption.CREATE); return; } throw new GradleException(String.format( "%s must set sourceCompatibility explicitly in '%s', " + "otherwise compilation will not be reproducible but instead depends on the Java version " + "that Gradle is currently running with (%s). To auto-fix, run%n" + "%n" + " ./gradlew %s --fix%n" + "%n" + "This will automatically add a suggested line " + "(you may need to adjust the number, e.g. to '1.8' for maximum compatibility).", getProject(), getProject().getRootProject().relativePath(getProject().getBuildFile()), JavaVersion.current(), getPath())); }</code><technical_language>this add a trailing newline end of file? suggestion Collections.singletonList(String.format("%nsourceCompatibility = %s%n", JavaVersion.current())),</technical_language>

Target:
public final void taskAction() throws IOException { org.gradle.api.plugins.internal.DefaultJavaPluginConvention convention = (org.gradle.api.plugins.internal.DefaultJavaPluginConvention) getProject().getConvention().getPlugin(JavaPluginConvention.class); if (convention.getRawSourceCompatibility() != null) { return; } if (shouldFix.get()) { Files.write( getProject().getBuildFile().toPath(), Collections.singletonList(String.format("%nsourceCompatibility = %s%n", JavaVersion.current())), StandardCharsets.UTF_8, StandardOpenOption.APPEND, StandardOpenOption.CREATE); return; } throw new GradleException(String.format( "%s must set sourceCompatibility explicitly in '%s', " + "otherwise compilation will not be reproducible but instead depends on the Java version " + "that Gradle is currently running with (%s). To auto-fix, run%n" + "%n" + " ./gradlew %s --fix%n" + "%n" + "This will automatically add a suggested line " + "(you may need to adjust the number, e.g. to '1.8' for maximum compatibility).", getProject(), getProject().getRootProject().relativePath(getProject().getBuildFile()), JavaVersion.current(), getPath())); }
Source:
<code>public void includeDeletedFlagWorks() throws Exception { int initialCountWithoutDeleted = surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, false).size(); int initialCountWithDeleted = surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, true).size(); Survey survey1 = createSurvey(new TestSurvey(DynamoSurveyDaoTest.class, true)); createSurvey(new TestSurvey(DynamoSurveyDaoTest.class, true)); surveyDao.deleteSurvey(survey1); assertEquals(1 + initialCountWithoutDeleted, surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, false).size()); <START> assertEquals(2 + initialCountWithDeleted, surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, true).size()); <END> surveyDao.deleteSurveyPermanently(survey1); assertEquals(1 + initialCountWithoutDeleted, surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, false).size()); assertEquals(1 + initialCountWithDeleted, surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, true).size()); }</code><technical_language>Instead of counts, verify list includes / include deleted survey? (Same for published version.)</technical_language>

Target:
public void includeDeletedFlagWorks() throws Exception { Survey survey1 = createSurvey(new TestSurvey(DynamoSurveyDaoTest.class, true)); createSurvey(new TestSurvey(DynamoSurveyDaoTest.class, true)); surveyDao.deleteSurvey(survey1); noneDeleted(surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, false), survey1.getGuid()); anyDeleted(surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, true), survey1.getGuid()); surveyDao.deleteSurveyPermanently(survey1); String guid = survey1.getGuid(); noneDeleted(surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, false), guid); noneDeleted(surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, true), guid); }
Source:
<code>protected boolean canDoAction() { final boolean wrongInput = getParameters() == null || getParameters().getId() == null || <START> getParameters().getId().equals(Guid.Empty); <END> if (!super.canDoAction() || wrongInput) { return false; } final MacPoolDAO macPoolDao = getDbFacade().getMacPoolDao(); final Guid macPoolId = getParameters().getId(); final MacPool macPool = macPoolDao.get(macPoolId); final int dcUsageCount = macPoolDao.getDCUsageCount(macPoolId); if (macPool == null) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_DOES_NOT_EXIST); return false; } final boolean canBeRemoved = macPool.canBeRemoved() && dcUsageCount == 0; if (!canBeRemoved) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_CANNOT_BE_REMOVED); return false; } else { return true; } }</code><technical_language>in add command, need for this here.</technical_language>

Target:
protected boolean canDoAction() { final boolean wrongInput = getParameters() == null || getParameters().getId() == null || getParameters().getId().equals(Guid.Empty); if (!super.canDoAction() || wrongInput) { return false; } final Guid macPoolId = getParameters().getId(); final MacPool macPool = getMacPoolDAO().get(macPoolId); final int dcUsageCount = getMacPoolDAO().getDCUsageCount(macPoolId); if (macPool == null) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_DOES_NOT_EXIST); return false; } final boolean canBeRemoved = macPool.canBeRemoved() && dcUsageCount == 0; if (!canBeRemoved) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_CANNOT_BE_REMOVED); return false; } else { return true; } }
Source:
<code>public void start() { if (stopping.getAsBoolean()) return; try { if (!started.compareAndSet(false, true)) return; tmpSnpDir = U.resolveWorkDirectory(tmpTaskWorkDir.getAbsolutePath(), relativeNodePath(cctx.kernalContext().pdsFolderResolver().resolveFolders()), false); snpSndr.init(); for (Integer grpId : parts.keySet()) { CacheGroupContext gctx = cctx.cache().cacheGroup(grpId); if (gctx == null) throw new IgniteCheckedException("Cache group context has not found. Cache group is stopped: " + grpId); if (!CU.isPersistentCache(gctx.config(), cctx.kernalContext().config().getDataStorageConfiguration())) throw new IgniteCheckedException("In-memory cache groups are not allowed to be snapshotted: " + grpId); if (gctx.config().isEncryptionEnabled()) <START> throw new IgniteCheckedException("Encrypted cache groups are note allowed to be snapshotted: " + grpId); <END> U.ensureDirectory(cacheWorkDir(tmpSnpDir, cacheDirName(gctx.config())), "directory for snapshotting cache group", log); } startedFut.listen(f -> ((GridCacheDatabaseSharedManager)cctx.database()).removeCheckpointListener(this) ); ((GridCacheDatabaseSharedManager)cctx.database()).addCheckpointListener(this); if (log.isInfoEnabled()) { log.info("Snapshot operation is scheduled on local node and will be handled by the checkpoint " + "listener [sctx=" + this + ", topVer=" + cctx.discovery().topologyVersionEx() + ']'); } } catch (IgniteCheckedException e) { acceptException(e); } }</code><technical_language>note -></technical_language>

Target:
public boolean start() { if (stopping()) return false; try { if (!started.compareAndSet(false, true)) return false; tmpSnpDir = U.resolveWorkDirectory(tmpTaskWorkDir.getAbsolutePath(), igniteCacheStoragePath(cctx.kernalContext().pdsFolderResolver().resolveFolders()), false); for (Integer grpId : parts.keySet()) { CacheGroupContext gctx = cctx.cache().cacheGroup(grpId); if (gctx == null) throw new IgniteCheckedException("Cache group context has not found. Cache group is stopped: " + grpId); if (!CU.isPersistentCache(gctx.config(), cctx.kernalContext().config().getDataStorageConfiguration())) throw new IgniteCheckedException("In-memory cache groups are not allowed to be snapshot: " + grpId); if (gctx.config().isEncryptionEnabled()) throw new IgniteCheckedException("Encrypted cache groups are not allowed to be snapshot: " + grpId); U.ensureDirectory(cacheWorkDir(tmpSnpDir, cacheDirName(gctx.config())), "directory for snapshotting cache group", log); } startedFut.listen(f -> ((GridCacheDatabaseSharedManager)cctx.database()).removeCheckpointListener(this) ); ((GridCacheDatabaseSharedManager)cctx.database()).addCheckpointListener(this); if (log.isInfoEnabled()) { log.info("Snapshot operation is scheduled on local node and will be handled by the checkpoint " + "listener [sctx=" + this + ", topVer=" + cctx.discovery().topologyVersionEx() + ']'); } } catch (IgniteCheckedException e) { acceptException(e); return false; } return true; }
Source:
<code>public static Bind parse(String serialized) { try { String[] parts = null; <START> if (SystemUtils.IS_OS_WINDOWS) { <END> parts = parseInternal(serialized); } else { parts = serialized.split(":"); } switch (parts.length) { case 2: { return new Bind(parts[0], new Volume(parts[1])); } case 3: { String[] flags = parts[2].split(","); AccessMode accessMode = AccessMode.DEFAULT; SELContext seMode = SELContext.DEFAULT; Boolean nocopy = null; PropagationMode propagationMode = PropagationMode.DEFAULT_MODE; for (String p : flags) { if (p.length() == 2) { accessMode = AccessMode.valueOf(p.toLowerCase()); } else if ("nocopy".equals(p)) { nocopy = true; } else if (PropagationMode.SHARED.toString().equals(p)) { propagationMode = PropagationMode.SHARED; } else if (PropagationMode.SLAVE.toString().equals(p)) { propagationMode = PropagationMode.SLAVE; } else if (PropagationMode.PRIVATE.toString().equals(p)) { propagationMode = PropagationMode.PRIVATE; } else { seMode = SELContext.fromString(p); } } return new Bind(parts[0], new Volume(parts[1]), accessMode, seMode, nocopy, propagationMode); } default: { throw new IllegalArgumentException(); } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'", e); } }</code><technical_language>Btw... work code is create in jvm (not windows) executed in other for windows image? Afair i this code 1:1 docker cli code windows specific cases</technical_language>

Target:
public static Bind parse(String serialized) { try { String[] parts = parseInternal(serialized); switch (parts.length) { case 2: { return new Bind(parts[0], new Volume(parts[1])); } case 3: { String[] flags = parts[2].split(","); AccessMode accessMode = AccessMode.DEFAULT; SELContext seMode = SELContext.DEFAULT; Boolean nocopy = null; PropagationMode propagationMode = PropagationMode.DEFAULT_MODE; for (String p : flags) { if (p.length() == 2) { accessMode = AccessMode.valueOf(p.toLowerCase()); } else if ("nocopy".equals(p)) { nocopy = true; } else if (PropagationMode.SHARED.toString().equals(p)) { propagationMode = PropagationMode.SHARED; } else if (PropagationMode.SLAVE.toString().equals(p)) { propagationMode = PropagationMode.SLAVE; } else if (PropagationMode.PRIVATE.toString().equals(p)) { propagationMode = PropagationMode.PRIVATE; } else { seMode = SELContext.fromString(p); } } return new Bind(parts[0], new Volume(parts[1]), accessMode, seMode, nocopy, propagationMode); } default: { throw new IllegalArgumentException(); } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'", e); } }
Source:
<code>public void testBindByPools() throws Exception { <START> <END> PoolIdAndQuantity[] pools = new PoolIdAndQuantity[2]; pools[0] = new PoolIdAndQuantity("first", 1); pools[1] = new PoolIdAndQuantity("second", 2); ConsumerCurator cc = mock(ConsumerCurator.class); SubscriptionServiceAdapter sa = mock(SubscriptionServiceAdapter.class); PoolManager pm = mock(PoolManager.class); Owner owner = TestUtil.createOwner(); Consumer consumer = TestUtil.createConsumer(owner); when(cc.verifyAndLookupConsumerWithEntitlements(eq("fakeConsumer"))).thenReturn( consumer); when(sa.hasUnacceptedSubscriptionTerms(any(Owner.class))).thenReturn(false); ConsumerResource cr = new ConsumerResource(cc, null, null, sa, null, null, null, i18n, null, null, null, null, null, null, pm, null, null, null, null, null, null, null, null, new CandlepinCommonTestConfig(), null, null, null, consumerBindUtil); Response rsp = cr.bind("fakeConsumer", null, null, null, null, null, true, null, null, pools, new TrustedUserPrincipal("TaylorSwift")); JobDetail detail = (JobDetail) rsp.getEntity(); PoolIdAndQuantity[] pQs = (PoolIdAndQuantity[]) detail.getJobDataMap().get("pool_and_quanities"); boolean firstFound = false; boolean secondFound = false; for (PoolIdAndQuantity pq : pQs) { if (pq.getPoolId().contentEquals("first")) { firstFound = true; assertEquals(1, pq.getQuantity().intValue()); } if (pq.getPoolId().contentEquals("second")) { secondFound = true; assertEquals(2, pq.getQuantity().intValue()); } } assertTrue(firstFound); assertTrue(secondFound); }</code><technical_language>Extraneous whitespace</technical_language>

Target:
public void testBindByPools() throws Exception { PoolIdAndQuantity[] pools = new PoolIdAndQuantity[2]; pools[0] = new PoolIdAndQuantity("first", 1); pools[1] = new PoolIdAndQuantity("second", 2); ConsumerCurator cc = mock(ConsumerCurator.class); SubscriptionServiceAdapter sa = mock(SubscriptionServiceAdapter.class); PoolManager pm = mock(PoolManager.class); Owner owner = TestUtil.createOwner(); Consumer consumer = TestUtil.createConsumer(owner); when(cc.verifyAndLookupConsumerWithEntitlements(eq("fakeConsumer"))).thenReturn( consumer); when(sa.hasUnacceptedSubscriptionTerms(any(Owner.class))).thenReturn(false); ConsumerResource cr = new ConsumerResource(cc, null, null, sa, null, null, null, i18n, null, null, null, null, null, null, pm, null, null, null, null, null, null, null, null, new CandlepinCommonTestConfig(), null, null, null, consumerBindUtil); Response rsp = cr.bind("fakeConsumer", null, null, null, null, null, true, null, null, pools, new TrustedUserPrincipal("TaylorSwift")); JobDetail detail = (JobDetail) rsp.getEntity(); PoolIdAndQuantity[] pQs = (PoolIdAndQuantity[]) detail.getJobDataMap().get("pool_and_quantities"); boolean firstFound = false; boolean secondFound = false; for (PoolIdAndQuantity pq : pQs) { if (pq.getPoolId().contentEquals("first")) { firstFound = true; assertEquals(1, pq.getQuantity().intValue()); } if (pq.getPoolId().contentEquals("second")) { secondFound = true; assertEquals(2, pq.getQuantity().intValue()); } } assertTrue(firstFound); assertTrue(secondFound); }
Source:
<code>public void updateCompactionTaskSlot(Double compactionTaskSlotRatio, Integer maxCompactionTaskSlots) throws Exception { String url = StringUtils.format("%sconfig/compaction/taskslots?ratio=%s&max=%s", getCoordinatorURL(), StringUtils.urlEncode(compactionTaskSlotRatio.toString()), StringUtils.urlEncode(maxCompactionTaskSlots.toString())); StatusResponseHolder response = httpClient.go(new Request(HttpMethod.POST, new URL(url)), responseHandler).get(); if (!response.getStatus().equals(HttpResponseStatus.OK)) { throw new ISE( <START> "Error while force trigger auto compaction status[%s] content[%s]", <END> response.getStatus(), response.getContent() ); } }</code><technical_language>message updating compaction task slots instead</technical_language>

Target:
public void updateCompactionTaskSlot(Double compactionTaskSlotRatio, Integer maxCompactionTaskSlots) throws Exception { String url = StringUtils.format("%sconfig/compaction/taskslots?ratio=%s&max=%s", getCoordinatorURL(), StringUtils.urlEncode(compactionTaskSlotRatio.toString()), StringUtils.urlEncode(maxCompactionTaskSlots.toString())); StatusResponseHolder response = httpClient.go(new Request(HttpMethod.POST, new URL(url)), responseHandler).get(); if (!response.getStatus().equals(HttpResponseStatus.OK)) { throw new ISE( "Error while updating compaction task slot status[%s] content[%s]", response.getStatus(), response.getContent() ); } }
Source:
<code>protected void handleRenameOperation( File hiddenTarget, File target ) throws IOException { if ( target.exists() ) { target.delete(); } boolean success = hiddenTarget.renameTo( target ); for ( int i = 1; success == false && i <= getRenameRetryCount(); i++ ) { getLogger().debug( "Rename operation attempt failed on --> {}, will wait ms and try again", new Object[] { i, hiddenTarget.getAbsolutePath(), target.getAbsolutePath(), getRenameRetryDelay() } ); try { Thread.sleep( getRenameRetryDelay() ); } catch ( InterruptedException e ) { } if ( target.exists() ) { target.delete(); } success = hiddenTarget.renameTo( target ); if ( success ) { getLogger().info( "Rename operation succeeded after retries on --> {}", <START> new Object[] { i, hiddenTarget.getAbsolutePath(), target.getAbsolutePath() } ); <END> } } if ( !success ) { try { FileUtils.rename( hiddenTarget, target ); } catch ( IOException e ) { getLogger().error( "Rename operation failed after retries in ms intervals --> {}", new Object[] { getRenameRetryCount(), getRenameRetryDelay(), hiddenTarget.getAbsolutePath(), target.getAbsolutePath() } ); throw new IOException( String.format( "Cannot rename file \"%s\" to \"%s\"! Message: %s", hiddenTarget.getAbsolutePath(), target.getAbsolutePath(), e.getMessage() ), e ); } } }</code><technical_language>I var args new Object[] required if memory serves. in other places</technical_language>

Target:
protected void handleRenameOperation( File hiddenTarget, File target ) throws IOException { if ( target.exists() ) { target.delete(); } boolean success = hiddenTarget.renameTo( target ); for ( int i = 1; success == false && i <= getRenameRetryCount(); i++ ) { getLogger().debug( "Rename operation attempt failed on --> {}, will wait ms and try again", i, hiddenTarget.getAbsolutePath(), target.getAbsolutePath(), getRenameRetryDelay() ); try { Thread.sleep( getRenameRetryDelay() ); } catch ( InterruptedException e ) { } if ( target.exists() ) { target.delete(); } success = hiddenTarget.renameTo( target ); if ( success ) { getLogger().info( "Rename operation succeeded after retries on --> {}", i, hiddenTarget.getAbsolutePath(), target.getAbsolutePath() ); } } if ( !success ) { try { FileUtils.rename( hiddenTarget, target ); } catch ( IOException e ) { getLogger().error( "Rename operation failed after retries in ms intervals --> {}", getRenameRetryCount(), getRenameRetryDelay(), hiddenTarget.getAbsolutePath(), target.getAbsolutePath() ); throw new IOException( String.format( "Cannot rename file \"%s\" to \"%s\"! Message: %s", hiddenTarget.getAbsolutePath(), target.getAbsolutePath(), e.getMessage() ), e ); } } }
Source:
<code>public Iterable<Event> events() throws IOException { <START> final MkIssueEvents issueevents = new MkIssueEvents( <END> this.storage, this.self, this.coords ); return new MkIterable<Event>( this.storage, String.format( "/github/repos/repo[@coords='%s']/issue-events/issue-event[@issue='%s']", this.coords, this.num ), new MkIterable.Mapping<Event>() { @Override public Event map(final XML xml) { return issueevents.get( Integer.parseInt(xml.xpath("number/text()").get(0)) ); } } ); }</code><technical_language>@cvrebert avoid composite names: call this var evts</technical_language>

Target:
public Iterable<Event> events() throws IOException { return new MkIterable<Event>( this.storage, String.format( "/github/repos/repo[@coords='%s']/issue-events/issue-event[issue='%s']", this.coords, this.num ), new MkIssueEventMapping(this) ); }
Source:
<code>public void alterCatalog(String catName, Catalog cat) throws MetaException, InvalidOperationException { rawStore.alterCatalog(catName, cat); <START> catName = catName.toLowerCase(); <END> sharedCache.alterCatalogInCache(StringUtils.normalizeIdentifier(catName), cat); }</code><technical_language>StringUtils.normalizeIdentifier lowercase well, this is necessary. issue is present in getDatabase (but introduced patch)</technical_language>

Target:
public void alterCatalog(String catName, Catalog cat) throws MetaException, InvalidOperationException { rawStore.alterCatalog(catName, cat); sharedCache.alterCatalogInCache(StringUtils.normalizeIdentifier(catName), cat); }
Source:
<code>private PlanBuilder planBuilderFor(PlanBuilder builder, Scope scope, Iterable<? extends Expression> expressionsToRemap) { PlanBuilder newBuilder = planBuilderFor(builder, scope); <START> for (Expression expression : expressionsToRemap) { <END> newBuilder.getTranslations().put(expression, builder.translate(expression)); } return newBuilder; }</code><technical_language>do stream(expressionsToRemap) .forEach(expression -> newBuilder.getTranslations().put(expression, builder.translate(expression))); I strong opinions. codebase prefer stream API logic is simple</technical_language>

Target:
private PlanBuilder planBuilderFor(PlanBuilder builder, Scope scope, Iterable<? extends Expression> expressionsToRemap) { PlanBuilder newBuilder = planBuilderFor(builder, scope); stream(expressionsToRemap) .forEach(expression -> newBuilder.getTranslations().put(expression, builder.translate(expression))); return newBuilder; }
Source:
<code>private boolean isEnterpriseArchive(Archive<?> archive) { <START> return archive instanceof EnterpriseArchive; <END> }</code><technical_language>rely instanceOf 'ArchiveView'. EnterpriseArchive/WebArchive/JavaArchive's view interfaces necessarily Container understands. e.g. archive.getName().endsWith(".jar")</technical_language>

Target:
private boolean isEnterpriseArchive(Archive<?> archive) { return archive.getName().endsWith(".ear"); }
Source:
<code>private void startInstance(Object obj) throws IllegalAccessException, InvocationTargetException { Preconditions.checkNotNull(obj, "obj is null"); if (!startedInstances.contains(obj)) { <START> startedInstances.add(obj); <END> log.debug("Starting %s", obj.getClass().getName()); LifeCycleMethods methods = methodsMap.get(obj.getClass()); for (Method postConstruct : methods.methodsFor(PostConstruct.class)) { log.debug("\t%s()", postConstruct.getName()); postConstruct.invoke(obj); } } }</code><technical_language>problem here. For this one, I a ConcurrentMap<Object, Boolean> putIfAbsent method</technical_language>

Target:
private void startInstance(Object obj) throws IllegalAccessException, InvocationTargetException { log.debug("Starting %s", obj.getClass().getName()); LifeCycleMethods methods = methodsMap.get(obj.getClass()); for (Method postConstruct : methods.methodsFor(PostConstruct.class)) { log.debug("\t%s()", postConstruct.getName()); postConstruct.invoke(obj); } }