auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testPostCommentPerIssue() throws Exception { <START> when(config.getIssueSeverityThreshold()).thenReturn(Severity.INFO); <END> when(stashCommentsReport1.contains(stashCommentMessage1, FILE_PATH_1, 1)).thenReturn(true); when(stashCommentsReport1.contains(stashCommentMessage2, FILE_PATH_1, 2)).thenReturn(false); when(stashCommentsReport2.contains(stashCommentMessage3, FILE_PATH_2, 1)).thenReturn(false); myFacade.postCommentPerIssue(pr, report, diffReport, stashClient); verify(stashClient, times(0)).postCommentLineOnPullRequest(pr, stashCommentMessage1, FILE_PATH_1, 1, STASH_DIFF_TYPE); verify(stashClient, times(1)).postCommentLineOnPullRequest(pr, stashCommentMessage2, "path/to/file1", 2, STASH_DIFF_TYPE); verify(stashClient, times(1)).postCommentLineOnPullRequest(pr, stashCommentMessage3, "path/to/file2", 1, STASH_DIFF_TYPE); }</code><technical_language>move calls setUp() method</technical_language>

Target:
public void testPostCommentPerIssue() throws Exception { when(stashCommentsReport1.contains(stashCommentMessage1, FILE_PATH_1, 1)).thenReturn(true); when(stashCommentsReport1.contains(stashCommentMessage2, FILE_PATH_1, 2)).thenReturn(false); when(stashCommentsReport2.contains(stashCommentMessage3, FILE_PATH_2, 1)).thenReturn(false); myFacade.postCommentPerIssue(pr, report, diffReport, stashClient); verify(stashClient, times(0)).postCommentLineOnPullRequest(pr, stashCommentMessage1, FILE_PATH_1, 1, STASH_DIFF_TYPE); verify(stashClient, times(1)).postCommentLineOnPullRequest(pr, stashCommentMessage2, "path/to/file1", 2, STASH_DIFF_TYPE); verify(stashClient, times(1)).postCommentLineOnPullRequest(pr, stashCommentMessage3, "path/to/file2", 1, STASH_DIFF_TYPE); }
Source:
<code>public WebAppForbiddenException() { super(Response .status(Response.Status.FORBIDDEN) <START> .entity(new HashMap<String,String>() {{ <END> put("status", "failed"); put("message", "Not Authorized");}}) .build()); }</code><technical_language>This is considered a bad practice creates a new anonymous class WebAppForbiddenException$1 needed. More a new instance is created time content of instance is same. A constant Map<String, String> ENTITY = new HashMap<String, String>() more appropriate, a static initialiser set content</technical_language>

Target:
public WebAppForbiddenException() { super(Response .status(Response.Status.FORBIDDEN) .type(MediaType.APPLICATION_JSON) .entity(myMap) .build()); }
Source:
<code>public Mono<Void> deleteModel(String modelId) { return deleteModelWithResponse(modelId) <START> .map(response -> response.getValue()); <END> }</code><technical_language>)</technical_language>

Target:
public Mono<Void> deleteModel(String modelId) { return deleteModelWithResponse(modelId) .map(Response::getValue); }
Source:
<code>public HttpResponse<InstanceInfo> sendHeartBeat(String appName, String id, InstanceInfo info, InstanceStatus overriddenStatus) { ClientResponse response = null; try { String urlPath = "apps/" + appName + "/" + id; WebResource webResource = getJerseyApacheClient().resource(serviceUrl) .path(urlPath) .queryParam("status", info.getStatus().toString()) .queryParam("lastDirtyTimestamp", info.getLastDirtyTimestamp().toString()); if (overriddenStatus != null) { webResource = webResource.queryParam("overriddenstatus", overriddenStatus.name()); } addExtraHeaders(webResource); response = webResource.accept(MediaType.APPLICATION_JSON_TYPE).put(ClientResponse.class); <START> InstanceInfo infoFromPeer = null; <END> if (response.getStatus() == Status.OK.getStatusCode() && response.hasEntity()) { infoFromPeer = response.getEntity(InstanceInfo.class); } return HttpResponse.responseWith(response.getStatus(), infoFromPeer); } finally { if (response != null) { response.close(); } } }</code><technical_language>move peer specific code a server implementation of this class? If break out, nice refactor DiscoveryClient this class</technical_language>

Target:
public HttpResponse<InstanceInfo> sendHeartBeat(String appName, String id, InstanceInfo info, InstanceStatus overriddenStatus) { String urlPath = "apps/" + appName + '/' + id; ClientResponse response = null; try { WebResource webResource = getJerseyApacheClient().resource(serviceUrl) .path(urlPath) .queryParam("status", info.getStatus().toString()) .queryParam("lastDirtyTimestamp", info.getLastDirtyTimestamp().toString()); if (overriddenStatus != null) { webResource = webResource.queryParam("overriddenstatus", overriddenStatus.name()); } Builder requestBuilder = webResource.getRequestBuilder(); addExtraHeaders(requestBuilder); return HttpResponse.responseWith(response.getStatus()); } finally { if (logger.isDebugEnabled()) { logger.debug("[heartbeat] Jersey HTTP PUT {}; statusCode={}", urlPath, response == null ? "N/A" : response.getStatus()); } if (response != null) { response.close(); } } }
Source:
<code>private void addBasicParameters(TestExecutionBuilder testExecutionBuilder, Report report) { testExecutionBuilder.parameter("exec.config", report.getConfiguration().name); testExecutionBuilder.parameter("exec.jenkins_build_url", jenkinsBuildUrl); testExecutionBuilder.parameter("exec.jenkins_build_number", jenkinsBuild); if (buildParams != null) { for (Map.Entry<String, String> buildParam : buildParams.entrySet()) { testExecutionBuilder.parameter(buildParam.getKey(), buildParam.getValue()); } } if (buildParamsFile != null) { Properties paramsFromFile = new Properties(); try { <START> paramsFromFile.load(new FileInputStream(buildParamsFile)); <END> } catch (IOException e) { log.warn("Error while loading build parameters from file", e); } for (Map.Entry<Object, Object> entry : paramsFromFile.entrySet()) { testExecutionBuilder.parameter((String) entry.getKey(), (String) entry.getValue()); } } }</code><technical_language>Please try-with-resources, Properties.load close stream</technical_language>

Target:
private void addBasicParameters(TestExecutionBuilder testExecutionBuilder, Report report) { testExecutionBuilder.parameter("exec.config", report.getConfiguration().name); testExecutionBuilder.parameter("exec.jenkins_build_url", jenkinsBuildUrl); testExecutionBuilder.parameter("exec.jenkins_build_number", jenkinsBuild); if (buildParams != null) { for (Map.Entry<String, String> buildParam : buildParams.entrySet()) { testExecutionBuilder.parameter(buildParam.getKey(), buildParam.getValue()); } } if (buildParamsFile != null) { Properties paramsFromFile = new Properties(); try (FileInputStream fileInputStream = new FileInputStream(buildParamsFile)) { paramsFromFile.load(fileInputStream); } catch (IOException e) { log.warn("Error while loading build parameters from file", e); } for (Map.Entry<Object, Object> entry : paramsFromFile.entrySet()) { testExecutionBuilder.parameter((String) entry.getKey(), (String) entry.getValue()); } } }
Source:
<code>protected void processHandRelease(float xvel, float yvel, boolean isCloseBeforeDragged) { float minVelocity = mDragHelper.getMinVelocity(); View surfaceView = getSurfaceView(); DragEdge currentDragEdge = null; try { <START> currentDragEdge = mCurrentDragEdge; <END> } catch (Exception e) { e.printStackTrace(); } if(currentDragEdge == null || surfaceView == null){ return; } float willOpenPercent = (isCloseBeforeDragged ? .25f : .75f); if(currentDragEdge == DragEdge.Left){ if(xvel > minVelocity) open(); else if(xvel < -minVelocity) close(); else{ float openPercent = 1f * getSurfaceView().getLeft() / mDragDistance; if(openPercent > willOpenPercent ) open(); else close(); } }else if(currentDragEdge == DragEdge.Right){ if(xvel > minVelocity) close(); else if(xvel < -minVelocity) open(); else{ float openPercent = 1f * (-getSurfaceView().getLeft()) / mDragDistance; if(openPercent > willOpenPercent ) open(); else close(); } }else if(currentDragEdge == DragEdge.Top){ if(yvel > minVelocity) open(); else if(yvel < -minVelocity) close(); else{ float openPercent = 1f * getSurfaceView().getTop() / mDragDistance; if(openPercent > willOpenPercent ) open(); else close(); } }else if(currentDragEdge == DragEdge.Bottom){ if(yvel > minVelocity) close(); else if(yvel < -minVelocity) open(); else{ float openPercent = 1f * (-getSurfaceView().getTop()) / mDragDistance; if(openPercent > willOpenPercent ) open(); else close(); } } }</code><technical_language>useless try catch</technical_language>

Target:
protected void processHandRelease(float xvel, float yvel, boolean isCloseBeforeDragged) { float minVelocity = mDragHelper.getMinVelocity(); View surfaceView = getSurfaceView(); DragEdge currentDragEdge = mCurrentDragEdge; if(currentDragEdge == null || surfaceView == null){ return; } float willOpenPercent = (isCloseBeforeDragged ? .25f : .75f); if(currentDragEdge == DragEdge.Left){ if(xvel > minVelocity) open(); else if(xvel < -minVelocity) close(); else{ float openPercent = 1f * getSurfaceView().getLeft() / mDragDistance; if(openPercent > willOpenPercent ) open(); else close(); } }else if(currentDragEdge == DragEdge.Right){ if(xvel > minVelocity) close(); else if(xvel < -minVelocity) open(); else{ float openPercent = 1f * (-getSurfaceView().getLeft()) / mDragDistance; if(openPercent > willOpenPercent ) open(); else close(); } }else if(currentDragEdge == DragEdge.Top){ if(yvel > minVelocity) open(); else if(yvel < -minVelocity) close(); else{ float openPercent = 1f * getSurfaceView().getTop() / mDragDistance; if(openPercent > willOpenPercent ) open(); else close(); } }else if(currentDragEdge == DragEdge.Bottom){ if(yvel > minVelocity) close(); else if(yvel < -minVelocity) open(); else{ float openPercent = 1f * (-getSurfaceView().getTop()) / mDragDistance; if(openPercent > willOpenPercent ) open(); else close(); } } }
Source:
<code>public void initialise() { renderingConfig = config.getRendering(); blur = worldRenderer.getMaterial("engine:prog.blur"); requireDynamicFBO(new FBOConfig(BLUR_0_URN, 0.5f, FBO.Type.DEFAULT)); requireDynamicFBO(new FBOConfig(BLUR_1_URN, 0.5f, FBO.Type.DEFAULT)); <START> requireDynamicFBO(new FBOConfig(TONE_MAPPED_URN, 1.0f, FBO.Type.HDR)); <END> }</code><technical_language>convinced _URN suffix. urn is basically a string. IDE type if necessary. remove all</technical_language>

Target:
public void initialise() { renderingConfig = config.getRendering(); blur = worldRenderer.getMaterial("engine:prog.blur"); requiresFBO(new FBOConfig(BLUR_0, HALF_SCALE, FBO.Type.DEFAULT), displayResolutionDependentFBOs); requiresFBO(new FBOConfig(BLUR_1, HALF_SCALE, FBO.Type.DEFAULT), displayResolutionDependentFBOs); requiresFBO(new FBOConfig(TONE_MAPPED, FULL_SCALE, FBO.Type.HDR), displayResolutionDependentFBOs); }
Source:
<code>public void verifyThreadClosed(String userName, String reason, String message) { refreshPage(); <START> Assertion.assertStringContains(driver.findElement(firstMessageWrapperBy).findElement(closeThreadInfobox).getText(), userName + " closed this thread because:\n" + reason); <END> }</code><technical_language>long line</technical_language>

Target:
public void verifyThreadClosed(String userName, String reason, String message) { refreshPage(); Assertion.assertStringContains( driver.findElement(firstMessageWrapperBy).findElement(closeThreadInfobox).getText(), userName + " closed this thread because:\n" + reason ); PageObjectLogging.log("verifyThreadClosed", "verifyed thread closed", true); }
Source:
<code><START> public ParseServices(Json json) { <END> super(json, TypeLiteral.get(Services.class)); }</code><technical_language>In general, injection constructors package private</technical_language>

Target:
ParseServices(Json json) { super(json, TypeLiteral.get(Services.class)); }
Source:
<code>public void setMessage(HttpMessage msg) { String query = null; try { query = msg.getRequestHeader().getURI().getQuery(); } catch (URIException e) { log.error(e.getMessage(), e); } if (query == null || query.isEmpty()) { if (msg.getRequestBody().length() == 0) { return; } } List<HttpHeaderField> httpHeaders = msg.getRequestHeader().getHeaders(); <START> if (httpHeaders == null) return; <END> int headerPos=0; for (HttpHeaderField header : httpHeaders) { boolean ignoreHeader = false; for (int idx = 0; idx < nonInjectableHeaders.length; idx++) { if ( header.getName().equalsIgnoreCase(nonInjectableHeaders[idx])) { ignoreHeader=true; break; } } if (!ignoreHeader) { params.add(new NameValuePair(NameValuePair.TYPE_HEADER, header.getName(), header.getValue(), headerPos++)); } } }</code><technical_language>returned list is null</technical_language>

Target:
public void setMessage(HttpMessage msg) { String query = null; try { query = msg.getRequestHeader().getURI().getQuery(); } catch (URIException e) { log.error(e.getMessage(), e); } if (query == null || query.isEmpty()) { if (msg.getRequestBody().length() == 0) { return; } } List<HttpHeaderField> httpHeaders = msg.getRequestHeader().getHeaders(); int headerPos=0; for (HttpHeaderField header : httpHeaders) { if (! NON_INJECTABLE_HEADERS.contains(header.getName().toLowerCase(Locale.ROOT))) { params.add(new NameValuePair(NameValuePair.TYPE_HEADER, header.getName(), header.getValue(), headerPos++)); } } }
Source:
<code>public void testAllocationFromCameraFlexibleYuv() throws Exception { <START> if (SystemProperties.getBoolean("ro.config.low_ram", false)) { return; } <END> final int NUM_FRAME_VERIFIED = 1; mCameraIterable.forEachCamera(new CameraBlock() { @Override public void run(CameraDevice camera) throws CameraAccessException { mSizeIterable.forEachSize(YUV_420_888, new SizeBlock() { @Override public void run(final Size size) throws CameraAccessException { try (ScriptGraph scriptGraph = ScriptGraph.create() .configureInputWithSurface(size, YUV_420_888) .chainScript(ScriptYuvToRgb.class) .buildGraph()) { if (VERBOSE) Log.v(TAG, "Prepared ScriptYuvToRgb for size " + size); CaptureRequest request = configureAndCreateRequestForSurface(scriptGraph.getInputSurface()).build(); mResultIterable.forEachResultRepeating( request, NUM_FRAME_VERIFIED, new ResultBlock() { @Override public void run(CaptureResult result) throws CameraAccessException { scriptGraph.advanceInputWaiting(); scriptGraph.execute(); validateInputOutputNotZeroes(scriptGraph, size); scriptGraph.advanceInputAndDrop(); } }); stopCapture(); if (VERBOSE) Log.v(TAG, "Cleanup Renderscript cache"); scriptGraph.close(); RenderScriptSingleton.clearContext(); RenderScriptSingleton.setContext(getContext()); } } }); } }); }</code><technical_language>Instead of skipping test altogether, extend result timeout at: <LINK_0>;l=898?q=AllocationTest.java in case of ram device</technical_language>

Target:
public void testAllocationFromCameraFlexibleYuv() throws Exception { final int NUM_FRAME_VERIFIED = 1; mCameraIterable.forEachCamera(new CameraBlock() { @Override public void run(CameraDevice camera) throws CameraAccessException { mSizeIterable.forEachSize(YUV_420_888, new SizeBlock() { @Override public void run(final Size size) throws CameraAccessException { try (ScriptGraph scriptGraph = ScriptGraph.create() .configureInputWithSurface(size, YUV_420_888) .chainScript(ScriptYuvToRgb.class) .buildGraph()) { if (VERBOSE) Log.v(TAG, "Prepared ScriptYuvToRgb for size " + size); CaptureRequest request = configureAndCreateRequestForSurface(scriptGraph.getInputSurface()).build(); mResultIterable.forEachResultRepeating( request, NUM_FRAME_VERIFIED, new ResultBlock() { @Override public void run(CaptureResult result) throws CameraAccessException { scriptGraph.advanceInputWaiting(); scriptGraph.execute(); validateInputOutputNotZeroes(scriptGraph, size); scriptGraph.advanceInputAndDrop(); } }); stopCapture(); if (VERBOSE) Log.v(TAG, "Cleanup Renderscript cache"); scriptGraph.close(); RenderScriptSingleton.clearContext(); RenderScriptSingleton.setContext(getContext()); } } }); } }); }
Source:
<code>public static void assertParentRepairFailedWithMessageContains(AbstractCluster<?> cluster, int coordinator, String ks, String table, String message) { ResultSet rs = queryParentRepairHistory(cluster, coordinator, ks, table); validateExistingParentRepair(rs, row -> { <START> Assert.assertNotNull("finished_at not found, alears the repair is not complete?", rs.getTimestamp("finished_at")); <END> Assert.assertNotNull("Exception not found", rs.getString("exception_stacktrace")); String exceptionMessage = rs.getString("exception_message"); Assert.assertNotNull("Exception not found", exceptionMessage); Assert.assertTrue("Unable to locate message '" + message + "' in repair error message: " + exceptionMessage, exceptionMessage.contains(message)); }); }</code><technical_language>Typo in "alears" (in places in this file)</technical_language>

Target:
public static void assertParentRepairFailedWithMessageContains(AbstractCluster<?> cluster, int coordinator, String ks, String table, String message) { QueryResult rs = queryParentRepairHistory(cluster, coordinator, ks, table); validateExistingParentRepair(rs, row -> { Assert.assertNotNull("finished_at not found, the repair is not complete?", row.getTimestamp("finished_at")); Assert.assertNotNull("Exception not found", row.getString("exception_stacktrace")); String exceptionMessage = row.getString("exception_message"); Assert.assertNotNull("Exception not found", exceptionMessage); Assert.assertTrue("Unable to locate message '" + message + "' in repair error message: " + exceptionMessage, exceptionMessage.contains(message)); }); }
Source:
<code>public Collection<ArtifactToken> getRelated(ArtifactId artifact, RelationTypeSide relationType) { List<ArtifactToken> results = new ArrayList<>(); if (artifact instanceof ArtifactReadable) { for (ArtifactReadable art : getArtifact(artifact).getRelated(relationType)) { results.add(art); } } else if (artifact instanceof IAtsObject) { IAtsObject iAtsObject = (IAtsObject) artifact; for (ArtifactReadable art : getArtifact(iAtsObject.getStoreObject()).getRelated(relationType)) { results.add(art); <START> } <END> } return results; }</code><technical_language>remove if/else if statements getArtifact() call checking casting for</technical_language>

Target:
public Collection<ArtifactToken> getRelated(ArtifactId artifact, RelationTypeSide relationType) { List<ArtifactToken> results = new ArrayList<>(); for (ArtifactReadable art : getArtifact(artifact).getRelated(relationType)) { if (art != null) { results.add(art); } } return results; }
Source:
<code>public void testNotRetrieveHostName() { try { InetAddress address = mock(InetAddress.class); when(address.getCanonicalHostName()).thenReturn("worker10"); when(address.getHostName()).thenReturn("worker10"); when(address.getHostAddress()).thenReturn("127.0.0.1"); TaskManagerLocation info = new TaskManagerLocation(ResourceID.generate(), address, 19871, false); assertNotEquals("worker10", info.getHostname()); assertNotEquals("worker10", info.getFQDNHostname()); assertEquals("127.0.0.1", info.getHostname()); assertEquals("127.0.0.1", info.getFQDNHostname()); } catch (Exception e) { e.printStackTrace(); <START> fail(e.getMessage()); <END> } }</code><technical_language>need manually fail test. if exception thrown out of test, fail. other code in this file is old, outdated pattern</technical_language>

Target:
public void testNotRetrieveHostName() { InetAddress address = mock(InetAddress.class); when(address.getCanonicalHostName()).thenReturn("worker10"); when(address.getHostName()).thenReturn("worker10"); when(address.getHostAddress()).thenReturn("127.0.0.1"); TaskManagerLocation info = new TaskManagerLocation(ResourceID.generate(), address, 19871, new TaskManagerLocation.IpOnlyHostNameSupplier(address)); assertNotEquals("worker10", info.getHostname()); assertNotEquals("worker10", info.getFQDNHostname()); assertEquals("127.0.0.1", info.getHostname()); assertEquals("127.0.0.1", info.getFQDNHostname()); }
Source:
<code>public static Object withBlockingDetails(String description, Callable code) throws Exception { Task current = current(); if (current instanceof BasicTask) ((BasicTask)current).setBlockingDetails(description); if (code!=null) { try { return code.call(); <START> } finally { <END> if (current instanceof BasicTask) ((BasicTask)current).setBlockingDetails(null); } } return null; }</code><technical_language>This code strange: try-finally block of if (code!=null) reset blockingDetails, if code==null? If do want this behaviour (i.e. leave set null is passed in), cleaner separate methods for behaviours</technical_language>

Target:
public static Object withBlockingDetails(String description, Callable code) throws Exception { Task current = current(); if (code==null) { log.warn("legacy invocation of withBlockingDetails with null code block, ignoring"); return null; } if (current instanceof BasicTask) ((BasicTask)current).setBlockingDetails(description); try { return code.call(); } finally { if (current instanceof BasicTask) ((BasicTask)current).setBlockingDetails(null); } }
Source:
<code>protected void showMergeDialog(List<T> selectedItems) { if (adapter.getSelectedItems().size() <= 1) { ToastUtil.showError(getContext(), R.string.am_merge_error); } else { TextInputDialog.Builder builder = new TextInputDialog.Builder(getContext()); builder.setHint(getString(R.string.project_name_label)) .setPositiveButton(getString(R.string.ok), (TextInputDialog.OnClickListener) (dialog, textInput) -> { <START> Toast.makeText(getContext(), "Merging " + selectedItems.get(0).getName() + " and " <END> + selectedItems.get(1).getName(), Toast.LENGTH_LONG).show(); }); builder.setTitle(R.string.new_project_dialog_title) .setNegativeButton(R.string.cancel, null) .show(); } setShowProgressBar(true); finishActionMode(); }</code><technical_language>This text localized</technical_language>

Target:
protected void showMergeDialog(List<T> selectedItems) { if (adapter.getSelectedItems().size() <= 1) { ToastUtil.showError(getContext(), R.string.am_merge_error); } else { TextInputDialog.Builder builder = new TextInputDialog.Builder(getContext()); builder.setHint(getString(R.string.project_name_label)) .setPositiveButton(getString(R.string.ok), (TextInputDialog.OnClickListener) (dialog, textInput) -> { mergeProjects(selectedItems, textInput); }); builder.setTitle(R.string.new_merge_project_dialog_title) .setNegativeButton(R.string.cancel, null) .show(); } setShowProgressBar(true); finishActionMode(); }
Source:
<code>public JsonParserIterator( JavaType typeRef, Future<InputStream> future, String url, <START> @Nullable Query<T> query, <END> String host, ObjectMapper objectMapper, BytesAccumulatingResponseHandler responseHandler ) { this.typeRef = typeRef; this.future = future; this.url = url; this.query = query; jp = null; this.host = host; this.objectMapper = objectMapper; this.responseHandler = responseHandler; this.timeoutAt = query != null ? query.<Long>getContextValue(DirectDruidClient.QUERY_FAIL_TIME, -1L) : -1L; this.hasTimeout = timeoutAt > -1; }</code><technical_language>please add @Nullable member variable query well? Intellij perform a proper inspection based annotation</technical_language>

Target:
public JsonParserIterator( JavaType typeRef, Future<InputStream> future, String url, @Nullable Query<T> query, String host, ObjectMapper objectMapper, BytesAccumulatingResponseHandler responseHandler ) { this.typeRef = typeRef; this.future = future; this.url = url; if (query != null) { this.timeoutAt = query.<Long>getContextValue(DirectDruidClient.QUERY_FAIL_TIME, -1L); this.queryId = query.getId(); } else { this.timeoutAt = -1; this.queryId = null; } this.jp = null; this.host = host; this.objectMapper = objectMapper; this.responseHandler = responseHandler; this.hasTimeout = timeoutAt > -1; }
Source:
<code>public void setColor(int color) { <START> this.setColor(color, <END> color); }</code><technical_language>remove this</technical_language>

Target:
public void setColor(int color) { setColor(color, color); }
Source:
<code>public boolean checkForSubscriptions(String queueName) throws AndesException { SubscriptionStore subscriptionStore = new SubscriptionStore(); Map<String, LocalSubscription> subscriptionMapForQueue = subscriptionStore.getLocalSubscriptionMap(queueName, false); <START> if(subscriptionMapForQueue.isEmpty()) <END> return false; else return true; }</code><technical_language>brackets if is a single line in "if" condition</technical_language>

Target:
public boolean checkForSubscriptions(String queueName) throws AndesException { SubscriptionStore subscriptionStore = new SubscriptionStore(); Map<String, LocalSubscription> subscriptionMapForQueue = subscriptionStore.getLocalSubscriptionMap(queueName, false); if(subscriptionMapForQueue.isEmpty()) { return false; } else{ return true; } }
Source:
<code>private void performImportScript(String[] csv) throws Exception { String filename = "test.csv"; BufferedWriter out = new BufferedWriter( new OutputStreamWriter( new FileOutputStream(filename), "UTF-8")); for (String csvLine : csv) { out.write(csvLine + "\n"); } out.flush(); out.close(); out = null; <START> runDSpaceScript("metadata-import", "-f", "test.csv", "-e", "admin@email.com", "-s"); <END> File file = new File(filename); if (file.exists()) { file.delete(); } }</code><technical_language>filename too, instead of literal "test.csv"</technical_language>

Target:
private void performImportScript(String[] csv) throws Exception { String filename = "test.csv"; BufferedWriter out = new BufferedWriter( new OutputStreamWriter( new FileOutputStream(filename), "UTF-8")); for (String csvLine : csv) { out.write(csvLine + "\n"); } out.flush(); out.close(); out = null; runDSpaceScript("metadata-import", "-f", filename, "-e", "admin@email.com", "-s"); File file = new File(filename); if (file.exists()) { file.delete(); } }
Source:
<code>private EncodingParams buildTagEncodingForSize(final int tagValueSize, final int tagID) { return new ByteArrayLenEncoding( <START> new CanonicalHuffmanIntegerEncoding(new int[] { tagValueSize }, new int[] { 0 }), <END> new ExternalByteArrayEncoding(tagID)).toParam(); }</code><technical_language>create a static constant for new int[] { 0 } avoid creating time this method is called</technical_language>

Target:
private EncodingParams buildTagEncodingForSize(final int tagValueSize, final int tagID) { return new ByteArrayLenEncoding( new CanonicalHuffmanIntegerEncoding(new int[] { tagValueSize }, singleZero), new ExternalByteArrayEncoding(tagID)).toParam(); }
Source:
<code>public ServiceResponseMapper<? extends ValueLocator> buildServiceResponseMapper(PluginTask task) { JacksonServiceResponseMapper.Builder builder = JacksonServiceResponseMapper.builder(); builder.add("marketoGUID", Types.STRING) .add("leadId", Types.STRING) <START> .add("activityDate", Types.TIMESTAMP, "%Y-%m-%dT%H:%M:%S%z") <END> .add("activityTypeId", Types.STRING) .add("campaignId", Types.STRING) .add("primaryAttributeValueId", Types.STRING) .add("primaryAttributeValue", Types.STRING) .add("attributes", Types.JSON); return builder.build(); }</code><technical_language>This MarketoUtils.ISO_8601_FORMAT</technical_language>

Target:
public ServiceResponseMapper<? extends ValueLocator> buildServiceResponseMapper(PluginTask task) { JacksonServiceResponseMapper.Builder builder = JacksonServiceResponseMapper.builder(); builder.add("marketoGUID", Types.STRING) .add("leadId", Types.STRING) .add("activityDate", Types.TIMESTAMP, MarketoUtils.MARKETO_DATE_TIME_FORMAT) .add("activityTypeId", Types.STRING) .add("campaignId", Types.STRING) .add("primaryAttributeValueId", Types.STRING) .add("primaryAttributeValue", Types.STRING) .add("attributes", Types.JSON); return builder.build(); }
Source:
<code>public void testToolbar() { List<SWTBotToolbarButton> buttons = fViewBot.getToolbarButtons(); <START> String[] tooltipsArray = {"Align Views", "Optimize", "", "Show View Filters", "Show Legend", "", "Reset the Time Scale to Default", "Select Previous State Change", "Select Next State Change", "", "Add Bookmark...", "Previous Marker", "Next Marker", "", "Select Previous Process", "Select Next Process", "Zoom In", "Zoom Out", "", "Hide Arrows", "Follow CPU Backward", "Follow CPU Forward", "Go to previous event of the selected thread", "Go to next event of the selected thread"}; <END> List<String> tooltipsExpected = Arrays.asList(tooltipsArray); List<String> tooltips = new ArrayList<>(); for(SWTBotToolbarButton button : buttons){ tooltips.add(button.getToolTipText()); assertTrue(button.getText() + " enabled", button.isEnabled()); assertTrue(button.getText() + " visible", button.isVisible()); } assertEquals(tooltipsExpected, tooltips); }</code><technical_language>format this array a human scroll right ? Please</technical_language>

Target:
public void testToolbar() { List<SWTBotToolbarButton> buttons = fViewBot.getToolbarButtons(); List<String> tooltipsExpected = getToolbarTooltips(); List<String> tooltips = new ArrayList<>(); for (SWTBotToolbarButton button : buttons) { tooltips.add(button.getToolTipText()); assertTrue(button.getText() + " enabled", button.isEnabled()); assertTrue(button.getText() + " visible", button.isVisible()); } assertEquals(tooltipsExpected, tooltips); }
Source:
<code>public Maintainable toMaintenance() { final StatusTransitioner.Transition st = statusTransitioner.maintenance(); try { final Maintainable maintainable = new Maintainable() { private LocalPersistenceService persistenceService; @Override public void create() { EhcacheManager.this.create(); } @Override public void destroy() { <START> startPersistenceService(); <END> EhcacheManager.this.destroy(); persistenceService.destroyAllPersistenceContext(); stopPersistenceService(); } @Override public void close() { statusTransitioner.exitMaintenance(); } private void startPersistenceService() { persistenceService = serviceLocator.getService(LocalPersistenceService.class); persistenceService.start(serviceLocator); } private void stopPersistenceService() { persistenceService.stop(); } }; st.succeeded(); return maintainable; } catch (RuntimeException e) { throw st.failed(e); } }</code><technical_language>starting locks persistence location failing do is else, part of "going maintenance" maintenance succeeds. starting stopping happen part of leaving maintenance</technical_language>

Target:
public Maintainable toMaintenance() { final StatusTransitioner.Transition st = statusTransitioner.maintenance(); startPersistenceService(); try { final Maintainable maintainable = new Maintainable() { private LocalPersistenceService persistenceService = serviceLocator.getService(LocalPersistenceService.class); @Override public void create() { EhcacheManager.this.create(); } @Override public void destroy() { EhcacheManager.this.destroy(); persistenceService.destroyAllPersistenceContext(); } @Override public void close() { persistenceService.stop(); statusTransitioner.exitMaintenance(); } }; st.succeeded(); return maintainable; } catch (RuntimeException e) { throw st.failed(e); } }
Source:
<code>public void createAndTriggerReplicationWithSourceIamAuth() throws Exception { mockWebServer.enqueue(JSON_OK); CloudantClient c = CloudantClientHelper.newMockWebServerClientBuilder(mockWebServer) <START> .build(); <END> c.replication() .source(sourceDbUrl) .sourceIamApiKey(EXPECTED_OK_COOKIE) .target(targetDbUrl) .trigger(); RecordedRequest[] requests = takeN(mockWebServer, 1); assertEquals(requests[0].getPath(), "/_replicate"); String body = requests[0].getBody().readString(Charset.forName("UTF-8")); assertThat("The replication document should contain the source IAM API key", body, containsString(authJson + EXPECTED_OK_COOKIE)); assertThat("The replication document should contain the correct target", body, containsString("\"target\":\"" + targetDbUrl + "\"")); }</code><technical_language>I format of IAM API key identify issues encoding com.cloudant.tests.HttpIamTest#iamApiKey public share tests. Of need updating useful instead of current "iam" string value</technical_language>

Target:
public void createAndTriggerReplicationWithSourceIamAuth() throws Exception { server.enqueue(JSON_OK); CloudantClient c = CloudantClientHelper.newMockWebServerClientBuilder(server) .build(); c.replication() .source(sourceDbUrl) .sourceIamApiKey(IAM_API_KEY) .target(targetDbUrl) .trigger(); RecordedRequest[] requests = takeN(server, 1); assertEquals(requests[0].getPath(), "/_replicate"); String body = requests[0].getBody().readUtf8(); assertThat("The replication document should contain the source IAM API key", body, containsString(authJson + IAM_API_KEY)); assertThat("The replication document should contain the correct target", body, containsString("\"target\":\"" + targetDbUrl + "\"")); }
Source:
<code>private static <A extends Annotation> A findAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType, Set<Annotation> visited) { Annotation[] anns = annotatedElement.getAnnotations(); for (Annotation ann : anns) { <START> if (JHelper.objectSameReference(ann.annotationType(), annotationType)) { <END> return (A) ann; } } for (Annotation ann : anns) { if (!isInJavaLangAnnotationPackage(ann) && visited.add(ann)) { A annotation = findAnnotation(ann.annotationType(), annotationType, visited); if (annotation != null) { return annotation; } } } return null; }</code><technical_language>AnnotationTypes classes, == safe</technical_language>

Target:
private static <A extends Annotation> A findAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType, Set<Annotation> visited) { Annotation[] anns = annotatedElement.getAnnotations(); for (Annotation ann : anns) { if (ann.annotationType() == annotationType) { return (A) ann; } } for (Annotation ann : anns) { if (!isInJavaLangAnnotationPackage(ann) && visited.add(ann)) { A annotation = findAnnotation(ann.annotationType(), annotationType, visited); if (annotation != null) { return annotation; } } } return null; }
Source:
<code>public ResponseBodyData readFile(String requestId) throws IOException { InputStream in = mContext.openFileInput(getFilename(requestId)); try { int firstByte = in.read(); if (firstByte == -1) { throw new EOFException("Failed to read base64Encode byte"); } ResponseBodyData bodyData = new ResponseBodyData(); bodyData.base64Encoded = firstByte != 0; if (mRequestIdMap.containsKey(requestId)) { AsyncPrettyPrinter asyncPrettyPrinter = mRequestIdMap.get(requestId); bodyData.data = prettyPrintContent(in, asyncPrettyPrinter); } <START> else { <END> bodyData.data = readContentsAsUTF8(in); } return bodyData; } finally { in.close(); } }</code><technical_language>style nit: } else {</technical_language>

Target:
public ResponseBodyData readFile(String requestId) throws IOException { InputStream in = mContext.openFileInput(getFilename(requestId)); try { int firstByte = in.read(); if (firstByte == -1) { throw new EOFException("Failed to read base64Encode byte"); } ResponseBodyData bodyData = new ResponseBodyData(); bodyData.base64Encoded = firstByte != 0; AsyncPrettyPrinter asyncPrettyPrinter = mRequestIdMap.get(requestId); if (asyncPrettyPrinter != null) { bodyData.data = prettyPrintContentWithTimeOut(asyncPrettyPrinter, in); } else { bodyData.data = Util.readAsUTF8(in); } return bodyData; } finally { in.close(); } }
Source:
<code>public void updated(final String name) { try { final String path = getZNodePath(name); <START> zkClient.setData().forPath(path, new byte[0]); <END> } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>trigger watchers if set before</technical_language>

Target:
public void updated(final String name) throws Exception { final String path = getZNodePath(name); created(name); zkClient.setData().forPath(path, new byte[0]); }
Source:
<code>public void addUserMetaData(Map<String, String> userMetaDataMap) { StringBuilder userMetadata = new StringBuilder("?SDK=Android&Version=" + SDK_VERSION); if (userMetaDataMap != null) { for (Map.Entry<String, String> metaData : userMetaDataMap.entrySet()) { userMetadata.append("&" + metaData.getKey() + "=" + metaData.getValue()); } } if(userMetadata.length() > 255) { LOGGER.warn("Too many characters. User metadata was truncated.", new IllegalArgumentException("Total number of characters in user metadata" + <START> " cannot exceed " + (255 - ("?SDK=Android&Version=" + SDK_VERSION).length()))); <END> this.userMetaData = userMetadata.substring(0, 255); } else { this.userMetaData = userMetadata.toString(); } }</code><technical_language>Aovid code duplication capturing length line 222 a local variable</technical_language>

Target:
public void addUserMetaData(Map<String, String> userMetaDataMap) { StringBuilder userMetadata = new StringBuilder("?SDK=Android&Version=" + SDK_VERSION); int baseLength = userMetadata.length(); if (userMetaDataMap != null) { for (Map.Entry<String, String> metaData : userMetaDataMap.entrySet()) { userMetadata.append("&" + metaData.getKey() + "=" + metaData.getValue()); } } if(userMetadata.length() > 255) { LOGGER.warn("Too many characters. User metadata was truncated.", new IllegalArgumentException("Total number of characters in user metadata" + " cannot exceed " + (255 - baseLength))); this.userMetaData = userMetadata.substring(0, 255); } else { this.userMetaData = userMetadata.toString(); } }
Source:
<code>public List<VlanVO> listVlansForPod(long podId) { List<PodVlanMapVO> vlanMaps = _podVlanMapDao.listPodVlanMapsByPod(podId); List<VlanVO> result = new ArrayList<VlanVO>(); for (PodVlanMapVO pvmvo : vlanMaps) { VlanVO vlanByPodId = findById(pvmvo.getVlanDbId()); <START> if (vlanByPodId != null && vlanByPodId.getRemoved() == null) { <END> result.add(vlanByPodId); } } return result; }</code><technical_language>a null check is enough, removed items returned GenericDaoBase::findById()</technical_language>

Target:
public List<VlanVO> listVlansForPod(long podId) { List<PodVlanMapVO> vlanMaps = _podVlanMapDao.listPodVlanMapsByPod(podId); List<VlanVO> result = new ArrayList<VlanVO>(); for (PodVlanMapVO pvmvo : vlanMaps) { VlanVO vlanByPodId = findById(pvmvo.getVlanDbId()); if (vlanByPodId != null) { result.add(vlanByPodId); } } return result; }
Source:
<code>public ClasspathResourceDataSchemaResolver(ClassLoader classLoader) { for (DataSchemaParserFactory parserForFormat: BUILTIN_FORMAT_PARSER_FACTORIES) { SingleFormatClasspathSchemaResolver resolver = new SingleFormatClasspathSchemaResolver(parserForFormat); <START> resolver.setExtension("." + parserForFormat.getLanguageExtension()); <END> addResolver(resolver); } _classLoader = classLoader; }</code><technical_language>do need this setter exposed? constructor handle this automatically</technical_language>

Target:
public ClasspathResourceDataSchemaResolver(ClassLoader classLoader) { for (DataSchemaParserFactory parserForFormat: BUILTIN_FORMAT_PARSER_FACTORIES) { addResolver(new SingleFormatClasspathSchemaResolver(parserForFormat)); } _classLoader = classLoader; }
Source:
<code>private Map<String, Object> generateJsonDiskDescription(Map<String, Object> descriptionFields, String... descriptionFieldsPriority) { Map<String, Object> descriptionMap = new TreeMap<>(); int descriptionAvailableLength = METADATA_DESCRIPTION_MAX_LENGTH; for (int priority = 0; priority < descriptionFieldsPriority.length; ++priority) { String fieldName = descriptionFieldsPriority[priority]; String fieldValue = descriptionFields.get(fieldName).toString(); descriptionAvailableLength = addFieldToDescriptionMap(descriptionMap, fieldName, fieldValue, descriptionAvailableLength); <START> if (descriptionAvailableLength < 0) { <END> String diskAlias = descriptionFields.get(DISK_ALIAS).toString(); String storedFieldValue = (String) descriptionMap.get(fieldName); String[] descriptionFieldsLeft = Arrays.copyOfRange(descriptionFieldsPriority, priority, descriptionFieldsPriority.length); String diskFieldsNames = StringUtils.join(descriptionFieldsLeft, ", ", 0, descriptionFieldsLeft.length); if (storedFieldValue == null) { auditLogFailedToStoreDiskFields(diskAlias, diskFieldsNames); } else if (storedFieldValue.length() < fieldValue.length()) { auditLogFailedToStoreEntireDiskField(diskAlias, fieldName, storedFieldValue, diskFieldsNames); } break; } } return descriptionMap; }</code><technical_language>suggestion: consider extract this a method, more clear. "isFieldAddedToMapSuccessfully()"</technical_language>

Target:
private Map<String, Object> generateJsonDiskDescription(Map<String, Object> descriptionFields, String... descriptionFieldsPriority) { Map<String, Object> descriptionMap = new TreeMap<>(); int descriptionAvailableLength = METADATA_DESCRIPTION_MAX_LENGTH; for (int priority = 0; priority < descriptionFieldsPriority.length; ++priority) { String fieldName = descriptionFieldsPriority[priority]; String fieldValue = descriptionFields.get(fieldName).toString(); descriptionAvailableLength = addFieldToDescriptionMap(descriptionMap, fieldName, fieldValue, descriptionAvailableLength); if (descriptionAvailableLength <= 0) { if (!auditLogIfFieldWasNotAddedSuccessfully(descriptionFields, descriptionMap, fieldName, fieldValue, descriptionFieldsPriority, priority)) { break; } } } return descriptionMap; }
Source:
<code>public static Collection<Node> getNodes(AdminClient adminClient, List<Integer> nodeIds, Boolean allNodes) { Collection<Node> nodes = null; if(allNodes) { nodes = adminClient.getAdminClientCluster().getNodes(); } else { nodes = new ArrayList<Node>(); for(Integer nodeId: nodeIds) { nodes.add(adminClient.getAdminClientCluster().getNodeById(nodeId)); } } <START> if(nodes.size() == 0) <END> throw new VoldemortException("The cluster doesn't have any node."); return nodes; }</code><technical_language>Please add { } for 1 line of code</technical_language>

Target:
public static Collection<Node> getNodes(AdminClient adminClient, List<Integer> nodeIds, Boolean allNodes) { Collection<Node> nodes = null; if(allNodes) { nodes = adminClient.getAdminClientCluster().getNodes(); } else { nodes = new ArrayList<Node>(); for(Integer nodeId: nodeIds) { nodes.add(adminClient.getAdminClientCluster().getNodeById(nodeId)); } } if(nodes.size() == 0) { throw new VoldemortException("The cluster doesn't have any node."); } return nodes; }
Source:
<code>private DefaultCategoryDataset createJunitExecutionBarDataset() { double diffSeconds = Math.abs(averageTestDurationSeconds - junitRunsCount); double diffMinutes = Math.abs(averageTestDurationMinutes - junitRunsCount); final DefaultCategoryDataset result = new DefaultCategoryDataset(); result.setValue(junitRunsCount, "1", "Number of Test Runs"); <START> if (diffSeconds < diffMinutes) <END> result.setValue(averageTestDurationSeconds, "1", "Test Run Average Duration (in seconds)"); else result.setValue(averageTestDurationMinutes, "1", "Test Run Average Duration (in minutes)"); return result; }</code><technical_language>Please curly braces</technical_language>

Target:
private DefaultCategoryDataset createJunitExecutionBarDataset() { double differenceSeconds = Math.abs(averageTestDurationSeconds - junitRunsCount); double differenceMinutes = Math.abs(averageTestDurationMinutes - junitRunsCount); DefaultCategoryDataset result = new DefaultCategoryDataset(); result.setValue(junitRunsCount, "1", "Number of Test Runs"); String TestDuration = "Average Test Run Duration"; if (differenceSeconds < differenceMinutes) { result.setValue(averageTestDurationSeconds, "1", TestDuration + " (in seconds)"); } else { result.setValue(averageTestDurationMinutes, "1", TestDuration + " (in minutes)"); } return result; }
Source:
<code>public static VdcParameter deserialize(String key) { String[] tokens = key.split(";"); switch (Integer.parseInt(getValue(tokens[0]))) { case 0: synchronized (parametersMap) { return parametersMap.get(new Guid(getValue(tokens[1]))); <START> } <END> } return null; }</code><technical_language>default exception? do handle</technical_language>

Target:
public static VdcParameter deserialize(String key) { Map<String, String> map = new HashMap<String, String>(); for (String token : key.split(";")) { String[] keyVal = token.split("="); map.put(keyVal[0], keyVal[1]); } switch (Integer.parseInt(map.get(VERSION_KEY))) { case 0: synchronized (parametersMap) { return parametersMap.get(new Guid(map.get(GUID_KEY))); } default: throw new InvalidParameterKeyException(key); } }
Source:
<code>Object buildObjectValue(ObjectValue defaultValue, GraphQLInputObjectType objectType) { Map<String, Object> map = new LinkedHashMap<>(); objectType.getFieldDefinitions().forEach( f -> { <START> final Value<?> fieldValueFromDefaultObjectValue = defaultValue.getObjectFields().stream() <END> .filter(dvf -> dvf.getName().equals(f.getName())).map(ObjectField::getValue).findFirst().orElse(null); map.put(f.getName(), fieldValueFromDefaultObjectValue != null ? buildValue(fieldValueFromDefaultObjectValue, f.getType()): f.getDefaultValue()); } ); return map; }</code><technical_language>fields of objects typically < 10 - iterating is a real problem. schema building is KN a heavy slower (where slower is slow) - perf savings in schema generation a rule is terrible - people performance in schema gen side of</technical_language>

Target:
Object buildObjectValue(ObjectValue defaultValue, GraphQLInputObjectType objectType) { Map<String, Object> map = new LinkedHashMap<>(); objectType.getFieldDefinitions().forEach( f -> { final Value<?> fieldValueFromDefaultObjectValue = getFieldValueFromObjectValue(defaultValue, f.getName()); map.put(f.getName(), fieldValueFromDefaultObjectValue != null ? buildValue(fieldValueFromDefaultObjectValue, f.getType()) : f.getDefaultValue()); } ); return map; }
Source:
<code>public void securityServiceDenialTest() throws Exception { String msg = "@@expected"; securityServiceFactory.exceptionToReturn = new IllegalStateException(msg); securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessRequest; verifyFailureWithMsg(msg); securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.PostProcessRequest; verifyFailureWithMsg(msg); securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessResponse; verifyFailureWithMsg(msg); securityServiceFactory.exceptionToThrow = new IllegalStateException(msg); securityServiceFactory.exceptionToReturn = null; verifyFailureWithMsg(msg); <START> securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.PostProcessRequest; <END> verifyFailureWithMsg(msg); securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessRequest; verifyFailureWithMsg(msg); }</code><technical_language>minor: a bit confusing cases exceptionToReturn = null in reverse order of three</technical_language>

Target:
public void securityServiceDenialTest() throws Exception { String msg = "@@expected"; securityServiceFactory.exceptionToReturn = new IllegalStateException(msg); securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessRequest; verifyFailureWithMsg(msg); securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.PostProcessRequest; verifyFailureWithMsg(msg); securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessResponse; verifyFailureWithMsg(msg); securityServiceFactory.exceptionToThrow = new IllegalStateException(msg); securityServiceFactory.exceptionToReturn = null; securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessRequest; verifyFailureWithMsg(msg); securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.PostProcessRequest; verifyFailureWithMsg(msg); securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessResponse; verifyFailureWithMsg(msg); }
Source:
<code>protected List<VM> getVmsFromExportDomain() { GetAllFromExportDomainQueryParameters p = new GetAllFromExportDomainQueryParameters (getParameters().getStoragePoolId(), getParameters().getSourceDomainId()); <START> VdcQueryReturnValue qretVal = getBackend().runInternalQuery(VdcQueryType.GetVmsFromExportDomain, p); <END> if (!qretVal.getSucceeded()) { return null; } return (List<VM>) qretVal.getReturnValue(); }</code><technical_language>consider changing variable name this qRetVal</technical_language>

Target:
protected List<VM> getVmsFromExportDomain() { GetAllFromExportDomainQueryParameters p = new GetAllFromExportDomainQueryParameters (getParameters().getStoragePoolId(), getParameters().getSourceDomainId()); VdcQueryReturnValue qRetVal = getBackend().runInternalQuery(VdcQueryType.GetVmsFromExportDomain, p); if (!qRetVal.getSucceeded()) { return null; } return (List<VM>) qRetVal.getReturnValue(); }