auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void startWithExtraStop() throws Exception { assertTrue(defaultEventLoop.isActive()); defaultEventLoop.stop(); <START> thread.join(); <END> assertFalse(defaultEventLoop.isActive()); try { defaultEventLoop.stop(); fail(); } catch (IllegalStateException e) { thread = defaultEventLoop.start(); assertTrue(defaultEventLoop.isActive()); defaultEventLoop.stop(); thread.join(); } }</code><technical_language>Consider adding a timeout</technical_language>

Target:
public void startWithExtraStop() throws Exception { assertTrue(defaultEventLoop.isActive()); defaultEventLoop.stop(); thread.join(); assertFalse(defaultEventLoop.isActive()); try { defaultEventLoop.stop(); fail(); } catch (IllegalStateException e) { thread = defaultEventLoop.start(); assertTrue(defaultEventLoop.isActive()); defaultEventLoop.stop(); thread.join(); assertFalse(defaultEventLoop.isActive()); } }
Source:
<code>public MainEventHandler() { String connectionlessProtocolList = Context.getConfig().getString("status.ignoreOffline"); if (connectionlessProtocolList != null) { connectionlessProtocols.addAll(Arrays.asList(connectionlessProtocolList.split(","))); } <START> logEvents = Sets.newHashSet(Context.getConfig().getString("logger.events", DEFAULT_LOGGER_EVENTS).split(",")); <END> }</code><technical_language>I prefer standard Java API instead minimize dependencies usage possible</technical_language>

Target:
public MainEventHandler() { String connectionlessProtocolList = Context.getConfig().getString("status.ignoreOffline"); if (connectionlessProtocolList != null) { connectionlessProtocols.addAll(Arrays.asList(connectionlessProtocolList.split(","))); } logEvents = new HashSet<>(Arrays.asList( Context.getConfig().getString("logger.events", DEFAULT_LOGGER_EVENTS).split(","))); }
Source:
<code>public void init(TestInfo testInfo) throws Exception { final String repositoryId = getRepositoryName(REPOSITORY_ID, testInfo); final String centralRepositoryId = getRepositoryName(CENTRAL_REPOSITORY_ID, testInfo); artifactEntryService.delete( artifactEntryService.findArtifactList(STORAGE_ID, repositoryId, ImmutableMap.of("groupId", "org.carlspring.maven", "artifactId", "derby-maven-plugin", "version", "1.10"), true)); artifactEntryService.delete( artifactEntryService.findArtifactList(STORAGE_ID, repositoryId, ImmutableMap.of("groupId", "org.carlspring", "artifactId", "properties-injector", "version", "1.1"), true)); artifactEntryService.delete( artifactEntryService.findArtifactList(STORAGE_ID, repositoryId, ImmutableMap.of("groupId", "javax.media", "artifactId", "jai_core", <START> "version", "1.1.3"), <END> true)); }</code><technical_language>Cosmetic: Please, re-indent parameters coding convention</technical_language>

Target:
public void init(TestInfo testInfo) throws Exception { final String repositoryId = getRepositoryName(REPOSITORY_ID, testInfo); artifactEntryService.delete(artifactEntryService.findArtifactList(STORAGE_ID, repositoryId, ImmutableMap.of("groupId", "org.carlspring.maven", "artifactId", "derby-maven-plugin", "version", "1.10"), true)); artifactEntryService.delete(artifactEntryService.findArtifactList(STORAGE_ID, repositoryId, ImmutableMap.of("groupId", "org.carlspring", "artifactId", "properties-injector", "version", "1.1"), true)); artifactEntryService.delete(artifactEntryService.findArtifactList(STORAGE_ID, repositoryId, ImmutableMap.of("groupId", "javax.media", "artifactId", "jai_core", "version", "1.1.3"), true)); }
Source:
<code>private String valueFromDn(AttributeMapping mapping, final String dn) { String valueRdn = mapping.getRdn(); try { for (Rdn rdn : new LdapName(dn).getRdns()) { if (rdn.getType().equalsIgnoreCase(valueRdn)) { return rdn.getValue().toString(); } } } catch (Exception cause) { <START> throw log.ldapRealmInvalidRdnForAttribute(mapping.getName(), dn, valueRdn); <END> } return null; }</code><technical_language>Do want lose here</technical_language>

Target:
private String valueFromDn(AttributeMapping mapping, final String dn) { String valueRdn = mapping.getRdn(); try { for (Rdn rdn : new LdapName(dn).getRdns()) { if (rdn.getType().equalsIgnoreCase(valueRdn)) { return rdn.getValue().toString(); } } } catch (Exception cause) { throw log.ldapRealmInvalidRdnForAttribute(mapping.getName(), dn, valueRdn, cause); } return null; }
Source:
<code>public static String encryptPassword(String password) { String result = password; String keyFile = Config.<String> GetValue(ConfigValues.keystoreUrl, Config.DefaultConfigurationVersion); String passwd = Config.<String> GetValue(ConfigValues.keystorePass, Config.DefaultConfigurationVersion); String alias = Config.<String> GetValue(ConfigValues.CertAlias, Config.DefaultConfigurationVersion); try { result = EncryptionUtils.encrypt((String) result, keyFile, passwd, alias); } catch (Exception e) { <START> result = password; <END> } return result; }</code><technical_language>?Actually this is a bug. *encryption* fails allowed store in DB. This is decryption failure, effort cyphered value. Please exception this fail</technical_language>

Target:
public static String encryptPassword(String password) { String result = password; String keyFile = Config.<String> GetValue(ConfigValues.keystoreUrl, Config.DefaultConfigurationVersion); String passwd = Config.<String> GetValue(ConfigValues.keystorePass, Config.DefaultConfigurationVersion); String alias = Config.<String> GetValue(ConfigValues.CertAlias, Config.DefaultConfigurationVersion); try { result = EncryptionUtils.encrypt((String) result, keyFile, passwd, alias); } catch (Exception e) { log.errorFormat("Failed to encrpyt password, error message: {0}", e.getMessage()); throw new SecurityException(e); } return result; }
Source:
<code>private String escapeControl(final String input) { <START> final Pattern pattern = Pattern.compile("[\u0000-\u001f]"); <END> final Matcher matcher = pattern.matcher(input); final StringBuffer escaped = new StringBuffer(input.length()); while (matcher.find()) { matcher.appendReplacement( escaped, String.format("\\\\u%04X", (int) matcher.group().charAt(0)) ); } matcher.appendTail(escaped); return escaped.toString(); }</code><technical_language>I a static private field, for sake of performance</technical_language>

Target:
private String escapeControl(final String input) { final Matcher matcher = CONTROL.matcher(input); final StringBuffer escaped = new StringBuffer(input.length()); while (matcher.find()) { matcher.appendReplacement( escaped, String.format("\\\\u%04X", (int) matcher.group().charAt(0)) ); } matcher.appendTail(escaped); return escaped.toString(); }
Source:
<code>@Test public void testInsertSourceRelTypeWithNullValues() throws Exception { Planner planner = getPlanner(null, Programs.standard()); SqlNode parse = planner.parse( "insert into \"emps\" values(1, 1, null, 1, 1)"); SqlNode validate = planner.validate(parse); RelNode convert = planner.rel(validate).rel; RelDataType insertSourceType = convert.getInput(0).getRowType(); String typeString = SqlTests.getTypeString(insertSourceType); <START> assertEquals(typeString, <END> "RecordType(INTEGER NOT NULL empid, INTEGER NOT NULL deptno, VARCHAR name, " + "REAL NOT NULL salary, INTEGER commission) NOT NULL"); }</code><technical_language>I assertEquals parameters inversed</technical_language>

Target:
@Test public void testInsertSourceRelTypeWithNullValues() throws Exception { Planner planner = getPlanner(null, Programs.standard()); SqlNode parse = planner.parse( "insert into \"emps\" values(1, 1, null, 1, 1)"); SqlNode validate = planner.validate(parse); RelNode convert = planner.rel(validate).rel; RelDataType insertSourceType = convert.getInput(0).getRowType(); String typeString = SqlTests.getTypeString(insertSourceType); assertEquals("RecordType(INTEGER NOT NULL empid, INTEGER NOT NULL deptno, VARCHAR name, " + "REAL NOT NULL salary, INTEGER commission) NOT NULL", typeString); }
Source:
<code>private CompletableFuture<Acknowledge> runApplicationAndShutdownClusterAsync(final DispatcherGateway dispatcherGateway) { return applicationCompletionFuture .handle((r, t) -> { if (t == null) { LOG.info("Application completed SUCCESSFULLY"); return dispatcherGateway.shutDownCluster(ApplicationStatus.SUCCEEDED); } final Optional<ApplicationFailureException> exception = ExceptionUtils.findThrowable(t, ApplicationFailureException.class); if (exception.isPresent()) { final ApplicationStatus applicationStatus = exception.get().getStatus(); if (applicationStatus == ApplicationStatus.CANCELED || applicationStatus == ApplicationStatus.FAILED) { LOG.info("Application {}: ", applicationStatus, t); return dispatcherGateway.shutDownCluster(applicationStatus); } } <START> LOG.warn("Exiting with Application Status UNKNOWN: ", t); <END> this.errorHandler.onFatalError(new FlinkException("Application failed unexpectedly.", t)); return FutureUtils.<Acknowledge>completedExceptionally(t); }) .thenCompose(Function.identity()); }</code><technical_language>suggestion LOG.warn("Application failed unexpectedly: ", t);</technical_language>

Target:
private CompletableFuture<Acknowledge> runApplicationAndShutdownClusterAsync(final DispatcherGateway dispatcherGateway) { return applicationCompletionFuture .handle((r, t) -> { if (t == null) { LOG.info("Application completed SUCCESSFULLY"); return dispatcherGateway.shutDownCluster(ApplicationStatus.SUCCEEDED); } final Optional<ApplicationFailureException> exception = ExceptionUtils.findThrowable(t, ApplicationFailureException.class); if (exception.isPresent()) { final ApplicationStatus applicationStatus = exception.get().getStatus(); if (applicationStatus == ApplicationStatus.CANCELED || applicationStatus == ApplicationStatus.FAILED) { LOG.info("Application {}: ", applicationStatus, t); return dispatcherGateway.shutDownCluster(applicationStatus); } } LOG.warn("Application failed unexpectedly: ", t); this.errorHandler.onFatalError(new FlinkException("Application failed unexpectedly.", t)); return FutureUtils.<Acknowledge>completedExceptionally(t); }) .thenCompose(Function.identity()); }
Source:
<code>@Override public final void run() { boolean reload = false; boolean sleep = false; List<Entry> entries = null; while (isRunning()) { if (location == null) { try { if (sleep) { Thread.sleep(100); } location = locator.getRegionLocation(regionInfo.getStartKey(), regionInfo.getReplicaId(), reload) .get(); sleep = false; } catch (ExecutionException ee) { LOG.warn("Error getting location for meta region " + regionInfo + ", " + ee); reload = true; sleep = true; continue; } catch (InterruptedException ie) { LOG.warn("Interrupted while getting location for meta region " + regionInfo + ", " + ie); Thread.currentThread().interrupt(); } } try { if (entries == null) { entries = queue.poll(20000, TimeUnit.MILLISECONDS); } if (entries == null) { continue; } CompletableFuture<Long> future = replicate(entries); try { <START> future.get(); <END> entries = null; } catch (InterruptedException e) { Thread.currentThread().interrupt(); continue; } catch (ExecutionException e) { Throwable cause = e.getCause(); LOG.warn("Failed to replicate entries for region of meta table", entries.size()); LOG.warn("Cause: " + cause); location = null; reload = true; } } catch (InterruptedException | ReplicationRuntimeException e) { LOG.warn("Interrupted while waiting for next replication entry batch", e); Thread.currentThread().interrupt(); } } }</code><technical_language>timeout</technical_language>

Target:
@Override public final void run() { List<Entry> entries = null; while (isRunning()) { try { if (entries == null) { entries = queue.poll(20000, TimeUnit.MILLISECONDS); } if (entries == null) { continue; } CompletableFuture<Long> future = replicate(entries); future.get(); entries = null; } catch (ExecutionException e) { Throwable cause = e.getCause(); LOG.warn("Failed to replicate entries for region of meta table, retry, ", entries.size(), cause); } catch (InterruptedException e) { LOG.warn("Interrupted while waiting for next replication entry batch", e); Thread.currentThread().interrupt(); } } }
Source:
<code>public TickProducer(SiteTaskerQueue taskQueue) { m_taskQueue = taskQueue; m_logger = new VoltLogger("HOST"); m_partitionId = taskQueue.getPartitionId(); m_taskTimeThreshold = 1_000_000L * VoltDB.instance() .getCatalogContext() .getDeployment() <START> .getSystemsettings() <END> .getProcedure() .getWarningtimeout(); }</code><technical_language>need null checks here. SystemSettings Procedure null minOccurs is 0 for those. If null, need default of 10s</technical_language>

Target:
public TickProducer(SiteTaskerQueue taskQueue) { m_taskQueue = taskQueue; m_logger = new VoltLogger("HOST"); m_partitionId = taskQueue.getPartitionId(); m_procedureLogThreshold = 1_000_000L * VoltDB.instance() .getCatalogContext() .getDeployment() .getSystemsettings() .getProcedure() .getLoginfo(); }
Source:
<code><START> public List<Record> takeDeferredRecords() { <END> List<Record> records = new ArrayList<Record>(deferredRecords); deferredRecords.clear(); for (Record record : records) { deferredRecordsSize -= record.size(); } return records; }</code><technical_language>This happened if is a bug ensure deferredRecordsSize is 0</technical_language>

Target:
public List<Record> takeDeferredRecords() { List<Record> records = new ArrayList<Record>(deferredRecords); deferredRecords.clear(); for (Record record : records) { removeDeferredProcessedRecord(record); } return records; }
Source:
<code>private ProjectState lookup(final Project.NameKey key) throws OrmException { if (key == null) { return null; } if (key.equals(wildProject) || key.get() == null || key.get().isEmpty()) { return getWildProjectState(); } final ReviewDb db = schema.open(); try { final Project project = db.projects().get(key); if (project == null) { return null; } ProjectState parentProjectState = null; Project.NameKey parentNameKey = project.getParent(); if (parentNameKey == null || parentNameKey.get() == null || parentNameKey.get().isEmpty()){ parentProjectState = getWildProjectState(); } else { <START> parentProjectState = ProjectCacheImpl.this.get(parentNameKey); <END> if (parentProjectState == null){ parentProjectState = lookup(parentNameKey); } } final Collection<RefRight> projectRights = Collections.unmodifiableCollection(db.refRights().byProject( project.getNameKey()).toList()); final ProjectState.InheritedRights inheritedRights = new InheritedRightsComposer(parentProjectState); return projectStateFactory .create(project, projectRights, inheritedRights); } finally { db.close(); } }</code><technical_language>do this of try/finally database ReviewDb open? connection returned pool reused for recursive lookup of parent. If parent chain depth exceeds number of connections in pool right this code freeze timeout, throw exception. moving recursive get db.close() connection returned pool confined size of pool maximum project recursion</technical_language>

Target:
private ProjectState lookup(final Project.NameKey key) throws OrmException { final ReviewDb db = schema.open(); try { final Project p = db.projects().get(key); if (p == null) { return null; } final Collection<RefRight> rights = Collections.unmodifiableCollection(db.refRights().byProject( p.getNameKey()).toList()); return projectStateFactory.create(p, rights); } finally { db.close(); } }
Source:
<code>public void deleteDiagramTest() throws Exception { List<Diagram> modelDiagrams = getDiagrams(); int amountBeforeDeletion = modelDiagrams.size(); selectElementInTheModelexplorer(modelDiagrams.get(0)); IHandler handler = getActiveHandler(); handler.execute((new ExecutionEvent(testedCommand, Collections.EMPTY_MAP, null, null))); modelDiagrams = getDiagrams(); <START> <END> Assert.assertEquals("The deletion of a diagram has no effect", amountBeforeDeletion - 1, modelDiagrams.size()); }</code><technical_language>please, add NON-NLS tags</technical_language>

Target:
public void deleteDiagramTest() throws Exception { List<Diagram> modelDiagrams = getDiagrams(); int amountBeforeDeletion = modelDiagrams.size(); selectElementInTheModelexplorer(modelDiagrams.get(0)); IHandler handler = getActiveHandler(); handler.execute((new ExecutionEvent(testedCommand, Collections.EMPTY_MAP, null, null))); modelDiagrams = getDiagrams(); Assert.assertEquals("The deletion of a diagram has no effect", amountBeforeDeletion - 1, modelDiagrams.size()); TransactionalEditingDomain domain = ServiceUtilsForEObject.getInstance().getTransactionalEditingDomain(getRootOfTheModel()); domain.getCommandStack().undo(); modelDiagrams = getDiagrams(); Assert.assertEquals("The undo after the deletion of a diagram has no effect", amountBeforeDeletion, modelDiagrams.size()); domain.getCommandStack().redo(); modelDiagrams = getDiagrams(); Assert.assertEquals("The redo after the deletion of a diagram has no effect", amountBeforeDeletion - 1, modelDiagrams.size()); domain.getCommandStack().undo(); modelDiagrams = getDiagrams(); Assert.assertEquals("The undo after the deletion of a diagram has no effect", amountBeforeDeletion, modelDiagrams.size()); domain.getCommandStack().redo(); modelDiagrams = getDiagrams(); Assert.assertEquals("The redo after the deletion of a diagram has no effect", amountBeforeDeletion - 1, modelDiagrams.size()); }
Source:
<code>public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() { if (fRequirements == null) { fRequirements = new ArrayList<>(); TmfAnalysisRequirement events = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT); <START> events.addValue(UstMemoryStrings.MALLOC, AnalysisRequirementValueLevel.OPTIONAL); <END> events.addValue(UstMemoryStrings.FREE, AnalysisRequirementValueLevel.OPTIONAL); events.addValue(UstMemoryStrings.CALLOC, AnalysisRequirementValueLevel.OPTIONAL); events.addValue(UstMemoryStrings.REALLOC, AnalysisRequirementValueLevel.OPTIONAL); events.addValue(UstMemoryStrings.MEMALIGN, AnalysisRequirementValueLevel.OPTIONAL); events.addValue(UstMemoryStrings.POSIX_MEMALIGN, AnalysisRequirementValueLevel.OPTIONAL); events.addInformation("The libc wrapper should be loaded in order to get the events in the trace output."); TmfAnalysisRequirement domain = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN); domain.addValue(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN_TYPE_UST, AnalysisRequirementValueLevel.MANDATORY); fRequirements.add(events); fRequirements.add(domain); } return fRequirements; }</code><technical_language>I put mandatory default. I do yet, events is analysis. applies LTTng kernel analysis</technical_language>

Target:
public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() { List<TmfAnalysisRequirement> requirements = new ArrayList<>(); TmfAnalysisRequirement events = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT); events.addValue(UstMemoryStrings.MALLOC, AnalysisRequirementValueLevel.MANDATORY); events.addValue(UstMemoryStrings.FREE, AnalysisRequirementValueLevel.MANDATORY); events.addValue(UstMemoryStrings.CALLOC, AnalysisRequirementValueLevel.MANDATORY); events.addValue(UstMemoryStrings.REALLOC, AnalysisRequirementValueLevel.MANDATORY); events.addValue(UstMemoryStrings.MEMALIGN, AnalysisRequirementValueLevel.MANDATORY); events.addValue(UstMemoryStrings.POSIX_MEMALIGN, AnalysisRequirementValueLevel.MANDATORY); events.addInformation(Messages.UstMemoryAnalysisModule_EventsLoadingInformation); TmfAnalysisRequirement domain = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN); domain.addValue(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN_TYPE_UST, AnalysisRequirementValueLevel.MANDATORY); requirements.add(events); requirements.add(domain); return requirements; }
Source:
<code>public Optional<Map<String, Object>> findUnRevokedAccount(TokenHash tokenHash) { Optional<Map<String, Object>> storedTokenHash = Optional.ofNullable(jdbi.withHandle(handle -> <START> handle.createQuery("SELECT account_id, coalesce(type, 'API') as type, coalesce(token_type, 'CARD') as token_type FROM tokens WHERE token_hash = :token_hash AND revoked IS NULL") <END> .bind("token_hash", tokenHash.getValue()) .first())); if (storedTokenHash.isPresent()) { updateLastUsedTime(tokenHash); } return storedTokenHash; }</code><technical_language>Is coalesce(type, 'API') necessary a default column existing rows backfilled</technical_language>

Target:
public Optional<Map<String, Object>> findUnRevokedAccount(TokenHash tokenHash) { Optional<Map<String, Object>> storedTokenHash = Optional.ofNullable(jdbi.withHandle(handle -> handle.createQuery("SELECT account_id, type, coalesce(token_type, 'CARD') as token_type FROM tokens WHERE token_hash = :token_hash AND revoked IS NULL") .bind("token_hash", tokenHash.getValue()) .first())); if (storedTokenHash.isPresent()) { updateLastUsedTime(tokenHash); } return storedTokenHash; }
Source:
<code>private String matchingSpecialization(MethodSymbol method) { <START> List<Type> methodParameters = method.parameterTypes(); <END> Map<String, String> genericTypeMapping = genericTypes.isEmpty() ? Collections.emptyMap() : new HashMap<>(); Type actualReturnType = method.returnType().type(); String expectedReturnType = convertGenericType(returnType, actualReturnType, genericTypeMapping); if (!expectedReturnType.equals(actualReturnType.fullyQualifiedName())) { return null; } for (int i = 0; i < parameters.size(); i++) { Type actualType = methodParameters.get(i); String expectedType = convertGenericType(parameters.get(i), actualType, genericTypeMapping); if (!expectedType.equals(actualType.fullyQualifiedName())) { return null; } } return buildSpecializationName(genericTypeMapping); }</code><technical_language>This variable moved closer usage. (to deal return types params)</technical_language>

Target:
private String matchingSpecialization(MethodSymbol method) { Map<String, String> genericTypeMapping = genericTypes.isEmpty() ? Collections.emptyMap() : new HashMap<>(); Type actualReturnType = method.returnType().type(); String expectedReturnType = convertGenericType(returnType, actualReturnType, genericTypeMapping); if (!expectedReturnType.equals(actualReturnType.fullyQualifiedName())) { return null; } List<Type> methodParameters = method.parameterTypes(); for (int i = 0; i < parameters.size(); i++) { Type actualType = methodParameters.get(i); String expectedType = convertGenericType(parameters.get(i), actualType, genericTypeMapping); if (!expectedType.equals(actualType.fullyQualifiedName())) { return null; } } return buildSpecializationName(genericTypeMapping); }
Source:
<code>public Proc start() throws IOException { <START> if(cmds().isEmpty()){ <END> LOGGER.log(Level.INFO, "Trying to start a process without setting a command. This might cause " + "an unexpected exception"); } return launch(this); }</code><technical_language>suggestion if (cmds().isEmpty()) {</technical_language>

Target:
public Proc start() throws IOException { if (cmds().isEmpty()) { LOGGER.log(Level.WARNING, "Trying to start a process without setting a command. This might cause " + "an ArrayIndexOutOfBounds exception"); } return launch(this); }
Source:
<code>public void execute() { try (DbSession dbSession = dbClient.openSession(false)) { reportReader.readContextProperties().forEachRemaining( contextProperty -> { if (contextProperty.getKey().startsWith(SONAR_ANALYSIS)) { AnalysisPropertyDto analysisPropertyDto = new AnalysisPropertyDto() <START> .setUuid(UuidFactoryFast.getInstance().create()) <END> .setKey(contextProperty.getKey()) .setValue(contextProperty.getValue()) .setSnapshotUuid(analysisMetadataHolder.getUuid()); dbClient.analysisPropertiesDao().insert(dbSession, analysisPropertyDto); } }); dbSession.commit(); } }</code><technical_language>UuidFactoryFast in production. Collision risk is high. (and this create a static binding, avoided) a UuidFactory instance is pico container</technical_language>

Target:
public void execute() { final List<AnalysisPropertyDto> analysisPropertyDtos = new ArrayList<>(); reportReader.readContextProperties().forEachRemaining( contextProperty -> { if (contextProperty.getKey().startsWith(SONAR_ANALYSIS)) { analysisPropertyDtos.add(new AnalysisPropertyDto() .setUuid(uuidFactory.create()) .setKey(contextProperty.getKey()) .setValue(contextProperty.getValue()) .setSnapshotUuid(analysisMetadataHolder.getUuid())); } }); if (analysisPropertyDtos.isEmpty()) { return; } try (DbSession dbSession = dbClient.openSession(false)) { dbClient.analysisPropertiesDao().insert(dbSession, analysisPropertyDtos); dbSession.commit(); } }
Source:
<code>public Connection getConnection() throws SQLException { while (true) { long start = System.currentTimeMillis(); Pair<HikariDataSource, Connection> ret; try { <START> ret = getConnectionInternal(); <END> } finally { long now = System.currentTimeMillis(); long elapsed = now - start; if (elapsed > 1000) { log.warn("Waited {}ms for connection", elapsed); logPoolStats(); } else { log.debug("Waited {}ms for connection", elapsed); } } HikariDataSource dataSourcePool = ret.getLeft(); Connection conn = ret.getRight(); try { testConnection(conn); } catch (SQLException e) { log.error("Dropping connection which failed validation", e); dataSourcePool.evictConnection(conn); continue; } return conn; } }</code><technical_language>a pair, getConnectionInternal() getDataSourcePoolInternal() call getConnection() explicitly (I this is a bit cleaner making unpacking a Pair)</technical_language>

Target:
public Connection getConnection() throws SQLException { long start = System.currentTimeMillis(); try { while (true) { HikariDataSource dataSourcePool = getDataSourcePool(); Connection conn = dataSourcePool.getConnection(); try { testConnection(conn); } catch (SQLException e) { log.error("Dropping connection which failed validation", e); dataSourcePool.evictConnection(conn); if (System.currentTimeMillis() > start + connConfig.getCheckoutTimeout()) { throw e; } continue; } return conn; } } finally { long now = System.currentTimeMillis(); long elapsed = now - start; if (elapsed > 1000) { log.warn("Waited {}ms for connection", elapsed); logPoolStats(); } else { log.debug("Waited {}ms for connection", elapsed); } } }
Source:
<code>public void initialize(ServiceConfiguration config) { if (config.port == null) { config.port = config.secure ? 8883 : 1883; } connection = service.getBrokerConnection(Constants.CLIENTID); if (connection != null) { connection.stop(); service.removeBrokerConnection(Constants.CLIENTID); } connection = new MqttBrokerConnection("127.0.0.1", config.port, config.secure, Constants.CLIENTID); connection.addConnectionObserver(this); if (config.username != null) { connection.setCredentials(config.username, config.password); } try { startEmbeddedServer(config.port, config.secure, config.username, config.password, config.persistenceFile); } catch (IOException e) { logger.debug("Could not start embedded broker", e); logger.debug(e.getLocalizedMessage()); <START> return; <END> } }</code><technical_language>sense hide startable embedded server OSGi framework informed activation done successfully? Other services rely this activated that. If throw exception caller of activate method (the DS implementation) wrong activate services depends this one..</technical_language>

Target:
public void initialize(ServiceConfiguration config) throws IOException { int port = config.port == null ? (config.port = config.secure ? 8883 : 1883) : config.port; connection = service.getBrokerConnection(Constants.CLIENTID); if (connection != null) { connection.stop(); service.removeBrokerConnection(Constants.CLIENTID); } connection = new MqttBrokerConnection("127.0.0.1", config.port, config.secure, Constants.CLIENTID); connection.addConnectionObserver(this); if (config.username != null) { connection.setCredentials(config.username, config.password); } startEmbeddedServer(port, config.secure, config.username, config.password, config.persistenceFile); }
Source:
<code>public void printNfoldCorrssvalidationNbAcc(int classesNum, double thres, int minWordsAppearenceCount) { double acc = 0; double precision = 0; double recall = 0; double total = 0; double confusionMatrix[][] = new double[classesNum][classesNum]; for (int i = 0; i < folds.length; i++) { DocumentCollection train = getTrain(i); DocumentCollection test = getTest(i); FeatureMap map = new FeatureMap(); map.addDocs(train, minWordsAppearenceCount, false); MemoryEfficientNB nb = new MemoryEfficientNB(train, map, classesNum); acc += nb.getAcc(test) / ((double) folds.length); for (int j = 0; j < test.docs.size(); j++) { total++; Document d = test.docs.elementAt(j); int label = nb.classify(d, thres); if (label > -1) { recall++; confusionMatrix[d.classID][label]++; } if (label == d.classID) precision++; } } System.out.println("Accuracy: " + acc); System.out.println("Within " + thres + " confidence threshold:"); System.out.println("\tPrecision=" + precision / recall); System.out.println("\tRecall=" + recall / total); <START> System.out.println("\tConfusion matrix within confidence threshold:"); <END> for (int i = 0; i < classesNum; i++) { for (int j = 0; j < classesNum; j++) logger.info(confusionMatrix[i][j] + "\t"); System.out.println(); } }</code><technical_language>consistent -- STDOUT logger. Please this method is called decide usage STDOUT logger used</technical_language>

Target:
public void printNfoldCorrssvalidationNbAcc(int classesNum, double thres, int minWordsAppearenceCount) { double acc = 0; double precision = 0; double recall = 0; double total = 0; double confusionMatrix[][] = new double[classesNum][classesNum]; for (int i = 0; i < folds.length; i++) { DocumentCollection train = getTrain(i); DocumentCollection test = getTest(i); FeatureMap map = new FeatureMap(); map.addDocs(train, minWordsAppearenceCount, false); MemoryEfficientNB nb = new MemoryEfficientNB(train, map, classesNum); acc += nb.getAcc(test) / ((double) folds.length); for (int j = 0; j < test.docs.size(); j++) { total++; Document d = test.docs.elementAt(j); int label = nb.classify(d, thres); if (label > -1) { recall++; confusionMatrix[d.classID][label]++; } if (label == d.classID) precision++; } } System.out.println("Accuracy: " + acc); System.out.println("Within " + thres + " confidence threshold:"); System.out.println("\tPrecision=" + precision / recall); System.out.println("\tRecall=" + recall / total); System.out.println("\tConfusion matrix within confidence threshold:"); for (int i = 0; i < classesNum; i++) { for (int j = 0; j < classesNum; j++) System.out.print(confusionMatrix[i][j] + "\t"); System.out.println(); } }
Source:
<code><START> public synchronized boolean offer(Runnable runnable) { <END> int poolSize = executor.getPoolSize(); boolean retval = false; if ((poolSize >= executor.getMaximumPoolSize()) || (size() < idleThreads)) retval = super.offer(runnable); return retval; }</code><technical_language>@franz1981 I feel man this... this one</technical_language>

Target:
public boolean offer(Runnable runnable) { boolean retval = false; synchronized (lock) { if ((executor.getPoolSize() >= executor.getMaximumPoolSize()) || (threadTaskDelta > 0)) { retval = super.offer(runnable); if (retval) threadTaskDelta--; } } return retval; }
Source:
<code>protected void locateFileFromHardDiskDialog(){ FileDialog dialog = new FileDialog(getEditorSite().getShell(), SWT.NONE); dialog.setFilterNames(new String[] {SourceLookupUIMessages.CSourceNotFoundEditor_2}); CDebugUtils.FileParts missingFileParts = CDebugUtils.getFileParts(missingFile); dialog.setFilterExtensions(new String[] {"*." + missingFileParts.getExtension()}); <START> dialog.setFilterPath(Platform.getLocation().toOSString()); <END> locateFileFromResource(dialog.open()); }</code><technical_language>Good idea setFilterPath, I Platform location is start... is is accessible? binary file location is a good default. Another option is save selected path. if is a option really</technical_language>

Target:
protected void locateFileFromHardDiskDialog(){ FileDialog dialog = new FileDialog(getEditorSite().getShell(), SWT.NONE); dialog.setFilterNames(new String[] {SourceLookupUIMessages.CSourceNotFoundEditor_2}); CDebugUtils.FileParts missingFileParts = CDebugUtils.getFileParts(missingFile); dialog.setFilterExtensions(new String[] {"*." + missingFileParts.getExtension()}); dialog.setFilterPath(Platform.getLocation().toOSString()); String hardDiskDialogResult = dialog.open(); if( hardDiskDialogResult !=null ){ locateFileFromResource(dialog.open()); } }
Source:
<code>public void oauth(String consumerKey, String consumerSecret, String token, String tokenSecret) throws InterruptedException, ControlStreamException, IOException { BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000); SitestreamEndpoint endpoint = new SitestreamEndpoint(); Authentication auth = new OAuth1(consumerKey, consumerSecret, token, tokenSecret); BasicClient client = new ClientBuilder() .hosts(Constants.SITESTREAM_HOST) .endpoint(endpoint) .authentication(auth) .processor(new StringDelimitedProcessor(queue)) .build(); int numProcessingThreads = 4; ExecutorService service = Executors.newFixedThreadPool(numProcessingThreads); Twitter4jSitestreamClient t4jClient = new Twitter4jSitestreamClient( client, queue, Lists.newArrayList(listener), service); t4jClient.connect(); for (int threads = 0; threads < numProcessingThreads; threads++) { t4jClient.process(); } Thread.sleep(5000); HttpClient controllerHttpClient = new DefaultHttpClient(new PoolingClientConnectionManager()); HttpHosts sitestreamHosts = new HttpHosts(Constants.SITESTREAM_HOST); <START> SitestreamController controller = new SitestreamController(controllerHttpClient, sitestreamHosts, auth); <END> controller.getFriends(t4jClient.getStreamId(), 12345L); controller.addUser(t4jClient.getStreamId(), 987765L); client.stop(); }</code><technical_language>i if this path, in HttpClient argument, sitestreamHosts host list a default argument</technical_language>

Target:
public void oauth(String consumerKey, String consumerSecret, String token, String tokenSecret) throws InterruptedException, ControlStreamException, IOException { BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000); SitestreamEndpoint endpoint = new SitestreamEndpoint(); Authentication auth = new OAuth1(consumerKey, consumerSecret, token, tokenSecret); BasicClient client = new ClientBuilder() .hosts(Constants.SITESTREAM_HOST) .endpoint(endpoint) .authentication(auth) .processor(new StringDelimitedProcessor(queue)) .build(); int numProcessingThreads = 4; ExecutorService service = Executors.newFixedThreadPool(numProcessingThreads); Twitter4jSitestreamClient t4jClient = new Twitter4jSitestreamClient( client, queue, Lists.newArrayList(listener), service); t4jClient.connect(); for (int threads = 0; threads < numProcessingThreads; threads++) { t4jClient.process(); } Thread.sleep(5000); SitestreamController controller = new SitestreamController(auth); controller.getFriends(t4jClient.getStreamId(), 12345L); controller.addUser(t4jClient.getStreamId(), 987765L); client.stop(); }
Source:
<code>public String getUrlForPathWithoutWiki(String wikiName, String wikiPath) { String url = getUrlForWiki(wikiName); url = url + wikiPath; <START> return url; <END> }</code><technical_language>please replace this return getUrlForWiki(wikiName) + wikiPath</technical_language>

Target:
public String getUrlForPathWithoutWiki(String wikiName, String wikiPath) { return getUrlForWiki(wikiName) + wikiPath; }
Source:
<code>public void submittedMessageShowsInTheChat() throws Exception { givenChatUpdatesAfterEveryMessage(); launchChatActivityWithAccess(Access.PRIVATE); <START> submitMessage("test message"); <END> assertThatMessageFromUserIsShownInChat(AUTHENTICATED_USER.getName(), "test message"); }</code><technical_language>extract test string</technical_language>

Target:
public void submittedMessageShowsInTheChat() throws Exception { givenChatUpdatesAfterEveryMessage(); launchChatActivityWithAccess(Access.PRIVATE); String message = "test message"; submitMessage(message); assertThatMessageFromUserIsShownInChat(AUTHENTICATED_USER.getName(), message); }
Source:
<code>private Map<String, List<Pair<VDS, Integer>>> getDeviceListAllVds(List<String> lunsToResize) { Map<String, List<Pair<VDS, Integer>>> lunToVds = new HashMap<>(); for (VDS vds : getAllRunningVdssInPool()) { GetDeviceListVDSCommandParameters parameters = new GetDeviceListVDSCommandParameters(vds.getId(), getStorageDomain().getStorageType(), lunsToResize); List<LUNs> luns = (List<LUNs>) runVdsCommand(VDSCommandType.GetDeviceList, parameters).getReturnValue(); for (LUNs lun : luns) { List<Pair<VDS, Integer>> vdsSizePairs = lunToVds.get(lun.getLUN_id()); if (vdsSizePairs == null) { vdsSizePairs = new ArrayList<>(); lunToVds.put(lun.getLUN_id(), vdsSizePairs); } <START> vdsSizePairs.add(new Pair<VDS, Integer>(vds, lun.getDeviceSize())); <END> } } return lunToVds; }</code><technical_language>a MultiValueMapUtils - save this if statement</technical_language>

Target:
private Map<String, List<Pair<VDS, Integer>>> getDeviceListAllVds(List<String> lunsToResize) { Map<String, List<Pair<VDS, Integer>>> lunToVds = new HashMap<>(); for (VDS vds : getAllRunningVdssInPool()) { GetDeviceListVDSCommandParameters parameters = new GetDeviceListVDSCommandParameters(vds.getId(), getStorageDomain().getStorageType(), lunsToResize); List<LUNs> luns = (List<LUNs>) runVdsCommand(VDSCommandType.GetDeviceList, parameters).getReturnValue(); for (LUNs lun : luns) { MultiValueMapUtils.addToMap(lun.getLUN_id(), new Pair<>(vds, lun.getDeviceSize()), lunToVds); } } return lunToVds; }
Source:
<code>public void forceAdd(final VmNetworkInterface iface, CompensationContext compensationContext, boolean allocateMac) { if (allocateMac) { iface.setMacAddress(getMacPoolManager().allocateNewMac()); } else { if (!getMacPoolManager().addMac(iface.getMacAddress())) { iface.setPlugged(false); getMacPoolManager().forceAddMac(iface.getMacAddress()); auditLogMacInUse(iface); <START> log.infoFormat("VmInterfaceManager::Network Interface {0}'s MAC address is in use, " + <END> "therefore it is being unplugged from VM.", iface.getName()); } } getVmNetworkInterfaceDao().save(iface); getVmNetworkStatisticsDao().save(iface.getStatistics()); compensationContext.snapshotNewEntity(iface); compensationContext.snapshotNewEntity(iface.getStatistics()); }</code><technical_language>I "warn" this is a valid state, warn action taken. I MAC nice information for log, besides interface name</technical_language>

Target:
public void forceAdd(final VmNetworkInterface iface, CompensationContext compensationContext, boolean allocateMac) { if (allocateMac) { iface.setMacAddress(getMacPoolManager().allocateNewMac()); } else { getMacPoolManager().forceAddMac(iface.getMacAddress()); } getVmNetworkInterfaceDao().save(iface); getVmNetworkStatisticsDao().save(iface.getStatistics()); compensationContext.snapshotNewEntity(iface); compensationContext.snapshotNewEntity(iface.getStatistics()); }
Source:
<code>private String getOriginConfigTypeName(String confItemType) { ServiceConfigTypeAmbariToOriginalPattern pattern = ServiceConfigTypeAmbariToOriginalPattern.findByAmbariConfType(confItemType); if (pattern != null) { return pattern.originConfType(); } <START> return confItemType; <END> }</code><technical_language>if return null ? Is null valid? exception</technical_language>

Target:
private String getOriginConfigTypeName(String confItemType) { if (confItemType == null) { throw new IllegalArgumentException("confItemType can't be null"); } Optional<ServiceConfigTypeAmbariToOriginalPattern> pattern = ServiceConfigTypeAmbariToOriginalPattern.findByAmbariConfType(confItemType); return pattern.map(p -> p.originConfType()).orElse(confItemType); }
Source:
<code>public void visit(DataChartTimestampDescriptor<?> desc) { <START> setType(EnumSet.of(DescriptorType.NUMERICAL, DescriptorType.TIMESTAMP)); <END> }</code><technical_language>similar</technical_language>

Target:
public void visit(DataChartTimestampDescriptor<?> desc) { fType.add(DescriptorType.TIMESTAMP); }
Source:
<code>public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) throws ExecutionException { <START> return checkNotNull(new ArrayList<IBaseEventInfo>()); <END> }</code><technical_language>return checkNotNull(Collections.EMPTY_LIST); EMPTY_* static definitions do some sort of type inference, older .empty*() methods don't</technical_language>

Target:
public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) throws ExecutionException { return checkNotNull(Collections.EMPTY_LIST); }
Source:
<code>void set(DiffPreferences prefs) { this.prefs = prefs; setIgnoreWhitespace(prefs.ignoreWhitespace()); tabWidth.setIntValue(prefs.tabSize()); lineLength.setIntValue(prefs.lineLength()); syntaxHighlighting.setValue(prefs.syntaxHighlighting()); whitespaceErrors.setValue(prefs.showWhitespaceErrors()); showTabs.setValue(prefs.showTabs()); lineNumbers.setValue(prefs.showLineNumbers()); leftSide.setValue(view.diffTable.isVisibleA()); topMenu.setValue(!prefs.hideTopMenu()); manualReview.setValue(prefs.manualReview()); expandAllComments.setValue(prefs.expandAllComments()); renderEntireFile.setValue(prefs.renderEntireFile()); renderEntireFile.setEnabled(view.canEnableRenderEntireFile(prefs)); setTheme(prefs.theme()); <START> autoHideEmptyPane.setValue(prefs.autoHideEmptyPane()); <END> mode.setEnabled(prefs.syntaxHighlighting()); if (prefs.syntaxHighlighting()) { setMode(view.getCmFromSide(DisplaySide.B).getStringOption("mode")); } switch (view.getIntraLineStatus()) { case OFF: case OK: intralineDifference.setValue(prefs.intralineDifference()); break; case TIMEOUT: case FAILURE: intralineDifference.setValue(false); intralineDifference.setEnabled(false); break; } if (prefs.context() == WHOLE_FILE_CONTEXT) { contextLastValue = DEFAULT_CONTEXT; context.setText(""); contextEntireFile.setValue(true); } else { context.setIntValue(prefs.context()); contextEntireFile.setValue(false); } }</code><technical_language>I grouped this leftSide.setValue line 154</technical_language>

Target:
void set(DiffPreferences prefs) { this.prefs = prefs; setIgnoreWhitespace(prefs.ignoreWhitespace()); tabWidth.setIntValue(prefs.tabSize()); lineLength.setIntValue(prefs.lineLength()); syntaxHighlighting.setValue(prefs.syntaxHighlighting()); whitespaceErrors.setValue(prefs.showWhitespaceErrors()); showTabs.setValue(prefs.showTabs()); lineNumbers.setValue(prefs.showLineNumbers()); leftSide.setValue(view.diffTable.isVisibleA()); leftSide.setEnabled(!prefs.hideEmptyPane()); emptyPane.setValue(!prefs.hideEmptyPane()); topMenu.setValue(!prefs.hideTopMenu()); manualReview.setValue(prefs.manualReview()); expandAllComments.setValue(prefs.expandAllComments()); renderEntireFile.setValue(prefs.renderEntireFile()); renderEntireFile.setEnabled(view.canEnableRenderEntireFile(prefs)); setTheme(prefs.theme()); mode.setEnabled(prefs.syntaxHighlighting()); if (prefs.syntaxHighlighting()) { setMode(view.getCmFromSide(DisplaySide.B).getStringOption("mode")); } switch (view.getIntraLineStatus()) { case OFF: case OK: intralineDifference.setValue(prefs.intralineDifference()); break; case TIMEOUT: case FAILURE: intralineDifference.setValue(false); intralineDifference.setEnabled(false); break; } if (prefs.context() == WHOLE_FILE_CONTEXT) { contextLastValue = DEFAULT_CONTEXT; context.setText(""); contextEntireFile.setValue(true); } else { context.setIntValue(prefs.context()); contextEntireFile.setValue(false); } }
Source:
<code>public boolean shouldUpdateFragmentOnUpdateEvent(StatsEvents.SectionUpdatedAbstract event) { if (!isAdded()) { return false; } if (!getDate().equals(event.mDate)) { return false; } if (!isSameBlog(event)) { return false; } <START> if (event.mTimeframe != getTimeframe()) { <END> return false; } return true; }</code><technical_language>I future-proof this equals instead of != operator</technical_language>

Target:
public boolean shouldUpdateFragmentOnUpdateEvent(StatsEvents.SectionUpdatedAbstract event) { if (!isAdded()) { return false; } if (!getDate().equals(event.mDate)) { return false; } if (!isSameBlog(event)) { return false; } if (!event.mTimeframe.equals(getTimeframe())) { return false; } return true; }
Source:
<code>public Map<String, Object> perform() { ArrayList<Map<String, String>> list = null; Map<String, Object> results = new HashMap<String, Object>(2); int totalItemCount = 0; List<User> users = null; int realUserCount = 0; try { totalItemCount = getUserCount(); if (start < totalItemCount) { users = getUsers(); realUserCount = users.size(); } if (users != null) { int pageSize = realUserCount; list = new ArrayList<Map<String, String>>(pageSize); for (User aUser : users) { Map<String, String> aRecord = new HashMap<String, String>(); String fullName = aUser.getFullName(); fullName = (UtilMethods.isSet(fullName) ? fullName : " "); String emailAddress = aUser.getEmailAddress(); emailAddress = (UtilMethods.isSet(emailAddress) ? emailAddress : " "); <START> aRecord.put("id", aUser.getUserId()); <END> aRecord.put("type", USER_TYPE_VALUE); aRecord.put("name", fullName); aRecord.put("emailaddress", emailAddress); list.add(aRecord); } } else { list = new ArrayList<Map<String, String>>(0); } } catch (Exception ex) { Logger.warn(UserAjax.class, "::processUsersList -> Could not process list of users."); list = new ArrayList<Map<String, String>>(0); } results.put("data", list); results.put("total", totalItemCount); return results; }</code><technical_language>reduce this map("id", aUser.getUserId(), "type", USER_TYPE_VALUE ....) CollectionUtils.map</technical_language>

Target:
public Map<String, Object> perform() { ArrayList<Map<String, String>> list = null; Map<String, Object> results = new HashMap<String, Object>(2); int totalItemCount = 0; List<User> users = null; int realUserCount = 0; try { totalItemCount = getUserCount(); if (start < totalItemCount) { users = getUsers(); realUserCount = users.size(); } if (users != null) { int pageSize = realUserCount; list = new ArrayList<Map<String, String>>(pageSize); for (User aUser : users) { final Map<String, String> aRecord = map( "id", aUser.getUserId(), "type", USER_TYPE_VALUE, "name", UtilMethods.isSet(aUser.getFullName()) ? aUser.getFullName() : " ", "emailaddress", UtilMethods.isSet(aUser.getEmailAddress()) ? aUser.getEmailAddress() : " "); list.add(aRecord); } } else { list = EMPTY_MAP_LIST; } } catch (Exception ex) { Logger.warn(UserAjax.class, "::processUsersList -> Could not process list of users."); list = new ArrayList<Map<String, String>>(0); } results.put("data", list); results.put("total", totalItemCount); return results; }
Source:
<code>public void toStringTest() { final NodeList<Name> list = nodeList(new Name("abc"), new Name("bcd"), new Name("cde")); <START> assertEquals("abcbcdcde", list.toString()); <END> }</code><technical_language>This instead "[abc, bcd, cde]" changes I suggested</technical_language>

Target:
public void toStringTest() { final NodeList<Name> list = nodeList(new Name("abc"), new Name("bcd"), new Name("cde")); assertEquals("[abc, bcd, cde]", list.toString()); }
Source:
<code>protected Map<String, Object> doWork() { log.info("Starting "+getClass().getSimpleName()+": " + this); DataForQueryStressor stressTestStressor = null; stressTestStressor = new DataForQueryStressor(); stressTestStressor.setNodeIndex(getSlaveIndex(), getActiveSlaveCount()); stressTestStressor.setDurationMillis(duration); stressTestStressor.setWildCard(isWildCard); stressTestStressor.setDataPath(dataPath); stressTestStressor.setPropertyLength(propertyLength); <START> <END> PropertyHelper.copyProperties(this, stressTestStressor); return stressTestStressor.stress(cacheWrapper); }</code><technical_language>set properties manually call PropertyHelper.copyProperties - properties identical name, therefore, set automatically (then need setters all)</technical_language>

Target:
protected Map<String, Object> doWork() { log.info("Starting "+getClass().getSimpleName()+": " + this); DataForQueryStressor stressTestStressor = null; stressTestStressor = new DataForQueryStressor(); stressTestStressor.setNodeIndex(getSlaveIndex(), getActiveSlaveCount()); PropertyHelper.copyProperties(this, stressTestStressor); return stressTestStressor.stress(cacheWrapper); }
Source:
<code>private Response processMessage(final MessageHandler handler, final Message message) { Response response; try { response = handler.handle(message); } catch (MessageHandler.HandleException e) { response = Response.of(e.getMessage()); <START> LOGGER.log(Level.WARNING, "Exception while processing message", e); <END> } return response; }</code><technical_language>add some message info</technical_language>

Target:
private Response processMessage(final MessageHandler handler, final Message message) { Response response; try { response = handler.handle(message); } catch (MessageHandler.HandleException e) { response = Response.of(e.getMessage()); LOGGER.log(Level.WARNING, "Exception while processing message " + message, e); } return response; }