auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void addPublicIpAddress() { String publicIPAddressName = name + "publicip"; String dnsLabelPrefix = name; PublicIPAddressProperties.Builder properties = PublicIPAddressProperties.builder(); if (!dnsLabelPrefix.isEmpty()) { properties.dnsSettings(DnsSettings.builder().domainNameLabel(dnsLabelPrefix).build()); variables.put("dnsLabelPrefix", dnsLabelPrefix); } properties.publicIPAllocationMethod("Dynamic"); variables.put("publicIPAddressName", publicIPAddressName); variables.put("publicIPAddressReference", "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"); ResourceDefinition publicIpAddress = ResourceDefinition.builder() .name("[variables('publicIPAddressName')]") .type("Microsoft.Network/publicIPAddresses") .location(location) <START> .apiVersion("2015-06-15") <END> .properties(properties.build()) .build(); resources.add(publicIpAddress); }</code><technical_language>Add a constant shared PublicIpAddresses api</technical_language>

Target:
private void addPublicIpAddress() { String publicIPAddressName = name + "publicip"; String dnsLabelPrefix = name; PublicIPAddressProperties.Builder properties = PublicIPAddressProperties.builder(); if (!dnsLabelPrefix.isEmpty()) { properties.dnsSettings(DnsSettings.builder().domainNameLabel(dnsLabelPrefix).build()); variables.put("dnsLabelPrefix", dnsLabelPrefix); } properties.publicIPAllocationMethod("Dynamic"); variables.put("publicIPAddressName", publicIPAddressName); variables.put("publicIPAddressReference", "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"); ResourceDefinition publicIpAddress = ResourceDefinition.builder() .name("[variables('publicIPAddressName')]") .type("Microsoft.Network/publicIPAddresses") .location(location) .apiVersion(STORAGE_API_VERSION) .properties(properties.build()) .build(); resources.add(publicIpAddress); }
Source:
<code>private boolean isRGBValuesChange(Notification notification) { <START> return ViewpointPackage.Literals.RGB_VALUES.getEStructuralFeatures().contains(notification.getFeature()) && notification.getNotifier() instanceof RGBValues; <END> }</code><technical_language>Nitpick: instanceof check is redundant here</technical_language>

Target:
private boolean isRGBValuesChange(Notification notification) { return ViewpointPackage.Literals.RGB_VALUES.getEStructuralFeatures().contains(notification.getFeature()); }
Source:
<code>public Map<TopicPartition, OffsetAndMetadata> fetchCommittedOffsets(final Set<TopicPartition> partitions, final Timer timer) { if (partitions.isEmpty()) return Collections.emptyMap(); <START> final Generation generation = generationIfStable(); <END> if (pendingCommittedOffsetRequest != null && !pendingCommittedOffsetRequest.sameRequest(partitions, generation)) { pendingCommittedOffsetRequest = null; } do { if (!ensureCoordinatorReady(timer)) return null; final RequestFuture<Map<TopicPartition, OffsetAndMetadata>> future; if (pendingCommittedOffsetRequest != null) { future = pendingCommittedOffsetRequest.response; } else { future = sendOffsetFetchRequest(partitions); pendingCommittedOffsetRequest = new PendingCommittedOffsetRequest(partitions, generation, future); } client.poll(future, timer); if (future.isDone()) { pendingCommittedOffsetRequest = null; if (future.succeeded()) { return future.value(); } else if (!future.isRetriable()) { throw future.exception(); } else { timer.sleep(rebalanceConfig.retryBackoffMs); } } else { return null; } } while (timer.notExpired()); return null; }</code><technical_language>do renaming this local generation variable (and below) distinguish AbstractCoordinator field (or vice versa)? easier track of generation variables null (these) (instance variable). a name out there, consider</technical_language>

Target:
public Map<TopicPartition, OffsetAndMetadata> fetchCommittedOffsets(final Set<TopicPartition> partitions, final Timer timer) { if (partitions.isEmpty()) return Collections.emptyMap(); final Generation generationForOffsetRequest = generationIfStable(); if (pendingCommittedOffsetRequest != null && !pendingCommittedOffsetRequest.sameRequest(partitions, generationForOffsetRequest)) { pendingCommittedOffsetRequest = null; } do { if (!ensureCoordinatorReady(timer)) return null; final RequestFuture<Map<TopicPartition, OffsetAndMetadata>> future; if (pendingCommittedOffsetRequest != null) { future = pendingCommittedOffsetRequest.response; } else { future = sendOffsetFetchRequest(partitions); pendingCommittedOffsetRequest = new PendingCommittedOffsetRequest(partitions, generationForOffsetRequest, future); } client.poll(future, timer); if (future.isDone()) { pendingCommittedOffsetRequest = null; if (future.succeeded()) { return future.value(); } else if (!future.isRetriable()) { throw future.exception(); } else { timer.sleep(rebalanceConfig.retryBackoffMs); } } else { return null; } } while (timer.notExpired()); return null; }
Source:
<code>protected void detectBrowserProperties(UserAgentAnalyzer userAgentAnalyzer) { nl.basjes.parse.useragent.UserAgent parsedUserAgent = userAgentAnalyzer .parse(getUserAgent()); String userAgentName = parsedUserAgent.getValue("AgentName"); properties.setBrowserKonqueror(UserAgent.KONQUEROR.getUaStrings().contains(userAgentName)); properties.setBrowserChrome(UserAgent.CHROME.getUaStrings().contains(userAgentName)); properties.setBrowserEdge(UserAgent.EDGE.getUaStrings().contains(userAgentName)); properties.setBrowserSafari(UserAgent.SAFARI.getUaStrings().contains(userAgentName)); properties.setBrowserOpera(UserAgent.OPERA.getUaStrings().contains(userAgentName)); properties.setBrowserInternetExplorer( UserAgent.INTERNET_EXPLORER.getUaStrings().contains(userAgentName)); boolean isFireFox = UserAgent.FIREFOX.getUaStrings() <START> .contains(parsedUserAgent.getValue("AgentName")); <END> if (isFireFox) { properties.setBrowserMozillaFirefox(true); properties.setBrowserMozilla(true); } else { properties.setBrowserMozilla( UserAgent.MOZILLA.getUaStrings().contains(parsedUserAgent.getValue("AgentName"))); } setBrowserVersion(parsedUserAgent); log.debug("determined user agent: {}", properties); }</code><technical_language>userAgentName</technical_language>

Target:
protected void detectBrowserProperties(UserAgentAnalyzer userAgentAnalyzer) { nl.basjes.parse.useragent.UserAgent parsedUserAgent = userAgentAnalyzer .parse(getUserAgent()); String userAgentName = parsedUserAgent.getValue("AgentName"); properties.setBrowserKonqueror(UserAgent.KONQUEROR.getUaStrings().contains(userAgentName)); properties.setBrowserChrome(UserAgent.CHROME.getUaStrings().contains(userAgentName)); properties.setBrowserEdge(UserAgent.EDGE.getUaStrings().contains(userAgentName)); properties.setBrowserSafari(UserAgent.SAFARI.getUaStrings().contains(userAgentName)); properties.setBrowserOpera(UserAgent.OPERA.getUaStrings().contains(userAgentName)); properties.setBrowserInternetExplorer( UserAgent.INTERNET_EXPLORER.getUaStrings().contains(userAgentName)); boolean isFireFox = UserAgent.FIREFOX.getUaStrings().contains(userAgentName); if (isFireFox) { properties.setBrowserMozillaFirefox(true); properties.setBrowserMozilla(true); } else { properties.setBrowserMozilla(UserAgent.MOZILLA.getUaStrings().contains(userAgentName)); } setBrowserVersion(parsedUserAgent); log.debug("determined user agent: {}", properties); }
Source:
<code>private void onConfirmDelete() { int deletedVideoCount = 0; ArrayList<SectionItemInterface> list = adapter.getSelectedItems(); if (list != null) { for (SectionItemInterface section : list) { if (section.isDownload()) { DownloadEntry de = (DownloadEntry) section; environment.getStorage().removeDownload(de); deletedVideoCount++; <START> adapter.remove(section); <END> } } } notifyAdapter(); videoListView.setOnItemClickListener(adapter); setCheckBoxVisible(false); if (deletedVideoCount > 0) { UiUtil.showMessage(getView(), ResourceUtil.getFormattedStringForQuantity(getResources(), R.plurals.deleted_video, "video_count", deletedVideoCount).toString()); } getView().findViewById(R.id.delete_btn).setVisibility(View.GONE); getView().findViewById(R.id.edit_btn).setVisibility(View.VISIBLE); getView().findViewById(R.id.cancel_btn).setVisibility(View.GONE); }</code><technical_language>Hmm, this removes video items, remove section header empty: ![shot](<LINK_0></technical_language>

Target:
private void onConfirmDelete() { int deletedVideoCount = 0; ArrayList<SectionItemInterface> list = adapter.getSelectedItems(); if (list != null) { for (SectionItemInterface section : list) { if (section.isDownload()) { DownloadEntry de = (DownloadEntry) section; environment.getStorage().removeDownload(de); deletedVideoCount++; adapter.remove(section); } } } addToRecentAdapter(); notifyAdapter(); videoListView.setOnItemClickListener(adapter); setCheckBoxVisible(false); if (deletedVideoCount > 0) { UiUtil.showMessage(getView(), ResourceUtil.getFormattedStringForQuantity(getResources(), R.plurals.deleted_video, "video_count", deletedVideoCount).toString()); } getView().findViewById(R.id.delete_btn).setVisibility(View.GONE); getView().findViewById(R.id.edit_btn).setVisibility(View.VISIBLE); getView().findViewById(R.id.cancel_btn).setVisibility(View.GONE); }
Source:
<code>private void expandSection(final FormToolkit toolkit, Section section) { reviewsComposite = toolkit.createComposite(section); <START> section.setClient(reviewsComposite); <END> reviewsComposite.setLayout(EditorUtil.createSectionClientLayout()); getTaskEditorPage().registerDefaultDropListener(section); createReviewsTable(toolkit, reviewsComposite); toolkit.paintBordersFor(reviewsComposite); section.setClient(reviewsComposite); }</code><technical_language>I a duplicate setClient call below. strictly necessary</technical_language>

Target:
private void expandSection(final FormToolkit toolkit, Section section) { reviewsComposite = toolkit.createComposite(section); section.setClient(reviewsComposite); reviewsComposite.setLayout(EditorUtil.createSectionClientLayout()); getTaskEditorPage().registerDefaultDropListener(section); createReviewsTable(toolkit, reviewsComposite); toolkit.paintBordersFor(reviewsComposite); }
Source:
<code>public String getURL(boolean forceSkinAction) throws Exception { XWikiContext xcontext = this.xcontextProvider.get(); URL resourceUrl = this.xcontextProvider.get().getEngineContext().getResource(this.getPath()); Map<String, String> parameters = new LinkedHashMap<>(); <START> Path resourcePath = Paths.get(resourceUrl.toURI()); <END> FileTime lastModifiedTime = Files.getLastModifiedTime(resourcePath); parameters.put("cache-version", String.valueOf(lastModifiedTime.toMillis())); XWikiURLFactory urlf = xcontext.getURLFactory(); URL url; if (forceSkinAction) { url = urlf.createSkinURL(this.resourceName, "skins", getRepository().getId(), xcontext); } else { url = urlf.createSkinURL(this.resourceName, getRepository().getId(), xcontext); } url = urlf.addQueryParameters(url, parameters); return urlf.getURL(url, xcontext); }</code><technical_language>bulletproof a bit this line (or more accurately this date process) in case this resource converted a local file for some reason (like expended WAR weird URL scheme in WebSphere)</technical_language>

Target:
public String getURL(boolean forceSkinAction) throws Exception { XWikiContext xcontext = this.xcontextProvider.get(); Map<String, Object> parameters = new LinkedHashMap<>(); if (this.urlConfiguration.useResourceLastModificationDate()) { try { URL resourceUrl = this.xcontextProvider.get().getEngineContext().getResource(this.getPath()); Path resourcePath = Paths.get(resourceUrl.toURI()); FileTime lastModifiedTime = Files.getLastModifiedTime(resourcePath); parameters.put(XWiki.CACHE_VERSION, String.valueOf(lastModifiedTime.toMillis())); } catch (Exception e) { parameters.put(XWiki.CACHE_VERSION, xcontext.getWiki().getVersion()); } } else { parameters.put(XWiki.CACHE_VERSION, xcontext.getWiki().getVersion()); } XWikiURLFactory urlf = xcontext.getURLFactory(); URL url; if (forceSkinAction) { url = urlf.createSkinURL(this.resourceName, "skins", getRepository().getId(), xcontext, parameters); } else { url = urlf.createSkinURL(this.resourceName, getRepository().getId(), xcontext, parameters); } return urlf.getURL(url, xcontext); }
Source:
<code>private Collection<FeedbackResponse> getFeedbackResponseEntitiesForReceiverForQuestionInSection( String feedbackQuestionId, String receiver, String section) { Map<String, FeedbackResponse> FeedbackResponseList = new HashMap<String,FeedbackResponse>(); Query q = getPM().newQuery(FeedbackResponse.class); q.declareParameters("String feedbackQuestionIdParam, String receiverParam, String sectionParam"); q.setFilter("feedbackQuestionId == feedbackQuestionIdParam && receiver == receiverParam " + "&& giverSection == sectionParam"); @SuppressWarnings("unchecked") List<FeedbackResponse> firstQueryResponses = (List<FeedbackResponse>) q.execute(feedbackQuestionId, receiver, section); for(FeedbackResponse response : firstQueryResponses){ if (!JDOHelper.isDeleted(response)) { <START> FeedbackResponseList.put(response.getId(), response); <END> } } q.setFilter("feedbackQuestionId == feedbackQuestionIdParam && receiver == receiverParam " + "&& receiverSection == sectionParam"); @SuppressWarnings("unchecked") List<FeedbackResponse> secondQueryResponses = (List<FeedbackResponse>) q.execute(feedbackQuestionId, receiver, section); for(FeedbackResponse response : secondQueryResponses){ if (!JDOHelper.isDeleted(response)) { FeedbackResponseList.put(response.getId(), response); } } return FeedbackResponseList.values(); }</code><technical_language>get rename this variable :D. call a *List ..</technical_language>

Target:
private Collection<FeedbackResponse> getFeedbackResponseEntitiesForReceiverForQuestionInSection( String feedbackQuestionId, String receiver, String section) { Map<String, FeedbackResponse> feedbackResponses = new HashMap<String,FeedbackResponse>(); Query q = getPM().newQuery(FeedbackResponse.class); q.declareParameters("String feedbackQuestionIdParam, String receiverParam, String sectionParam"); q.setFilter("feedbackQuestionId == feedbackQuestionIdParam && receiver == receiverParam " + "&& giverSection == sectionParam"); @SuppressWarnings("unchecked") List<FeedbackResponse> firstQueryResponses = (List<FeedbackResponse>) q.execute(feedbackQuestionId, receiver, section); for(FeedbackResponse response : firstQueryResponses){ if (!JDOHelper.isDeleted(response)) { feedbackResponses.put(response.getId(), response); } } q.setFilter("feedbackQuestionId == feedbackQuestionIdParam && receiver == receiverParam " + "&& receiverSection == sectionParam"); @SuppressWarnings("unchecked") List<FeedbackResponse> secondQueryResponses = (List<FeedbackResponse>) q.execute(feedbackQuestionId, receiver, section); for(FeedbackResponse response : secondQueryResponses){ if (!JDOHelper.isDeleted(response)) { feedbackResponses.put(response.getId(), response); } } return feedbackResponses.values(); }
Source:
<code>private boolean createZkRealm(String realm) { <START> if (_zkClient.exists(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm)) { LOG.warn("createZkRealm() called for realm: {}, but this realm already exists! Namespace: {}", realm, _namespace); return true; } else { <END> try { _zkClient.createPersistent(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm); _zkClient.writeData(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm, new ZNRecord(realm)); } catch (Exception e) { LOG.error("Failed to create ZkRealm: {}, Namespace: ", realm, _namespace); return false; } } return true; }</code><technical_language>else clause need for this case</technical_language>

Target:
private boolean createZkRealm(String realm) { if (_zkClient.exists(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm)) { LOG.warn("createZkRealm() called for realm: {}, but this realm already exists! Namespace: {}", realm, _namespace); return true; } try { _zkClient.createPersistent(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm); _zkClient.writeData(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm, new ZNRecord(realm)); } catch (Exception e) { LOG.error("Failed to create ZkRealm: {}, Namespace: ", realm, _namespace); return false; } return true; }
Source:
<code>public DynamicItem<T> get() { <START> return new DynamicItem<T>(find(injector, type), null, key); <END> }</code><technical_language>"gerrit". internal server plugin name is "gerrit"</technical_language>

Target:
public DynamicItem<T> get() { return new DynamicItem<T>(key, find(injector, type), "gerrit"); }
Source:
<code><START> public ReadOnlyDictionaryInterface getDictionary(String key) { <END> int index = indexForColumnName(key); return index >= 0 ? getDictionary(index) : null; }</code><technical_language>return ReadOnlyDictionary</technical_language>

Target:
public ReadOnlyDictionary getDictionary(String key) { int index = indexForColumnName(key); return index >= 0 ? getDictionary(index) : null; }
Source:
<code>@Test public void testSandboxUsesSelectedBinding() throws Exception { SecureGroovyScript sgs = new SecureGroovyScript("return a++", true, null); Binding b = new Binding(); b.setVariable("a", 5); SecureGroovyScript.PreparedScript script = sgs.configuringWithKeyItem().prepare(Jenkins.getInstance().getPluginManager().uberClassLoader, b); try { Object res = script.run(); assertTrue((int) res == 5); assertTrue((int) b.getVariable("a") == 6); res = script.run(); assertTrue((int) res == 6); assertTrue((int) b.getVariable("a") == 7); } catch (Exception e) { <START> script.cleanUp(); <END> throw e; } }</code><technical_language>This in a finally block, a catch block (or Closeable trick mentioned above)</technical_language>

Target:
@Test public void testSandboxUsesSelectedBinding() throws Exception { SecureGroovyScript sgs = new SecureGroovyScript("return a++", true, null); Binding b = new Binding(); b.setVariable("a", 5); try(SecureGroovyScript.PreparedScript script = sgs.configuringWithKeyItem().prepare(Jenkins.getInstance().getPluginManager().uberClassLoader, b)) { Object res = script.run(); assertTrue((int) res == 5); assertTrue((int) b.getVariable("a") == 6); res = script.run(); assertTrue((int) res == 6); assertTrue((int) b.getVariable("a") == 7); } }
Source:
<code>public com.alliander.osgp.dto.valueobjects.smartmetering.PeriodicMeterReadsContainerGas convertTo( final PeriodicMeterReadsContainerGas source, final Type<com.alliander.osgp.dto.valueobjects.smartmetering.PeriodicMeterReadsContainerGas> destinationType) { <START> final List<PeriodicMeterReadsGas> r = new ArrayList<>(source.getPeriodicMeterReadsGas().size()); <END> for (final com.alliander.osgp.domain.core.valueobjects.smartmetering.PeriodicMeterReadsGas pmr : source .getPeriodicMeterReadsGas()) { r.add(new PeriodicMeterReadsGas(pmr.getLogTime(), PeriodType.valueOf(pmr.getPeriodType().name()), pmr .getConsumption(), pmr.getCaptureTime())); } return new com.alliander.osgp.dto.valueobjects.smartmetering.PeriodicMeterReadsContainerGas( source.getDeviceIdentification(), r); }</code><technical_language>careful pick short variable names. This method is short quickly 'r' represents, letter in is descriptive be</technical_language>

Target:
public com.alliander.osgp.dto.valueobjects.smartmetering.PeriodicMeterReadsContainerGas convertTo( final PeriodicMeterReadsContainerGas source, final Type<com.alliander.osgp.dto.valueobjects.smartmetering.PeriodicMeterReadsContainerGas> destinationType) { final List<MeterReadsGas> meterReadsGas = new ArrayList<>(source.getMeterReadsGas().size()); for (final com.alliander.osgp.domain.core.valueobjects.smartmetering.MeterReadsGas pmr : source .getMeterReadsGas()) { meterReadsGas.add(new MeterReadsGas(pmr.getLogTime(), pmr.getConsumption(), pmr.getCaptureTime())); } return new com.alliander.osgp.dto.valueobjects.smartmetering.PeriodicMeterReadsContainerGas( PeriodType.valueOf(source.getPeriodType().name()), meterReadsGas); }
Source:
<code>protected void appendWorkToDeadLetterQueue() { try { String key = getCategory() + ":" + getId(); StreamService service = Framework.getService(StreamService.class); if (service != null) { service.getLogManager(DEFAULT_LOG_MANAGER) .getAppender(DEAD_LETTER_QUEUE) <START> .append(key, Record.of(key, WorkComputation.serialize(this))); <END> } } catch (IllegalArgumentException e) { log.debug("No default log manager, don't save work in failure to a dead letter queue"); } catch (Exception e) { log.error("Failed to save work: " + getId() + " in dead letter queue", e); } }</code><technical_language>Fix indent, dots aligned</technical_language>

Target:
protected void appendWorkToDeadLetterQueue() { if (!State.RUNNING.equals(getWorkInstanceState())) { return; } try { String key = getCategory() + ":" + getId(); StreamService service = Framework.getService(StreamService.class); if (service != null) { service.getLogManager(DEFAULT_LOG_MANAGER) .getAppender(DEAD_LETTER_QUEUE) .append(key, Record.of(key, WorkComputation.serialize(this))); } } catch (IllegalArgumentException e) { log.debug("No default log manager, don't save work in failure to a dead letter queue"); } catch (Exception e) { log.error("Failed to save work: " + getId() + " in dead letter queue", e); } }
Source:
<code>private Mono<ClientHttpResponse> execute(HttpComponentsClientHttpRequest request, HttpClientContext context) { <START> Flux<ByteBuffer> byteBufferFlux = request.getByteBufferFlux(); ReactiveEntityProducer reactiveEntityProducer = createReactiveEntityProducer(request, byteBufferFlux); BasicRequestProducer basicRequestProducer = new BasicRequestProducer(request.getHttpRequest(), reactiveEntityProducer); <END> return Mono.<Message<HttpResponse, Publisher<ByteBuffer>>>create(sink -> { ReactiveResponseConsumer reactiveResponseConsumer = new ReactiveResponseConsumer(new MonoFutureCallbackAdapter<>(sink)); this.client.execute(basicRequestProducer, reactiveResponseConsumer, context, null); }).map(message -> new HttpComponentsClientHttpResponse(this.dataBufferFactory, message, context)); }</code><technical_language>extract body headers HttpComponentsClientHttpRequest, a toRequestProducer class instead, contains this code createReactiveEntityProducer below, returns a BasicRequestProducer. way, do is invoke method</technical_language>

Target:
private Mono<ClientHttpResponse> execute(HttpComponentsClientHttpRequest request, HttpClientContext context) { AsyncRequestProducer requestProducer = request.toRequestProducer(); return Mono.<Message<HttpResponse, Publisher<ByteBuffer>>>create(sink -> { ReactiveResponseConsumer reactiveResponseConsumer = new ReactiveResponseConsumer(new MonoFutureCallbackAdapter(sink)); this.client.execute(requestProducer, reactiveResponseConsumer, context, null); }).map(message -> new HttpComponentsClientHttpResponse(this.dataBufferFactory, message, context)); }
Source:
<code><START> private void applyGroupDefaults(GrpcChannelKey key, NettyChannelBuilder channelBuilder, <END> AlluxioConfiguration conf) { long keepAliveTimeMs = conf.getMs(PropertyKey.Template.USER_NETWORK_KEEPALIVE_TIME_MS .format(key.getNetworkGroup().getPropertyCode())); long keepAliveTimeoutMs = conf.getMs(PropertyKey.Template.USER_NETWORK_KEEPALIVE_TIMEOUT_MS .format(key.getNetworkGroup().getPropertyCode())); long inboundMessageSizeBytes = conf.getBytes(PropertyKey.Template.USER_NETWORK_MAX_INBOUND_MESSAGE_SIZE .format(key.getNetworkGroup().getPropertyCode())); long flowControlWindow = conf.getBytes(PropertyKey.Template.USER_NETWORK_FLOWCONTROL_WINDOW .format(key.getNetworkGroup().getPropertyCode())); Class<? extends Channel> channelType = NettyUtils.getChannelClass( !(key.getServerAddress().getSocketAddress() instanceof InetSocketAddress), PropertyKey.Template.USER_NETWORK_NETTY_CHANNEL .format(key.getNetworkGroup().getPropertyCode()), conf); EventLoopGroup eventLoopGroup = acquireNetworkEventLoop(key, conf); channelBuilder.keepAliveTime(keepAliveTimeMs, TimeUnit.MILLISECONDS); channelBuilder.keepAliveTimeout(keepAliveTimeoutMs, TimeUnit.MILLISECONDS); channelBuilder.maxInboundMetadataSize((int) inboundMessageSizeBytes); channelBuilder.flowControlWindow((int) flowControlWindow); channelBuilder.channelType(channelType); channelBuilder.eventLoopGroup(eventLoopGroup); channelBuilder.usePlaintext(); }</code><technical_language>Return channel builder here</technical_language>

Target:
private NettyChannelBuilder applyGroupDefaults(GrpcChannelKey key, NettyChannelBuilder channelBuilder, AlluxioConfiguration conf) { long keepAliveTimeMs = conf.getMs(PropertyKey.Template.USER_NETWORK_KEEPALIVE_TIME_MS .format(key.getNetworkGroup().getPropertyCode())); long keepAliveTimeoutMs = conf.getMs(PropertyKey.Template.USER_NETWORK_KEEPALIVE_TIMEOUT_MS .format(key.getNetworkGroup().getPropertyCode())); long inboundMessageSizeBytes = conf.getBytes(PropertyKey.Template.USER_NETWORK_MAX_INBOUND_MESSAGE_SIZE .format(key.getNetworkGroup().getPropertyCode())); long flowControlWindow = conf.getBytes(PropertyKey.Template.USER_NETWORK_FLOWCONTROL_WINDOW .format(key.getNetworkGroup().getPropertyCode())); Class<? extends Channel> channelType = NettyUtils.getChannelClass( !(key.getServerAddress().getSocketAddress() instanceof InetSocketAddress), PropertyKey.Template.USER_NETWORK_NETTY_CHANNEL .format(key.getNetworkGroup().getPropertyCode()), conf); EventLoopGroup eventLoopGroup = acquireNetworkEventLoop(key, conf); channelBuilder.keepAliveTime(keepAliveTimeMs, TimeUnit.MILLISECONDS); channelBuilder.keepAliveTimeout(keepAliveTimeoutMs, TimeUnit.MILLISECONDS); channelBuilder.maxInboundMetadataSize((int) inboundMessageSizeBytes); channelBuilder.flowControlWindow((int) flowControlWindow); channelBuilder.channelType(channelType); channelBuilder.eventLoopGroup(eventLoopGroup); channelBuilder.usePlaintext(); return channelBuilder; }
Source:
<code>private static boolean isAwsEndpoint(String endpoint) { <START> return (endpoint.startsWith("s3.") || endpoint.startsWith("s3-accelerate.")) <END> && (endpoint.endsWith(".amazonaws.com") || endpoint.endsWith(".amazonaws.com.cn")); }</code><technical_language>suggestion return (endpoint.startsWith("s3.") || isAwsAccelerateEndpoint(endpoint))</technical_language>

Target:
private boolean isAwsEndpoint(String endpoint) { return (endpoint.startsWith("s3.") || isAwsAccelerateEndpoint(endpoint)) && (endpoint.endsWith(".amazonaws.com") || endpoint.endsWith(".amazonaws.com.cn")); }
Source:
<code>public void close() throws IOException { mEvictorTask.cancel(true); mEvictor.shutdownNow(); try { mEvictor.awaitTermination(2, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); <START> throw new IOException("Failed to await evictor termination", e); <END> } }</code><technical_language>suggestion throw new IOException("Failed await LockPool evictor termination", e);</technical_language>

Target:
public void close() throws IOException { mEvictorTask.cancel(true); mEvictor.shutdownNow(); try { mEvictor.awaitTermination(2, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException("Failed to await LockPool evictor termination", e); } }
Source:
<code>private String getHeaderLine(int headerLineNo) { <START> String header = getHeaderLines().get(headerLineNo); <END> if (header.isEmpty()) { header = EMPTY_LINE_PATTERN; } return header; }</code><technical_language>please name line ,as term header for block of lines</technical_language>

Target:
private String getHeaderLine(int headerLineNo) { String line = getHeaderLines().get(headerLineNo); if (line.isEmpty()) { line = EMPTY_LINE_PATTERN; } return line; }
Source:
<code>public List<CredentialRepresentation> credentials(){ <START> auth.users().requireView(user); <END> List<CredentialModel> models = session.userCredentialManager().getStoredCredentials(realm, user); models.forEach(c -> c.setSecretData(null)); return models.stream().map(ModelToRepresentation::toRepresentation).collect(Collectors.toList()); }</code><technical_language>Is this change intentional</technical_language>

Target:
public List<CredentialRepresentation> credentials(){ auth.users().requireManage(user); List<CredentialModel> models = session.userCredentialManager().getStoredCredentials(realm, user); models.forEach(c -> c.setSecretData(null)); return models.stream().map(ModelToRepresentation::toRepresentation).collect(Collectors.toList()); }
Source:
<code>public static SubmoduleWalk forIndex(Repository repository) throws IOException { SubmoduleWalk generator = new SubmoduleWalk(repository); try { DirCache index = repository.readDirCache(); generator.setTree(new DirCacheIterator(index)); <START> if (repository.isBare()) <END> generator.setRootTree(new DirCacheIterator(index)); else generator.useWorkingTree = true; } catch (IOException e) { generator.release(); throw e; } return generator; }</code><technical_language>this sense? I bare repositories index repository.readDirCache() throw exception this point repository.getIndexFile() throws exception for bare repositories is called DirCache.read</technical_language>

Target:
public static SubmoduleWalk forIndex(Repository repository) throws IOException { SubmoduleWalk generator = new SubmoduleWalk(repository); try { DirCache index = repository.readDirCache(); generator.setTree(new DirCacheIterator(index)); generator.useWorkingTree = true; } catch (IOException e) { generator.release(); throw e; } return generator; }
Source:
<code>AstPackageExplorer(Language language) { availableNodeNames = getClasses("net.sourceforge.pmd.lang." + language.getTerseName() + ".ast") .filter(clazz -> clazz.getSimpleName().startsWith("AST")) .filter(clazz -> !clazz.isInterface() && !Modifier.isAbstract(clazz.getModifiers())) .map(m -> m.getSimpleName().substring("AST".length())) <START> .collect(Collectors.toList()); <END> }</code><technical_language>suggestion .collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList));</technical_language>

Target:
AstPackageExplorer(Language language) { availableNodeNames = getClasses("net.sourceforge.pmd.lang." + language.getTerseName() + ".ast") .filter(clazz -> clazz.getSimpleName().startsWith("AST")) .filter(clazz -> !clazz.isInterface() && !Modifier.isAbstract(clazz.getModifiers())) .map(m -> m.getSimpleName().substring("AST".length())) .collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList)); }
Source:
<code>public void updateAlertInTree(Alert originalAlert, Alert alert) { if (Constant.isLowMemoryOptionSet()) { return; } this.getTreeModel().updatePath(originalAlert, alert); if (isInFilter(alert)) { this.getFilteredTreeModel().updatePath(originalAlert, alert); } this.recalcAlerts(); if (View.isInitialised()) { JTree alertTree = this.getAlertPanel().getTreeAlert(); <START> alertTree.setExpandsSelectedPaths(true); <END> alertTree.setSelectionPath(findAlertInTree(alert)); alertTree.scrollPathToVisible(findAlertInTree(alert)); } }</code><technical_language>This done (in getTreeAlert())</technical_language>

Target:
public void updateAlertInTree(Alert originalAlert, Alert alert) { if (Constant.isLowMemoryOptionSet()) { return; } this.getTreeModel().updatePath(originalAlert, alert); if (isInFilter(alert)) { this.getFilteredTreeModel().updatePath(originalAlert, alert); } this.recalcAlerts(); if (View.isInitialised()) { JTree alertTree = this.getAlertPanel().getTreeAlert(); TreePath alertPath = new TreePath(getTreeModel().getAlertNode(alert).getPath()); alertTree.setSelectionPath(alertPath); alertTree.scrollPathToVisible(alertPath); } }
Source:
<code>private RevWalk getRevCommits() { RevWalk revWalk = new RevWalk(repo); revWalk.sort(RevSort.COMMIT_TIME_DESC, true); revWalk.sort(RevSort.BOUNDARY, true); AnyObjectId headId = getHeadId(); try { revWalk.markStart(revWalk.parseCommit(headId)); } catch (IOException e) { <START> MessageDialog.openError(getShell(), <END> UIText.TagAction_errorDuringTagging, UIText.TagAction_errorWhileGettingRevCommits); } return revWalk; }</code><technical_language>underlying error is displayed logged</technical_language>

Target:
private RevWalk getRevCommits() { RevWalk revWalk = new RevWalk(repo); revWalk.sort(RevSort.COMMIT_TIME_DESC, true); revWalk.sort(RevSort.BOUNDARY, true); try { AnyObjectId headId = repo.resolve(Constants.HEAD); revWalk.markStart(revWalk.parseCommit(headId)); } catch (IOException e) { ErrorDialog.openError(getShell(), UIText.TagAction_errorDuringTagging, UIText.TagAction_errorWhileGettingRevCommits, new Status( IStatus.ERROR, Activator.getPluginId(), e .getMessage(), e)); } return revWalk; }
Source:
<code>public static Date parseISO8601(String dateString) throws ParseException { Date date = new Date(); <START> SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); <END> sdf.setTimeZone(TimeZone.getTimeZone("UTC")); date.setTime(sdf.parse(dateString).getTime()); return date; }</code><technical_language>date format string refactored in multiple places. wondering expensive creation of a new SDF is</technical_language>

Target:
public static Date parseISO8601(String dateString) throws ParseException { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_FORMAT_STRING); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); date.setTime(sdf.parse(dateString).getTime()); return date; }
Source:
<code>private Promise<CommandImpl> add(final CommandImpl command) { final CommandDto commandDto = dtoFactory.createDto(CommandDto.class) .withName(getUniqueCommandName(command.getType(), command.getName())) .withCommandLine(command.getCommandLine()) .withType(command.getType()) .withAttributes(command.getAttributes()); return workspaceServiceClient.addCommand(appContext.getWorkspaceId(), commandDto).then(new Function<WorkspaceDto, CommandImpl>() { @Override public CommandImpl apply(WorkspaceDto arg) throws FunctionException { <START> final CommandImpl newCommand = new CommandImpl(commandDto.getName(), <END> command.getCommandLine(), command.getType(), command.getAttributes()); commands.put(newCommand.getName(), newCommand); fireCommandAdded(newCommand); return newCommand; } }); }</code><technical_language>I guess new CommandImpl(commandDto); here, do think</technical_language>

Target:
private Promise<CommandImpl> add(final CommandImpl command) { final CommandDto commandDto = dtoFactory.createDto(CommandDto.class) .withName(getUniqueCommandName(command.getType(), command.getName())) .withCommandLine(command.getCommandLine()) .withType(command.getType()) .withAttributes(command.getAttributes()); return workspaceServiceClient.addCommand(appContext.getWorkspaceId(), commandDto).then(new Function<WorkspaceDto, CommandImpl>() { @Override public CommandImpl apply(WorkspaceDto arg) throws FunctionException { final CommandImpl newCommand = new CommandImpl(command); newCommand.setName(commandDto.getName()); commands.put(newCommand.getName(), newCommand); fireCommandAdded(newCommand); return newCommand; } }); }
Source:
<code>private final String getSessionIndex(Assertion subjectAssertion) { List<AuthnStatement> authnStatements = subjectAssertion.getAuthnStatements(); if(authnStatements != null && authnStatements.size() > 0) { AuthnStatement statement = authnStatements.get(0); <START> return statement.getSessionIndex(); <END> } return null; }</code><technical_language>statement null</technical_language>

Target:
private final String getSessionIndex(Assertion subjectAssertion) { List<AuthnStatement> authnStatements = subjectAssertion.getAuthnStatements(); if(authnStatements != null && authnStatements.size() > 0) { AuthnStatement statement = authnStatements.get(0); if(statement != null) { return statement.getSessionIndex(); } } return null; }
Source:
<code>private ConnectionFactory getConnectionFactory(ConnectionFactory connectionFactory) { if (connectionFactory == null) { <START> if (System.getProperties().getProperty("com.api.client.should_use_proxy") != null) { <END> return new DefaultConnectionFactory(defaultProxy()); } return new DefaultConnectionFactory(); } return connectionFactory; }</code><technical_language>I a flag @garrettjonesgoogle thoughts</technical_language>

Target:
private ConnectionFactory getConnectionFactory(ConnectionFactory connectionFactory) { if (connectionFactory == null) { if (System.getProperty("com.api.client.should_use_proxy") != null) { return new DefaultConnectionFactory(defaultProxy()); } return new DefaultConnectionFactory(); } return connectionFactory; }
Source:
<code>private JmxTableHandle getJmxTableHandle(SchemaTableName tableName) { try { String canonicalName = new ObjectName(tableName.getTableName()).getCanonicalName(); Optional<ObjectName> objectName = mbeanServer.queryNames(WILDCARD, null).stream() .filter(name -> canonicalName.equalsIgnoreCase(name.getCanonicalName())) .findFirst(); if (!objectName.isPresent()) { return null; } MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(objectName.get()); ImmutableList.Builder<JmxColumnHandle> columns = ImmutableList.builder(); columns.add(new JmxColumnHandle(NODE_COLUMN_NAME, createUnboundedVarcharType())); Arrays.stream(mbeanInfo.getAttributes()) .filter(MBeanAttributeInfo::isReadable) .map(attribute -> new JmxColumnHandle(attribute.getName(), getColumnType(attribute))) <START> .sorted(Comparator.comparing(JmxColumnHandle::getColumnName)) <END> .forEach(columns::add); return new JmxTableHandle(objectName.get().toString(), columns.build(), true); } catch (JMException e) { return null; } }</code><technical_language>static import</technical_language>

Target:
private JmxTableHandle getJmxTableHandle(SchemaTableName tableName) { try { String objectNamePattern = toPattern(tableName.getTableName().toLowerCase(ENGLISH)); List<ObjectName> objectNames = mbeanServer.queryNames(WILDCARD, null).stream() .filter(name -> name.getCanonicalName().toLowerCase(ENGLISH).matches(objectNamePattern)) .collect(toImmutableList()); if (objectNames.isEmpty()) { return null; } List<JmxColumnHandle> columns = new ArrayList<>(); columns.add(new JmxColumnHandle(NODE_COLUMN_NAME, createUnboundedVarcharType())); columns.add(new JmxColumnHandle(OBJECT_NAME_NAME, createUnboundedVarcharType())); for (ObjectName objectName : objectNames) { MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(objectName); getColumnHandles(mbeanInfo).forEach(columns::add); } columns = columns.stream() .distinct() .sorted(comparing(JmxColumnHandle::getColumnName)) .collect(toImmutableList()); return new JmxTableHandle(tableName, objectNames.stream().map(ObjectName::toString).collect(toImmutableList()), columns, true); } catch (JMException e) { return null; } }
Source:
<code>public int compareTo(FitnessAndQuality o) { if (fitness == o.fitness) { if (quality == o.quality) { return 0; } <START> return quality < o.quality ? -1 : 1; <END> } return fitness < o.fitness ? -1 : 1; }</code><technical_language>this line moved line higher, close brace</technical_language>

Target:
public int compareTo(FitnessAndQuality o) { if (fitness == o.fitness) { if (quality == o.quality) { return 0; } else { return quality < o.quality ? -1 : 1; } } else { return fitness < o.fitness ? -1 : 1; } }
Source:
<code>@Test public void finderThrowsLessNiceErrorInEditMode() { View view = new View(Robolectric.application); try { <START> ButterKnife.Finder.VIEW.findRequiredView(view, android.R.id.button1, "yo mama"); <END> } catch (IllegalStateException e) { assertThat(e).hasMessage("Required view '<unavailable while editing>' " + "with ID " + android.R.id.button1 + " for yo mama was not found. If this view is optional add '@Nullable' annotation."); } }</code><technical_language>+1: good eye</technical_language>

Target:
@Test public void finderThrowsLessNiceErrorInEditMode() { View view = new View(Robolectric.application); try { ButterKnife.Finder.VIEW.findRequiredView(view, android.R.id.button1, "yo mama"); fail("View 'button1' with ID " + android.R.id.button1 + " should not have been found."); } catch (IllegalStateException e) { assertThat(e).hasMessage("Required view '<unavailable while editing>' " + "with ID " + android.R.id.button1 + " for yo mama was not found. If this view is optional add '@Nullable' annotation."); } }
Source:
<code>public void unassignTransportProvider(List<DatastreamTask> taskList) { Validate.notNull(taskList, "null task"); Set<KafkaProducerWrapper<byte[], byte[]>> producers = new HashSet<>(); for (DatastreamTask task : taskList) { if (_transportProviders.containsKey(task)) { KafkaTransportProvider transportProvider = _transportProviders.remove(task); producers.addAll(transportProvider.getProducers()); } else { LOG.warn("Trying to unassign already unassigned transport provider for task {}.", task); } } producers.forEach(p -> p.unassignTask(taskList)); <START> <END> }</code><technical_language>nit: remove extra line</technical_language>

Target:
public void unassignTransportProvider(List<DatastreamTask> taskList) { Validate.notNull(taskList, "null task list"); Set<KafkaProducerWrapper<byte[], byte[]>> producers = new HashSet<>(); for (DatastreamTask task : taskList) { if (_transportProviders.containsKey(task)) { KafkaTransportProvider transportProvider = _transportProviders.remove(task); producers.addAll(transportProvider.getProducers()); } else { LOG.warn("Trying to unassign already unassigned transport provider for task {}.", task); } } producers.forEach(p -> p.unassignTasks(taskList)); }
Source:
<code>public MySQLConnector(Supplier<MetadataStorageConnectorConfig> config, Supplier<MetadataStorageTablesConfig> dbTables) { super(config, dbTables); final BasicDataSource datasource = getDatasource(); datasource.setDriverClassLoader(getClass().getClassLoader()); datasource.setDriverClassName("com.mysql.jdbc.Driver"); datasource.setConnectionInitSqls(ImmutableList.of("SET sql_mode='ANSI_QUOTES'")); this.dbi = new DBI(datasource); <START> log.info("Configured MySQL as the metadata storage"); <END> }</code><technical_language>this debug level</technical_language>

Target:
public MySQLConnector(Supplier<MetadataStorageConnectorConfig> config, Supplier<MetadataStorageTablesConfig> dbTables) { super(config, dbTables); final BasicDataSource datasource = getDatasource(); datasource.setDriverClassLoader(getClass().getClassLoader()); datasource.setDriverClassName("com.mysql.jdbc.Driver"); datasource.setConnectionInitSqls(ImmutableList.of("SET sql_mode='ANSI_QUOTES'")); this.dbi = new DBI(datasource); log.info("Configured MySQL as metadata storage"); }
Source:
<code>void notifySessionError(String nativeErrorCategory, int nativeErrorCode, String errorMessage) { if (errorHandler == null) { return; } ErrorCode errCode = ErrorCode.fromNativeError(nativeErrorCategory, nativeErrorCode); if (errCode == ErrorCode.CLIENT_RESET) { RealmConfiguration backupRealmConfiguration = configuration.forErrorRecovery(errorMessage); clientResetHandler.onClientReset(this, new ClientResetRequiredError(errCode, "A Client Reset is required. " + <START> "Read more here: <LINK_0>", <END> configuration, backupRealmConfiguration)); } else { AppException wrappedError; if (errCode == ErrorCode.UNKNOWN) { wrappedError = new AppException(nativeErrorCategory, nativeErrorCode, errorMessage); } else { wrappedError = new AppException(errCode, errorMessage); } errorHandler.onError(this, wrappedError); } }</code><technical_language>Is code snippet pointed doc is up-to-date</technical_language>

Target:
void notifySessionError(String nativeErrorCategory, int nativeErrorCode, String errorMessage) { if (errorHandler == null) { return; } ErrorCode errCode = ErrorCode.fromNativeError(nativeErrorCategory, nativeErrorCode); if (errCode == ErrorCode.CLIENT_RESET) { RealmConfiguration backupRealmConfiguration = configuration.forErrorRecovery(errorMessage); clientResetHandler.onClientReset(this, new ClientResetRequiredError(appNativePointer, errCode, "A Client Reset is required. " + "Read more here: <LINK_0>", configuration, backupRealmConfiguration)); } else { AppException wrappedError; if (errCode == ErrorCode.UNKNOWN) { wrappedError = new AppException(nativeErrorCategory, nativeErrorCode, errorMessage); } else { wrappedError = new AppException(errCode, errorMessage); } errorHandler.onError(this, wrappedError); } }
Source:
<code>public void UtcDateStringToLocaDateMultiThread() throws InterruptedException { final Thread[] threads = new Thread[8]; final Checker[] checkers = new Checker[threads.length]; for (int i = 0; i < threads.length; i++) { checkers[i] = new Checker("1984/06/19 14:25:11", 456503111000L, 100000); threads[i] = new Thread(checkers[i], "ovf-checker-" + i); threads[i].start(); } for (Thread thread : threads) { thread.join(); } for (Checker checker : checkers) { <START> Assert.assertEquals(0, checker.errors); <END> } }</code><technical_language>omit Assert.</technical_language>

Target:
public void UtcDateStringToLocaDateMultiThread() throws InterruptedException { final Thread[] threads = new Thread[8]; final Checker[] checkers = new Checker[threads.length]; for (int i = 0; i < threads.length; i++) { checkers[i] = new Checker("1984/06/19 14:25:11", 456503111000L, 100000); threads[i] = new Thread(checkers[i], "ovf-checker-" + i); threads[i].start(); } for (Thread thread : threads) { thread.join(); } for (Checker checker : checkers) { assertEquals(0, checker.errors); } }
Source:
<code>protected void assertCompileTime(final long shortTime, final double factor, final long longTime) { <START> assertThat(longTime+" <END> should be less than "+factor+"x the compile time of "+shortTime, longTime < factor*shortTime); }</code><technical_language>prefer org.junit.Assert.assertTrue(String, boolean) for reasons: avoid additional dependency & expected failure reported junit failure error</technical_language>

Target:
protected void assertCompileTime(final long shortTime, final double factor, final long longTime) { assertTrue(longTime+" should be less than "+factor+"x the compile time of "+shortTime, longTime < factor*shortTime); }
Source:
<code>public DockerImage build(String image, File dir, @CheckForNull File log) throws IOException, InterruptedException { String tag = getDockerFileHash(dir); String full = image + ":" + tag; if (cmd("images").add(image).popen().verifyOrDieWith("failed to query the status of the image").trim().contains(" " + tag + " ")) { return new DockerImage(full); } ProcessBuilder buildCmd = cmd("build").add("-t", full, dir).build(); if (log != null) { buildCmd.redirectError(log).redirectOutput(log); } else { buildCmd.redirectError(ProcessBuilder.Redirect.INHERIT).redirectOutput(ProcessBuilder.Redirect.INHERIT); } if (buildCmd.start().waitFor() != 0) { <START> throw new Error("Failed to start image: " + tag); <END> } return new DockerImage(full); }</code><technical_language>this is a failure build image start it</technical_language>

Target:
public DockerImage build(String image, File dir, @CheckForNull File log) throws IOException, InterruptedException { String tag = getDockerFileHash(dir); String full = image + ":" + tag; if (cmd("images").add(image).popen().verifyOrDieWith("failed to query the status of the image").trim().contains(" " + tag + " ")) { return new DockerImage(full); } CommandBuilder buildCmd = cmd("build").add("-t", full, dir); ProcessBuilder processBuilder = buildCmd.build(); if (log != null) { processBuilder.redirectError(log).redirectOutput(log); } else { processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT).redirectOutput(ProcessBuilder.Redirect.INHERIT); } StringBuilder sb = new StringBuilder("Building Docker image `").append(buildCmd.toString()).append("`"); if (log != null) { sb.append(": logfile is at ").append(log); } System.out.println(sb.toString()); if (processBuilder.start().waitFor() != 0) { throw new Error("Failed to build image: " + tag); } return new DockerImage(full); }