auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void createSuccess() throws Exception { MetadataFieldRest metadataFieldRest = new MetadataFieldRest(); metadataFieldRest.setElement(ELEMENT); metadataFieldRest.setQualifier(QUALIFIER); metadataFieldRest.setScopeNote(SCOPE_NOTE); String authToken = getAuthToken(admin.getEmail(), password); AtomicReference<Integer> idRef = new AtomicReference<>(); try { assertThat(metadataFieldService.findByElement(context, metadataSchema, ELEMENT, QUALIFIER), nullValue()); getClient(authToken) .perform(post("/api/core/metadatafields") .param("schemaId", metadataSchema.getID() + "") .content(new ObjectMapper().writeValueAsBytes(metadataFieldRest)) .contentType(contentType)) .andExpect(status().isCreated()) .andDo(result -> idRef.set(read(result.getResponse().getContentAsString(), "$.id"))); <START> MetadataField metadataField = metadataFieldService.find(context, idRef.get()); <END> assertThat(metadataField, notNullValue()); assertEquals(metadataField.getMetadataSchema(), metadataSchema); assertEquals(metadataField.getElement(), ELEMENT); assertEquals(metadataField.getQualifier(), QUALIFIER); assertEquals(metadataField.getScopeNote(), SCOPE_NOTE); } finally { deleteMetadataFieldIfExists(); } }</code><technical_language>I would've expected a REST call check if update persisted. direct of service is typically done in other test. a rest call advantage imho check potentially "more layers" services more in line scope of Integration Test. For instance reveal bugs in a intermediate cache other code (not existing right test intent safe in future change something)</technical_language>

Target:
public void createSuccess() throws Exception { MetadataFieldRest metadataFieldRest = new MetadataFieldRest(); metadataFieldRest.setElement("testElementForCreate"); metadataFieldRest.setQualifier("testQualifierForCreate"); metadataFieldRest.setScopeNote(SCOPE_NOTE); String authToken = getAuthToken(admin.getEmail(), password); AtomicReference<Integer> idRef = new AtomicReference<>(); assertThat(metadataFieldService.findByElement(context, metadataSchema, ELEMENT, QUALIFIER), nullValue()); getClient(authToken) .perform(post("/api/core/metadatafields") .param("schemaId", metadataSchema.getID() + "") .content(new ObjectMapper().writeValueAsBytes(metadataFieldRest)) .contentType(contentType)) .andExpect(status().isCreated()) .andDo(result -> idRef.set(read(result.getResponse().getContentAsString(), "$.id"))); getClient(authToken).perform(get("/api/core/metadatafields/" + idRef.get())) .andExpect(status().isOk()) .andExpect(jsonPath("$", MetadataFieldMatcher.matchMetadataFieldByKeys( metadataSchema.getName(), "testElementForCreate", "testQualifierForCreate"))); }
Source:
<code>public void run(Operation operation) throws RequestException { Object key = keyGenerator.generateKey(keySelector.next()); Random random = stressor.getRandom(); Invocation<Integer> invocation; if (operation == StreamingOperations.GET) { invocation = new CacheInvocations.GetViaStream(cache, key); } else if (operation == StreamingOperations.PUT) { <START> invocation = new CacheInvocations.PutViaStream(cache, key, <END> valueGenerator.generateValue(key, entrySize.next(random), random)); } else throw new IllegalArgumentException(operation.name); stressor.makeRequest(invocation); }</code><technical_language>this compile? PutViaStream is Invocation<Void></technical_language>

Target:
public void run(Operation operation) throws RequestException { Object key = keyGenerator.generateKey(keySelector.next()); Random random = stressor.getRandom(); Invocation invocation; if (operation == StreamingOperations.GET) { invocation = new CacheInvocations.GetViaStream<Object, Integer>(cache, key, buffer); } else if (operation == StreamingOperations.PUT) { invocation = new CacheInvocations.PutViaStream<Object, InputStream>(cache, key, (InputStream) valueGenerator.generateValue(key, entrySize.next(random), random), buffer); } else throw new IllegalArgumentException(operation.name); stressor.makeRequest(invocation); }
Source:
<code>private void updateSchedules( StoredRevision revision, List<StoredWorkflowDefinition> defs, SchedulerManager srm, Instant currentTime) throws ResourceConflictException { ImmutableList.Builder<ScheduleWithScheduler> schedules = ImmutableList.builder(); for (StoredWorkflowDefinition def : defs) { <START> Optional<Scheduler> sr = srm.tryGetScheduler(revision, def, Optional.of(getUnusedKeysCallback())); <END> if (sr.isPresent()) { ScheduleTime firstTime = sr.get().getFirstScheduleTime(currentTime); Schedule schedule = Schedule.of(def.getName(), def.getId(), firstTime.getRunTime(), firstTime.getTime()); schedules.add(new ScheduleWithScheduler(schedule, sr.get())); } } store.updateSchedules(project.getId(), schedules.build(), (oldStatus, newSched) -> { return oldStatus.getLastScheduleTime() .transform(it -> newSched.getScheduler().nextScheduleTime(it)) .or(() -> ScheduleTime.of(newSched.getNextScheduleTime(), newSched.getNextRunTime())); }); }</code><technical_language>if throw UnusedConfigException, this a callback. A boolean flag is good enough. Callback is useful if ProjectResource.putProject creates a callback object ProjectResource.putProject decide type of exception class throw. I boolean flag is good enough</technical_language>

Target:
private void updateSchedules( StoredRevision revision, List<StoredWorkflowDefinition> defs, SchedulerManager srm, Instant currentTime) throws ResourceConflictException { ImmutableList.Builder<ScheduleWithScheduler> schedules = ImmutableList.builder(); for (StoredWorkflowDefinition def : defs) { Optional<Scheduler> sr = srm.tryGetScheduler(revision, def, true); if (sr.isPresent()) { ScheduleTime firstTime = sr.get().getFirstScheduleTime(currentTime); Schedule schedule = Schedule.of(def.getName(), def.getId(), firstTime.getRunTime(), firstTime.getTime()); schedules.add(new ScheduleWithScheduler(schedule, sr.get())); } } store.updateSchedules(project.getId(), schedules.build(), (oldStatus, newSched) -> { return oldStatus.getLastScheduleTime() .transform(it -> newSched.getScheduler().nextScheduleTime(it)) .or(() -> ScheduleTime.of(newSched.getNextScheduleTime(), newSched.getNextRunTime())); }); }
Source:
<code>public void setCurrentGDBThread(IExecutionDMContext ctx) { String id; if (ctx instanceof IMIExecutionDMContext) { id = ((IMIExecutionDMContext)ctx).getThreadId(); } else { return; <START> } <END> if (!id.equals(fCurrentThreadId)) { fCurrentThreadId = id; this.getSession().getExecutor().execute(new Runnable() { @Override public void run() { ICommand<MIInfo> command = fCommandFactory.createMIThreadSelect(ctx, fCurrentThreadId); fCommandControl.queueCommand(command, new ImmediateDataRequestMonitor<MIInfo> () {}); } }); } }</code><technical_language>for this case invert condition avoid reduce if e.g. if (!condition) { return; }</technical_language>

Target:
public void setCurrentGDBThread(IExecutionDMContext ctx) { String id; if (!(ctx instanceof IMIExecutionDMContext)) { return; } id = ((IMIExecutionDMContext)ctx).getThreadId(); if (!id.equals(fCurrentThreadId)) { fCurrentThreadId = id; this.getSession().getExecutor().execute(new DsfRunnable() { @Override public void run() { ICommand<MIInfo> command = fCommandFactory.createMIThreadSelect(ctx, fCurrentThreadId); fCommandControl.queueCommand(command, new ImmediateDataRequestMonitor<MIInfo> () {}); } }); } }
Source:
<code>private String getInstalledVdsIdIfExists(SSHClient client) { try { ByteArrayOutputStream out = new ConstraintByteArrayOutputStream(256); ByteArrayOutputStream err = new ConstraintByteArrayOutputStream(256); client.executeCommand(Config.<String> GetValue(ConfigValues.GetVdsmIdByVdsmToolCommand), <START> null, out, err); <END> return new String(out.toByteArray(), "UTF-8"); } catch (Exception e) { return null; } }</code><technical_language>pass null err if do it</technical_language>

Target:
private String getInstalledVdsIdIfExists(SSHClient client) { try { ByteArrayOutputStream out = new ConstraintByteArrayOutputStream(256); client.executeCommand(Config.<String> GetValue(ConfigValues.GetVdsmIdByVdsmToolCommand), null, out, null); return new String(out.toByteArray(), Charset.forName("UTF-8")); } catch (Exception e) { log.warnFormat( "Failed to initiate vdsm-id request on host", e ); return null; } }
Source:
<code>protected int uploadFile(OwnCloudClient client) throws HttpException, IOException, OperationCancelledException { int status = -1; try { File f = new File(mLocalPath); mEntity = new FileRequestEntity(f, mMimeType); synchronized (mDataTransferListeners) { ((ProgressiveDataTransferer)mEntity) .addDatatransferProgressListeners(mDataTransferListeners); } mPutMethod.addRequestHeader(OC_TOTAL_LENGTH_HEADER, String.valueOf(f.length())); mPutMethod.setRequestEntity(mEntity); status = client.executeMethod(mPutMethod); <START> if (status == 400 || status == 500) { <END> InvalidCharacterExceptionParser xmlParser = new InvalidCharacterExceptionParser(); InputStream is = new ByteArrayInputStream( mPutMethod.getResponseBodyAsString().getBytes()); try { mForbiddenCharsInServer = xmlParser.parseXMLResponse(is); } catch (Exception e) { mForbiddenCharsInServer = false; Log_OC.e(TAG, "Exception reading exception from server", e); } } client.exhaustResponse(mPutMethod.getResponseBodyAsStream()); } finally { mPutMethod.releaseConnection(); } return status; }</code><technical_language>too: do accept 500 anymore</technical_language>

Target:
protected int uploadFile(OwnCloudClient client) throws HttpException, IOException, OperationCancelledException { int status = -1; try { File f = new File(mLocalPath); mEntity = new FileRequestEntity(f, mMimeType); synchronized (mDataTransferListeners) { ((ProgressiveDataTransferer)mEntity) .addDatatransferProgressListeners(mDataTransferListeners); } mPutMethod.addRequestHeader(OC_TOTAL_LENGTH_HEADER, String.valueOf(f.length())); mPutMethod.setRequestEntity(mEntity); status = client.executeMethod(mPutMethod); if (status == 400) { InvalidCharacterExceptionParser xmlParser = new InvalidCharacterExceptionParser(); InputStream is = new ByteArrayInputStream( mPutMethod.getResponseBodyAsString().getBytes()); try { mForbiddenCharsInServer = xmlParser.parseXMLResponse(is); } catch (Exception e) { mForbiddenCharsInServer = false; Log_OC.e(TAG, "Exception reading exception from server", e); } } client.exhaustResponse(mPutMethod.getResponseBodyAsStream()); } finally { mPutMethod.releaseConnection(); } return status; }
Source:
<code>public void sendToConfigHost(RuntimeEnvironment env, String host, int port) { <START> LOGGER.log(Level.INFO, "Sending configuration to: {0}:{1}", new Object[]{host, Integer.toString(port)}); <END> try { env.writeConfiguration(host, port); } catch (IOException ex) { LOGGER.log(Level.SEVERE, "Failed to send configuration to " + host + " (is web application server running with opengrok deployed?)", ex); } LOGGER.info("Configuration update routine done, check log output for errors."); }</code><technical_language>is instance w/ missing port # couple of lines</technical_language>

Target:
public void sendToConfigHost(RuntimeEnvironment env, String host, int port) { LOGGER.log(Level.INFO, "Sending configuration to: {0}:{1}", new Object[]{host, Integer.toString(port)}); try { env.writeConfiguration(host, port); } catch (IOException ex) { LOGGER.log(Level.SEVERE, String.format( "Failed to send configuration to %s:%d " + "(is web application server running with opengrok deployed?)", host, port), ex); } LOGGER.info("Configuration update routine done, check log output for errors."); }
Source:
<code>private DataPoint rr_ave_update(List<DataPoint> rpeak_temp1, DataPointStream rr_ave, long initial_ts) { List<Long> peak_interval = new ArrayList<Long>(); DataPoint result = rr_ave.data.get(rr_ave.data.size() - 1); if (rpeak_temp1.size() != 0) { peak_interval.add(rpeak_temp1.get(0).timestamp-initial_ts); for (int i = 1; i < rpeak_temp1.size(); i++) { peak_interval.add(rpeak_temp1.get(i).timestamp - rpeak_temp1.get(i - 1).timestamp); } if (peak_interval.size() >= AUTOSENSE.PEAK_INTERVAL_MINIMUM_SIZE) { for (int i = peak_interval.size() - AUTOSENSE.PEAK_INTERVAL_MINIMUM_SIZE; i < peak_interval.size(); i++) { result.value += peak_interval.get(i); } <START> rr_ave.add(new DataPoint(rpeak_temp1.get(rpeak_temp1.size() - 1).timestamp, result.value /= 8.0)); <END> result = rr_ave.data.get(rr_ave.data.size() - 1); } } return result; }</code><technical_language>This is weird logic. updating result.value insides of a function call create a new datapoint</technical_language>

Target:
private DataPoint rr_ave_update(List<DataPoint> rpeak_temp1, DataPointStream rr_ave, long initial_ts) { List<Long> peak_interval = new ArrayList<Long>(); DataPoint result = rr_ave.data.get(rr_ave.data.size() - 1); if (rpeak_temp1.size() != 0) { peak_interval.add(rpeak_temp1.get(0).timestamp-initial_ts); for (int i = 1; i < rpeak_temp1.size(); i++) { peak_interval.add(rpeak_temp1.get(i).timestamp - rpeak_temp1.get(i - 1).timestamp); } if (peak_interval.size() >= AUTOSENSE.PEAK_INTERVAL_MINIMUM_SIZE) { long rr_ave_temp = 0; for (int i = peak_interval.size() - AUTOSENSE.PEAK_INTERVAL_MINIMUM_SIZE; i < peak_interval.size(); i++) { rr_ave_temp += peak_interval.get(i); } rr_ave.add(new DataPoint(rpeak_temp1.get(rpeak_temp1.size() - 1).timestamp, rr_ave_temp / 8.0)); result = rr_ave.data.get(rr_ave.data.size() - 1); } } return result; }
Source:
<code>private void registerChannelCreation(Channel channel, Object partitionKey, long now) { <START> if (partitions.containsKey(partitionKey)) { <END> channelId2Creation.putIfAbsent(channelId(channel), new ChannelCreation(now, partitionKey)); } }</code><technical_language>Actually, a stupid bug here: test supposed if (!channelId2Creation.containsKey(partitionKey)). goal avoid creating a new ChannelCreation if entry is there. gain computeIfAbsent instead of putIfAbsent lambda capturing, key exists. please revert change fix if test</technical_language>

Target:
private void registerChannelCreation(Channel channel, Object partitionKey, long now) { ChannelId id = channelId(channel); if (!channelId2Creation.containsKey(id)) { channelId2Creation.putIfAbsent(id, new ChannelCreation(now, partitionKey)); } }
Source:
<code>public void clear() { queuedHooks.clear(); queuedHooksSizeB = 0; forRequest = null; <START> warnThresholdBreached = false; <END> }</code><technical_language>this clear maxQueuedHooksSizeB warnQueuedHooksSizeB</technical_language>

Target:
public void clear() { queuedHooks.clear(); queuedHooksSizeB = 0; warnQueuedHooksSizeB = -1; maxQueuedHooksSizeB = -1; forRequest = null; warnThresholdBreached = false; }
Source:
<code>public Long commit(String author, String commitComment, String parentLockContext) { if (!isDirty()) { return -1L; } final DatastoreLockContext lockContext = createLockContext(service(User.class).getUsername(), parentLockContext); final DatastoreLockTarget lockTarget = createLockTarget(id(), path()); IOperationLockManager locks = service(IOperationLockManager.class); Commit commit = null; try { acquireLock(locks, lockContext, lockTarget); <START> final Long timestamp = service(TimestampProvider.class).getTimestamp(); <END> log().info("Persisting changes to {}@{}", path(), timestamp); commit = staging.commit(null, timestamp, author, commitComment); log().info("Changes have been successfully persisted to {}@{}.", path(), timestamp); return commit == null ? null : commit.getTimestamp(); } catch (final IndexException e) { Throwable rootCause = Throwables.getRootCause(e); if (rootCause instanceof CycleDetectedException) { throw (CycleDetectedException) rootCause; } throw new SnowowlRuntimeException(e.getMessage(), e); } finally { locks.unlock(lockContext, lockTarget); if (commit != null) { new RepositoryCommitNotification(id(), commit.getId(), commit.getGroupId(), commit.getBranch(), commit.getTimestamp(), commit.getAuthor(), commit.getComment(), getNewObjects(commit), getChangedObjects(commit), getRemovedObjects(commit), commit.getMergeSource()) .publish(service(IEventBus.class)); } clear(); } }</code><technical_language>lgtm-bot's notice: local variable timestamp need changed a Long value, need able return null end</technical_language>

Target:
public Long commit(String author, String commitComment, String parentLockContext) { if (!isDirty()) { return -1L; } final DatastoreLockContext lockContext = createLockContext(service(User.class).getUsername(), parentLockContext); final DatastoreLockTarget lockTarget = createLockTarget(id(), path()); IOperationLockManager locks = service(IOperationLockManager.class); Commit commit = null; try { acquireLock(locks, lockContext, lockTarget); final long timestamp = service(TimestampProvider.class).getTimestamp(); log().info("Persisting changes to {}@{}", path(), timestamp); commit = staging.commit(null, timestamp, author, commitComment); log().info("Changes have been successfully persisted to {}@{}.", path(), timestamp); return commit == null ? null : commit.getTimestamp(); } catch (final IndexException e) { Throwable rootCause = Throwables.getRootCause(e); if (rootCause instanceof CycleDetectedException) { throw (CycleDetectedException) rootCause; } throw new SnowowlRuntimeException(e.getMessage(), e); } finally { locks.unlock(lockContext, lockTarget); if (commit != null) { new RepositoryCommitNotification(id(), commit.getId(), commit.getGroupId(), commit.getBranch(), commit.getTimestamp(), commit.getAuthor(), commit.getComment(), getNewObjects(commit), getChangedObjects(commit), getRemovedObjects(commit), commit.getMergeSource()) .publish(service(IEventBus.class)); } clear(); } }
Source:
<code>public void testVisibilityDefaultMemberFunction() throws Exception { IBinding[] memberBindings = findQualifiedPossiblyImplicit(pdom, <START> "AClass::defaultMemFun"); <END> assertVisibility(ICPPClassType.v_private, getMemberVisibility(memberBindings[0])); }</code><technical_language>I assume 100-character line width limit, I treat a soft allow lines slightly longer improves readability</technical_language>

Target:
public void testVisibilityDefaultMemberFunction() throws Exception { IBinding[] defaultFunction = findQualifiedPossiblyImplicit(pdom, "A::defaultMemFun"); assertVisibility(ICPPClassType.v_private, getMemberVisibility(defaultFunction[0])); IBinding[] publicFunction = findQualifiedPossiblyImplicit(pdom, "A::publicMemFun"); assertVisibility(ICPPClassType.v_public, getMemberVisibility(publicFunction[0])); IBinding[] protectedFunction = findQualifiedPossiblyImplicit(pdom, "A::protectedMemFun"); assertVisibility(ICPPClassType.v_protected, getMemberVisibility(protectedFunction[0])); IBinding[] privateFunction = findQualifiedPossiblyImplicit(pdom, "A::privateMemFun"); assertVisibility(ICPPClassType.v_private, getMemberVisibility(privateFunction[0])); }
Source:
<code><START> public double[] getNodeSensitivitiesForValue(final Interpolator1DDataBundle data, final Double value) { <END> Validate.notNull(data, "data"); Validate.notNull(value, "value"); ArgumentChecker.isTrue(value < data.firstKey() || value > data.lastKey(), "value was within data range"); int nData = data.size(); double[] res = new double[nData]; Interpolator1DPiecewisePoynomialWithExtraKnotsDataBundle polyData = (Interpolator1DPiecewisePoynomialWithExtraKnotsDataBundle) data; double eps = polyData.getEps(); double small = polyData.getSmall(); if (Math.abs(value) < SMALL) { for (int i = 0; i < nData; ++i) { double den = Math.abs(polyData.getValues()[i]) < small ? eps : polyData.getValues()[i] * eps; double up = getPolynomialFunction().differentiate(polyData.getPiecewisePolynomialResultUp()[i], value) .getData()[0]; double dw = getPolynomialFunction().differentiate(polyData.getPiecewisePolynomialResultDw()[i], value) .getData()[0]; res[i] = 0.5 * (up - dw) / den; } } else { for (int i = 0; i < nData; ++i) { double den = Math.abs(polyData.getValues()[i]) < small ? eps : polyData.getValues()[i] * eps; double up = getPolynomialFunction().evaluate(polyData.getPiecewisePolynomialResultUp()[i], value).getData()[0]; double dw = getPolynomialFunction().evaluate(polyData.getPiecewisePolynomialResultDw()[i], value).getData()[0]; res[i] = 0.5 * (up - dw) / den / value; } } return res; }</code><technical_language>This method extremely similar <LINK_0>, sense for inherited a common source</technical_language>

Target:
public double[] getNodeSensitivitiesForValue(final Interpolator1DDataBundle data, final Double value) { Validate.notNull(data, "data"); Validate.notNull(value, "value"); ArgumentChecker.isTrue(value < data.firstKey() || value > data.lastKey(), "value was within data range"); Validate.isTrue(data instanceof Interpolator1DPiecewisePoynomialWithExtraKnotsDataBundle); Interpolator1DPiecewisePoynomialWithExtraKnotsDataBundle polyData = (Interpolator1DPiecewisePoynomialWithExtraKnotsDataBundle) data; return _interpolator.getNodeSensitivitiesForValue(polyData, value, _func, SMALL); }
Source:
<code>private Config run(InputStream is, ReportsBean reports) throws JumbuneException, IOException, JSchException, InterruptedException { JobConfig jobConfig = null; try{ jobConfig = JobConfigUtil.jobConfig(is); JobConfigUtil jobConfigUtil = new JobConfigUtil(jobConfig); loadInitialSetup(jobConfig); disableModules(jobConfig); jobConfigUtil.createJumbuneDirectories(); createJobJarFolderOnAgent(jobConfig); startExecution(reports, jobConfig); }finally{ try { <START> LOGGER.debug("Clean up process slave tmp + agent home shell case"); <END> cleanUpJumbuneAgentCurrentJobFolder(jobConfig); cleanUpSlavesTempFldr(jobConfig); deleteTokenFile(); } catch (Exception e) { LOGGER.error("Exception occurred in clean up slaves tmp folder ", e); } ConsoleLogUtil.CONSOLELOGGER.debug("clean up done"); } return jobConfig; }</code><technical_language>Remove this log, if required rephrase</technical_language>

Target:
private Config run(InputStream is, ReportsBean reports) throws JumbuneException, IOException, JSchException, InterruptedException { JobConfig jobConfig = null; try{ jobConfig = JobConfigUtil.jobConfig(is); JobConfigUtil jobConfigUtil = new JobConfigUtil(jobConfig); loadInitialSetup(jobConfig); disableModules(jobConfig); jobConfigUtil.createJumbuneDirectories(); createJobJarFolderOnAgent(jobConfig); startExecution(reports, jobConfig); }finally{ try { LOGGER.debug("Cleaning up agent and slaves temporary directories"); cleanUpJumbuneAgentCurrentJobFolder(jobConfig); cleanUpSlavesTempFldr(jobConfig); deleteTokenFile(); } catch (Exception e) { LOGGER.error("Exception occurred in clean up slaves tmp folder ", e); } ConsoleLogUtil.CONSOLELOGGER.debug("clean up done"); } return jobConfig; }
Source:
<code>private BulkActionView findBulkActionByQuery(final String luceneQuery, final User user) throws DotDataException { try { final String prepareBulkActionsQuery = LuceneQueryUtils .prepareBulkActionsQuery(luceneQuery); <START> final String query = "{\n" <END> + " \"query\" : { \n" + " \"query_string\" : {\n" + " \"query\" : \"%s\"\n" + " } \n" + "\n" + " },\n" + " \"aggs\" : {\n" + " \"tag\" : {\n" + " \"terms\" : {\n" + " \"field\" : \"wfstep\",\n" + " \"size\" : 1000 \n" + " }\n" + " }\n" + " },\n" + "\t\"size\":0 \n" + "}"; final String preparedQuery = String.format(query, prepareBulkActionsQuery); final SearchResponse response = this.contentletAPI .esSearchRaw(preparedQuery.toLowerCase(), false, user, false); Logger.debug(getClass(), () -> "luceneQuery: " + prepareBulkActionsQuery); Logger.debug(getClass(), () -> "esSearch: " + query); return this.buildBulkActionView(response, user); } catch (Exception e) { throw new DotDataException(e); } }</code><technical_language>a constant</technical_language>

Target:
private BulkActionView findBulkActionByQuery(final String luceneQuery, final User user) throws DotDataException { try { final String prepareBulkActionsQuery = LuceneQueryUtils .prepareBulkActionsQuery(luceneQuery); final String query = String.format(BULK_ACTIONS_QUERY_WRAPPER, prepareBulkActionsQuery); final SearchResponse response = this.contentletAPI .esSearchRaw(query.toLowerCase(), false, user, false); Logger.debug(getClass(), () -> "luceneQuery: " + prepareBulkActionsQuery); return this.buildBulkActionView(response, user); } catch (Exception e) { throw new DotDataException(e); } }
Source:
<code>private static boolean postAggregatorDirectColumnIsOk( final RowSignature aggregateRowSignature, final DruidExpression expression, final RexNode rexNode ) { if (!expression.isDirectColumnAccess()) { return false; } final ValueType columnValueType = aggregateRowSignature.getColumnType(expression.getDirectColumn()); <START> if (expression.isDirectColumnAccess() && columnValueType == ValueType.COMPLEX) { <END> return true; } final ExprType toExprType = Expressions.exprTypeForValueType(columnValueType); final ExprType fromExprType = Expressions.exprTypeForValueType( Calcites.getValueTypeForSqlTypeName(rexNode.getType().getSqlTypeName()) ); return toExprType.equals(fromExprType); }</code><technical_language>expression.isDirectColumnAccess() is true due check above, needed here</technical_language>

Target:
private static boolean postAggregatorDirectColumnIsOk( final RowSignature aggregateRowSignature, final DruidExpression expression, final RexNode rexNode ) { if (!expression.isDirectColumnAccess()) { return false; } final ValueType columnValueType = aggregateRowSignature.getColumnType(expression.getDirectColumn()); if (columnValueType == ValueType.COMPLEX) { return true; } final ExprType toExprType = Expressions.exprTypeForValueType(columnValueType); final ExprType fromExprType = Expressions.exprTypeForValueType( Calcites.getValueTypeForSqlTypeName(rexNode.getType().getSqlTypeName()) ); return toExprType.equals(fromExprType); }
Source:
<code>public void notifyCacheEntryCreated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) { if (!cacheEntryCreatedListeners.isEmpty()) { EventImpl<K, V> e = EventImpl.createEvent(cache, CACHE_ENTRY_CREATED); configureEvent(e, key, value, pre, ctx, command, null, null); boolean isLocalNodePrimaryOwner = clusteringDependentLogic.localNodeIsPrimaryOwner(key); boolean sendEvents = !ctx.isInTxScope(); try { for (CacheEntryListenerInvocation<K, V> listener : cacheEntryCreatedListeners) <START> listener.invoke(e, isLocalNodePrimaryOwner); <END> if (sendEvents) { eventManager.sendEvents(); sendEvents = false; } } finally { if (sendEvents) { eventManager.dropEvents(); } } } }</code><technical_language>Missing braces</technical_language>

Target:
public void notifyCacheEntryCreated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) { if (!cacheEntryCreatedListeners.isEmpty()) { EventImpl<K, V> e = EventImpl.createEvent(cache, CACHE_ENTRY_CREATED); configureEvent(e, key, value, pre, ctx, command, null, null); boolean isLocalNodePrimaryOwner = clusteringDependentLogic.localNodeIsPrimaryOwner(key); boolean sendEvents = !ctx.isInTxScope(); try { for (CacheEntryListenerInvocation<K, V> listener : cacheEntryCreatedListeners) { listener.invoke(e, isLocalNodePrimaryOwner); } if (sendEvents) { eventManager.sendEvents(); sendEvents = false; } } finally { if (sendEvents) { eventManager.dropEvents(); } } } }
Source:
<code>RequestRateLimiter(long maxRequestsPerSecond, long maxUniqueFeatures, Function<ContainerRequestContext, Optional<T>> requestFeatureFunc) { this.requestFeatureFunc = requestFeatureFunc; this.limiters = CacheBuilder.newBuilder() .maximumSize(maxUniqueFeatures) <START> .build(new CacheLoader<T, RateLimiter>() { <END> @Override public RateLimiter load(T key) throws Exception { return RateLimiter.create(maxRequestsPerSecond); } }); }</code><technical_language>planning using, do want recordStats() cache expose metrics</technical_language>

Target:
RequestRateLimiter(long maxRequestsPerSecond, long maxUniqueFeatures, Function<ContainerRequestContext, Optional<T>> requestFeatureFunc) { this.requestFeatureFunc = requestFeatureFunc; this.limiters = CacheBuilder.newBuilder() .maximumSize(maxUniqueFeatures) .expireAfterAccess(10, TimeUnit.MINUTES) .build(new CacheLoader<T, RateLimiter>() { @Override public RateLimiter load(T key) throws Exception { return RateLimiter.create(maxRequestsPerSecond); } }); }
Source:
<code>private void scrollToSection(@Nullable Section section) { if (section == null) { return; } bridge.execute(JavaScriptActionHandler.prepareToScrollTo(section.getAnchor(), "{ highlight: false }")); if (section.getId() == ABOUT_SECTION_ID) { bridge.execute(JavaScriptActionHandler.scrollToFooter(webView.getContext())); <START> } else { <END> final int topScrollExtra = 64; int offset = DimenUtil.roundedDpToPx(adapter.getYOffset(section.getId()) - topScrollExtra); webView.setScrollY(section.getId() == 0 ? 0 : offset); } }</code><technical_language>Do need this other scrolling logic this? sounds making scroll twice</technical_language>

Target:
private void scrollToSection(@Nullable Section section) { if (section == null) { return; } if (section.getId() == ABOUT_SECTION_ID) { bridge.execute(JavaScriptActionHandler.scrollToFooter(webView.getContext())); } else { bridge.execute(JavaScriptActionHandler.prepareToScrollTo(section.getAnchor(), "{ highlight: false }")); } }
Source:
<code>public String apply(ProjectResource rsrc) throws AuthException, ResourceNotFoundException, IOException { Repository repo = null; try { repo = repoManager.openRepository(rsrc.getNameKey()); <START> String headRef = repo.getRef(Constants.HEAD).getTarget().getName(); <END> if (!rsrc.getControl().controlForRef(headRef).isVisible()) { throw new AuthException(); } return headRef; } catch (RepositoryNotFoundException e) { throw new ResourceNotFoundException(rsrc.getName()); } finally { if (repo != null) { repo.close(); } } }</code><technical_language>If HEAD is a symbolic reference (aka detached) want return SHA-1. really: Ref head = repo.getRef(Constants.HEAD); if (head == null) { throw new ResourceNotFoundException("HEAD"); } else if (head.isSymbolic()) { String n = head.getTarget().getName(); if (rsrc.getControl().controlForRef(n).isVisible()) { return n; } throw new AuthException(); } else if (head.getObjectId() != null) { if (rsrc.getControl().isOwner()) { return head.getObjectId().name(); } throw new AuthException(); } throw new ResourceNotFoundException("HEAD");</technical_language>

Target:
public String apply(ProjectResource rsrc) throws AuthException, ResourceNotFoundException, IOException { Repository repo = null; try { repo = repoManager.openRepository(rsrc.getNameKey()); Ref head = repo.getRef(Constants.HEAD); if (head == null) { throw new ResourceNotFoundException(Constants.HEAD); } else if (head.isSymbolic()) { String n = head.getTarget().getName(); if (rsrc.getControl().controlForRef(n).isVisible()) { return n; } throw new AuthException(); } else if (head.getObjectId() != null) { if (rsrc.getControl().isOwner()) { return head.getObjectId().name(); } throw new AuthException(); } throw new ResourceNotFoundException(Constants.HEAD); } catch (RepositoryNotFoundException e) { throw new ResourceNotFoundException(rsrc.getName()); } finally { if (repo != null) { repo.close(); } } }
Source:
<code><START> public synchronized Iterable<Cache<K,V>> iterateAllCaches() { <END> return caches; }</code><technical_language>Insufficient synchronization. return a copy of internal list</technical_language>

Target:
public synchronized Iterable<Cache<K, V>> iterateAllCaches() { return new ArrayList<Cache<K, V>>(caches); }
Source:
<code>SolrOutputFormatProvider(BatchSolrSearchConfig batchConfig) { this.conf = new HashMap<>(); conf.put("solr.server.url", batchConfig.getSolrHost()); conf.put("solr.server.mode", batchConfig.getSolrMode()); <START> conf.put("solr.server.collection", batchConfig.getCollectionName()); <END> conf.put("solr.server.keyfield", batchConfig.getKeyField()); conf.put("solr.batch.size", batchConfig.getBatchSize()); if (batchConfig.getOutputFieldMappings() == null) { conf.put("solr.output.field.mappings", ""); } else { conf.put("solr.output.field.mappings", batchConfig.getOutputFieldMappings()); } }</code><technical_language>defined constants for keys in another class. public constants here, instead of string</technical_language>

Target:
SolrOutputFormatProvider(BatchSolrSearchConfig batchConfig) { this.conf = new HashMap<>(); conf.put(SolrRecordWriter.SERVER_URL, batchConfig.getSolrHost()); conf.put(SolrRecordWriter.SERVER_MODE, batchConfig.getSolrMode()); conf.put(SolrRecordWriter.COLLECTION_NAME, batchConfig.getCollectionName()); conf.put(SolrRecordWriter.KEY_FIELD, batchConfig.getKeyField()); conf.put(SolrRecordWriter.BATCH_SIZE, batchConfig.getBatchSize()); if (batchConfig.getOutputFieldMappings() == null) { conf.put(SolrRecordWriter.FIELD_MAPPINGS, ""); } else { conf.put(SolrRecordWriter.FIELD_MAPPINGS, batchConfig.getOutputFieldMappings()); } }
Source:
<code>private NacosConfigListener createTargetListener(String key, String group) { <START> String normalizedKey = normalizedKey(key); <END> NacosConfigListener configListener = new NacosConfigListener(); configListener.fillContext(normalizedKey, group); return configListener; }</code><technical_language>duplicate call of normalizedKey(key), caller of createTargetListener() called method, key passed in is a normalized one</technical_language>

Target:
private NacosConfigListener createTargetListener(String key, String group) { NacosConfigListener configListener = new NacosConfigListener(); configListener.fillContext(key, group); return configListener; }
Source:
<code>public void setSystemPurposeStatus(String systemPurposeStatus) { this.systemPurposeStatus = systemPurposeStatus; <START> this.setRHCloudProfileModified(new Date()); <END> }</code><technical_language>update profile timestamp here? This of required fields? regardless, is redundant, this is recalculated set if of syspurpose attributes change</technical_language>

Target:
public void setSystemPurposeStatus(String systemPurposeStatus) { this.systemPurposeStatus = systemPurposeStatus; }
Source:
<code>public void testNameToFullModuleNameMap() throws Exception { final Set<Class<?>> classes = CheckUtil.getCheckstyleModules(); final Class<PackageObjectFactory> packageObjectFactoryClass = PackageObjectFactory.class; final Field field = packageObjectFactoryClass.getDeclaredField("NAME_TO_FULL_MODULE_NAME"); field.setAccessible(true); final Collection<String> canonicalNames = ((Map<String, String>) field.get(null)).values(); final Optional<Class<?>> optional1 = classes.stream() .filter(clazz -> { return !canonicalNames.contains(clazz.getCanonicalName()) <START> && !"com.puppycrawl.tools.checkstyle.meta.JavadocMetadataScraper" <END> .equals(clazz.getName()); }).findFirst(); if (optional1.isPresent()) { fail("Invalid canonical name: " + optional1.get()); } final Optional<String> optional2 = canonicalNames.stream().filter(canonicalName -> { return classes.stream().map(Class::getCanonicalName) .noneMatch(clssCanonicalName -> clssCanonicalName.equals(canonicalName)); }).findFirst(); if (optional2.isPresent()) { fail("Invalid class: " + optional2.get()); } }</code><technical_language>please list of strings internal modules, please place this module in new list</technical_language>

Target:
public void testNameToFullModuleNameMap() throws Exception { final Set<Class<?>> classes = CheckUtil.getCheckstyleModules(); final Class<PackageObjectFactory> packageObjectFactoryClass = PackageObjectFactory.class; final Field field = packageObjectFactoryClass.getDeclaredField("NAME_TO_FULL_MODULE_NAME"); field.setAccessible(true); final Collection<String> canonicalNames = ((Map<String, String>) field.get(null)).values(); final Optional<Class<?>> optional1 = classes.stream() .filter(clazz -> { return !canonicalNames.contains(clazz.getCanonicalName()) && !Definitions.INTERNAL_MODULES.contains(clazz.getName()); }).findFirst(); if (optional1.isPresent()) { fail("Invalid canonical name: " + optional1.get()); } final Optional<String> optional2 = canonicalNames.stream().filter(canonicalName -> { return classes.stream().map(Class::getCanonicalName) .noneMatch(clssCanonicalName -> clssCanonicalName.equals(canonicalName)); }).findFirst(); if (optional2.isPresent()) { fail("Invalid class: " + optional2.get()); } }
Source:
<code>public void testLongFileNameThatRequiresEncoding() { String str = "+" + StringUtils.repeat("1", 255); String result = fileManager.getFileName(TaskTestUtil.createMockTask(str), true); assertNotNull(result); <START> assertTrue(result.length() <= 255); <END> assertEquals( "%2B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111.3664039548", result); }</code><technical_language>previous tests assert length</technical_language>

Target:
public void testLongFileNameThatRequiresEncoding() { String str = "+" + StringUtils.repeat("1", 255); String result = fileManager.getFileName(TaskTestUtil.createMockTask(str), false); assertEquals("%2B" + StringUtils.repeat("1", 237) + ".3664039548", result); result = fileManager.getFileName(TaskTestUtil.createMockTask(str), true); assertEquals(str.replaceAll("\\+", "%2B"), result); }
Source:
<code>public Map<String, Serializable> getStringSerializableMap(SchedulingService service, TaskTerminationData taskToTerminate) throws Exception { Map<String, Serializable> variables = new HashMap<>(); RunningTaskData taskData = taskToTerminate.taskData; TaskResultImpl taskResult = taskToTerminate.taskResult; InternalJob internalJob = taskToTerminate.internalJob; if (!taskToTerminate.normalTermination || taskResult == null) { List<InternalTask> iDependences = taskData.getTask().getIDependences(); if (iDependences != null) { List<TaskId> parentIds = new ArrayList<>(iDependences.size()); for (int i = 0; i < iDependences.size(); i++) { parentIds.add(iDependences.get(i).getId()); } Map<TaskId, TaskResult> taskResults = service.getInfrastructure().getDBManager() .loadTasksResults( taskData.getTask().getJobId(), parentIds); getResultsFromListOfTaskResults(variables, taskResults); } else { if (internalJob != null) <START> variables.putAll(taskData.getTask().getVariablesOverriden(internalJob)); <END> } variables.put(SchedulerVars.PA_TASK_SUCCESS.toString(), Boolean.toString(false)); } else if (taskResult.hadException()) { variables = fillMapWithTaskResult(taskResult, false); } else { variables = fillMapWithTaskResult(taskResult, true); } return variables; }</code><technical_language>Similar remark for SchedulingMethodImpl class</technical_language>

Target:
public VariablesMap getStringSerializableMap(SchedulingService service, TaskTerminationData taskToTerminate) throws Exception { VariablesMap variablesMap = new VariablesMap(); RunningTaskData taskData = taskToTerminate.taskData; TaskResultImpl taskResult = taskToTerminate.taskResult; InternalJob internalJob = taskToTerminate.internalJob; variablesMap.setScopeMap(taskData.getTask().getSerializableVariables()); if (!taskToTerminate.normalTermination || taskResult == null) { List<InternalTask> iDependences = taskData.getTask().getIDependences(); if (iDependences != null) { List<TaskId> parentIds = new ArrayList<>(iDependences.size()); for (int i = 0; i < iDependences.size(); i++) { parentIds.add(iDependences.get(i).getId()); } Map<TaskId, TaskResult> taskResults = service.getInfrastructure().getDBManager() .loadTasksResults( taskData.getTask().getJobId(), parentIds); getResultsFromListOfTaskResults(variablesMap.getInheritedMap(), taskResults); } else { if (internalJob != null) variablesMap.getInheritedMap().putAll(internalJob.getVariables()); } variablesMap.getInheritedMap().put(SchedulerVars.PA_TASK_SUCCESS.toString(), Boolean.toString(false)); } else if (taskResult.hadException()) { variablesMap.setInheritedMap(fillMapWithTaskResult(taskResult, false)); } else { variablesMap.setInheritedMap(fillMapWithTaskResult(taskResult, true)); } return variablesMap; }
Source:
<code>public DefaultZooKeeperClient(final CuratorFramework client, final String clusterId) { this.client = client; this.clusterId = clusterId; if (clusterId == null) { this.clusterIdExists = null; this.watcher = null; this.connectionStateListener = null; return; } this.clusterIdExists = new AtomicBoolean(false); this.watcher = new Watcher() { @Override public void process(WatchedEvent event) { log.info("DefaultZooKeeperClient processing WatchedEvent - {}", event); checkClusterIdExists(clusterId, "watcher"); } }; connectionStateListener = new ConnectionStateListener() { @Override public void stateChanged(CuratorFramework client, ConnectionState newState) { log.info("DefaultZooKeeperClient connection state change - {}", newState); <START> if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.CONNECTED) { <END> checkClusterIdExists(clusterId, "connectionStateListener"); } } }; }</code><technical_language>I checkClusterIdExists related methods cares is connection is active, while of values of enum considered a condition for calling checkClusterIdExists, this check simplified if (newState.isConnected()) ..</technical_language>

Target:
public DefaultZooKeeperClient(final CuratorFramework client, final String clusterId) { this.client = client; this.clusterId = clusterId; if (clusterId == null) { this.clusterIdExists = null; this.watcher = null; this.connectionStateListener = null; return; } this.clusterIdExists = new AtomicBoolean(false); this.watcher = new Watcher() { @Override public void process(WatchedEvent event) { log.info("DefaultZooKeeperClient processing WatchedEvent - {}", event); checkClusterIdExists(clusterId, "watcher"); } }; connectionStateListener = new ConnectionStateListener() { @Override public void stateChanged(CuratorFramework client, ConnectionState newState) { log.info("DefaultZooKeeperClient connection state change - {}", newState); if (newState.isConnected()) { checkClusterIdExists(clusterId, "connectionStateListener"); } } }; }
Source:
<code>public SerializableTransactionManager serializable() { <START> List<AutoCloseable> closeables = Lists.newArrayList(); <END> try { return serializableInternal(closeables); } catch (Throwable throwable) { log.warn("Exception thrown when creating transaction manager. " + "Closing previously opened resources", throwable); closeables.forEach(autoCloseable -> { try { autoCloseable.close(); } catch (Exception ex) { log.info("Error closing {}", SafeArg.of("klass", autoCloseable.getClass()), ex); } }); throw throwable; } }</code><technical_language>do try-with-resources a list implements autocloseable cut code here, worth it</technical_language>

Target:
public SerializableTransactionManager serializable() { List<AutoCloseable> closeables = Lists.newArrayList(); try { return serializableInternal(closeables); } catch (Throwable throwable) { List<String> closeablesClasses = closeables.stream() .map(autoCloseable -> autoCloseable.getClass().toString()) .collect(Collectors.toList()); log.warn("Exception thrown when creating transaction manager. " + "Closing previously opened resources: {}", SafeArg.of("classes", closeablesClasses.toString()), throwable); closeables.forEach(autoCloseable -> { try { autoCloseable.close(); } catch (Exception ex) { log.info("Error closing {}", SafeArg.of("class", autoCloseable.getClass().toString()), ex); } }); throw throwable; } }
Source:
<code>private void renderDiffBaseListBox(ChangeInfo info) { JsArray<RevisionInfo> list = info.revisions().values(); RevisionInfo.sortRevisionInfoByNumber(list); int selectedIdx = list.length(); for (int i = list.length() - 1; i >= 0; i--) { RevisionInfo r = list.get(i); diffBase.addItem( r._number() + ": " + r.name().substring(0, 6), r.name()); if (r.name().equals(revision)) { SelectElement.as(diffBase.getElement()).getOptions() .getItem(diffBase.getItemCount() - 1).setDisabled(true); } <START> if (base != null) { if (base.equals(String.valueOf(r._number()))) { <END> selectedIdx = list.length() - i - 1; } } } RevisionInfo rev = info.revisions().get(revision); JsArray<CommitInfo> parents = rev.commit().parents(); diffBase.addItem( parents.length() > 1 ? Util.C.autoMerge() : Util.C.baseDiffItem(), ""); diffBase.setSelectedIndex(selectedIdx); }</code><technical_language>if (base != null && base.equals(...))</technical_language>

Target:
private void renderDiffBaseListBox(ChangeInfo info) { JsArray<RevisionInfo> list = info.revisions().values(); RevisionInfo.sortRevisionInfoByNumber(list); int selectedIdx = list.length(); for (int i = list.length() - 1; i >= 0; i--) { RevisionInfo r = list.get(i); diffBase.addItem( r._number() + ": " + r.name().substring(0, 6), r.name()); if (r.name().equals(revision)) { SelectElement.as(diffBase.getElement()).getOptions() .getItem(diffBase.getItemCount() - 1).setDisabled(true); } if (base != null && base.equals(String.valueOf(r._number()))) { selectedIdx = diffBase.getItemCount() - 1; } } RevisionInfo rev = info.revisions().get(revision); JsArray<CommitInfo> parents = rev.commit().parents(); diffBase.addItem( parents.length() > 1 ? Util.C.autoMerge() : Util.C.baseDiffItem(), ""); diffBase.setSelectedIndex(selectedIdx); }
Source:
<code>public PagedArrayList(KeysetPage keyset, long totalSize, int firstResult, int maxResults) { this.keyset = keyset; this.totalSize = totalSize; this.page = (int) Math.floor((firstResult == -1 ? 0 : firstResult) * 1d / maxResults) + 1; <START> this.totalPages = totalSize < 1 ? (int) totalSize : (int) Math.ceil(totalSize * 1d / maxResults); <END> this.firstResult = firstResult; this.maxResults = maxResults; }</code><technical_language>1. totalSize * 1d / maxResults -> totalSize / (float) maxResults 2. I get added logic</technical_language>

Target:
public PagedArrayList(KeysetPage keyset, long totalSize, int firstResult, int maxResults) { this.keyset = keyset; this.totalSize = totalSize; this.page = (int) Math.floor((firstResult == -1 ? 0 : firstResult) * 1d / maxResults) + 1; this.totalPages = totalSize < 1 ? 0 : (int) Math.ceil(totalSize * 1d / maxResults); this.firstResult = firstResult; this.maxResults = maxResults; }
Source:
<code>public void generate(JNIMethod method) { List<String> tags = new ArrayList<>(); String data = ((AbstractItem)method).flatten(); if (data != null && data.length() != 0) { tags.add("@method " + data); } JNIParameter[] params = method.getParameters(); for (JNIParameter <START> param2 : <END> params) { ASTParameter param = (ASTParameter)param2; param.setCast(param.getCast()); data = ((AbstractItem)param).flatten(); if (data != null && data.length() != 0) { tags.add("@param " + param.getName() + " " + data); } } if (tags.size() == 0) return; if (tags.size() == 1) { String doc = " " + delimiter; inserts.put(Integer.valueOf(((ASTMethod)method).start), doc); } else { StringBuilder buffer = new StringBuilder(); buffer.append(" "); buffer.append(delimiter); inserts.put(Integer.valueOf(((ASTMethod)method).start), buffer.toString()); } }</code><technical_language>rename p</technical_language>

Target:
public void generate(JNIMethod method) { List<String> tags = new ArrayList<>(); String data = ((AbstractItem)method).flatten(); if (data != null && data.length() != 0) { tags.add("@method " + data); } for (JNIParameter p : method.getParameters()) { ASTParameter param = (ASTParameter)p; param.setCast(param.getCast()); data = ((AbstractItem)param).flatten(); if (data != null && data.length() != 0) { tags.add("@param " + param.getName() + " " + data); } } if (tags.size() == 0) return; if (tags.size() == 1) { String doc = " " + delimiter; inserts.put(Integer.valueOf(((ASTMethod)method).start), doc); } else { StringBuilder buffer = new StringBuilder(); buffer.append(" "); buffer.append(delimiter); inserts.put(Integer.valueOf(((ASTMethod)method).start), buffer.toString()); } }