auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void peekMessage() { final String messageId = UUID.randomUUID().toString(); final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, messageId, 0); final ReceiveMessageOptions options = new ReceiveMessageOptions().setAutoComplete(true); receiver = createBuilder() .receiveMessageOptions(options) .buildAsyncReceiverClient(); <START> StepVerifier.create(sender.send(message).thenMany(receiver.peek())) <END> .assertNext(receivedMessage -> { Assertions.assertEquals(contents, receivedMessage.getBodyAsString()); Assertions.assertTrue(receivedMessage.getProperties().containsKey(MESSAGE_TRACKING_ID)); Assertions.assertEquals(messageId, receivedMessage.getProperties().get(MESSAGE_TRACKING_ID)); }) .verifyComplete(); }</code><technical_language>sender.send(message).then(receiver.peek()) is want. thenMany suggests returns a flux</technical_language>

Target:
void peekMessage() { final String messageId = UUID.randomUUID().toString(); final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, messageId, 0); StepVerifier.create(sender.send(message).then(receiver.peek())) .assertNext(receivedMessage -> { Assertions.assertEquals(contents, receivedMessage.getBodyAsString()); Assertions.assertTrue(receivedMessage.getProperties().containsKey(MESSAGE_TRACKING_ID)); Assertions.assertEquals(messageId, receivedMessage.getProperties().get(MESSAGE_TRACKING_ID)); }) .verifyComplete(); }
Source:
<code>protected void executeVDSCommand() { vmManager.lock(); try { executeVmCommand(); <START> vmManager.setLastUpdateDate(Calendar.getInstance().getTime()); <END> } finally { vmManager.unlock(); } }</code><technical_language>Note a side effect of putting time user changes CD, is a chance skip a cycle of monitoring. end of world</technical_language>

Target:
protected void executeVDSCommand() { vmManager.lock(); try { executeVmCommand(); updateVmDataChangedTime(); } finally { vmManager.unlock(); } }
Source:
<code>public String validateInput() { File file = getSelectedFile(); if (file == null) { return I18N.tr("A file must be selected"); } boolean exists = getSelectedFile().exists(); if (exists && fileMustNotExist) { return UIFactory.getI18n().tr("The file already exists"); } else if(exists && confirmOverwrite) { if(JOptionPane.showConfirmDialog(getComponent(),"<html><body><p style='width: "+ getMessageWidth()+ "px;'>"+ I18N.tr("The file {0} already exists do you confirm overwrite ?" <START> + "</body></html>", getSelectedFile()) , <END> I18N.tr("Overwrite confirmation"), JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) { return I18N.tr("Overwrite canceled"); } } return null; }</code><technical_language>This is a [run-on sentence](<LINK_0> In addition, a space question mark in English. Better: "The file {0} exists. Overwrite?"</technical_language>

Target:
public String validateInput() { File file = getSelectedFile(); if (file == null) { return I18N.tr("A file must be selected"); } boolean exists = getSelectedFile().exists(); if (exists && fileMustNotExist) { return UIFactory.getI18n().tr("The file already exists"); } else if(exists && confirmOverwrite) { if (JOptionPane.showConfirmDialog( getComponent(), "<html><body><p style='width: " + messageWidth + "px;'>" + I18N.tr("The file {0} already exists. Overwrite?" + "</body></html>", getSelectedFile()), I18N.tr("Confirm overwrite"), JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) { return I18N.tr("Overwrite canceled"); } } return null; }
Source:
<code>private GlusterVolumeTaskStatusEntity fetchRemobeBricksStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRemoveBricksStatus, new GlusterVolumeRemoveBricksVDSParameters(getUpServerId(clusterId), volume.getName(), getParameters().getBricks(), volume.getReplicaCount())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue(); GlusterAsyncTask asyncTask = volume.getAsyncTask(); if (asyncTask != null && asyncTask.getTaskId() != null) { List<Step> stepsList = getStepDao().getStepsByExternalId(asyncTask.getTaskId()); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } <START> updateTaskStepDetails(asyncTask, entity.getStatusSummary().getStatus()); <END> if (asyncTask.getStatus() == JobExecutionStatus.ABORTED) { entity.getStatusSummary().setStatus(JobExecutionStatus.ABORTED); } } updateHostIP(entity); return entity; }</code><technical_language>pass step retrieved updateTaskStepDetails method? avoid a call dao</technical_language>

Target:
private GlusterVolumeTaskStatusEntity fetchRemobeBricksStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRemoveBricksStatus, new GlusterVolumeRemoveBricksVDSParameters(getUpServerId(clusterId), volume.getName(), getParameters().getBricks(), volume.getReplicaCount())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue(); GlusterAsyncTask asyncTask = volume.getAsyncTask(); if (asyncTask != null && asyncTask.getTaskId() != null) { List<Step> stepsList = getStepDao().getStepsByExternalId(asyncTask.getTaskId()); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } updateTaskStepDetails(asyncTask, entity.getStatusSummary().getStatus(), stepsList); if (asyncTask.getStatus() == JobExecutionStatus.ABORTED) { entity.getStatusSummary().setStatus(JobExecutionStatus.ABORTED); } } updateHostIP(entity); return entity; }
Source:
<code>private EnvVars addVarsToBuildEnv(final EnvVars envs, final ArrayList<ParameterValue> vars) { <START> for (ParameterValue p : vars) { <END> envs.putIfNotNull(p.getName(), String.valueOf(p.getValue())); } return envs; }</code><technical_language>final</technical_language>

Target:
private EnvVars addVarsToBuildEnv(final EnvVars envs, final ArrayList<ParameterValue> vars) { for (final ParameterValue p : vars) { envs.putIfNotNull(p.getName(), String.valueOf(p.getValue())); } return envs; }
Source:
<code>public AbstractChannelTypeBuilder(ChannelTypeUID channelTypeUID, String label) { this.channelTypeUID = channelTypeUID; <START> this.label = label; <END> }</code><technical_language>in a previous version parameters checked for empty-ness, nice again</technical_language>

Target:
public AbstractChannelTypeBuilder(ChannelTypeUID channelTypeUID, String label) { if (channelTypeUID == null) { throw new IllegalArgumentException("ChannelTypeUID must be set."); } if (StringUtils.isEmpty(label)) { throw new IllegalArgumentException("Label for a ChannelType must not be empty."); } this.channelTypeUID = channelTypeUID; this.label = label; }
Source:
<code>public static void fhirResourceSearchGet(String resourceName) throws IOException, URISyntaxException { CloudHealthcare client = createClient(); HttpClient httpClient = HttpClients.createDefault(); String uri = String.format( <START> "%sv1beta1/%s", client.getRootUrl(), resourceName); <END> URIBuilder uriBuilder = new URIBuilder(uri) .setParameter("access_token", getAccessToken()); HttpUriRequest request = RequestBuilder .get() .setUri(uriBuilder.build()) .addHeader("Content-Type", "application/fhir+json") .addHeader("Accept-Charset", "utf-8") .addHeader("Accept", "application/fhir+json; charset=utf-8") .build(); HttpResponse response = httpClient.execute(request); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { System.err.print(String.format( "Exception searching FHIR resources: %s\n", response.getStatusLine().toString())); responseEntity.writeTo(System.err); throw new RuntimeException(); } System.out.println("FHIR resource search results: "); responseEntity.writeTo(System.out); }</code><technical_language>s.b. v1, v1beta1</technical_language>

Target:
public static void fhirResourceSearchGet(String resourceName) throws IOException, URISyntaxException { CloudHealthcare client = createClient(); HttpClient httpClient = HttpClients.createDefault(); String uri = String.format( "%sv1/%s", client.getRootUrl(), resourceName); URIBuilder uriBuilder = new URIBuilder(uri) .setParameter("access_token", getAccessToken()); HttpUriRequest request = RequestBuilder .get() .setUri(uriBuilder.build()) .addHeader("Content-Type", "application/fhir+json") .addHeader("Accept-Charset", "utf-8") .addHeader("Accept", "application/fhir+json; charset=utf-8") .build(); HttpResponse response = httpClient.execute(request); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { System.err.print(String.format( "Exception searching FHIR resources: %s\n", response.getStatusLine().toString())); responseEntity.writeTo(System.err); throw new RuntimeException(); } System.out.println("FHIR resource search results: "); responseEntity.writeTo(System.out); }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ColumnStatistics that = (ColumnStatistics) o; return hasNumberOfValues == that.hasNumberOfValues && <START> numberOfValues == that.numberOfValues && <END> Objects.equals(booleanStatistics, that.booleanStatistics) && Objects.equals(integerStatistics, that.integerStatistics) && Objects.equals(doubleStatistics, that.doubleStatistics) && Objects.equals(stringStatistics, that.stringStatistics) && Objects.equals(dateStatistics, that.dateStatistics) && Objects.equals(decimalStatistics, that.decimalStatistics) && Objects.equals(bloomFilter, that.bloomFilter); }</code><technical_language>compare this if hasNumberOfValues</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ColumnStatistics that = (ColumnStatistics) o; return Objects.equals(hasNumberOfValues, that.hasNumberOfValues) && Objects.equals(getNumberOfValues(), that.getNumberOfValues()) && Objects.equals(booleanStatistics, that.booleanStatistics) && Objects.equals(integerStatistics, that.integerStatistics) && Objects.equals(doubleStatistics, that.doubleStatistics) && Objects.equals(stringStatistics, that.stringStatistics) && Objects.equals(dateStatistics, that.dateStatistics) && Objects.equals(decimalStatistics, that.decimalStatistics) && Objects.equals(bloomFilter, that.bloomFilter); }
Source:
<code>public static CreateServer create(List<String> servers) { <START> return new AutoValue_PrivateNetwork_Server_CreateServer(servers == null ? ImmutableList.<String>of() : servers); <END> }</code><technical_language>Enforce immutable list present too</technical_language>

Target:
public static CreateServer create(List<String> servers) { return new AutoValue_PrivateNetwork_Server_CreateServer(servers == null ? ImmutableList.<String>of() : ImmutableList.copyOf(servers)); }
Source:
<code>default Set<User> calculateCulprits() { Set<User> r = new HashSet<User>(); RunT p = ((RunT)this).getPreviousCompletedBuild(); if (p != null && ((RunT)this).isBuilding()) { Result pr = p.getResult(); if (pr != null && pr.isWorseThan(Result.SUCCESS)) { r.addAll(p.getCulprits()); } } for (ChangeLogSet<? extends ChangeLogSet.Entry> c : getChangeSets()) { <START> for (ChangeLogSet.Entry e : c) <END> r.add(e.getAuthor()); } return r; }</code><technical_language>braces</technical_language>

Target:
default Set<User> calculateCulprits() { Set<User> r = new HashSet<>(); RunT p = ((RunT)this).getPreviousCompletedBuild(); if (p != null) { Result pr = p.getResult(); if (pr != null && pr.isWorseThan(Result.SUCCESS)) { r.addAll(p.getCulprits()); } } for (ChangeLogSet<? extends ChangeLogSet.Entry> c : getChangeSets()) { for (ChangeLogSet.Entry e : c) { r.add(e.getAuthor()); } } return r; }
Source:
<code>public static ColumnarArray toColumnarArray(Block block) { requireNonNull(block, "block is null"); if (block instanceof LazyBlock) { return toColumnarArray((LazyBlock) block); } if (block instanceof DictionaryBlock) { return toColumnarArray((DictionaryBlock) block); } if (block instanceof RunLengthEncodedBlock) { return toColumnarArray((RunLengthEncodedBlock) block); <START> } <END> if (!(block instanceof AbstractArrayBlock)) { throw new IllegalArgumentException("Invalid array block: " + block.getClass().getName()); } AbstractArrayBlock arrayBlock = (AbstractArrayBlock) block; Block elementsBlock = arrayBlock.getValues(); int elementsOffset = 0; int elementsLength = 0; if (arrayBlock.getPositionCount() > 0) { elementsOffset = arrayBlock.getOffset(0); elementsLength = arrayBlock.getOffset(arrayBlock.getPositionCount()) - elementsOffset; } elementsBlock = elementsBlock.getRegion(elementsOffset, elementsLength); return new ColumnarArray(block, arrayBlock.getOffsetBase(), arrayBlock.getOffsets(), elementsBlock); }</code><technical_language>Do in ColumnarRow</technical_language>

Target:
public static ColumnarArray toColumnarArray(Block block) { requireNonNull(block, "block is null"); if (block instanceof DictionaryBlock) { return toColumnarArray((DictionaryBlock) block); } if (block instanceof RunLengthEncodedBlock) { return toColumnarArray((RunLengthEncodedBlock) block); } if (!(block instanceof AbstractArrayBlock)) { throw new IllegalArgumentException("Invalid array block: " + block.getClass().getName()); } AbstractArrayBlock arrayBlock = (AbstractArrayBlock) block; Block elementsBlock = arrayBlock.getValues(); int elementsOffset = 0; int elementsLength = 0; if (arrayBlock.getPositionCount() > 0) { elementsOffset = arrayBlock.getOffset(0); elementsLength = arrayBlock.getOffset(arrayBlock.getPositionCount()) - elementsOffset; } elementsBlock = elementsBlock.getRegion(elementsOffset, elementsLength); return new ColumnarArray(block, arrayBlock.getOffsetBase(), arrayBlock.getOffsets(), elementsBlock); }
Source:
<code>private void prepareHandlers() { <START> for (Map.Entry<Class<?>, SortedSet<MessageHandlingMember<? super T>>> typeHandlers <END> : handlerInspector.getAllHandlers().entrySet()) { for (MessageHandlingMember<? super T> handler : typeHandlers.getValue()) { Class<?> type = typeHandlers.getKey(); if (handler.unwrap(CommandMessageHandlingMember.class).isPresent()) { if (Modifier.isAbstract(type.getModifiers()) && handler.unwrap(Constructor.class).isPresent()) { throw new AggregateModellingException(format( "An abstract aggregate %s cannot have @CommandHandler on constructor.", type)); } addHandler(allCommandHandlers, type, handler); } else if (handler.unwrap(CommandHandlerInterceptorHandlingMember.class).isPresent()) { addHandler(allCommandHandlerInterceptors, type, handler); } else { addHandler(allEventHandlers, type, handler); } } } validateCommandHandlers(); }</code><technical_language>Nit: I renaming typeHandlers handlersPerType is slightly clearer. a taste though, marked a nit</technical_language>

Target:
private void prepareHandlers() { for (Map.Entry<Class<?>, SortedSet<MessageHandlingMember<? super T>>> handlersPerType : handlerInspector.getAllHandlers().entrySet()) { Class<?> type = handlersPerType.getKey(); for (MessageHandlingMember<? super T> handler : handlersPerType.getValue()) { if (handler.unwrap(CommandMessageHandlingMember.class).isPresent()) { if (Modifier.isAbstract(type.getModifiers()) && handler.unwrap(Constructor.class).isPresent()) { throw new AggregateModellingException(format( "An abstract aggregate %s cannot have @CommandHandler on constructor.", type)); } addHandler(allCommandHandlers, type, handler); } else if (handler.unwrap(CommandHandlerInterceptorHandlingMember.class).isPresent()) { addHandler(allCommandHandlerInterceptors, type, handler); } else { addHandler(allEventHandlers, type, handler); } } } validateCommandHandlers(); }
Source:
<code>default Builder result(ItemStack result) { <START> return result(result.createSnapshot()); <END> }</code><technical_language>a null check checkNotNull(result, "result")</technical_language>

Target:
default Builder result(ItemStack result) { checkNotNull(result, "result"); return result(result.createSnapshot()); }
Source:
<code>int foo(int y) { MathOperation addition = (x) -> x + x; MathOperation addition2 = (x) -> { return x + x; }; MathOperation addition3 = x -> x + x; <START> MathOperation2 addition4 = (a, b) -> a + b; <END> return y; }</code><technical_language>Do lambdas nested expressions? Lambdas cases for expressions , do difference them</technical_language>

Target:
int foo(int y) { MathOperation case1 = (x) -> x + x; MathOperation case2 = (x) -> { return x + x; }; MathOperation case3 = (int x) -> x + x; MathOperation case4 = x -> x + x; MathOperation2 case5 = (a, b) -> a + b; MathOperation2 case6 = (int a, int b) -> a + b; MathOperation2 case7 = (int a, int b) -> { return a + b; }; Objects.requireNonNull(null, () -> "message"); call((x) -> x + x); new HashSet<Integer>().stream().filter((filter) -> filter > 0); return y; }
Source:
<code>void runBenchmark() { try { long start, time; start = JVM.monotonicTimeMillis(); String privateDir = System.getProperty("fileconn.dir.private"); Random random = new Random(); <START> String filename = new javax.bluetooth.UUID(java.lang.Math.abs(random.nextInt())).toString(); <END> FileConnection file = (FileConnection)Connector.open(privateDir + filename); System.out.println("Writing to file " + privateDir + filename); file.create(); SecureRandom rnd = SecureRandom.getInstance(SecureRandom.ALG_SECURE_RANDOM); OutputStream out = file.openOutputStream(); byte[] b = new byte[1024]; for (int i = 0; i < 1000; i++) { rnd.nextBytes(b, 0, 1024); out.write(b); } out.close(); time = JVM.monotonicTimeMillis() - start; System.out.println("FileConnection.write time: " + time); } catch (Exception e) { System.out.println("Unexpected exception: " + e); e.printStackTrace(); } }</code><technical_language>javax.bluetooth.UUID exists if build JSR_082=1, another name? a static name work, a: Java if (file.exists()) { file.delete(); }</technical_language>

Target:
void runBenchmark() { try { long start; String privateDir = System.getProperty("fileconn.dir.private"); String filename = String.valueOf(System.currentTimeMillis()); start = JVM.monotonicTimeMillis(); FileConnection file = (FileConnection)Connector.open(privateDir + filename); System.out.println("Writing to file " + privateDir + filename); file.create(); System.out.println("FileConnection.open/create time: " + (JVM.monotonicTimeMillis() - start)); start = JVM.monotonicTimeMillis(); OutputStream out = file.openOutputStream(); System.out.println("FileConnection.openOutputStream time: " + (JVM.monotonicTimeMillis() - start)); start = JVM.monotonicTimeMillis(); for (int i = 0; i < 1000; i++) { out.write(b); } System.out.println("OutputStream.write time: " + (JVM.monotonicTimeMillis() - start)); out.close(); file.close(); } catch (Exception e) { System.out.println("Unexpected exception: " + e); e.printStackTrace(); } }
Source:
<code>public boolean equals(final Object obj) { if (obj == this) { return true; } if (!(obj instanceof Ds3Element)) { return false; } final Ds3Element element = (Ds3Element) obj; <START> if (this.getName().equals(element.getName()) <END> && this.getType().equals(element.getType()) && this.getComponentType().equals(element.getComponentType())) { return true; } return false; }</code><technical_language>This simplified return result of boolean expression</technical_language>

Target:
public boolean equals(final Object obj) { if (obj == this) { return true; } if (!(obj instanceof Ds3Element)) { return false; } final Ds3Element element = (Ds3Element) obj; return this.getName().equals(element.getName()) && this.getType().equals(element.getType()) && this.getComponentType().equals(element.getComponentType()); }
Source:
<code>public String getUsername(URI uri) throws ClientConfigException { final CallbackHandler callbackHandler = AUTH_CONTEXT_CLIENT.getCallbackHandler(AUTH_CONTEXT_CLIENT.getAuthenticationConfiguration(uri, authenticationContext)); NameCallback nameCallback = new NameCallback("user name"); try { callbackHandler.handle(new Callback[]{nameCallback}); return nameCallback.getName(); } catch (IOException | UnsupportedCallbackException e) { <START> throw new ClientConfigException("Name callback handling was unsuccessful"); <END> } }</code><technical_language>good get this ElytronMessages class</technical_language>

Target:
public String getUsername(URI uri) throws ClientConfigException { final CallbackHandler callbackHandler = AUTH_CONTEXT_CLIENT.getCallbackHandler(AUTH_CONTEXT_CLIENT.getAuthenticationConfiguration(uri, AuthenticationContext.captureCurrent())); NameCallback nameCallback = new NameCallback("user name"); try { callbackHandler.handle(new Callback[]{nameCallback}); return nameCallback.getName(); } catch (IOException | UnsupportedCallbackException e) { throw new ClientConfigException(ElytronMessages.log.nameCallbackHandlingWasUnsuccessful()); } }
Source:
<code>private boolean validateSurl(String surlString) { TSURL surl; if(!SurlValidator.valid(surlString)){ <START> validationResponse = Response.status(400).entity("Invalid surl\n\n").build(); <END> return false; } try { surl = TSURL.makeFromStringValidate(surlString); } catch (InvalidTSURLAttributesException e) { validationResponse = Response.status(400).build(); return false; } try { stori = NamespaceDirector.getNamespace().resolveStoRIbySURL(surl); } catch (UnapprochableSurlException e) { log.warn("Unable to build a stori for surl " + surl + " UnapprochableSurlException: " + e.getMessage()); return false; } return true; }</code><technical_language>for surl</technical_language>

Target:
private boolean validateSurl(String surlString) { TSURL surl; if(!SurlValidator.valid(surlString)){ validationResponse = Response.status(400).entity("Invalid surl: " + surlString + "\n\n").build(); return false; } try { surl = TSURL.makeFromStringValidate(surlString); } catch (InvalidTSURLAttributesException e) { validationResponse = Response.status(400).build(); return false; } try { stori = NamespaceDirector.getNamespace().resolveStoRIbySURL(surl); } catch (UnapprochableSurlException e) { log.warn("Unable to build a stori for surl " + surl + " UnapprochableSurlException: " + e.getMessage()); return false; } return true; }
Source:
<code>protected void startScan() { removeOlderResults(getTimestampOfLastScan(), null); logger.trace("Starting Discovery"); List<String> networkIPs = getScannableIPs(); scannedIPcount = 0; networkIPs.add(0, "127.0.0.1"); final int totalScans = networkIPs.size() * 2; MqttBrokerConnection o[]; try { o = createTestConnections(networkIPs); } catch (ConfigurationException e) { logger.debug("Could not create MqttBrokerConnection object", e); stopScan(); return; } for (MqttBrokerConnection c : o) { scheduler.execute(() -> { Thread.currentThread().setName("Discovery thread " + c.getHost() + ":" + String.valueOf(c.getPort())); try { scanTarget(c); } catch (ConfigurationException | MqttException | InterruptedException e) { <START> logger.trace("Scan of failed", c.getHost() + ":" + String.valueOf(c.getPort())); <END> } stopScanIfAllScanned(totalScans); }); } }</code><technical_language>change fully parameterised logging</technical_language>

Target:
protected void startScan() { removeOlderResults(getTimestampOfLastScan(), null); logger.trace("Starting Discovery"); List<String> networkIPs = getScannableIPs(); scannedIPcount = 0; networkIPs.add(0, "127.0.0.1"); final int totalScans = networkIPs.size() * 2; MqttBrokerConnection o[]; try { o = createTestConnections(networkIPs); } catch (ConfigurationException e) { logger.debug("Could not create MqttBrokerConnection object", e); stopScan(); return; } for (MqttBrokerConnection c : o) { scheduler.execute(() -> { try { scanTarget(c); } catch (ConfigurationException | MqttException | InterruptedException e) { logger.trace("Scan of {}:{} failed", c.getHost(), String.valueOf(c.getPort())); } stopScanIfAllScanned(totalScans); }); } }
Source:
<code>public void setupLibraryBreadCrumbsForImportProjects(final String repositoryUrl) { breadcrumbs.clearBreadcrumbs(LibraryPlaces.LIBRARY_PERSPECTIVE); breadcrumbs.addBreadCrumb(LibraryPlaces.LIBRARY_PERSPECTIVE, translationUtils.getOrganizationalUnitAliasInPlural(), () -> goToOrganizationalUnits()); breadcrumbs.addBreadCrumb(LibraryPlaces.LIBRARY_PERSPECTIVE, projectContext.getActiveOrganizationalUnit() .orElseThrow(() -> new IllegalStateException("Cannot create library breadcrumb without active organizational unit.")) <START> .getName(), <END> () -> goToLibrary()); breadcrumbs.addBreadCrumb(LibraryPlaces.LIBRARY_PERSPECTIVE, ts.getTranslation(LibraryConstants.ImportProjects), () -> goToImportProjects(repositoryUrl)); }</code><technical_language>prefer if message "space" instead of "organizational unit" class names "organizational unit". do this</technical_language>

Target:
public void setupLibraryBreadCrumbsForImportProjects(final String repositoryUrl) { breadcrumbs.clearBreadcrumbs(LibraryPlaces.LIBRARY_PERSPECTIVE); breadcrumbs.addBreadCrumb(LibraryPlaces.LIBRARY_PERSPECTIVE, translationUtils.getOrganizationalUnitAliasInPlural(), () -> goToOrganizationalUnits()); breadcrumbs.addBreadCrumb(LibraryPlaces.LIBRARY_PERSPECTIVE, projectContext.getActiveOrganizationalUnit() .orElseThrow(() -> new IllegalStateException("Cannot create library breadcrumb without active space.")) .getName(), () -> goToLibrary()); breadcrumbs.addBreadCrumb(LibraryPlaces.LIBRARY_PERSPECTIVE, ts.getTranslation(LibraryConstants.ImportProjects), () -> goToImportProjects(repositoryUrl)); }
Source:
<code>public String getAdvertiseNonce() { return CAPABILITY_PUSH_CERT + "=" + <START> nonceGenerator.createNonce(seed, dirPath, TimeUnit.MILLISECONDS .toSeconds(System.currentTimeMillis())); <END> }</code><technical_language>save nonce in sentNonce</technical_language>

Target:
public String getAdvertiseNonce() { sentNonce = nonceGenerator.createNonce(seed, db, TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())); return CAPABILITY_PUSH_CERT + "=" + sentNonce; }
Source:
<code>public Iterable<ProjectState> parents() { <START> return new Iterable<ProjectState>() { <END> @Override public Iterator<ProjectState> iterator() { Iterator<ProjectState> i = tree().iterator(); Preconditions.checkState( i.hasNext() && i.next() == ProjectState.this, "skip starting ProjectState"); return i; } }; }</code><technical_language>nit: Iterables.skip(tree(), 1)</technical_language>

Target:
public Iterable<ProjectState> parents() { return Iterables.skip(tree(), 1); }
Source:
<code><START> public void managementClientWithProxy() throws InterruptedException, ServiceBusException { <END> String proxyHostName = "127.0.0.1"; int proxyPort = 8888; final ProxySelector systemDefaultSelector = ProxySelector.getDefault(); ProxySelector.setDefault(new ProxySelector() { @Override public List<Proxy> select(URI uri) { if (uri != null && uri.getHost() != null ) { List<Proxy> proxies = new LinkedList<>(); proxies.add(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHostName, proxyPort))); return proxies; } return systemDefaultSelector.select(uri); } @Override public void connectFailed(URI uri, SocketAddress sa, IOException ioe){ if (uri == null || sa == null || ioe == null) { throw new IllegalArgumentException("Arguments can't be null."); } systemDefaultSelector.connectFailed(uri, sa, ioe); } }); URI namespaceEndpointURI = TestUtils.getNamespaceEndpointURI(); ClientSettings managementClientSettings = TestUtils.getManagementClientSettings(); ManagementClient managementClient = new ManagementClient(namespaceEndpointURI, managementClientSettings); String queueName = "proxy" + UUID.randomUUID().toString().substring(0, 8); QueueDescription q = new QueueDescription(queueName); QueueDescription qCreated = managementClient.createQueue(q); Assert.assertEquals(q, qCreated); }</code><technical_language>managementClientWithProxy [](start = 16, length = 25) ignore this test. CI/CD machine doens't a proxy server this run there</technical_language>

Target:
public void managementClientWithProxy() throws Exception { String proxyHostName = "127.0.0.1"; int proxyPort = 8888; final ProxySelector systemDefaultSelector = ProxySelector.getDefault(); ProxySelector.setDefault(new ProxySelector() { @Override public List<Proxy> select(URI uri) { if (uri != null && uri.getHost() != null ) { List<Proxy> proxies = new LinkedList<>(); proxies.add(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHostName, proxyPort))); return proxies; } return systemDefaultSelector.select(uri); } @Override public void connectFailed(URI uri, SocketAddress sa, IOException ioe){ if (uri == null || sa == null || ioe == null) { throw new IllegalArgumentException("Arguments can't be null."); } systemDefaultSelector.connectFailed(uri, sa, ioe); } }); URI namespaceEndpointURI = TestUtils.getNamespaceEndpointURI(); ClientSettings managementClientSettings = TestUtils.getManagementClientSettings(); ManagementClient managementClient = new ManagementClient(namespaceEndpointURI, managementClientSettings); String queueName = "test" + UUID.randomUUID().toString().substring(0, 8); QueueDescription q = new QueueDescription(queueName); QueueDescription qCreated = managementClient.createQueue(q); Assert.assertEquals(q, qCreated); String connectionString = TestUtils.getNamespaceConnectionString(); ConnectionStringBuilder connStrBuilder = new ConnectionStringBuilder(connectionString, queueName); connStrBuilder.setTransportType(TransportType.AMQP_WEB_SOCKETS); QueueClient sendClient = new QueueClient(connStrBuilder, ReceiveMode.PEEKLOCK); Message message = new Message("hello"); sendClient.sendAsync(message).thenRunAsync(() -> sendClient.closeAsync()); waitForEnter(10); }
Source:
<code>private static Authorizer getAuthorizer(TimelockAuthConfiguration authConfiguration) { Map<AuthenticatedClient, Privileges> privilegesMap = authConfiguration.privileges().stream() .collect(Collectors.toMap(p -> AuthenticatedClient.create(p.id()), PrivilegesConfiguration::privileges)); <START> return SimpleAuthorizer.of(privilegesMap, AuthRequirement.PRIVILEGE_BASED); <END> }</code><technical_language>extract out AuthRequirement.PRIVLEGE_BASED a constant explaining this is timelock 0.x, 1.x etc</technical_language>

Target:
private static Authorizer getAuthorizer(TimelockAuthConfiguration authConfiguration) { Map<ClientId, Privileges> privilegesMap = authConfiguration.privileges().stream() .collect(Collectors.toMap(PrivilegesConfiguration::clientId, PrivilegesConfiguration::privileges)); return SimpleAuthorizer.of(privilegesMap, AUTH_REQUIREMENT); }
Source:
<code>private void propagatePartitionErrorToPrestoException(String databaseName, String tableName, List<PartitionError> partitionErrors) { if (partitionErrors != null && !partitionErrors.isEmpty()) { ErrorDetail errorDetail = partitionErrors.get(0).getErrorDetail(); String glueExceptionCode = errorDetail.getErrorCode(); switch (glueExceptionCode) { case "AlreadyExistsException": <START> throw new PrestoException(StandardErrorCode.ALREADY_EXISTS, errorDetail.getErrorMessage()); <END> case "EntityNotFoundException": throw new TableNotFoundException(new SchemaTableName(databaseName, tableName), errorDetail.getErrorMessage()); default: throw new PrestoException(HIVE_METASTORE_ERROR, errorDetail.getErrorCode() + ": " + errorDetail.getErrorMessage()); } } }</code><technical_language>Static import ALREADY_EXISTS</technical_language>

Target:
private void propagatePartitionErrorToPrestoException(String databaseName, String tableName, List<PartitionError> partitionErrors) { if (partitionErrors != null && !partitionErrors.isEmpty()) { ErrorDetail errorDetail = partitionErrors.get(0).getErrorDetail(); String glueExceptionCode = errorDetail.getErrorCode(); switch (glueExceptionCode) { case "AlreadyExistsException": throw new PrestoException(ALREADY_EXISTS, errorDetail.getErrorMessage()); case "EntityNotFoundException": throw new TableNotFoundException(new SchemaTableName(databaseName, tableName), errorDetail.getErrorMessage()); default: throw new PrestoException(HIVE_METASTORE_ERROR, errorDetail.getErrorCode() + ": " + errorDetail.getErrorMessage()); } } }
Source:
<code>public String getBranchPath(ServiceProvider context) { if (branchPath == null) { <START> CodeSystemVersionSearchRequestBuilder versionSearch = CodeSystemRequests.prepareSearchCodeSystemVersion() .one() .filterByCodeSystemShortName(codeSystem.getShortName()); <END> if (uri.isHead()) { branchPath = codeSystem.getBranchPath(); } else { if (uri.isLatest()) { versionSearch.sortBy(SearchResourceRequest.SortField.descending(CodeSystemVersionEntry.Fields.EFFECTIVE_DATE)); } else { versionSearch.filterByVersionId(uri.getPath()); } branchPath = versionSearch .build(codeSystem.getRepositoryUuid()) .getRequest() .execute(context) .stream() .findFirst() .map(CodeSystemVersionEntry::getPath) .orElse(codeSystem.getRelativeBranchPath(uri.getPath())); } } return branchPath; }</code><technical_language>code system version search request is in else block below; move local variable declaration block</technical_language>

Target:
public String getBranchPath(ServiceProvider context) { if (branchPath == null) { if (uri.isHead()) { branchPath = codeSystem.getBranchPath(); } else { CodeSystemVersionSearchRequestBuilder versionSearch = CodeSystemRequests.prepareSearchCodeSystemVersion() .one() .filterByCodeSystemShortName(codeSystem.getShortName()); if (uri.isLatest()) { versionSearch.sortBy(SearchResourceRequest.SortField.descending(CodeSystemVersionEntry.Fields.EFFECTIVE_DATE)); } else { versionSearch.filterByVersionId(uri.getPath()); } branchPath = versionSearch .build(codeSystem.getRepositoryUuid()) .getRequest() .execute(context) .stream() .findFirst() .map(CodeSystemVersionEntry::getPath) .orElse(codeSystem.getRelativeBranchPath(uri.getPath())); } } return branchPath; }
Source:
<code>public void savePlannedVisitDates(String subjectId, LocalDate primeVaccinationDate) { Subject subject = subjectDataService.findSubjectBySubjectId(subjectId); <START> validateDate(subjectId, primeVaccinationDate); <END> if (subject == null) { throw new VisitScheduleException(String.format("Cannot save Planned Dates, because Participant with Id: %s not found", subjectId)); } if (subject.getVisits() == null || subject.getVisits().isEmpty()) { throw new VisitScheduleException(String.format("Cannot save Planned Dates, because Participant with Id: %s has no Visits", subjectId)); } if (subject.getPrimerVaccinationDate() != null) { throw new VisitScheduleException(String.format("Cannot save Planned Dates, because Participant with Id: %s has been vaccinated", subjectId)); } visitBookingDetailsService.createOrUpdate(calculatePlannedDates(subject.getVisits(), primeVaccinationDate).values()); }</code><technical_language>move this calculatePlannedDates</technical_language>

Target:
public void savePlannedVisitDates(String subjectId, LocalDate primeVaccinationDate) { Subject subject = subjectDataService.findSubjectBySubjectId(subjectId); if (subject == null) { throw new VisitScheduleException(String.format("Cannot save Planned Dates, because Participant with Id: %s not found", subjectId)); } if (subject.getVisits() == null || subject.getVisits().isEmpty()) { throw new VisitScheduleException(String.format("Cannot save Planned Dates, because Participant with Id: %s has no Visits", subjectId)); } if (subject.getPrimerVaccinationDate() != null) { throw new VisitScheduleException(String.format("Cannot save Planned Dates, because Participant with Id: %s has been vaccinated", subjectId)); } visitBookingDetailsService.createOrUpdate(calculatePlannedDates(subject.getVisits(), primeVaccinationDate).values()); }
Source:
<code>private SQLException receiveErrorResponse() throws IOException { int elen = pgStream.receiveInteger4(); EncodingPredictor.DecodeResult totalMessage = pgStream.receiveErrorString(elen - 4); ServerErrorMessage errorMsg = new ServerErrorMessage(totalMessage); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, " <=BE ErrorMessage({0})", errorMsg.toString()); } PSQLException error; <START> if (errorMsg.getMessage() != null && errorMsg.getMessage().endsWith(COPY_ERROR_MESSAGE)) { <END> error = new CopyNotSupportedException(errorMsg); } else { error = new PSQLException(errorMsg); } if (transactionFailCause == null) { transactionFailCause = error; } else { error.initCause(transactionFailCause); } return error; }</code><technical_language>Assuming is a translated string, this work? This check for string for PSQLException throw, good a perspective CopyNotSupportedException throw in a 1% of cases</technical_language>

Target:
private SQLException receiveErrorResponse() throws IOException { int elen = pgStream.receiveInteger4(); assert elen > 4 : "Error response length must be greater than 4"; EncodingPredictor.DecodeResult totalMessage = pgStream.receiveErrorString(elen - 4); ServerErrorMessage errorMsg = new ServerErrorMessage(totalMessage); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, " <=BE ErrorMessage({0})", errorMsg.toString()); } PSQLException error = new PSQLException(errorMsg); if (transactionFailCause == null) { transactionFailCause = error; } else { error.initCause(transactionFailCause); } return error; }
Source:
<code>public String getLoginFromSessionId(@PathParam("sessionId") String sessionId) throws SchedulerRestException, LoginException, NotConnectedRestException { if (sessionId != null && sessionStore.exists(sessionId)) { return sessionStore.get(sessionId).getUserName(); } <START> return ""; <END> }</code><technical_language>Is throw exception in case</technical_language>

Target:
public String getLoginFromSessionId(@PathParam("sessionId") String sessionId) throws SchedulerRestException, LoginException, NotConnectedRestException { if (sessionId != null && sessionStore.exists(sessionId)) { return sessionStore.get(sessionId).getUserName(); } throw new NotFoundException("login cannot be found with the session id " + sessionId); }
Source:
<code>public AbstractRecordAndOffset(final SAMRecord record, final int offset, int length, int refPos) { <START> validateIndex(offset, record.getBaseQualities()); <END> if (length > record.getReadLength()) { throw new IllegalArgumentException("Block length cannot be larger than whole read length"); } this.offset = offset; this.record = record; this.length = length; this.refPos = refPos; }</code><technical_language>confusing name, this validateOffset</technical_language>

Target:
public AbstractRecordAndOffset(final SAMRecord record, final int offset, int length, int refPos) { this(record, offset); }
Source:
<code>public static boolean isNetworkInSync(VdsNetworkInterface iface, Network network, NetworkQoS qos) { return (network.getMtu() == 0 || iface.getMtu() == network.getMtu()) && Objects.equals(iface.getVlanId(), network.getVlanId()) && iface.isBridged() == network.isVmNetwork() <START> && (Objects.equals(iface.getQos(), qos) || iface.isQosOverridden()); <END> }</code><technical_language>I stated, syncness affected fact user decided override QoS. is this get out of sync if decided put QoS definition</technical_language>

Target:
public static boolean isNetworkInSync(VdsNetworkInterface iface, Network network, NetworkQoS qos) { return (network.getMtu() == 0 || iface.getMtu() == network.getMtu()) && Objects.equals(iface.getVlanId(), network.getVlanId()) && iface.isBridged() == network.isVmNetwork() && (isQosInSync(iface, qos) || iface.isQosOverridden()); }
Source:
<code>private void doTaskEnd() { if((this.listenerFailed || this.started) && !this.finished) { this.taskExecution.setEndTime(new Date()); if(this.exitCodeEvent != null) { this.taskExecution.setExitCode(this.exitCodeEvent.getExitCode()); } else if(this.listenerFailed || this.applicationFailedEvent != null){ this.taskExecution.setExitCode(1); } else{ this.taskExecution.setExitCode(0); } if(this.applicationFailedEvent != null) { this.taskExecution.setErrorMessage(stackTraceToString(this.applicationFailedEvent.getException())); } if(this.listenerException != null) { String errorMessage = this.stackTraceToString(this.listenerException); if (StringUtils.hasText(this.taskExecution.getErrorMessage())) { errorMessage = String.format("%s :Task Also threw this Exception: %s", errorMessage, this.taskExecution.getErrorMessage()); } this.taskExecution.setErrorMessage(errorMessage); } if(this.listenerFailed && this.taskExecution.getExitCode() != 0) { setMessages(invokeOnTaskError(this.taskExecution, this.listenerException)); } else if (this.applicationFailedEvent != null && this.taskExecution.getExitCode() != 0) { setMessages(invokeOnTaskError(this.taskExecution, this.applicationFailedEvent.getException())); } setMessages(invokeOnTaskEnd(this.taskExecution)); if(this.listenerFailed) { <START> this.taskExecution.setExitCode(1); <END> } this.taskRepository.completeTaskExecution(this.taskExecution.getExecutionId(), this.taskExecution.getExitCode(), this.taskExecution.getEndTime(), this.taskExecution.getExitMessage(), this.taskExecution.getErrorMessage()); this.finished = true; if(this.taskProperties.getClosecontextEnabled() && this.context.isActive()) { this.context.close(); } } else if(!this.started){ logger.error("An event to end a task has been received for a task that has " + "not yet started."); } }</code><technical_language>this hardcoded 1, a specific other (to specific error condition exception thrown a SCT listener), this result of configured ExitCodeGenerator? in lifecycle ExitCodeGenerator get called based this logic</technical_language>

Target:
private void doTaskEnd() { if((this.listenerFailed || this.started) && !this.finished) { this.taskExecution.setEndTime(new Date()); if(this.applicationFailedEvent != null) { this.taskExecution.setErrorMessage(stackTraceToString(this.applicationFailedEvent.getException())); } this.taskExecution.setExitCode(calcExitStatus()); if (this.applicationFailedEvent != null) { setExitMessage(invokeOnTaskError(this.taskExecution, this.applicationFailedEvent.getException())); } setExitMessage(invokeOnTaskEnd(this.taskExecution)); this.taskRepository.completeTaskExecution(this.taskExecution.getExecutionId(), this.taskExecution.getExitCode(), this.taskExecution.getEndTime(), this.taskExecution.getExitMessage(), this.taskExecution.getErrorMessage()); this.finished = true; if(this.taskProperties.getClosecontextEnabled() && this.context.isActive()) { this.context.close(); } } else if(!this.started){ logger.error("An event to end a task has been received for a task that has " + "not yet started."); } }
Source:
<code>public void shouldRemoveExistingElements() { final Seq<Integer> seq = of(1, 2, 3); <START> assertThat(seq.reject(i -> i == 1)).isEqualTo(of(2, 3)); <END> assertThat(seq.reject(i -> i == 2)).isEqualTo(of(1, 3)); assertThat(seq.reject(i -> i == 3)).isEqualTo(of(1, 2)); assertThat(seq.reject(ignore -> true)).isEmpty(); assertThat(seq.reject(ignore -> false)).isSameAs(seq); }</code><technical_language>This test removeAll method. is deprecated, tested</technical_language>

Target:
public void shouldRemoveExistingElements() { final Seq<Integer> seq = of(1, 2, 3); assertThat(seq.removeAll(i -> i == 1)).isEqualTo(of(2, 3)); assertThat(seq.removeAll(i -> i == 2)).isEqualTo(of(1, 3)); assertThat(seq.removeAll(i -> i == 3)).isEqualTo(of(1, 2)); assertThat(seq.removeAll(ignore -> true)).isEmpty(); assertThat(seq.removeAll(ignore -> false)).isSameAs(seq); }
Source:
<code>private void minimumSleep(long millis) { long nanos = TimeUnit.MILLISECONDS.toNanos(millis); long start = System.nanoTime(); while (true) { long nanosLeft = nanos - (System.nanoTime() - start); if (nanosLeft <= 0) { break; } try { <START> Thread.sleep(TimeUnit.NANOSECONDS.toMillis(nanosLeft)); <END> } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } } }</code><technical_language>do TimeUnit.NANOSECONDS.sleep(nanosLeft)</technical_language>

Target:
private void minimumSleep(long millis) { long nanos = TimeUnit.MILLISECONDS.toNanos(millis); long start = System.nanoTime(); while (true) { long nanosLeft = nanos - (System.nanoTime() - start); if (nanosLeft <= 0) { break; } try { TimeUnit.NANOSECONDS.sleep(nanosLeft); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } } }
Source:
<code>public void test_capabilities_exposed() throws Exception { Capability[] capabilities = consumer.getValueForNode(consumerId, new String[]{"management", "clients", clientIdentifier, "registry", "capabilities"}, Capability[].class); assertThat(capabilities.length, equalTo(5)); assertThat(capabilities[0].getName(), equalTo("ActionsCapability")); assertThat(capabilities[1].getName(), equalTo("StatisticsCapability")); assertThat(capabilities[2].getName(), equalTo("StatisticCollectorCapability")); assertThat(capabilities[3].getName(), equalTo("SettingsCapability")); assertThat(capabilities[4].getName(), equalTo("ManagementAgentService")); assertThat(capabilities[0].getDescriptors(), hasSize(4)); Collection<Descriptor> descriptors = capabilities[1].getDescriptors(); Collection<Descriptor> allDescriptors = new ArrayList<Descriptor>(); allDescriptors.addAll(StatsUtil.CACHE_DESCRIPTORS); allDescriptors.addAll(StatsUtil.ONHEAP_DESCRIPTORS); allDescriptors.addAll(StatsUtil.OFFHEAP_DESCRIPTORS); allDescriptors.addAll(StatsUtil.CLUSTERED_DESCRIPTORS); assertThat(descriptors, hasSize(allDescriptors.size())); assertThat(descriptors, containsInAnyOrder(allDescriptors.toArray())); <START> assertThat(capabilities[1].getDescriptors(), hasSize(allDescriptors.size())); <END> }</code><technical_language>this line 149</technical_language>

Target:
public void test_capabilities_exposed() throws Exception { Capability[] capabilities = consumer.getValueForNode(consumerId, new String[]{"management", "clients", clientIdentifier, "registry", "capabilities"}, Capability[].class); assertThat(capabilities.length, equalTo(5)); assertThat(capabilities[0].getName(), equalTo("ActionsCapability")); assertThat(capabilities[1].getName(), equalTo("StatisticsCapability")); assertThat(capabilities[2].getName(), equalTo("StatisticCollectorCapability")); assertThat(capabilities[3].getName(), equalTo("SettingsCapability")); assertThat(capabilities[4].getName(), equalTo("ManagementAgentService")); assertThat(capabilities[0].getDescriptors(), hasSize(4)); Collection<Descriptor> descriptors = capabilities[1].getDescriptors(); Collection<Descriptor> allDescriptors = new ArrayList<Descriptor>(); allDescriptors.addAll(CACHE_DESCRIPTORS); allDescriptors.addAll(ONHEAP_DESCRIPTORS); allDescriptors.addAll(OFFHEAP_DESCRIPTORS); allDescriptors.addAll(CLUSTERED_DESCRIPTORS); assertThat(descriptors, containsInAnyOrder(allDescriptors.toArray())); assertThat(descriptors, hasSize(allDescriptors.size())); }
Source:
<code>private List<Entity> getEntities(String extensionName, String jobName, InputStream configStream, String extensionType, String extensionBuildLocation) { List<Entity> entities = null; if (!extensionType.equals(ExtensionType.CUSTOM.name())) { try { entities = ExtensionHandler.loadAndPrepare(extensionName, jobName, configStream, extensionBuildLocation); } catch (Exception e) { <START> LOG.error("Error in building the extension. Cause: ", e); <END> throw new FalconCLIException("Error in building the extension:" + e.getMessage(), e); } if (entities == null || entities.isEmpty()) { throw new FalconCLIException("No entities got built for the given extension"); } } return entities; }</code><technical_language>log this in OUT stream error extension builder error stack easily user</technical_language>

Target:
private List<Entity> getEntities(String extensionName, String jobName, InputStream configStream, String extensionType, String extensionBuildLocation) { List<Entity> entities = null; if (!extensionType.equals(ExtensionType.CUSTOM.name())) { try { entities = ExtensionHandler.loadAndPrepare(extensionName, jobName, configStream, extensionBuildLocation); } catch (Exception e) { LOG.error("Error in building the extension. Cause: ", e); OUT.get().println("Error in building the extension:" + ExceptionUtils.getFullStackTrace(e)); throw new FalconCLIException("Error in building the extension:" + e.getMessage(), e); } if (entities == null || entities.isEmpty()) { throw new FalconCLIException("No entities got built for the given extension"); } } return entities; }