auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>@Override public Image decodeImage(BufferedSource source, Request request) throws IOException { try { <START> SVG svg = SVG.getFromInputStream(source.peek().inputStream()); <END> if (request.hasSize()) { if (request.targetWidth != 0) { svg.setDocumentWidth(request.targetWidth); } if (request.targetHeight != 0) { svg.setDocumentHeight(request.targetHeight); } } int width = (int) svg.getDocumentWidth(); if (width == -1) { width = (int) svg.getDocumentViewBox().width(); } int height = (int) svg.getDocumentHeight(); if (height == -1) { height = (int) svg.getDocumentViewBox().height(); } Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); svg.renderToCanvas(canvas); return new Image(bitmap); } catch (SVGParseException e) { throw new IOException(e); } }</code><technical_language>reason for peek()</technical_language>

Target:
@Override public Image decodeImage(BufferedSource source, Request request) throws IOException { try { SVG svg = SVG.getFromInputStream(source.inputStream()); if (request.hasSize()) { if (request.targetWidth != 0) { svg.setDocumentWidth(request.targetWidth); } if (request.targetHeight != 0) { svg.setDocumentHeight(request.targetHeight); } } int width = (int) svg.getDocumentWidth(); if (width == -1) { width = (int) svg.getDocumentViewBox().width(); } int height = (int) svg.getDocumentHeight(); if (height == -1) { height = (int) svg.getDocumentViewBox().height(); } Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); svg.renderToCanvas(canvas); return new Image(bitmap); } catch (SVGParseException e) { throw new IOException(e); } }
Source:
<code>public void testAddChildCycle3() { assertNotNull(fFixture); assertNotNull(f42Fixture); assertNotNull(fHiFixture); ((CalledFunction) f42Fixture).addChild(fHiFixture); <START> assertEquals(Collections.singletonList(fHiFixture), f42Fixture.getChildren()); <END> }</code><technical_language>unreachable. remove</technical_language>

Target:
public void testAddChildCycle3() { assertNotNull(fFixture); assertNotNull(f42Fixture); assertNotNull(fHiFixture); ((CalledFunction) f42Fixture).addChild(fHiFixture); }
Source:
<code>protected Delimiter changeDelimiterIfNecessary(String line, Delimiter delimiter) { END statement, then the order is significant. if (line.startsWith("CREATE PROCEDURE") || line.startsWith("CREATE TRIGGER")) { <START> if (insideStatementAllowingNestedBeginEndBlocks) { <END> throw new FlywayException("Beginning another CREATE TRIGGER/CREATE PROCEDURE inside Trigger or Procedure not supported"); } insideStatementAllowingNestedBeginEndBlocks = true; } if (insideStatementAllowingNestedBeginEndBlocks) { if (line.startsWith("BEGIN")) { beginEndNestedDepth++; } if (line.endsWith("END;")) { beginEndNestedDepth--; if (beginEndNestedDepth < 0) { throw new FlywayException("Syntax error in SQL script: unpaired END; statement"); } else if (beginEndNestedDepth == 0) { insideStatementAllowingNestedBeginEndBlocks = false; } } } if (insideStatementAllowingNestedBeginEndBlocks) { return null; } return getDefaultDelimiter(); }</code><technical_language>This change breaks case CREATE PROCEDURE separate lines</technical_language>

Target:
protected Delimiter changeDelimiterIfNecessary(String line, Delimiter delimiter) { if (statementStartNormalized.length() < 16) { final String effectiveLine = cutCommentsFromEnd(line); statementStartNormalized += effectiveLine + " "; statementStartNormalized = StringUtils.trimLeadingWhitespace(StringUtils.collapseWhitespace(statementStartNormalized)); } boolean insideStatementAllowingNestedBeginEndBlocks = statementStartNormalized.startsWith("CREATE PROCEDURE") || statementStartNormalized.startsWith("CREATE FUNCTION") || statementStartNormalized.startsWith("CREATE TRIGGER"); if (insideStatementAllowingNestedBeginEndBlocks) { if (line.startsWith("BEGIN")) { beginEndNestedDepth++; } if (line.endsWith("END;")) { beginEndNestedDepth--; if (beginEndNestedDepth < 0) { LOG.warn("SQL statement parsed unsuccessfully: found unpaired 'END;' in statement"); } if (beginEndNestedDepth <= 0) { insideStatementAllowingNestedBeginEndBlocks = false; } } } if (insideStatementAllowingNestedBeginEndBlocks) { return null; } return getDefaultDelimiter(); }
Source:
<code>public SharedReferencePointMapper() { <START> idToReferencePointMapping = new HashMap<String, IReferencePoint>(); <END> referencePointToIDMapping = new HashMap<IReferencePoint, String>(); referencePointsOfUsers = new HashMap<User, List<String>>(); partiallySharedResourceMapping = new HashMap<IReferencePoint, Set<IResource>>(); completelySharedReferencePoints = new HashSet<IReferencePoint>(); partiallySharedReferencePoints = new HashSet<IReferencePoint>(); }</code><technical_language>Minor - Unnecessary type declarations initialization. a lot of in this class, address individually</technical_language>

Target:
public SharedReferencePointMapper() { idToReferencePointMapping = new HashMap(); referencePointToIDMapping = new HashMap(); referencePointsOfUsers = new HashMap(); partiallySharedResourceMapping = new HashMap(); completelySharedReferencePoints = new HashSet(); partiallySharedReferencePoints = new HashSet(); }
Source:
<code>public PlanSanityChecker(boolean forceSingleNode) { checkers = ImmutableListMultimap.<Stage, Checker>builder() .putAll( Stage.INTERMEDIATE, new ValidateDependenciesChecker(), new NoDuplicatePlanNodeIdsChecker(), new TypeValidator(), new NoSubqueryExpressionLeftChecker(), new NoIdentifierLeftChecker(), new VerifyOnlyOneOutputNode()) .putAll( Stage.FRAGMENT, new ValidateDependenciesChecker(), new NoDuplicatePlanNodeIdsChecker(), new TypeValidator(), new NoSubqueryExpressionLeftChecker(), new NoIdentifierLeftChecker(), new VerifyNoFilteredAggregations()) .putAll( Stage.FINAL, new ValidateDependenciesChecker(), new NoDuplicatePlanNodeIdsChecker(), new TypeValidator(), new NoSubqueryExpressionLeftChecker(), new NoIdentifierLeftChecker(), new VerifyOnlyOneOutputNode(), new VerifyNoFilteredAggregations(), new ValidateAggregationsWithDefaultValues(forceSingleNode), new ValidateStreamingAggregations(), <START> new NoExpressionLeftCheck()) <END> .build(); }</code><technical_language>this is needed for Stage.FRAGMENT</technical_language>

Target:
public PlanSanityChecker(boolean forceSingleNode) { checkers = ImmutableListMultimap.<Stage, Checker>builder() .putAll( Stage.INTERMEDIATE, new ValidateDependenciesChecker(), new NoDuplicatePlanNodeIdsChecker(), new TypeValidator(), new NoSubqueryExpressionLeftChecker(), new NoIdentifierLeftChecker(), new VerifyOnlyOneOutputNode()) .putAll( Stage.FRAGMENT, new ValidateDependenciesChecker(), new NoDuplicatePlanNodeIdsChecker(), new TypeValidator(), new NoSubqueryExpressionLeftChecker(), new NoIdentifierLeftChecker(), new VerifyNoFilteredAggregations(), new VerifyNoOriginalExpression()) .putAll( Stage.FINAL, new ValidateDependenciesChecker(), new NoDuplicatePlanNodeIdsChecker(), new TypeValidator(), new NoSubqueryExpressionLeftChecker(), new NoIdentifierLeftChecker(), new VerifyOnlyOneOutputNode(), new VerifyNoFilteredAggregations(), new ValidateAggregationsWithDefaultValues(forceSingleNode), new ValidateStreamingAggregations(), new VerifyNoOriginalExpression()) .build(); }
Source:
<code>public Collection<ParameterOption> getParameterOptions(URI uri, String param, Locale locale) { if (!uri.equals(CONFIG_URI)) { return null; } if (param.equals(PARAM_PRIMARY_ADDRESS)) { Stream<CidrAddress> ipv4Addresses = NetUtil.getAllInterfaceAddresses().stream() .filter(a -> a.getAddress() instanceof Inet4Address); return ipv4Addresses.map(a -> new ParameterOption(a.toString(), a.toString())).collect(Collectors.toList()); } if (param.equals(PARAM_BROADCAST_ADDRESS)) { List<String> broadcastAddrList = NetUtil.getAllBroadcastAddresses(); <START> broadcastAddrList.add("255.255.255.255"); <END> return broadcastAddrList.stream().map(a -> new ParameterOption(a, a)).collect(Collectors.toList()); } return null; }</code><technical_language>I stumbled this address means wikipedia I found: > is broadcast address of zero network 0.0.0.0, in Internet Protocol standards stands for this network, i.e. local network. Transmission this address is limited definition, in is forwarded routers connecting local network other networks. setting this "random" "this network" is defined if multiple network interfaces, right? I guess remove this one</technical_language>

Target:
public Collection<ParameterOption> getParameterOptions(URI uri, String param, Locale locale) { if (!uri.equals(CONFIG_URI)) { return null; } if (param.equals(PARAM_PRIMARY_ADDRESS)) { Stream<CidrAddress> ipv4Addresses = NetUtil.getAllInterfaceAddresses().stream() .filter(a -> a.getAddress() instanceof Inet4Address); return ipv4Addresses.map(a -> new ParameterOption(a.toString(), a.toString())).collect(Collectors.toList()); } if (param.equals(PARAM_BROADCAST_ADDRESS)) { ArrayList<String> broadcastAddrList = new ArrayList<>(NetUtil.getAllBroadcastAddresses()); broadcastAddrList.add("255.255.255.255"); return broadcastAddrList.stream().map(a -> new ParameterOption(a, a)).collect(Collectors.toList()); } return null; }
Source:
<code>@Override public SqlOperandCountRange getOperandCountRange() { <START> return SqlOperandCountRanges.from(1); <END> }</code><technical_language>same. SqlOperandCountRanges.of(1) is enough</technical_language>

Target:
@Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(1); }
Source:
<code>public void testAssetLoaderInternalStorageActivity() { <START> mRule.getActivity(); <END> mRule.openByActivityTitle(R.string.asset_loader_internal_storage_activity_title); onWebView() .withElement(findElement(Locator.TAG_NAME, "h3")) .check(webMatches(getText(), containsString("Successfully loaded html from app files dir!"))); }</code><technical_language>this is a noop, please delete</technical_language>

Target:
public void testAssetLoaderInternalStorageActivity() { mRule.openByActivityTitle(R.string.asset_loader_internal_storage_activity_title); onWebView() .withElement(findElement(Locator.TAG_NAME, "h3")) .check(webMatches(getText(), containsString("Successfully loaded html from app files dir!"))); }
Source:
<code>private void deleteSegmentsOnAck(PBDSegment<M> segment, int entryNumber) { if (m_cursorClosed || m_segments.size() == 1) { return; } if (segment.m_deleteOnAck == true && segment.segmentIndex() == m_segments.firstKey()) { m_deferredDeleter.execute(this::deleteMarkedSegments); return; } if (canDeleteSegmentsBefore(segment, entryNumber)) { <START> m_deferredDeleter.execute(() -> deleteSegmentsBefore(segment)); <END> } }</code><technical_language>this. Bad edit merge</technical_language>

Target:
private void deleteSegmentsOnAck(PBDSegment<M> segment, int entryNumber) { if (m_cursorClosed || m_segments.size() == 1) { return; } if (segment.m_deleteOnAck == true && segment.segmentIndex() == m_segments.firstKey()) { m_deferredDeleter.execute(this::deleteMarkedSegments); return; } callDeleteSegmentsBefore(segment, entryNumber); }
Source:
<code>public void listClear() throws XWikiException{ attachmentList.clear(); <START> assertEquals(attachmentList,new ArrayList<XWikiAttachment>()); <END> }</code><technical_language>I assertTrue attachmentList.isEmpty() instead want (not equals some list)</technical_language>

Target:
public void listClear() throws XWikiException { attachmentList.clear(); assertTrue(attachmentList.isEmpty()); }
Source:
<code><START> public void testWithStopSignal() throws Exception { <END> Integer signal = 10; CreateContainerResponse resp = dockerClient.createContainerCmd(BUSYBOX_IMAGE) .withCmd("/bin/sh", "-c", "trap 'echo \"exit trapped 10\"; exit 10' USR1; while true; do sleep 1; done") .withAttachStdin(true) .withTty(true) .withStopSignal(signal.toString()) .exec(); final String containerId = resp.getId(); assertThat(containerId, not(isEmptyString())); dockerClient.startContainerCmd(containerId).exec(); InspectContainerResponse inspect = dockerClient.inspectContainerCmd(containerId).exec(); assertThat(inspect.getState().getRunning(), is(true)); dockerClient.stopContainerCmd(containerId).exec(); Thread.sleep(TimeUnit.SECONDS.toMillis(3)); inspect = dockerClient.inspectContainerCmd(containerId).exec(); assertThat(inspect.getState().getRunning(), is(false)); assertThat(inspect.getState().getExitCode(), is(signal)); StringBuilder stringBuilder = new StringBuilder(); final StringBuilderLogReader callback = new StringBuilderLogReader(stringBuilder); dockerClient.logContainerCmd(containerId) .withStdErr(true) .withStdOut(true) .withTailAll() .exec(callback); Thread.sleep(TimeUnit.SECONDS.toMillis(5)); String log = callback.builder.toString(); assertThat(log, is("exit trapped 10")); }</code><technical_language>Yes. Please duplicate new tests for netty</technical_language>

Target:
public void testWithStopSignal() throws Exception { Integer signal = 10; CreateContainerResponse resp = dockerClient.createContainerCmd(BUSYBOX_IMAGE) .withCmd("/bin/sh", "-c", "trap 'echo \"exit trapped 10\"; exit 10' USR1; while true; do sleep 1; done") .withAttachStdin(true) .withTty(true) .withStopSignal(signal.toString()) .exec(); final String containerId = resp.getId(); assertThat(containerId, not(isEmptyString())); dockerClient.startContainerCmd(containerId).exec(); InspectContainerResponse inspect = dockerClient.inspectContainerCmd(containerId).exec(); assertThat(inspect.getState().getRunning(), is(true)); dockerClient.stopContainerCmd(containerId).exec(); Thread.sleep(TimeUnit.SECONDS.toMillis(3)); inspect = dockerClient.inspectContainerCmd(containerId).exec(); assertThat(inspect.getState().getRunning(), is(false)); assertThat(inspect.getState().getExitCode(), is(signal)); StringBuilder stringBuilder = new StringBuilder(); final StringBuilderLogReader callback = new StringBuilderLogReader(stringBuilder); dockerClient.logContainerCmd(containerId) .withStdErr(true) .withStdOut(true) .withTailAll() .exec(callback) .awaitCompletion(); String log = callback.builder.toString(); assertThat(log, is("exit trapped 10")); }
Source:
<code>public static String satelReadDeviceName( @ParamDoc(name = "deviceType", text = "type of the device, one of: PARTITION, ZONE, USER, EXPANDER, LCD, OUTPUT, TIMER, TELEPHONE, OBJECT") String deviceType, @ParamDoc(name = "deviceNumber", text = "number of the device to read") int deviceNumber) { if (!satelIsConnected()) { <START> return null; <END> } DeviceType devType; try { devType = DeviceType.valueOf(deviceType.toUpperCase()); } catch (Exception e) { logger.warn("Invalid device type given: {}", deviceType); return null; } ReadDeviceInfoCommand cmd = new ReadDeviceInfoCommand(devType, deviceNumber); if (!SatelActionService.satelCommModule.sendCommand(cmd)) { logger.warn("Unable to read device info: {}, {}", deviceType, deviceNumber); return null; } try { return cmd.getName(SatelActionService.satelCommModule.getTextEncoding()); } catch (UnsupportedEncodingException e) { logger.error("Unsupported encoding: {}", SatelActionService.satelCommModule.getTextEncoding()); return null; } }</code><technical_language>log log in method</technical_language>

Target:
public static String satelReadDeviceName( @ParamDoc(name = "deviceType", text = "type of the device, one of: PARTITION, ZONE, USER, EXPANDER, LCD, OUTPUT, TIMER, TELEPHONE, OBJECT") String deviceType, @ParamDoc(name = "deviceNumber", text = "number of the device to read") int deviceNumber) { if (!satelIsConnected()) { logger.warn("Not connected to communication module or Satel binding not available."); return null; } DeviceType devType; try { devType = DeviceType.valueOf(deviceType.toUpperCase()); } catch (Exception e) { logger.warn("Invalid device type given: {}", deviceType); return null; } ReadDeviceInfoCommand cmd = new ReadDeviceInfoCommand(devType, deviceNumber); if (!SatelActionService.satelCommModule.sendCommand(cmd)) { logger.warn("Unable to read device info: {}, {}", deviceType, deviceNumber); return null; } try { return cmd.getName(SatelActionService.satelCommModule.getTextEncoding()); } catch (UnsupportedEncodingException e) { logger.error("Unsupported encoding: {}", SatelActionService.satelCommModule.getTextEncoding()); return null; } }
Source:
<code>protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case RequestCodes.ADD_ACCOUNT: case RequestCodes.CREATE_SITE: if (resultCode == RESULT_OK) { debounceLoadSites(); if (data == null) { data = new Intent(); } if (data.getBooleanExtra(KEY_SITE_CREATED_BUT_NOT_FETCHED, false)) { showSiteCreatedButNotFetchedSnackbar(); } else { data.putExtra(WPMainActivity.ARG_CREATE_SITE, RequestCodes.CREATE_SITE); setResult(resultCode, data); finish(); } } break; } switch (requestCode) { case RequestCodes.CREATE_SITE: if (data != null) { int newSiteLocalID = data.getIntExtra(SitePickerActivity.KEY_LOCAL_ID, -1); <START> SiteUtils.enableBlockEditor(mDispatcher, mSiteStore, newSiteLocalID); <END> } break; } }</code><technical_language>WDYT moving call closer site creation process, right site creation success <LINK_0> process happen background UI get updated app returns foreground so, move call in background too</technical_language>

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case RequestCodes.ADD_ACCOUNT: case RequestCodes.CREATE_SITE: if (resultCode == RESULT_OK) { debounceLoadSites(); if (data == null) { data = new Intent(); } if (data.getBooleanExtra(KEY_SITE_CREATED_BUT_NOT_FETCHED, false)) { showSiteCreatedButNotFetchedSnackbar(); } else { data.putExtra(WPMainActivity.ARG_CREATE_SITE, RequestCodes.CREATE_SITE); setResult(resultCode, data); finish(); } } break; } switch (requestCode) { case RequestCodes.CREATE_SITE: if (data != null) { int newSiteLocalID = data.getIntExtra(SitePickerActivity.KEY_LOCAL_ID, -1); SiteUtils.enableBlockEditor(mDispatcher, mSiteStore, newSiteLocalID); SiteModel newSiteModel = mSiteStore.getSiteByLocalId(newSiteLocalID); if (newSiteModel != null) { AppPrefs.setShowGutenbergInfoPopup(newSiteModel.getUrl(), true); } } break; } }
Source:
<code>public TaskTracker tasks() throws SemanticException { try { if (event.shouldNotReplicate()) { return tracker; } String dbName = tableContext.dbNameToLoadIn; ImportTableDesc tableDesc = tableContext.overrideProperties(event.tableDesc(dbName)); Table table = ImportSemanticAnalyzer.tableIfExists(tableDesc, context.hiveDb); Database parentDb = context.hiveDb.getDatabase(tableDesc.getDatabaseName()); if (parentDb == null) { if (!tableContext.waitOnPrecursor()) { throw new SemanticException( ErrorMsg.DATABASE_NOT_EXISTS.getMsg(tableDesc.getDatabaseName())); } } Task<?> tblRootTask = null; ReplUtils.LoadOpType opType = getLoadOpType(table, parentDb); switch (opType) { case LOAD_NEW: break; case LOAD_REPLACE: tblRootTask = dropTableTask(table); break; case LOAD_INVALID: <START> throw new InvalidOperationException("Load not allowed on table " + table.getFullyQualifiedName() <END> + " as it was already bootstrap loaded from another dump."); case LOAD_SKIP: return tracker; } if (tableDesc.getLocation() == null) { tableDesc.setLocation(location(tableDesc, parentDb)); } newTableTasks(tableDesc, tblRootTask); Task<?> ckptTask = ReplUtils.getTableCheckpointTask( tableDesc, null, context.dumpDirectory, context.hiveConf ); if (!isPartitioned(tableDesc)) { Task<? extends Serializable> replLogTask = ReplUtils.getTableReplLogTask(tableDesc, replLogger, context.hiveConf); ckptTask.addDependentTask(replLogTask); } tracker.addDependentTask(ckptTask); return tracker; } catch (Exception e) { throw new SemanticException(e); } }</code><technical_language>skipping need check if ckpt property set / repl id set task added</technical_language>

Target:
public TaskTracker tasks() throws SemanticException { try { if (event.shouldNotReplicate()) { return tracker; } String dbName = tableContext.dbNameToLoadIn; ImportTableDesc tableDesc = tableContext.overrideProperties(event.tableDesc(dbName)); Table table = ImportSemanticAnalyzer.tableIfExists(tableDesc, context.hiveDb); Database parentDb = context.hiveDb.getDatabase(tableDesc.getDatabaseName()); if (parentDb == null) { if (!tableContext.waitOnPrecursor()) { throw new SemanticException( ErrorMsg.DATABASE_NOT_EXISTS.getMsg(tableDesc.getDatabaseName())); } } Task<?> tblRootTask = null; ReplLoadOpType loadTblType = getLoadTableType(table); switch (loadTblType) { case LOAD_NEW: break; case LOAD_REPLACE: tblRootTask = dropTableTask(table); break; case LOAD_SKIP: return tracker; default: break; } if (tableDesc.getLocation() == null) { tableDesc.setLocation(location(tableDesc, parentDb)); } newTableTasks(tableDesc, tblRootTask); Task<?> ckptTask = ReplUtils.getTableCheckpointTask( tableDesc, null, context.dumpDirectory, context.hiveConf ); if (!isPartitioned(tableDesc)) { Task<? extends Serializable> replLogTask = ReplUtils.getTableReplLogTask(tableDesc, replLogger, context.hiveConf); ckptTask.addDependentTask(replLogTask); } tracker.addDependentTask(ckptTask); return tracker; } catch (Exception e) { throw new SemanticException(e); } }
Source:
<code>public RFuture<Collection<Double>> getAllScoreAsync(Collection<V> elements) { return redisson.getScript(DoubleCodec.INSTANCE).evalAsync(RScript.Mode.READ_ONLY, "local r = " + <START> "for i, v in ipairs(KEYS) do " + <END> "r[#r+1] = redis.call('ZSCORE', ARGV[1], v); " + "end;" + "return r;", RScript.ReturnType.MULTI, new ArrayList<>(encode(elements)), getName()); }</code><technical_language>no, please params keys. getName() is key</technical_language>

Target:
public RFuture<List<Double>> getAllScoreAsync(Collection<V> elements) { return commandExecutor.evalReadAsync((String) null, DoubleCodec.INSTANCE, RedisCommands.EVAL_LIST, "local r = " + "for i, v in ipairs(ARGV) do " + "r[#r+1] = redis.call('ZSCORE', KEYS[1], ARGV[i]); " + "end;" + "return r;", Collections.singletonList(getName()), encode(elements).toArray()); }
Source:
<code><START> public void testArrayOfDates() throws ParseException { <END> ArrayProperty property = getArrayProperty(DateType.INSTANCE); String myTestDate = "2017-11-29T12:30-03:44"; Date date = DateParser.parseW3CDateTime(myTestDate); Calendar cal = Calendar.getInstance(); cal.setTime(date); property.setValue(new Object[] {null, cal, date, myTestDate}); assertArrayEquals(new Object[] { null, cal, cal, cal }, (Calendar[]) property.getValue()); Calendar calWithCorrectTimezone = GregorianCalendar.from(ZonedDateTime.parse(myTestDate)); assertNotEquals(cal, calWithCorrectTimezone); property.setValue(new Object[] {null, calWithCorrectTimezone}); assertArrayEquals(new Object[] { null, calWithCorrectTimezone }, (Calendar[]) property.getValue()); }</code><technical_language>'throws Exception in unit tests, care specific type</technical_language>

Target:
public void testArrayOfDates() { ArrayProperty property = getArrayProperty(DateType.INSTANCE); String myTestDate = "2017-11-29T12:30-03:44"; Date date = DateParser.parseW3CDateTime(myTestDate); Calendar cal = Calendar.getInstance(); cal.setTime(date); property.setValue(new Object[] { null, cal, date, myTestDate }); assertArrayEquals(new Object[] { null, cal, cal, cal }, (Calendar[]) property.getValue()); Calendar calWithCorrectTimezone = GregorianCalendar.from(ZonedDateTime.parse(myTestDate)); assertNotEquals(cal, calWithCorrectTimezone); property.setValue(new Object[] { null, calWithCorrectTimezone }); assertArrayEquals(new Object[] { null, calWithCorrectTimezone }, (Calendar[]) property.getValue()); }
Source:
<code>public void visitToken(DetailAST arrayInit) { final DetailAST rcurly = arrayInit.findFirstToken(TokenTypes.RCURLY); final DetailAST previousSibling = rcurly.getPreviousSibling(); if (arrayInit.getChildCount() != 1 && !TokenUtil.areOnSameLine(rcurly, previousSibling) && !TokenUtil.areOnSameLine(arrayInit, previousSibling) && previousSibling.getType() != TokenTypes.COMMA) { <START> log(rcurly, MSG_KEY); <END> } }</code><technical_language>@romani @rnveach violation reported array item instead of rcurly</technical_language>

Target:
public void visitToken(DetailAST arrayInit) { final DetailAST rcurly = arrayInit.findFirstToken(TokenTypes.RCURLY); final DetailAST previousSibling = rcurly.getPreviousSibling(); if (arrayInit.getChildCount() != 1 && !TokenUtil.areOnSameLine(rcurly, previousSibling) && !TokenUtil.areOnSameLine(arrayInit, previousSibling) && previousSibling.getType() != TokenTypes.COMMA) { log(previousSibling, MSG_KEY); } }
Source:
<code>public void write( Settings settings, File settingsFile ) throws ManipulationException { try { <START> PrintWriter printWriter = new PrintWriter( settingsFile, StandardCharsets.UTF_8.toString() ); <END> new SettingsXpp3Writer().write( printWriter, settings ); } catch ( IOException e ) { throw new ManipulationException( "Failed to create repo removal backup settings.xml file: {}", settingsFile, e ); } }</code><technical_language>change here? mentioned partial models in test a reason, this is a test case. This file a encoding set user. Recommend: settings.getModelEncoding() != null ? settings.getModelEncoding() : StandardCarsets_UTF_8.name();</technical_language>

Target:
public void write( Settings settings, File settingsFile ) throws ManipulationException { try { PrintWriter printWriter = new PrintWriter( settingsFile, StringUtils.isEmpty( settings.getModelEncoding() ) ? StandardCharsets.UTF_8.toString() : settings.getModelEncoding() ); new SettingsXpp3Writer().write( printWriter, settings ); } catch ( IOException e ) { throw new ManipulationException( "Failed to create repo removal backup settings.xml file: {}", settingsFile, e ); } }
Source:
<code>public static Iterable<Path> listRegionFiles(Path worldDir) { try { <START> return Files.newDirectoryStream(worldDir.resolve("region"), "*.mca"); <END> } catch (IOException e) { return Collections.emptySet(); } }</code><technical_language>need close this stream (e.g. try-with-resources, require inlining it.</technical_language>

Target:
public static Iterable<Path> listRegionFiles(Path worldDir) { try (DirectoryStream<Path> stream = Files.newDirectoryStream(worldDir.resolve("region"), "*.mca")) { return Lists.newArrayList(stream); } catch (IOException e) { return Collections.emptySet(); } }
Source:
<code>public String toString() { <START> return "Range [startLine=" + startLine + ", startCh=" + startCh <END> + ", endLine=" + endLine + ", endCh=" + endCh + "]"; }</code><technical_language>space [</technical_language>

Target:
public String toString() { return "Range[startLine=" + startLine + ", startCharacter=" + startCharacter + ", endLine=" + endLine + ", endCharacter=" + endCharacter + "]"; }
Source:
<code>protected void writeFile(final IOService ioService, final Path path, final FileItem uploadedItem) throws IOException { try { ioService.startBatch(path.getFileSystem()); if (!ioService.exists(path)) { ioService.createFile(path); } ioService.write(path, IOUtils.toByteArray(uploadedItem.getInputStream())); } catch (final Exception e) { <START> throw new RuntimeException(e); <END> } finally { uploadedItem.getInputStream().close(); ioService.endBatch(); } }</code><technical_language>I benefit wrapping Exception RuntimeExcetpion, explain please</technical_language>

Target:
protected void writeFile(final IOService ioService, final Path path, final FileItem uploadedItem) throws IOException { try { ioService.startBatch(path.getFileSystem()); if (!ioService.exists(path)) { ioService.createFile(path); } ioService.write(path, IOUtils.toByteArray(uploadedItem.getInputStream())); } finally { uploadedItem.getInputStream().close(); ioService.endBatch(); } }
Source:
<code>public String metricNameSuffix() { <START> return "-" + name().toLowerCase(Locale.ROOT); <END> }</code><technical_language>This replaces a single allocation construction allocations method call</technical_language>

Target:
public String metricNameSuffix() { return metricNameSuffix; }
Source:
<code>private static Element createElementEndpointBy(Document document, String serviceName, String serviceUrl, String endpointVersion) { Element endpoint = createElementBy(document, "endpoint"); createElementBy(endpoint, "name", serviceName); Element configurationList = createElementBy(endpoint, "endpointConfigurationList"); Element configuration = createElementBy(configurationList, "endpointConfiguration"); createElementBy(configuration, "url", serviceUrl); createElementBy(configuration, "version", <START> contantsIgnoreCaseOf(serviceName, "adapter") ? "LEVEL_a0" : endpointVersion); <END> return endpoint; }</code><technical_language>misspelling contantsIgnoreCaseOf</technical_language>

Target:
private static Element createElementEndpointBy(Document document, String serviceName, String serviceUrl, String endpointVersion) { Element endpoint = createElementBy(document, "endpoint"); createElementBy(endpoint, "name", serviceName); Element configurationList = createElementBy(endpoint, "endpointConfigurationList"); Element configuration = createElementBy(configurationList, "endpointConfiguration"); createElementBy(configuration, "url", serviceUrl); createElementBy(configuration, "version", containsIgnoreCaseOf(serviceName, "adapter") ? "LEVEL_a0" : endpointVersion); return endpoint; }
Source:
<code>public Map<String, Locale> getLocales() { <START> return Locale.getMap("en-US", "fr-FR", "es-ES", "de-DE", "nl-NL", "ru-RU", "hi-IN","it-IT", "fi-FI","pt-PT"); <END> }</code><technical_language>This right... convention do inmoov chat bots locales assocated them... program ab is concerned. supports english japanese. (based currently implemented tokenziers</technical_language>

Target:
public Map<String, Locale> getLocales() { return Locale.getLocaleMap("en-US", "fr-FR", "es-ES", "de-DE", "nl-NL", "ru-RU", "hi-IN","it-IT", "fi-FI","pt-PT"); }
Source:
<code>public void factoryWithDirectUrlWithSpecificBranch() throws Exception { try { testFactoryWithSpecificBranch.authenticateAndOpen(); } catch (TimeoutException ex) { <START> fail("Known issue <LINK_0>"); <END> } projectExplorer.waitProjectExplorer(); notificationsPopupPanel.waitProgressPopupPanelClose(); events.clickEventLogBtn(); events.waitExpectedMessage("Project gitPullTest imported", UPDATING_PROJECT_TIMEOUT_SEC); events.waitExpectedMessage( "Successfully configured and cloned source code of gitPullTest.", UPDATING_PROJECT_TIMEOUT_SEC); events.waitExpectedMessage( "Project: gitPullTest | cloned from: gitPullTest | remote branch: refs/remotes/origin/contrib-12092015 | local branch: contrib-12092015", UPDATING_PROJECT_TIMEOUT_SEC); projectExplorer.expandPathInProjectExplorer("gitPullTest/my-lib"); projectExplorer.waitItem("gitPullTest/my-lib/pom.xml"); String wsId = workspaceServiceClient .getByName(seleniumWebDriver.getWorkspaceNameFromBrowserUrl(), testUser.getName()) .getId(); List<String> visibleItems = projectExplorer.getNamesOfAllOpenItems(); assertTrue( visibleItems.containsAll( ImmutableList.of("gitPullTest", "my-lib", "my-webapp", "src", "pom.xml"))); String projectType = testProjectServiceClient.getFirstProject(wsId).getType(); assertTrue(projectType.equals("blank")); }</code><technical_language>pass **ex** variable fail() method additional info catching exception</technical_language>

Target:
public void factoryWithDirectUrlWithSpecificBranch() throws Exception { try { testFactoryWithSpecificBranch.authenticateAndOpen(); } catch (TimeoutException ex) { fail("Known issue <LINK_0>", ex); } projectExplorer.waitProjectExplorer(); notificationsPopupPanel.waitProgressPopupPanelClose(); events.clickEventLogBtn(); events.waitExpectedMessage("Project gitPullTest imported", UPDATING_PROJECT_TIMEOUT_SEC); events.waitExpectedMessage( "Successfully configured and cloned source code of gitPullTest.", UPDATING_PROJECT_TIMEOUT_SEC); events.waitExpectedMessage( "Project: gitPullTest | cloned from: gitPullTest | remote branch: refs/remotes/origin/contrib-12092015 | local branch: contrib-12092015", UPDATING_PROJECT_TIMEOUT_SEC); projectExplorer.expandPathInProjectExplorer("gitPullTest/my-lib"); projectExplorer.waitItem("gitPullTest/my-lib/pom.xml"); String wsId = workspaceServiceClient .getByName(seleniumWebDriver.getWorkspaceNameFromBrowserUrl(), testUser.getName()) .getId(); List<String> visibleItems = projectExplorer.getNamesOfAllOpenItems(); assertTrue( visibleItems.containsAll( ImmutableList.of("gitPullTest", "my-lib", "my-webapp", "src", "pom.xml"))); String projectType = testProjectServiceClient.getFirstProject(wsId).getType(); assertTrue(projectType.equals("blank")); }
Source:
<code>private ObjectPool(final int min, final int max, final long validationInterval) { this.maxSize = max; initialize(min); schedulerWorker = Executors.newScheduledThreadPool(1, new RxThreadFactory("RxObjectPool")); schedulerWorker.scheduleAtFixedRate(new Runnable() { @Override public void run() { <START> int size = pool.size(); <END> if (size < min) { int sizeToBeAdded = max - size; for (int i = 0; i < sizeToBeAdded; i++) { pool.add(createObject()); } } else if (size > max) { int sizeToBeRemoved = size - max; for (int i = 0; i < sizeToBeRemoved; i++) { pool.poll(); } } } }, validationInterval, validationInterval, TimeUnit.SECONDS); }</code><technical_language>convinced this worse. data is driving this decision? is this do numbers tested in this PR changes observeOn</technical_language>

Target:
private ObjectPool(final int min, final int max, final long validationInterval) { this.maxSize = max; initialize(min); schedulerWorker = Schedulers.computation().createWorker(); schedulerWorker.schedulePeriodically(new Action0() { @Override public void call() { int size = pool.size(); if (size < min) { int sizeToBeAdded = max - size; for (int i = 0; i < sizeToBeAdded; i++) { pool.add(createObject()); } } else if (size > max) { int sizeToBeRemoved = size - max; for (int i = 0; i < sizeToBeRemoved; i++) { pool.poll(); } } } }, validationInterval, validationInterval, TimeUnit.SECONDS); }
Source:
<code>private Comparator<Class<? extends Annotation>> createDecoratorComparator(DecoratorOrder order) { List<Class<? extends Annotation>> ordering = Arrays.asList(order.value()); <START> ToIntFunction<Class<? extends Annotation>> indexOf = type -> { <END> int index = ordering.indexOf(type); return index == -1 ? ordering.size() : index; }; return Comparator.comparingInt(indexOf::applyAsInt); }</code><technical_language>I lambda expression passed Comparator.comparingInt</technical_language>

Target:
private Comparator<Class<? extends Annotation>> createDecoratorComparator(DecoratorOrder order) { List<Class<? extends Annotation>> ordering = Arrays.asList(order.value()); return Comparator.comparingInt(type -> { int index = ordering.indexOf(type); return index == -1 ? ordering.size() : index; }); }
Source:
<code>public void setAnycastPrefix(String anycastPrefix) { <START> ActiveMQServerLogger.LOGGER.info("Setting a prefix", new Exception()); <END> for (String prefix : anycastPrefix.split(",")) { prefixes.put(SimpleString.toSimpleString(prefix), RoutingType.ANYCAST); } }</code><technical_language>Remove this please.. Debug added for benefit forgotten here. I a big exception broker I jsut started PR checked out, I thought error</technical_language>

Target:
public void setAnycastPrefix(String anycastPrefix) { for (String prefix : anycastPrefix.split(",")) { prefixes.put(SimpleString.toSimpleString(prefix), RoutingType.ANYCAST); } }
Source:
<code><START> private void setViewsGreyedOut(boolean greyedOut) { <END> titleView.setTextColor(greyedOut ? ContextCompat.getColor(getContext(), R.color.base30) : ResourceUtil.getThemedColor(getContext(), R.attr.primary_text_color)); subtitleView.setTextColor(greyedOut ? ContextCompat.getColor(getContext(), R.color.base50) : ResourceUtil.getThemedColor(getContext(), R.attr.secondary_text_color)); imageView.setAlpha(greyedOut ? 0.5f : 1.0f); }</code><technical_language>is a slight chance this View destroyed this callback is reached. this protected a check for isAttachedToWindow()</technical_language>

Target:
private void setViewsGreyedOut(boolean greyedOut) { if (!isAttachedToWindow()) { return; } titleView.setTextColor(greyedOut ? ContextCompat.getColor(getContext(), R.color.base30) : ResourceUtil.getThemedColor(getContext(), R.attr.primary_text_color)); subtitleView.setTextColor(greyedOut ? ContextCompat.getColor(getContext(), R.color.base50) : ResourceUtil.getThemedColor(getContext(), R.attr.secondary_text_color)); imageView.setAlpha(greyedOut ? 0.5f : 1.0f); }
Source:
<code>public boolean nullable() { <START> return !nullableAnnotation().isEmpty(); <END> }</code><technical_language>pre-calculate this save it</technical_language>

Target:
public boolean nullable() { return nullable; }
Source:
<code>public void testAdjustmentOfSubsmission() { loadEnrollmentPage(); ______TS("typical case: enroll new student to existing course"); StudentAttributes newStudent = new StudentAttributes(); newStudent.section = "None"; newStudent.team = "Team 1.1</td></div>'\""; newStudent.course = "idOfTypicalCourse1"; newStudent.email = "random@g.tmt"; newStudent.name = "someName"; newStudent.comments = "comments"; String enrollString = "Section | Team | Name | Email | Comment" + Const.EOL + newStudent.toEnrollmentString(); enrollPage.enroll(enrollString); ThreadHelper.waitFor(2000); ______TS("typical case : existing student changes team"); loadEnrollmentPage(); final FeedbackSessionAttributes session = testData.feedbackSessions.get("session2InCourse1"); <START> final StudentAttributes student = testData.students.get("student1InCourse1"); <END> List<FeedbackResponseAttributes> oldResponsesForSession = getAllResponsesForStudentForSession(student, session.getFeedbackSessionName()); assertFalse(oldResponsesForSession.isEmpty()); String newTeam = "Team 1.2"; student.team = newTeam; enrollString = "Section | Team | Name | Email | Comment" + Const.EOL + student.toEnrollmentString(); enrollPage.enroll(enrollString); RetryManager.runUntilSuccessful(new RetryableTaskReturns<Integer>("Assert zero new responses") { @Override public Integer run() { return getAllResponsesForStudentForSession(student, session.getFeedbackSessionName()).size(); } @Override public boolean isSuccessful(Integer result) { return result == 0; } }); }</code><technical_language>is this necessary</technical_language>

Target:
public void testAdjustmentOfSubsmission() { loadEnrollmentPage(); ______TS("typical case: enroll new student to existing course"); StudentAttributes newStudent = new StudentAttributes(); newStudent.section = "None"; newStudent.team = "Team 1.1</td></div>'\""; newStudent.course = "idOfTypicalCourse1"; newStudent.email = "random@g.tmt"; newStudent.name = "someName"; newStudent.comments = "comments"; String enrollString = "Section | Team | Name | Email | Comment" + Const.EOL + newStudent.toEnrollmentString(); enrollPage.enroll(enrollString); ThreadHelper.waitFor(2000); ______TS("typical case : existing student changes team"); loadEnrollmentPage(); final FeedbackSessionAttributes session = testData.feedbackSessions.get("session2InCourse1"); final StudentAttributes student = testData.students.get("student1InCourse1"); List<FeedbackResponseAttributes> oldResponsesForSession = getAllResponsesForStudentForSession(student, session.getFeedbackSessionName()); assertFalse(oldResponsesForSession.isEmpty()); String newTeam = "Team 1.2"; student.team = newTeam; enrollString = "Section | Team | Name | Email | Comment" + Const.EOL + student.toEnrollmentString(); enrollPage.enroll(enrollString); RetryManager.runUntilSuccessful(new RetryableTaskReturns<Integer>("Assert outdated responses removed") { @Override public Integer run() { return getAllResponsesForStudentForSession(student, session.getFeedbackSessionName()).size(); } @Override public boolean isSuccessful(Integer numberOfResponses) { return numberOfResponses == 0; } }); }
Source:
<code><START> public SaveScreenshotTask(Bitmap screenshot) { <END> this.context = getContext(); this.screenshot = screenshot; }</code><technical_language>package scope, matter</technical_language>

Target:
SaveScreenshotTask(Bitmap screenshot) { this.context = getContext(); this.screenshot = screenshot; }
Source:
<code>public void acknowledgeRequest(int requestID) throws RemoteException { logger.finer("Received acknowledgement for request " + requestID); int newCount = pendingAcknowledgements.get(requestID) - 1; pendingAcknowledgements.replace(requestID, newCount); <START> if (newCount == 0) { <END> logger.fine("All acknowledgements for request " + requestID + " received"); Action action = pendingRequests.get(requestID).getAction(); performAction(action); broadcastActionToServers(action); removeRequest(requestID); } }</code><technical_language>if a request get's acknowledgements... stays in map forever? timeout</technical_language>

Target:
public void acknowledgeRequest(int requestID) throws RemoteException { logger.finer("Received acknowledgement for request " + requestID); int newCount = pendingAcknowledgements.get(requestID) - 1; if(pendingAcknowledgements.containsKey(requestID)) { pendingAcknowledgements.put(requestID, newCount); } if (newCount == 0) { logger.fine("All acknowledgements for request " + requestID + " received"); Action action = pendingRequests.get(requestID).getAction(); performAction(action); broadcastActionToServers(action); removeRequest(requestID); } }
Source:
<code>public void serialize( QueryMetricsResponse response, JsonGenerator g, SerializerProvider provider ) throws IOException { final List<ShardedResultGroup> result = response.getResult(); final Map<String, SortedSet<String>> common = calculateCommon(g, result); g.writeStartObject(); g.writeObjectField("queryId", response.getQueryId()); g.writeObjectField("range", response.getRange()); g.writeObjectField("trace", response.getTrace()); g.writeObjectField("limits", response.getLimits()); g.writeFieldName("commonTags"); serializeCommonTags(g, common); g.writeFieldName("result"); serializeResult(g, common, result); <START> g.writeObjectField("rawSampleSize", response.getPreAggregationSampleSize()); <END> g.writeFieldName("errors"); serializeErrors(g, response.getErrors()); g.writeEndObject(); }</code><technical_language>Field named resulting JSON object reduce confusion (if possible)</technical_language>

Target:
public void serialize( QueryMetricsResponse response, JsonGenerator g, SerializerProvider provider ) throws IOException { final List<ShardedResultGroup> result = response.getResult(); final Map<String, SortedSet<String>> common = calculateCommon(g, result); g.writeStartObject(); g.writeObjectField("queryId", response.getQueryId()); g.writeObjectField("range", response.getRange()); g.writeObjectField("trace", response.getTrace()); g.writeObjectField("limits", response.getLimits()); g.writeFieldName("commonTags"); serializeCommonTags(g, common); g.writeFieldName("result"); serializeResult(g, common, result); g.writeObjectField("preAggregationSampleSize", response.getPreAggregationSampleSize()); g.writeFieldName("errors"); serializeErrors(g, response.getErrors()); g.writeEndObject(); }
Source:
<code>public RefactoringStatus validateDescriptor() { final RefactoringStatus status= super.validateDescriptor(); if (fType == null) status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveStaticMembersDescriptor_no_type)); if (fMembers == null) status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveStaticMembersDescriptor_no_members)); else { <START> for (IMember fMember : fMembers) { <END> if (fMember == null) { status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveStaticMembersDescriptor_invalid_members)); break; } } } return status; }</code><technical_language>rename member</technical_language>

Target:
public RefactoringStatus validateDescriptor() { final RefactoringStatus status= super.validateDescriptor(); if (fType == null) status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveStaticMembersDescriptor_no_type)); if (fMembers == null) status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveStaticMembersDescriptor_no_members)); else { for (IMember member : fMembers) { if (member == null) { status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveStaticMembersDescriptor_invalid_members)); break; } } } return status; }
Source:
<code>public <T extends Identifiable> void moveItems(Workset from, Workset to, Collection<T> items, Function<Workset, Set<T>> getter, String pluralTypeLabel) { Set<T> sourceItems = getter.apply(from); int initialSize = sourceItems.size(); Set<Long> itemIds = items.stream().map(Identifiable::getId).collect(Collectors.toSet()); <START> sourceItems.removeIf(item -> itemIds.contains(item.getId())); <END> if (initialSize - sourceItems.size() != items.size()) { throw new ValidationException(String.format("Not all %s were found in source workset", pluralTypeLabel)); } getter.apply(to).addAll(items); worksetStore.save(to); worksetStore.save(from); }</code><technical_language>i this okay, I test if move stuff a workset itself. worth throwing a validation exception if to.getId() == from.getId() early return</technical_language>

Target:
public <T extends Identifiable> void moveItems(Workset from, Workset to, Collection<T> items, Function<Workset, Set<T>> getter, String pluralTypeLabel) { if (from.getId() == to.getId()) { throw new ValidationException(String.format("Trying to move %s from the same workset", pluralTypeLabel)); } Set<T> sourceItems = getter.apply(from); int initialSize = sourceItems.size(); Set<Long> itemIds = items.stream().map(Identifiable::getId).collect(Collectors.toSet()); sourceItems.removeIf(item -> itemIds.contains(item.getId())); if (initialSize - sourceItems.size() != items.size()) { throw new ValidationException(String.format("Not all %s were found in source workset", pluralTypeLabel)); } getter.apply(to).addAll(items); worksetStore.save(to); worksetStore.save(from); }
Source:
<code>public Void call() throws Exception { if (verbose) { System.out.println("Launching brooklyn app: "+app+" in "+Iterables.toString(locations)); } ResourceUtils utils = new ResourceUtils(this); ClassLoader parent = utils.getLoader(); GroovyClassLoader loader = new GroovyClassLoader(parent); AbstractApplication application = loadApplicationFromClasspathOrParse(utils, loader, app); if (script != null) { String content = utils.getResourceAsString(script); GroovyShell shell = new GroovyShell(loader); shell.evaluate(content); } List<Location> brooklynLocations = new LocationRegistry().getLocationsById( <START> Iterables.isEmpty(locations) ? ImmutableSet.of(CommandLineLocations.LOCALHOST) : locations); <END> BrooklynLauncher.manage(application, port, !noShutdownOnExit, !noConsole); application.start(brooklynLocations); if (verbose) { Entities.dumpInfo(application); } waitUntilInterrupted(); return null; }</code><technical_language>need locations==null || Iterables.isEmpty(locations) get NPE if --locations set</technical_language>

Target:
public Void call() throws Exception { if (verbose) { System.out.println("Launching brooklyn app: "+app+" in "+Iterables.toString(locations)); } ResourceUtils utils = new ResourceUtils(this); ClassLoader parent = utils.getLoader(); GroovyClassLoader loader = new GroovyClassLoader(parent); AbstractApplication application = loadApplicationFromClasspathOrParse(utils, loader, app); if (script != null) { String content = utils.getResourceAsString(script); GroovyShell shell = new GroovyShell(loader); shell.evaluate(content); } List<Location> brooklynLocations = new LocationRegistry().getLocationsById( (locations==null || Iterables.isEmpty(locations)) ? ImmutableSet.of(CommandLineLocations.LOCALHOST) : locations); log.info("Adding application under brooklyn management"); BrooklynLauncher.manage(application, port, !noShutdownOnExit, !noConsole); log.info("Starting brooklyn application: "+app); application.start(brooklynLocations); if (verbose) { Entities.dumpInfo(application); } waitUntilInterrupted(); return null; }