auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public VDSInfoReturn getCapabilities(BrokerCommandCallback callback) { JsonRpcRequest request = new RequestBuilder("Host.getCapabilities").build(); <START> Map<String, Object> response = new FutureMap(this.client, request, callback) .withResponseKey("info"); <END> return new VDSInfoReturn(response, true); }</code><technical_language>do like: client.call(request, callback); return handled a callback</technical_language>

Target:
public void getCapabilities(BrokerCommandCallback callback) { JsonRpcRequest request = new RequestBuilder("Host.getCapabilities").build(); try { client.call(request, callback); } catch (ClientConnectionException e) { throw new TransportRunTimeException("Connection issues during send request", e); } }
Source:
<code>public boolean canFindVdsToRunOn(List<String> messages, boolean isMigrate) { boolean returnValue = false; if (getDestinationVdsId() != null) { returnValue = canRunOnDestinationVds(messages, isMigrate); } if (!returnValue) { if (privateVm.getMigrationSupport() == MigrationSupport.PINNED_TO_HOST) { messages.add(0, VdcBllMessages.VM_PINNED_TO_HOST_CANNOT_RUN_ON_THE_DEFAULT_VDS.toString()); <START> String hostName = getDestinationVdsId() != null ? DbFacade.getInstance() <END> .getVdsDao() .get(getDestinationVdsId()) .getName() : null; if (hostName != null) { messages.add(1, String.format("$VdsName %1$s", hostName)); } else { messages.add(1, VdcBllMessages.HOST_NAME_NOT_AVAILABLE.toString()); } return false; } returnValue = canFindAnyVds(messages, isMigrate); } return returnValue; }</code><technical_language>mind changing positive condition? getDestinationVdsId() == null ? null : ...</technical_language>

Target:
public boolean canFindVdsToRunOn(List<String> messages, boolean isMigrate) { boolean returnValue = false; if (getDestinationVdsId() != null) { returnValue = canRunOnDestinationVds(messages, isMigrate); } if (!returnValue) { if (privateVm.getMigrationSupport() == MigrationSupport.PINNED_TO_HOST) { messages.add(0, VdcBllMessages.VM_PINNED_TO_HOST_CANNOT_RUN_ON_THE_DEFAULT_VDS.toString()); VDS host = getDestinationVdsId() == null ? null : DbFacade.getInstance() .getVdsDao() .get(getDestinationVdsId()); String hostName = host == null ? null : host.getName(); messages.add(1, host == null ? VdcBllMessages.HOST_NAME_NOT_AVAILABLE.toString() : String.format("$VdsName %1$s", hostName)); return false; } returnValue = canFindAnyVds(messages, isMigrate); } return returnValue; }
Source:
<code>public static ValidationReport fromGraph(Graph graph, Node node) { boolean conforms = G.contains(graph, node, SHACL.conforms, C.TRUE); List<Node> results = G.listSP(graph, node, SHACL.result); <START> if ( conforms && ! results.isEmpty() ) <END> if ( conforms ) return ValidationReport.create().build(); List<ReportEntry> entries = new ArrayList<>(); Set<Triple> paths = new HashSet<>(); for ( Node r : results ) { Node pn = get(graph, r, SHACL.resultPath); Path path = ( pn != null ) ? ShaclPaths.parsePath(graph, pn) : null ; ReportEntry e = ReportEntry.create() .focusNode( get(graph, r, SHACL.focusNode) ) .resultPath( path ) .message( get(graph, r, SHACL.resultMessage) ) .severity( get(graph, r, SHACL.resultSeverity) ) .source( get(graph, r, SHACL.sourceShape) ) .sourceConstraint( get(graph, r, SHACL.sourceConstraint) ) .sourceConstraintComponent( get(graph, r, SHACL.sourceConstraintComponent) ) .detail( get(graph, r, SHACL.detail) ) .value( get(graph, r, SHACL.value) ) ; entries.add(e); } return new ValidationReport(paths, entries); }</code><technical_language>debug/unused code</technical_language>

Target:
public static ValidationReport fromGraph(Graph graph, Node node) { boolean conforms = G.contains(graph, node, SHACL.conforms, C.TRUE); List<Node> results = G.listSP(graph, node, SHACL.result); if ( conforms ) return ValidationReport.create().build(); List<ReportEntry> entries = new ArrayList<>(); Set<Triple> paths = new HashSet<>(); for ( Node r : results ) { Node pn = get(graph, r, SHACL.resultPath); Path path = ( pn != null ) ? ShaclPaths.parsePath(graph, pn) : null ; ReportEntry e = ReportEntry.create() .focusNode( get(graph, r, SHACL.focusNode) ) .resultPath( path ) .message( get(graph, r, SHACL.resultMessage) ) .severity( get(graph, r, SHACL.resultSeverity) ) .source( get(graph, r, SHACL.sourceShape) ) .sourceConstraint( get(graph, r, SHACL.sourceConstraint) ) .sourceConstraintComponent( get(graph, r, SHACL.sourceConstraintComponent) ) .detail( get(graph, r, SHACL.detail) ) .value( get(graph, r, SHACL.value) ) ; entries.add(e); } return new ValidationReport(paths, entries, graph.getPrefixMapping()); }
Source:
<code>public List<Expression> getExpressions() { <START> List<Expression> result = new ArrayList<Expression>(groupByAttributes); <END> result.add(expression); return result; }</code><technical_language>Type argument Expression is need</technical_language>

Target:
public List<Expression> getExpressions() { List<Expression> result = new ArrayList<>(groupByAttributes); result.add(expression); return result; }
Source:
<code>public static void afterClass() { if (DELETE_AFTER_TEST) { try { <START> FileUtils.deleteDirectory(new File("TestCameraTrapData")); <END> } catch (IOException ex) { LOG.error(null, ex); } } }</code><technical_language>method throws exception</technical_language>

Target:
public static void afterClass() throws IOException { if (DELETE_AFTER_TEST) { FileUtils.deleteDirectory(new File("TestCameraTrapData")); } }
Source:
<code>private static void addModuleToCodePath(@NotNull GeneralCommandLine commandLine, @NotNull JpsModule module, boolean forTests, @NotNull CompileContext context) throws ProjectBuildException{ File outputDirectory = getBuildOutputDirectory(module, forTests, context); <START> commandLine.addParameters("-pa", outputDirectory.getPath()); <END> for(String rootUrl : module.getContentRootsList().getUrls()){ try{ String path = new URL(rootUrl).getPath(); commandLine.addParameters("-pa", path); }catch (MalformedURLException e){ context.processMessage(new CompilerMessage(ElIXIRC_NAME, BuildMessage.Kind.ERROR, "Failed to find content root for module: " + module.getName())); } } }</code><technical_language>[x] "-pa" command line option is more once, reader understand meaning putting in a constant, ADD_PATH_TO_FRONT_OF_CODE_PATH = "-pa". Yes, more verbose, relieves reader of elixirc erlc command line options</technical_language>

Target:
private static void addModuleToCodePath(@NotNull GeneralCommandLine commandLine, @NotNull JpsModule module, boolean forTests, @NotNull CompileContext context) throws ProjectBuildException{ File outputDirectory = getBuildOutputDirectory(module, forTests, context); commandLine.addParameters(ADD_PATH_TO_FRONT_OF_CODE_PATH, outputDirectory.getPath()); for(String rootUrl : module.getContentRootsList().getUrls()){ try{ String path = new URL(rootUrl).getPath(); commandLine.addParameters(ADD_PATH_TO_FRONT_OF_CODE_PATH, path); }catch (MalformedURLException e){ context.processMessage(new CompilerMessage(ElIXIRC_NAME, BuildMessage.Kind.ERROR, "Failed to find content root for module: " + module.getName())); } } }
Source:
<code>public void addResourceRole(PerunSession sess, User user, Role role, Resource resource) throws InternalErrorException, AlreadyAdminException { if (!role.equals(Role.RESOURCESELFSERVICE)) { <START> throw new InternalErrorException("Role '" + role + "' cannot be set on resource."); <END> } try { jdbc.update("insert into authz (user_id, role_id, resource_id) values (?, (select id from roles where name=?), ?)", user.getId(), role.getRoleName(), resource.getId()); } catch (DataIntegrityViolationException e) { throw new AlreadyAdminException("User id=" + user.getId() + " is already "+role+" in resource " + resource, e, user, resource, role); } catch (RuntimeException e) { throw new InternalErrorException(e); } }</code><technical_language>Erase single quotes in exception message</technical_language>

Target:
public void addResourceRole(PerunSession sess, User user, Role role, Resource resource) throws InternalErrorException, AlreadyAdminException { if (!role.equals(Role.RESOURCESELFSERVICE)) { throw new InternalErrorException("Role " + role + " cannot be set on resource."); } try { jdbc.update("insert into authz (user_id, role_id, resource_id) values (?, (select id from roles where name=?), ?)", user.getId(), role.getRoleName(), resource.getId()); } catch (DataIntegrityViolationException e) { throw new AlreadyAdminException("User id=" + user.getId() + " is already "+role+" in resource " + resource, e, user, resource, role); } catch (RuntimeException e) { throw new InternalErrorException(e); } }
Source:
<code>public final String pushState(@Parameter(description = "The destination site name", name = "SiteName") String siteName) { String status = bringSiteOnline(siteName); if (!SUCCESS.equals(status)) { return String.format("Unable to pushState to '%s'. %s", siteName, status); } try { stateTransferManager.startPushState(siteName); } catch (Throwable throwable) { <START> log.errorf(throwable, "Unable to pushState to '%s'.", siteName); <END> return String.format("Unable to pushState to '%s'. %s", siteName, throwable.getLocalizedMessage()); } return SUCCESS; }</code><technical_language>in Log interface</technical_language>

Target:
public final String pushState(@Parameter(description = "The destination site name", name = "SiteName") String siteName) { try { String status = bringSiteOnline(siteName); if (!SUCCESS.equals(status)) { return String.format("Unable to pushState to '%s'. %s", siteName, status); } stateTransferManager.startPushState(siteName); } catch (Throwable throwable) { log.xsiteAdminOperationError("pushState", siteName, throwable); return String.format("Unable to pushState to '%s'. %s", siteName, throwable.getLocalizedMessage()); } return SUCCESS; }
Source:
<code>public void afterDownloadingXForm_cancelling_throwsInterruptedExceptionAndDoesNotSaveAnything() throws Exception { String xform = createXForm("id", "version"); ServerFormDetails serverFormDetails = new ServerFormDetails( "Form", "http://downloadUrl", "http://manifestUrl", "id", "version", "md5:" + FileUtils.getMd5Hash(new ByteArrayInputStream(xform.getBytes())), true, false, null); CancelAfterFormDownloadFormListApi formListApi = new CancelAfterFormDownloadFormListApi(xform); ServerFormDownloader downloader = new ServerFormDownloader(formListApi, formsRepository, cacheDir, formsDir.getAbsolutePath()); try { downloader.downloadForm(serverFormDetails, null, formListApi); <START> fail("Excepted exception"); <END> } catch (InterruptedException e) { assertThat(formsRepository.getAll(), is(empty())); assertThat(asList(new File(getCacheFilesPath()).listFiles()), is(empty())); assertThat(asList(new File(getFormFilesPath()).listFiles()), is(empty())); } }</code><technical_language>Expected</technical_language>

Target:
public void afterDownloadingXForm_cancelling_throwsInterruptedExceptionAndDoesNotSaveAnything() throws Exception { String xform = createXForm("id", "version"); ServerFormDetails serverFormDetails = new ServerFormDetails( "Form", "http://downloadUrl", "http://manifestUrl", "id", "version", "md5:" + FileUtils.getMd5Hash(new ByteArrayInputStream(xform.getBytes())), true, false, null); CancelAfterFormDownloadFormSource formListApi = new CancelAfterFormDownloadFormSource(xform); ServerFormDownloader downloader = new ServerFormDownloader(formListApi, formsRepository, cacheDir, formsDir.getAbsolutePath(), new FormMetadataParser(ReferenceManager.instance())); try { downloader.downloadForm(serverFormDetails, null, formListApi); fail("Expected exception"); } catch (InterruptedException e) { assertThat(formsRepository.getAll(), is(empty())); assertThat(asList(new File(getCacheFilesPath()).listFiles()), is(empty())); assertThat(asList(new File(getFormFilesPath()).listFiles()), is(empty())); } }
Source:
<code>public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) { markGlobalFailure(); if (context == null) { logger.debug("Encountered null metric context likely due to exception in preInvocation: {}", UnsafeArg.of("exception", cause), cause); return; } String failuresMetricName = InstrumentationUtils.getFailuresMetricName(context, serviceName); <START> Map<String, String> tags = tagFunction.map(f -> f.apply(context)).orElse(ImmutableMap.of()); <END> taggedMetricRegistry.meter(MetricName.builder() .safeName(failuresMetricName) .safeTags(tags) .build()) .mark(); taggedMetricRegistry.meter(MetricName.builder() .safeName(MetricRegistry.name(failuresMetricName, cause.getClass().getName())) .safeTags(tags) .build()) .mark(); }</code><technical_language>nit: orElseGet(() -> ... (as CircleCI kindly pointed out)</technical_language>

Target:
public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) { markGlobalFailure(); if (context == null) { logger.debug("Encountered null metric context likely due to exception in preInvocation: {}", UnsafeArg.of("exception", cause), cause); return; } String failuresMetricName = InstrumentationUtils.getFailuresMetricName(context, serviceName); Map<String, String> tags = tagFunction.map(f -> f.apply(context)).orElseGet(ImmutableMap::of); taggedMetricRegistry.meter(MetricName.builder() .safeName(failuresMetricName) .safeTags(tags) .build()) .mark(); taggedMetricRegistry.meter(MetricName.builder() .safeName(MetricRegistry.name(failuresMetricName, cause.getClass().getName())) .safeTags(tags) .build()) .mark(); }
Source:
<code>private double getMatchingPrice(ArrayList<Order> sortedBuyOrderBook, ArrayList<Order> sortedSellOrderBook) { double matchingPrice; int <START> obSize; <END> if (sortedBuyOrderBook.size() > sortedSellOrderBook.size()) { obSize = sortedBuyOrderBook.size(); }else{ obSize = sortedSellOrderBook.size(); } int[] cumulativeSell = new int[obSize]; int[] cumulativeBuy = new int[obSize]; int[] totalTrades = new int[obSize]; double[] tradePrices = new double[obSize]; int individualBuy = 0; int individualSell = 0; for (int i = 0; i < obSize; i++) { Order so; Order bo; if (i < sortedSellOrderBook.size()) { so = sortedSellOrderBook.get(i); individualSell = so.getSize(); cumulativeSell[i] = (i > 0) ? cumulativeSell[i-1] + individualSell : individualSell; } tradePrices[i] = sortedSellOrderBook.get(i).getPrice(); if (i < sortedBuyOrderBook.size()) { bo = sortedBuyOrderBook.get(i); individualBuy = bo.getSize(); cumulativeBuy[i] = (i > 0) ? cumulativeBuy[i-1] + individualBuy : individualBuy; } } for (int i = 0; i < obSize; i++){ totalTrades[i] = cumulativeBuy[i] + cumulativeSell[i]; } matchingPrice = tradePrices[0]; for (int i = 0; i < totalTrades.length; i++) { if (totalTrades[i] > matchingPrice) { matchingPrice = tradePrices[i]; } } return matchingPrice; }</code><technical_language>change this variable name a more revealable name describe does</technical_language>

Target:
private double getMatchingPrice(ArrayList<Order> sortedBuyOrderBook, ArrayList<Order> sortedSellOrderBook) { double matchingPrice; int obSize; if (sortedBuyOrderBook.size() > sortedSellOrderBook.size()) { obSize = sortedBuyOrderBook.size(); }else{ obSize = sortedSellOrderBook.size(); } int[] cumulativeSell = new int[obSize]; int[] cumulativeBuy = new int[obSize]; int[] totalTrades = new int[obSize]; double[] tradePrices = new double[obSize]; int individualBuy = 0; int individualSell = 0; for (int i = 0; i < obSize; i++) { Order sellord; Order buyord; if (i < sortedSellOrderBook.size()) { sellord = sortedSellOrderBook.get(i); individualSell = sellord.getSize(); cumulativeSell[i] = (i > 0) ? cumulativeSell[i-1] + individualSell : individualSell; } tradePrices[i] = sortedSellOrderBook.get(i).getPrice(); if (i < sortedBuyOrderBook.size()) { buyord = sortedBuyOrderBook.get(i); individualBuy = buyord.getSize(); cumulativeBuy[i] = (i > 0) ? cumulativeBuy[i-1] + individualBuy : individualBuy; } } for (int i = 0; i < obSize; i++){ totalTrades[i] = cumulativeBuy[i] + cumulativeSell[i]; } matchingPrice = tradePrices[0]; for (int i = 0; i < totalTrades.length; i++) { if (totalTrades[i] > matchingPrice) { matchingPrice = tradePrices[i]; } } return matchingPrice; }
Source:
<code>public DDFCache(DDFManager manager) { mDDFManager = manager; Long maxNumberOfDDFs = Long.valueOf(Config.getGlobalValue(Config.ConfigConstant.MAX_NUMBER_OF_DDFS_IN_CACHE)); <START> <END> Long timeToIdle = Long.valueOf(Config.getGlobalValue(Config.ConfigConstant.DDF_TIME_TO_IDLE_SECONDS)); mLog.info(String.format("Maximum number of ddfs in cache %s", maxNumberOfDDFs)); mLog.info(String.format("DDF's time to idle = %s seconds", timeToIdle)); mDDFCache = CacheBuilder.newBuilder(). maximumSize(maxNumberOfDDFs).expireAfterAccess(timeToIdle, TimeUnit.SECONDS). recordStats().removalListener(new DDFRemovalListener()) .build(new CacheLoader<UUID, DDF>() { @Override public DDF load(UUID uuid) throws Exception { try { mLog.info(String.format("restoring ddf %s", uuid)); return mDDFManager.restoreDDF(uuid); } catch (Exception e) { mLog.error(String.format("Error restoring DDF %s, error = %s", uuid, ExceptionUtils.getStackTrace(e))); throw new DDFException(String.format("DDF with uuid %s does not exist", uuid)); } } }); }</code><technical_language>thought, cache a DDF, is underlying data cached? if is, size of DDF large, hit OOM number of DDF limit in cache is hit</technical_language>

Target:
public DDFCache(DDFManager manager) { mDDFManager = manager; Long maxNumberOfDDFs = Long.valueOf(Config.getGlobalValue(Config.ConfigConstant.MAX_NUMBER_OF_DDFS_IN_CACHE)); Long maxNumberOfDDFsWName = Long .valueOf(Config.getGlobalValue(Config.ConfigConstant.MAX_NUMBER_OF_DDFS_WITH_NAME_IN_CACHE)); Long timeToIdle = Long.valueOf(Config.getGlobalValue(Config.ConfigConstant.DDF_TIME_TO_IDLE_SECONDS)); mLog.info(String.format("Maximum number of ddfs in cache %s", maxNumberOfDDFs)); mLog.info(String.format("DDF's time to idle = %s seconds", timeToIdle)); mDDFCache = CacheBuilder.newBuilder(). maximumSize(maxNumberOfDDFs).expireAfterAccess(timeToIdle, TimeUnit.SECONDS). recordStats().removalListener(new DDFRemovalListener()).build(); mDDFwithNameCache = CacheBuilder.newBuilder(). maximumSize(maxNumberOfDDFsWName).recordStats().removalListener(new DDFRemovalListener()).build(); }
Source:
<code>private Set<String> getKeysFromDeps(List<Dependency> deps) { <START> Set<String> depsMap = new HashSet<>(deps.size()); <END> for (Dependency dep : deps) { StringBuilder sb = new StringBuilder(); sb.append(dep.getGroupId()).append(DELIMITER).append(dep.getArtifactId()).append(DELIMITER).append(dep.getVersion()); depsMap.add(sb.toString()); } return depsMap; }</code><technical_language>variable name depsMap for Set is confusing</technical_language>

Target:
private Map<String, String> getKeysFromDeps(List<Dependency> deps) { Map<String, String> depsMap = new HashMap(deps.size()); for (Dependency dep : deps) { StringBuilder sb = new StringBuilder(); sb.append(dep.getGroupId()).append(DELIMITER).append(dep.getArtifactId()); depsMap.put(sb.toString(), dep.getVersion()); } return depsMap; }
Source:
<code>public CounterChartViewer(Composite parent) { super(parent, null, null, null); Chart chart = getSwtChart(); chart.getLegend().setPosition(SWT.BOTTOM); chart.getLegend().setVisible(true); <START> chart.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); <END> }</code><technical_language>This COLOR_WIDGET_BACKGROUND, is gray plot area, plot area is white. match other widget backgrounds it. anyways, is default background of chart, necessary</technical_language>

Target:
public CounterChartViewer(Composite parent) { super(parent, null, null, null); Chart chart = getSwtChart(); chart.getLegend().setPosition(SWT.BOTTOM); chart.getLegend().setVisible(true); chart.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); }
Source:
<code>private BlockLease flattenDictionaryBlock(DictionaryBlock dictionaryBlock) { Block dictionary = dictionaryBlock.getDictionary(); int positionCount = dictionaryBlock.getPositionCount(); <START> int[] currentRemappedIds = (int[]) dictionaryBlock.getIds().getArray(); <END> int[] newRemappedIds = null; while (true) { if (dictionary instanceof DictionaryBlock) { dictionaryBlock = (DictionaryBlock) dictionary; int[] ids = (int[]) dictionaryBlock.getIds().getArray(); if (newRemappedIds == null) { newRemappedIds = allocator.borrowIntArray(positionCount); } for (int i = 0; i < positionCount; ++i) { newRemappedIds[i] = ids[currentRemappedIds[i] + dictionaryBlock.getOffsetBase()]; } currentRemappedIds = newRemappedIds; dictionary = dictionaryBlock.getDictionary(); } else if (dictionary instanceof RunLengthEncodedBlock) { RunLengthEncodedBlock rle = (RunLengthEncodedBlock) dictionary; if (newRemappedIds == null) { newRemappedIds = allocator.borrowIntArray(positionCount); } Arrays.fill(newRemappedIds, 0, positionCount, 0); currentRemappedIds = newRemappedIds; dictionary = rle.getValue(); } else { break; } } if (newRemappedIds == null) { return newLease(dictionaryBlock); } dictionary = new DictionaryBlock(positionCount, dictionary, currentRemappedIds); int[] leasedMapToReturn = newRemappedIds; return newLease(dictionary, () -> allocator.returnArray(leasedMapToReturn)); }</code><technical_language>(int[]) cast is redundant; L64</technical_language>

Target:
private BlockLease flattenDictionaryBlock(DictionaryBlock dictionaryBlock) { Block dictionary = dictionaryBlock.getDictionary(); int positionCount = dictionaryBlock.getPositionCount(); int[] currentRemappedIds = dictionaryBlock.getRawIds(); int[] newRemappedIds = null; while (true) { if (dictionary instanceof DictionaryBlock) { dictionaryBlock = (DictionaryBlock) dictionary; int[] ids = dictionaryBlock.getRawIds(); if (newRemappedIds == null) { newRemappedIds = allocator.borrowIntArray(positionCount); } for (int i = 0; i < positionCount; ++i) { newRemappedIds[i] = ids[currentRemappedIds[i] + dictionaryBlock.getOffsetBase()]; } currentRemappedIds = newRemappedIds; dictionary = dictionaryBlock.getDictionary(); } else if (dictionary instanceof RunLengthEncodedBlock) { RunLengthEncodedBlock rle = (RunLengthEncodedBlock) dictionary; if (newRemappedIds == null) { newRemappedIds = allocator.borrowIntArray(positionCount); } Arrays.fill(newRemappedIds, 0, positionCount, 0); currentRemappedIds = newRemappedIds; dictionary = rle.getValue(); } else { break; } } if (newRemappedIds == null) { return newLease(dictionaryBlock); } dictionary = new DictionaryBlock(positionCount, dictionary, currentRemappedIds); int[] leasedMapToReturn = newRemappedIds; return newLease(dictionary, () -> allocator.returnArray(leasedMapToReturn)); }
Source:
<code>private List<String> readAsList(InputTextField field) { if (field.getText().isEmpty()) { <START> return new ArrayList<>(); <END> } else { return Arrays.asList(StringUtils.deleteWhitespace(field.getText()).split(",")); } }</code><technical_language>Collections.emptyList() instead of new ArrayList<>()</technical_language>

Target:
private List<String> readAsList(InputTextField field) { if (field.getText().isEmpty()) { return Collections.emptyList(); } else { return Arrays.asList(StringUtils.deleteWhitespace(field.getText()).split(",")); } }
Source:
<code><START> public RedisJedisManager(String host, int port, int database, String password) { <END> JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); jedisPoolConfig.setMaxTotal(maxTotal); jedisPoolConfig.setMaxIdle(maxIdle); jedisPoolConfig.setMinIdle(minIdle); this.host = host; this.port = port; this.database = database; this.password = password; this.jedisPoolConfig = jedisPoolConfig; this.jedisPoolCache = CacheBuilder.newBuilder().build(CacheLoader.from(this::createConsumer)); }</code><technical_language>Allow external JedisPool instantiated user</technical_language>

Target:
public RedisJedisManager(String host, int port, int database, String password) { JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); jedisPoolConfig.setMaxTotal(maxTotal); jedisPoolConfig.setMaxIdle(maxIdle); jedisPoolConfig.setMinIdle(minIdle); this.host = host; this.port = port; this.database = database; this.password = password; this.jedisPoolConfig = jedisPoolConfig; this.jedisPoolCache = CacheBuilder.newBuilder() .removalListener(new JedisPoolRemovalListener()) .build(CacheLoader.from(this::createConsumer)); }
Source:
<code>private boolean validateNewColumnRequest() { if (!userPrefs_.allowSourceColumns().getValue()) { pGlobalDisplay_.get().showMessage(GlobalDisplay.MSG_INFO, "Cannot Add Column", <START> "Allow Source Columns preference is disabled."); <END> return false; } else if (additionalSourceCount_ >= MAX_COLUMN_COUNT) { pGlobalDisplay_.get().showMessage(GlobalDisplay.MSG_INFO, "Cannot Add Column", "You can't add more than " + MAX_COLUMN_COUNT + " columns."); return false; } return true; }</code><technical_language>This command needs disabled, hidden, allowSourceColumns preference prevents working. suggest handling in source column manager (i.e. bind a preference listener sets command enabled/visible based of pref)</technical_language>

Target:
private boolean validateNewColumnRequest() { if (additionalSourceCount_ >= MAX_COLUMN_COUNT) { pGlobalDisplay_.get().showMessage(GlobalDisplay.MSG_INFO, "Cannot Add Column", "You can't add more than " + MAX_COLUMN_COUNT + " columns."); return false; } return true; }
Source:
<code>public void testRequestUriEnabled(Scenario scenario) throws Exception { start(false); RewriteRegexRule rule = new RewriteRegexRule(); reset(); <START> _request.setHttpURI(HttpURI.build(_request.getHttpURI()).asImmutable()); <END> rule.setRegex(scenario.regex); rule.setReplacement(scenario.replacement); _request.setHttpURI(HttpURI.build(_request.getHttpURI(), scenario.uriPathQuery, null, scenario.queryString).asImmutable()); String result = rule.matchAndApply(scenario.uriPathQuery, _request, _response); assertEquals(scenario.expectedRequestURI, result); rule.applyURI(_request, scenario.uriPathQuery, result); if (result != null) { assertEquals(scenario.expectedRequestURI, _request.getRequestURI()); assertEquals(scenario.expectedQueryString, _request.getQueryString()); } if (scenario.expectedQueryString != null) { MultiMap<String> params = new MultiMap<String>(); UrlEncoded.decodeTo(scenario.expectedQueryString, params, StandardCharsets.UTF_8); for (String n : params.keySet()) { assertEquals(params.getString(n), _request.getParameter(n)); } } }</code><technical_language>Remove asImmutable() this test class</technical_language>

Target:
public void testRequestUriEnabled(Scenario scenario) throws Exception { start(false); RewriteRegexRule rule = new RewriteRegexRule(); reset(); _request.setHttpURI(HttpURI.build(_request.getHttpURI())); rule.setRegex(scenario.regex); rule.setReplacement(scenario.replacement); _request.setHttpURI(HttpURI.build(_request.getHttpURI(), scenario.uriPathQuery, null, scenario.queryString)); String result = rule.matchAndApply(scenario.uriPathQuery, _request, _response); assertEquals(scenario.expectedRequestURI, result); rule.applyURI(_request, scenario.uriPathQuery, result); if (result != null) { assertEquals(scenario.expectedRequestURI, _request.getRequestURI()); assertEquals(scenario.expectedQueryString, _request.getQueryString()); } if (scenario.expectedQueryString != null) { MultiMap<String> params = new MultiMap<String>(); UrlEncoded.decodeTo(scenario.expectedQueryString, params, StandardCharsets.UTF_8); for (String n : params.keySet()) { assertEquals(params.getString(n), _request.getParameter(n)); } } }
Source:
<code>public void setUp() throws Exception { <START> this.workspaceName = generate("workspace", 5); <END> dashboard.open(); createWorkspaceHelper.createAndEditWorkspaceFromStack( Devfile.JAVA_MAVEN, workspaceName, Collections.emptyList(), null); }</code><technical_language>need delete test workspace pragmatically test finished</technical_language>

Target:
public void setUp() throws Exception { dashboard.open(); createWorkspaceHelper.createAndEditWorkspaceFromStack( Devfile.JAVA_MAVEN, WORKSPACE_NAME, Collections.emptyList(), null); }
Source:
<code>public LiuWestFilter(Model model, Properties properties) { super(model, properties); String rhoStr = properties.getProperty("rho", "1"); try { rho = Double.parseDouble(rhoStr); System.out.println("perturbation amount: " + rho); } catch (NumberFormatException e) { Util.fatalErrorWithoutStack("Invalid rho parameter: " + rhoStr); } funcNamesToPerturb = new ArrayList<String>(); for (Function func : model.getFunctions()) { if (func instanceof NonRandomFunction) { continue; } if (func.isTimeIndexed()) { continue; } if (func.getRetType() != BuiltInTypes.REAL) { continue; } if (func.getArgTypes().length > 0) { continue; } <START> funcNamesToPerturb.add(func.getName()); <END> } System.out.println("funcNamesToPerturb: " + funcNamesToPerturb); }</code><technical_language>I suppose store function itself</technical_language>

Target:
public LiuWestFilter(Model model, Properties properties) { super(model, properties); String rhoStr = properties.getProperty("rho", "0.97"); try { rho = Double.parseDouble(rhoStr); System.out.println("perturbation amount: " + rho); } catch (NumberFormatException e) { Util.fatalErrorWithoutStack("Invalid rho parameter: " + rhoStr); } funcNamesToPerturb = new ArrayList<String>(); for (Function func : model.getFunctions()) { if (func instanceof NonRandomFunction) { continue; } if (func.isTimeIndexed()) { continue; } if (func.getRetType() != BuiltInTypes.REAL) { continue; } if (func.getArgTypes().length > 0) { continue; } funcNamesToPerturb.add(func.getName()); } System.out.println("funcNamesToPerturb: " + funcNamesToPerturb); }
Source:
<code>public GroupedExecutionProperties visitTableScan(TableScanNode node, Void context) { Optional<TablePartitioning> tablePartitioning = metadata.getLayout(session, node.getTable()).getTablePartitioning(); if (!tablePartitioning.isPresent()) { return GroupedExecutionProperties.notCapable(); } List<ConnectorPartitionHandle> partitionHandles = nodePartitioningManager.listPartitionHandles(session, tablePartitioning.get().getPartitioningHandle()); if (ImmutableList.of(NOT_PARTITIONED).equals(partitionHandles)) { <START> return new GroupedExecutionProperties(false, false, ImmutableList.of(), partitionHandles.size()); <END> } else { return new GroupedExecutionProperties(true, false, ImmutableList.of(node.getId()), partitionHandles.size()); } }</code><technical_language>nit: set hardcoded 1</technical_language>

Target:
public GroupedExecutionProperties visitTableScan(TableScanNode node, Void context) { Optional<TablePartitioning> tablePartitioning = metadata.getLayout(session, node.getTable()).getTablePartitioning(); if (!tablePartitioning.isPresent()) { return GroupedExecutionProperties.notCapable(); } List<ConnectorPartitionHandle> partitionHandles = nodePartitioningManager.listPartitionHandles(session, tablePartitioning.get().getPartitioningHandle()); if (ImmutableList.of(NOT_PARTITIONED).equals(partitionHandles)) { return new GroupedExecutionProperties(false, false, ImmutableList.of(), 1); } else { return new GroupedExecutionProperties(true, false, ImmutableList.of(node.getId()), partitionHandles.size()); } }
Source:
<code>ZoneIdentifierInfo(AbstractFile zoneFile) throws FileNotFoundException, IOException { String line; <START> try (BufferedReader reader = new BufferedReader(new InputStreamReader(new ReadContentInputStream(zoneFile)))) { <END> while ((line = reader.readLine()) != null) { String[] tokens = line.split("="); if (tokens.length < 2) { continue; } dataMap.put(tokens[0].trim().toLowerCase(), tokens[1].trim()); } } }</code><technical_language>I consider [Properties ](<LINK_0> avoiding this level stream reading code</technical_language>

Target:
ZoneIdentifierInfo(AbstractFile zoneFile) throws IOException { properties.load(new ReadContentInputStream(zoneFile)); }
Source:
<code>public static int calcHeatNeutralHSRequirement(Entity entity) { int heat = 0; for (Mounted m : entity.getWeaponList()) { WeaponType wt = (WeaponType) m.getType(); if ((wt.hasFlag(WeaponType.F_LASER) && (wt.getAmmoType() == AmmoType.T_NA)) || wt.hasFlag(WeaponType.F_PPC) || wt.hasFlag(WeaponType.F_PLASMA) || wt.hasFlag(WeaponType.F_PLASMA_MFUK) || (wt.hasFlag(WeaponType.F_FLAMER) && (wt.getAmmoType() == AmmoType.T_NA))) { heat += wt.getHeat(); } if (wt.hasFlag(WeaponType.F_LASER) && (m.getLinkedBy() != null) && !m.getLinkedBy().isInoperable() && m.getLinkedBy().getType().hasFlag(MiscType.F_LASER_INSULATOR)) { heat -= 1; if (heat == 0) { heat++; } } if ((m.getLinkedBy() != null) && (m.getLinkedBy().getType() instanceof MiscType) && m.getLinkedBy().getType(). hasFlag(MiscType.F_PPC_CAPACITOR)) { heat += 5; } } for (Mounted m : entity.getMisc()) { if (m.getType().hasFlag(MiscType.F_CLUB) && m.getType().hasSubType(MiscType.S_SPOT_WELDER) && entity.hasEngine() && (entity.getEngine().isFusion() <START> || entity.getEngine().getEngineType() == Engine.FISSION)) { <END> continue; } heat += m.getType().getHeat(); } if (entity.hasStealth()) { heat += 10; } return heat; }</code><technical_language>suggestion || (entity.getEngine().getEngineType() == Engine.FISSION))) {</technical_language>

Target:
public static int calcHeatNeutralHSRequirement(Entity entity) { int heat = 0; for (Mounted m : entity.getWeaponList()) { WeaponType wt = (WeaponType) m.getType(); if ((wt.hasFlag(WeaponType.F_LASER) && (wt.getAmmoType() == AmmoType.T_NA)) || wt.hasFlag(WeaponType.F_PPC) || wt.hasFlag(WeaponType.F_PLASMA) || wt.hasFlag(WeaponType.F_PLASMA_MFUK) || (wt.hasFlag(WeaponType.F_FLAMER) && (wt.getAmmoType() == AmmoType.T_NA))) { heat += wt.getHeat(); } if (wt.hasFlag(WeaponType.F_LASER) && (m.getLinkedBy() != null) && !m.getLinkedBy().isInoperable() && m.getLinkedBy().getType().hasFlag(MiscType.F_LASER_INSULATOR)) { heat -= 1; if (heat == 0) { heat++; } } if ((m.getLinkedBy() != null) && (m.getLinkedBy().getType() instanceof MiscType) && m.getLinkedBy().getType(). hasFlag(MiscType.F_PPC_CAPACITOR)) { heat += 5; } } for (Mounted m : entity.getMisc()) { if (m.getType().hasFlag(MiscType.F_CLUB) && m.getType().hasSubType(MiscType.S_SPOT_WELDER) && entity.hasEngine() && (entity.getEngine().isFusion() || (entity.getEngine().getEngineType() == Engine.FISSION))) { continue; } heat += m.getType().getHeat(); } if (entity.hasStealth()) { heat += 10; } return heat; }
Source:
<code>public int hashCode() { int certsHashCode = 0; Collection<CertificateDTO> certificateDTOs = this.getCertificates(); if (certificateDTOs != null) { for (CertificateDTO dto : certificateDTOs) { certsHashCode = 31 * certsHashCode + (dto != null ? dto.hashCode() : 0); } } <START> <END> HashCodeBuilder builder = new HashCodeBuilder(37, 7) .append(super.hashCode()) .append(this.getId()) .append(this.getOwner() != null ? this.getOwner().getId() : null) .append(this.getPool() != null ? this.getPool().getId() : null) .append(this.getConsumer() != null ? this.getConsumer().getUuid() : null) .append(this.getQuantity()) .append(this.isDeletedFromPool()) .append(this.getEndDate()) .append(this.getStartDate()) .append(certsHashCode); return builder.toHashCode(); }</code><technical_language>This loop needs hashcode of ID match equals is using</technical_language>

Target:
public int hashCode() { int certsHashCode = 0; Collection<CertificateDTO> certificateDTOs = this.getCertificates(); if (certificateDTOs != null) { for (CertificateDTO dto : certificateDTOs) { certsHashCode = 31 * certsHashCode + (dto != null && dto.getId() != null ? dto.getId().hashCode() : 0); } } HashCodeBuilder builder = new HashCodeBuilder(37, 7) .append(super.hashCode()) .append(this.getId()) .append(this.getOwner() != null ? this.getOwner().getId() : null) .append(this.getPool() != null ? this.getPool().getId() : null) .append(this.getConsumer() != null ? this.getConsumer().getUuid() : null) .append(this.getQuantity()) .append(this.isDeletedFromPool()) .append(this.getEndDate()) .append(this.getStartDate()) .append(certsHashCode); return builder.toHashCode(); }
Source:
<code>public void updated(Provider<E> provider, E oldElement, E element) { Collection<E> elements = elementMap.get(provider); if (elements != null && elements.contains(oldElement) && oldElement.getUID().equals(element.getUID())) { try { E existingElement = get(oldElement.getUID()); if (existingElement != null) { beforeUpdateElement(existingElement); } onUpdateElement(oldElement, element); <START> if (existingElement != null) { <END> elements.remove(existingElement); } elements.add(element); notifyListenersAboutUpdatedElement(oldElement, element); } catch (Exception ex) { logger.warn("Could not update element: {}", ex.getMessage(), ex); } } }</code><technical_language>depends collection itself. A collection is allowed throw a NPE if it... NullPointerException - if element is null this collection permit null elements (optional) put CopyOnWriteArraySet a collection implementation map. So, change map type CopyOnWriteArraySet handle collection save here</technical_language>

Target:
public void updated(Provider<E> provider, E oldElement, E element) { Collection<E> elements = elementMap.get(provider); if (elements != null && elements.contains(oldElement) && oldElement.getUID().equals(element.getUID())) { try { E existingElement = get(oldElement.getUID()); if (existingElement != null) { beforeUpdateElement(existingElement); } else { logger.debug("{} with key '{}' could not be updated for provider because it does not exist!", element.getClass().getSimpleName(), element.getUID(), provider.getClass().getSimpleName()); } onUpdateElement(oldElement, element); if (existingElement != null) { elements.remove(existingElement); } elements.add(element); notifyListenersAboutUpdatedElement(oldElement, element); } catch (Exception ex) { logger.warn("Could not update element: {}", ex.getMessage(), ex); } } }
Source:
<code>public StreamSpec streamFromConfig(String streamId) { StreamConfig streamConfig = new StreamConfig(config); <START> String defaultPhysicalName = String.format("%s-%s-%s", config.get(JobConfig.JOB_NAME()), config.get(JobConfig.JOB_ID(), "1"), streamId); <END> String physicalName = streamConfig.getPhysicalName(streamId, defaultPhysicalName); return streamFromConfig(streamId, physicalName); }</code><technical_language>good this reversible - e.g. making - is a separator is present in JOB_NAME</technical_language>

Target:
public StreamSpec streamFromConfig(String streamId) { StreamConfig streamConfig = new StreamConfig(config); String physicalName = streamConfig.getPhysicalName(streamId); return streamFromConfig(streamId, physicalName); }
Source:
<code>public StompSubframeDecoder(int maxLineLength, int maxChunkSize, boolean validateHeaders) { super(State.SKIP_CONTROL_CHARACTERS); checkPositive(maxLineLength, "maxLineLength"); checkPositive(maxChunkSize, "maxChunkSize"); this.maxChunkSize = maxChunkSize; commandParser = new Utf8LineParser(new AppendableCharSequence(16), maxLineLength); <START> headerParser = new HeaderParser(new AppendableCharSequence(123), maxLineLength, validateHeaders); <END> }</code><technical_language>123 ? (just curious)</technical_language>

Target:
public StompSubframeDecoder(int maxLineLength, int maxChunkSize, boolean validateHeaders) { super(State.SKIP_CONTROL_CHARACTERS); checkPositive(maxLineLength, "maxLineLength"); checkPositive(maxChunkSize, "maxChunkSize"); this.maxChunkSize = maxChunkSize; commandParser = new Utf8LineParser(new AppendableCharSequence(16), maxLineLength); headerParser = new HeaderParser(new AppendableCharSequence(128), maxLineLength, validateHeaders); }
Source:
<code>public SagaResult getResult() { <START> return !finished ? SagaResult.PROGRESS : forward ? SagaResult.FINISHED : SagaResult.ROLLBACKED; <END> }</code><technical_language>nested ternary operators quickly complicated for reader. simple if/else here</technical_language>

Target:
public SagaResult getResult() { if (finished) { return forward ? SagaResult.FINISHED : SagaResult.ROLLBACKED; } return SagaResult.PROGRESS; }
Source:
<code>private Expectations asyncGetExpectation( KeyValueService kvMock, Cell cell, long transactionTs, LockService lockMock) throws Exception { return new Expectations() {{ oneOf(kvMock).getAsync(TABLE, ImmutableMap.of(cell, transactionTs)); will(returnValue(Futures.immediateFailedFuture(new RuntimeException()))); <START> never(lockMock).lockWithFullLockResponse(with(LockClient.ANONYMOUS), with(any(LockRequest.class))); <END> }}; }</code><technical_language>JMock works, if suggest never(lockMock)... part a separate assertion part of ExpectationFactory's products, is of get is asynchronous</technical_language>

Target:
private Expectations asyncGetExpectation( KeyValueService kvMock, Cell cell, long transactionTs, LockService lockMock) { return new Expectations() {{ oneOf(kvMock).getAsync(TABLE, ImmutableMap.of(cell, transactionTs)); will(returnValue(Futures.immediateFailedFuture(new RuntimeException()))); }}; }
Source:
<code>public static void mergeIteratorConfig(List<IterInfo> destList, Map<String,Map<String,String>> destOpts, List<IterInfo> tableIters, Map<String,Map<String,String>> tableOpts, List<IterInfo> ssi, Map<String,Map<String,String>> ssio) { destList.addAll(tableIters); destList.addAll(ssi); <START> Collections.sort(destList, IterConfigUtil.ITER_INFO_COMPARATOR); <END> Set<Map.Entry<String,Map<String,String>>> es = tableOpts.entrySet(); for (Map.Entry<String,Map<String,String>> entry : es) { if (entry.getValue() == null) { destOpts.put(entry.getKey(), null); } else { destOpts.put(entry.getKey(), new HashMap<>(entry.getValue())); } } mergeOptions(ssio, destOpts); }</code><technical_language>drop IterConfigUtil. IterConfigUtil.ITER_INFO_COMPARATOR</technical_language>

Target:
public static void mergeIteratorConfig(List<IterInfo> destList, Map<String,Map<String,String>> destOpts, List<IterInfo> tableIters, Map<String,Map<String,String>> tableOpts, List<IterInfo> ssi, Map<String,Map<String,String>> ssio) { destList.addAll(tableIters); destList.addAll(ssi); Collections.sort(destList, ITER_INFO_COMPARATOR); Set<Entry<String,Map<String,String>>> es = tableOpts.entrySet(); for (Entry<String,Map<String,String>> entry : es) { if (entry.getValue() == null) { destOpts.put(entry.getKey(), null); } else { destOpts.put(entry.getKey(), new HashMap<>(entry.getValue())); } } mergeOptions(ssio, destOpts); }
Source:
<code>public void testPopulateFieldInfo() { TestOutputOperator outputOperator = setupForOutputOperatorTest(); outputOperator.input.setup(tpc); <START> outputOperator.setup(context); <END> outputOperator.activate(context); List<TestPojo> events = Lists.newArrayList(); for (int i = 0; i < 3; i++) { Set<Integer> set = new HashSet<Integer>(); set.add(i); List<Integer> list = new ArrayList<Integer>(); list.add(i); Map<String, Integer> map = new HashMap<String, Integer>(); map.put("key" + i, i); events.add(new TestPojo(UUID.randomUUID(), i, "abclast", true, i, 2.0, set, list, map, new Date(System.currentTimeMillis()))); } outputOperator.beginWindow(0); for (TestPojo event : events) { outputOperator.input.process(event); } outputOperator.endWindow(); Assert.assertEquals("rows in db", 3, outputOperator.getNumOfEventsInStore()); outputOperator.getEventsInStore(); }</code><technical_language>Check order of setup for input port operator</technical_language>

Target:
public void testPopulateFieldInfo() { TestOutputOperator outputOperator = setupForOutputOperatorTest(); outputOperator.setup(context); outputOperator.input.setup(tpc); outputOperator.activate(context); List<TestPojo> events = Lists.newArrayList(); for (int i = 0; i < 3; i++) { Set<Integer> set = new HashSet<Integer>(); set.add(i); List<Integer> list = new ArrayList<Integer>(); list.add(i); Map<String, Integer> map = new HashMap<String, Integer>(); map.put("key" + i, i); events.add(new TestPojo(UUID.randomUUID(), i, "abclast", true, i, 2.0, set, list, map, new Date(System.currentTimeMillis()))); } outputOperator.beginWindow(0); for (TestPojo event : events) { outputOperator.input.process(event); } outputOperator.endWindow(); Assert.assertEquals("rows in db", 3, outputOperator.getNumOfEventsInStore()); outputOperator.getEventsInStore(); }
Source:
<code>public FunctionPollConfig<S, T> supplier(final Supplier<? extends S> val) { checkNotNull(val, "supplier"); this.callable = new Callable<S>() { @Override public S call() throws Exception { <START> return (S) val.get(); <END> } }; return this; }</code><technical_language>Do cast? I missing something? strong feelings</technical_language>

Target:
public FunctionPollConfig<S, T> supplier(final Supplier<? extends S> val) { checkNotNull(val, "supplier"); this.callable = new Callable<S>() { @Override public S call() throws Exception { return val.get(); } }; return this; }
Source:
<code>public static SamInputResource of(final Path path) { <START> if (Files.isRegularFile(path)) { <END> return new SamInputResource(new PathInputResource(path)); } else { return of(path.toFile()); } }</code><technical_language>talking @lbergelson now, pointed out Files.isRegularFile() is expensive GCS (about expensive Files.exists()). a good idea check scheme of Path Files.isRegularFile() check. If Path a scheme, file://, create a PathInputResource unconditionally. If Path scheme, scheme is file://, do Files.isRegularFile() check decide create a PathInputResource a FileInputResource. Sound reasonable? check scheme of a Path path.toUri().getScheme(). If get exception, catch fall previous behavior</technical_language>

Target:
public static SamInputResource of(final Path path) { if (path.getFileSystem() == FileSystems.getDefault() && !Files.isRegularFile(path)) { return of(path.toFile()); } else { return new SamInputResource(new PathInputResource(path)); } }
Source:
<code>public void setClassId(String name) { <START> table_.setClassName(ClassIds.FAST_SELECT_TABLE + "_" + name); <END> }</code><technical_language>this potentially result in class names spaces in them</technical_language>

Target:
public void setClassId(String name) { table_.setClassName(ClassIds.FAST_SELECT_TABLE + "_" + ClassIds.idSafeString(name)); }
Source:
<code>public void run() { BufferedReader reader = new BufferedReader(new InputStreamReader(fInputStream)); try { String line; while ((line = reader.readLine()) != null) { if (line.length() != 0) { if(GdbDebugOptions.DEBUG) { <START> GdbDebugOptions.trace(String.format( "%s %s %s", GdbPlugin.getDebugTime(), MI_TRACE_IDENTIFIER, line)); END> } final String finalLine = line; if (getMITracingStream() != null) { try { String message = GdbPlugin.getDebugTime() + " " + finalLine + "\n"; while (message.length() > 100) { String partial = message.substring(0, 100) + "\\\n"; message = message.substring(100); getMITracingStream().write(partial.getBytes()); } getMITracingStream().write(message.getBytes()); } catch (IOException e) { setMITracingStream(null); } } processMIOutput(line); } } } catch (IOException e) { } catch (RejectedExecutionException e) { } try { fInputStream.close(); } catch (IOException e) { } }</code><technical_language>add a \n end in this case: "%s %s %s\n"</technical_language>

Target:
public void run() { BufferedReader reader = new BufferedReader(new InputStreamReader(fInputStream)); try { String line; while ((line = reader.readLine()) != null) { if (line.length() != 0) { if(GdbDebugOptions.DEBUG) { GdbDebugOptions.trace(String.format( "%s %s %s\n", GdbPlugin.getDebugTime(), MI_TRACE_IDENTIFIER, line)); } final String finalLine = line; if (getMITracingStream() != null) { try { String message = GdbPlugin.getDebugTime() + " " + finalLine + "\n"; while (message.length() > 100) { String partial = message.substring(0, 100) + "\\\n"; message = message.substring(100); getMITracingStream().write(partial.getBytes()); } getMITracingStream().write(message.getBytes()); } catch (IOException e) { setMITracingStream(null); } } processMIOutput(line); } } } catch (IOException e) { } catch (RejectedExecutionException e) { } try { fInputStream.close(); } catch (IOException e) { } }