auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void addNode(final @Nonnull Node node) throws IOException { Node oldNode = nodes.get(node.getNodeName()); if (node != oldNode) { Queue.withLock(new Runnable() { @Override public void run() { nodes.put(node.getNodeName(), node); jenkins.updateComputerList(); jenkins.trimLabels(); } }); try { persistNode(node); <START> } catch (IOException e) { <END> Queue.withLock(new Runnable() { @Override public void run() { nodes.compute(node.getNodeName(), (ignoredNodeName, ignoredNode) -> oldNode); jenkins.updateComputerList(); jenkins.trimLabels(); } }); throw e; } NodeListener.fireOnCreated(node); } }</code><technical_language>RuntimeException</technical_language>

Target:
public void addNode(final @Nonnull Node node) throws IOException { Node oldNode = nodes.get(node.getNodeName()); if (node != oldNode) { Queue.withLock(new Runnable() { @Override public void run() { nodes.put(node.getNodeName(), node); jenkins.updateComputerList(); jenkins.trimLabels(); } }); try { persistNode(node); } catch (IOException | RuntimeException e) { Queue.withLock(new Runnable() { @Override public void run() { nodes.compute(node.getNodeName(), (ignoredNodeName, ignoredNode) -> oldNode); jenkins.updateComputerList(); jenkins.trimLabels(); } }); throw e; } NodeListener.fireOnCreated(node); } }
Source:
<code>void initComboBox() { keyListBoxEditor = new ListModelTypeAheadListBoxEditor<>( new ListModelTypeAheadListBoxEditor.NullSafeSuggestBoxRenderer<GlusterVolumeOptionInfo>() { @Override public String getReplacementStringNullSafe(GlusterVolumeOptionInfo option) { return option.getKey(); } @Override public String getDisplayStringNullSafe(GlusterVolumeOptionInfo data) { return templates .typeAheadNameDescription(data == null ? constants.empty() : data.getKey(), <START> constants.empty()) <END> .asString(); } }); }</code><technical_language>return data.getDescription</technical_language>

Target:
void initComboBox() { keyListBoxEditor = new ListModelTypeAheadChangeableListBoxEditor( new ListModelTypeAheadChangeableListBoxEditor.NullSafeSuggestBoxRenderer() { @Override public String getDisplayStringNullSafe(String data) { return typeAheadNameTemplateNullSafe(data); } }); }
Source:
<code><START> public static JobQueue.Builder buildJobQueue(String jobQueueName, int delayStart, <END> int failureThreshold, int capacity) { return buildJobQueue(jobQueueName, delayStart, failureThreshold, capacity, false); }</code><technical_language>This is a test method, need ensure compatibility. change method</technical_language>

Target:
public static JobQueue.Builder buildJobQueue(String jobQueueName, int delayStart, int failureThreshold, int capacity) { return buildJobQueue(jobQueueName, delayStart, failureThreshold, capacity, true); }
Source:
<code>public ServiceBusMessage(byte[] body) { this.binaryData = Objects.requireNonNull(body, "'body' cannot be null."); this.context = Context.NONE; <START> amqpAnnotatedMessage = new AmqpAnnotatedMessage(new AmqpDataBody(Collections.singletonList( <END> new BinaryData(binaryData)))); }</code><technical_language>this.amqpAnnotatedMessage</technical_language>

Target:
public ServiceBusMessage(byte[] body) { this.binaryData = Objects.requireNonNull(body, "'body' cannot be null."); this.context = Context.NONE; this.amqpAnnotatedMessage = new AmqpAnnotatedMessage(new AmqpDataBody(Collections.singletonList( new BinaryData(binaryData)))); }
Source:
<code>protected CacheStore createCacheStore() throws Exception { String hostname = System.getProperty("MONGODB_HOSTNAME"); <START> if(hostname == null || "".equals(hostname)){ <END> hostname = "127.0.0.1"; } int port = 27017; String configurationPort = System.getProperty("MONGODB_PORT"); try { if(configurationPort == null || "".equals(configurationPort)){ port = Integer.parseInt(configurationPort); } } catch(NumberFormatException e){ log.mongoPortIllegalValue(configurationPort); } log.runningTest(hostname, port); MongoDBCacheStoreConfig config = new MongoDBCacheStoreConfig(hostname, port, 2000, "", "", "infinispan_test_database", "infinispan_indexes", -1); config.setPurgeSynchronously(true); cacheStore = new MongoDBCacheStore(); cacheStore.init(config, getCache(), getMarshaller()); cacheStore.start(); return cacheStore; }</code><technical_language>_if_ nice a space. _{_</technical_language>

Target:
protected CacheStore createCacheStore() throws Exception { String hostname = System.getProperty("MONGODB_HOSTNAME"); if (hostname == null || "".equals(hostname)) { hostname = "127.0.0.1"; } int port = 27017; String configurationPort = System.getProperty("MONGODB_PORT"); try { if (configurationPort != null && !"".equals(configurationPort)) { port = Integer.parseInt(configurationPort); } } catch (NumberFormatException e) { throw log.mongoPortIllegalValue(configurationPort); } log.runningTest(hostname, port); MongoDBCacheStoreConfig config = new MongoDBCacheStoreConfig(hostname, port, 2000, "", "", "infinispan_test_database", "infinispan_indexes", -1); config.setPurgeSynchronously(true); cacheStore = new MongoDBCacheStore(); cacheStore.init(config, getCache(), getMarshaller()); cacheStore.start(); return cacheStore; }
Source:
<code>public void testCreateSSLContext_invalidCustomSSLContextClass() { ZKConfig zkConfig = new ZKConfig(); ClientX509Util clientX509Util = new ClientX509Util(); zkConfig.setProperty(clientX509Util.getSslClientContextProperty(), String.class.getCanonicalName()); try { clientX509Util.createSSLContext(zkConfig); <START> fail("SSLContextException expected."); <END> } catch (X509Exception.SSLContextException e) { assertTrue(e.getMessage().contains(clientX509Util.getSslClientContextProperty())); } }</code><technical_language>nit: remove try-catch modify annotation method @Test(expected = X509Exception.SSLContextException.class). this approach check message, I ok - testing for specific error messages is fragile anyway. care message, create a specific sublcass of SSLContextException for this case check for exception type</technical_language>

Target:
public void testCreateSSLContext_invalidCustomSSLContextClass() throws Exception { ZKConfig zkConfig = new ZKConfig(); ClientX509Util clientX509Util = new ClientX509Util(); zkConfig.setProperty(clientX509Util.getSslContextSupplierClassProperty(), String.class.getCanonicalName()); clientX509Util.createSSLContext(zkConfig); }
Source:
<code><START> public EntityMap<FeedScopedId, Stop> getStops() { <END> return stopsById; }</code><technical_language>feels wrong getters a Builder class. I realize this adapted a pre-existing class getters. I of getters fetch a collection, caller calls add(). more sense replace getters methods addStops() addRoutes(). However, I in some places GtfsContextBuilder.build() fetching collections this Builder modifying them. I this is a of progressively refactoring existing code, refactored more conventional behavior</technical_language>

Target:
public EntityById<FeedScopedId, Stop> getStops() { return stopsById; }
Source:
<code>public void cleanUpSucceeds() throws Exception { final String credentialsId = "zipfile"; File jar = new File(FileItem.class.getProtectionDomain().getCodeSource().getLocation().toURI()); FileItem fi = new FileItemImpl(jar); FileCredentialsImpl fc = new FileCredentialsImpl(CredentialsScope.GLOBAL, credentialsId, "Just a zip file", fi, fi.getName(), null); CredentialsProvider.lookupStores(j.jenkins).iterator().next().addCredentials(Domain.global(), fc); WorkflowJob p = j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition("" + "node {\n" + " withCredentials([[$class: 'ZipFileBinding', credentialsId: 'zipfile', variable: 'ziploc']]) {\n" + (Functions.isWindows() ? " bat 'type %ziploc%\\\\META-INF\\\\MANIFEST.MF'\n" : " sh 'cat ${ziploc}/META-INF/MANIFEST.MF'\n" ) + " def manifest = readFile encoding: 'UTF-8', file: \"${env.ziploc}/META-INF/MANIFEST.MF\"\n" + " echo \"manifest contents....\\n${manifest}\"\n" <START> + " if (!manifest.contains('Specification-Title: Apache Commons FileUpload')) {\n" <END> + " error ('incorrect details from zip file')\n" + " }\n" + " }\n" + "}\n" , false )); j.assertBuildStatusSuccess(p.scheduleBuild2(0)); }</code><technical_language>Test depending a transitive dependency. If dependency is upgraded Specification-Title is changed, test fail. choose a fixed dependency set in this plugin pom? safer. However, improbable Specification-Title changes, noting it</technical_language>

Target:
public void cleanUpSucceeds() throws Exception { final String credentialsId = "zipfile"; InputStream zipStream = this.getClass().getResourceAsStream("a.zip"); try { assertThat(zipStream, is(not(nullValue()))); File zip = tmp.newFile("a.zip"); FileUtils.copyInputStreamToFile(zipStream, zip); FileItem fi = new FileItemImpl(zip); FileCredentialsImpl fc = new FileCredentialsImpl(CredentialsScope.GLOBAL, credentialsId, "Just a zip file", fi, fi.getName(), null); CredentialsProvider.lookupStores(j.jenkins).iterator().next().addCredentials(Domain.global(), fc); } finally { IOUtils.closeQuietly(zipStream); zipStream = null; } final String unixFile = "/dir/testfile.txt"; final String winFile = unixFile.replace("/", "\\\\"); final String contents = "Test of ZipFileBinding\n"; WorkflowJob p = j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition("" + "node {\n" + " withCredentials([[$class: 'ZipFileBinding', credentialsId: '"+ credentialsId +"', variable: 'ziploc']]) {\n" + (Functions.isWindows() ? " bat 'type %ziploc%"+ winFile + "'\n" : " sh 'cat ${ziploc}" + unixFile + "'\n" ) + " def text = readFile encoding: 'UTF-8', file: \"${env.ziploc}" + unixFile + "\"\n" + " if (!text.equals('''" + contents + "''')) {\n" + " error ('incorrect details from zip file')\n" + " }\n" + " }\n" + "}\n" , true)); WorkflowRun run = p.scheduleBuild2(0).get(); j.assertBuildStatusSuccess(run); j.assertLogContains(contents, run); }
Source:
<code>public void setItemSelected(int position) { if (!mItemsSelected.get(position)) { mItemsSelected.put(position, true); } <START> notifyDataSetChanged(); <END> }</code><technical_language>I for single items notifyItemChanged(position) instead of notifyDataSetChanged() (same toggleItemSelected)</technical_language>

Target:
public void setItemSelected(int position) { if (!mItemsSelected.get(position)) { mItemsSelected.put(position, true); } notifyItemChanged(position); }
Source:
<code>public ValidateScheduler(DiagramEditPart diagramEditPart, long delay) { this.diagramEditPart = diagramEditPart; <START> this.scheduledJobs = new ArrayDeque<ValidateJob>(); <END> }</code><technical_language>this.delay = delay;</technical_language>

Target:
public ValidateScheduler(DiagramEditPart diagramEditPart, long delay) { this.diagramEditPart = diagramEditPart; this.scheduledJobs = new ArrayDeque<ValidateJob>(); this.delay = delay; }
Source:
<code>public void addListener(IReporter listener) { <START> if (!m_reporters.values().contains(listener)) { <END> addListener((ITestNGListener) listener); } }</code><technical_language>containsValue</technical_language>

Target:
public void addListener(IReporter listener) { if (!m_reporters.containsValue(listener)) { addListener((ITestNGListener) listener); } }
Source:
<code>public void performFiltering() { CallFilter dummyStart = new CallFilter(); CallFilter dummyComplete = new CallFilter(); for (CallFilter filter : filtersList) { addEdge(dummyStart, filter); } for (CallFilter filter : filtersList) { addEdge(filter, dummyComplete); } addEdge(dummyStart, dummyComplete); filtersQueue.offer(dummyStart); try { <START> <END> while (true) { CallFilter filter = filtersQueue.take(); CompletableFuture<CallFilteringResult> filterFuture = scheduleFilter(filter, filtersQueue); mFutures.put(filter, filterFuture); filterScheduled++; if (filterScheduled == (filtersList.size() + 2 )) { break; } } mResult = mFutures.get(dummyComplete).get(); } catch (InterruptedException | ExecutionException e) { Log.w(this, "Call filters failed due to: " + e.toString()); } mListener.onCallFilteringComplete(mCall, mResult); }</code><technical_language>extraneous blank line</technical_language>

Target:
public void performFiltering() { CallFilteringResult result = new CallFilteringResult.Builder() .setShouldAllowCall(true) .setShouldReject(false) .setShouldSilence(false) .setShouldAddToCallLog(true) .setShouldShowNotification(true) .setCall(mCall) .build(); CallFilter dummyStart = new CallFilter(); CallFilter dummyComplete = new CallFilter(); for (CallFilter filter : mFiltersList) { addEdge(dummyStart, filter); } for (CallFilter filter : mFiltersList) { addEdge(filter, dummyComplete); } addEdge(dummyStart, dummyComplete); mFiltersQueue.offer(dummyStart); try { while (mFilterScheduled < (mFiltersList.size() + 2)) { CallFilter filter = mFiltersQueue .poll(INCOMING_CALL_FILTERS_TIMEOUT, TimeUnit.MILLISECONDS); CompletableFuture<CallFilteringResult> filterFuture = scheduleFilter(filter, mFiltersQueue); mFutures.put(filter, filterFuture); mFilterScheduled++; } result = mFutures.get(dummyComplete) .get(INCOMING_CALL_FILTERS_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException | TimeoutException e) { Log.w(this, "Call filters failed due to: " + e.toString()); } mListener.onCallFilteringComplete(mCall, result); }
Source:
<code>private void start(PhoneNumber number) { <START> if (PhoneNumber.isValid(number)) { <END> mPhoneEditText.setText(number.getPhoneNumber()); mPhoneEditText.setSelection(number.getPhoneNumber().length()); } else { mPhoneInputLayout.setError(getString(R.string.fui_invalid_phone_number)); return; } if (PhoneNumber.isCountryValid(number)) { setCountryCode(number); } onNext(); }</code><technical_language>nit: nornmally I this pattern is clearer: java if (bad condition) { // ... return; } // Good condition.... indentation survives future editing better</technical_language>

Target:
private void start(PhoneNumber number) { if (!PhoneNumber.isValid(number)) { mPhoneInputLayout.setError(getString(R.string.fui_invalid_phone_number)); return; } mPhoneEditText.setText(number.getPhoneNumber()); mPhoneEditText.setSelection(number.getPhoneNumber().length()); if (PhoneNumber.isCountryValid(number)) { setCountryCode(number); } onNext(); }
Source:
<code>public void testDestroy() { final UberfireDock uberfireDock = mock(UberfireDock.class); <START> dock.setOpened(false); <END> doReturn(uberfireDock).when(dock).getUberfireDock(); dock.destroy(); verify(uberfireDocks).remove(uberfireDock); }</code><technical_language>I do understand need this method, please clarify</technical_language>

Target:
public void testDestroy() { final UberfireDock uberfireDock = mock(UberfireDock.class); doReturn(uberfireDock).when(dock).getUberfireDock(); dock.destroy(); verify(uberfireDocks).remove(uberfireDock); }
Source:
<code>private static Iterable<ImmutableBitmap> getBitmapIterator( final BitmapIndex bitmapIndex, final LikeDimFilter.LikeMatcher likeMatcher, final Indexed<String> dimValues ) { final String lower = Strings.nullToEmpty(likeMatcher.getPrefix()); final String upper = Strings.nullToEmpty(likeMatcher.getPrefix()) + Character.MAX_VALUE; final int startIndex; final int endIndex; final int lowerFound = bitmapIndex.getIndex(lower); startIndex = lowerFound >= 0 ? lowerFound : -(lowerFound + 1); final int upperFound = bitmapIndex.getIndex(upper); endIndex = upperFound >= 0 ? upperFound + 1 : -(upperFound + 1); return new Iterable<ImmutableBitmap>() { @Override public Iterator<ImmutableBitmap> iterator() { <START> return new Iterator<ImmutableBitmap>() <END> { int currIndex = startIndex; @Override public boolean hasNext() { return currIndex < endIndex; } @Override public ImmutableBitmap next() { while (currIndex < endIndex && !likeMatcher.matchesSuffixOnly(dimValues.get(currIndex))) { currIndex++; } if (currIndex == endIndex) { return bitmapIndex.getBitmapFactory().makeEmptyImmutableBitmap(); } return bitmapIndex.getBitmap(currIndex++); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; }</code><technical_language>please apply improvement? <LINK_0></technical_language>

Target:
private static Iterable<ImmutableBitmap> getBitmapIterator( final BitmapIndex bitmapIndex, final LikeDimFilter.LikeMatcher likeMatcher, final Indexed<String> dimValues ) { return Filters.bitmapsFromIndexes(getBitmapIndexIterator(bitmapIndex, likeMatcher, dimValues), bitmapIndex); }
Source:
<code>public Saga to(final Map<String, Object> props) { final Map<String, Object> properties = Maps.newHashMap(props); final Class sagaClass = (Class) properties.remove(X_KASPER_SAGA_CLASS); final Object identifier = properties.remove(X_KASPER_SAGA_IDENTIFIER); final Saga saga = sagaFactory.create(identifier, sagaClass); for (final Entry<String, Object> entry : properties.entrySet()) { try { final Field field = sagaClass.getDeclaredField(entry.getKey()); field.setAccessible(Boolean.TRUE); field.set(saga, entry.getValue()); } catch (final IllegalAccessException | NoSuchFieldException e) { <START> e.printStackTrace(); END> } } return saga; }</code><technical_language>-1: ;p</technical_language>

Target:
public Saga to(final Map<String, Object> props) { final Map<String, Object> properties = Maps.newHashMap(props); final Class sagaClass = (Class) properties.remove(X_KASPER_SAGA_CLASS); final Object identifier = properties.remove(X_KASPER_SAGA_IDENTIFIER); final Saga saga = sagaFactory.create(identifier, sagaClass); for (final Entry<String, Object> entry : properties.entrySet()) { try { final Field field = sagaClass.getDeclaredField(entry.getKey()); field.setAccessible(Boolean.TRUE); field.set(saga, entry.getValue()); } catch (final IllegalAccessException | NoSuchFieldException e) { LOGGER.error("Failed to restore property '{}' to a saga instance, <saga={}> <identifier={}> <propertyValue={}>", entry.getKey(), saga.getClass(), identifier, entry.getValue(), e); } } return saga; }
Source:
<code>private MacroManager getMacroManager() { <START> return MacroManager.getDefaultInstance(); <END> }</code><technical_language>Get a service</technical_language>

Target:
public MacroManager getMacroManager() { if (fMacroManager == null) { Activator plugin = Activator.getDefault(); IPath stateLocation = plugin.getStateLocation(); stateLocation.append("macros"); File userHome = new File(System.getProperty("user.home")); File eclipseUserHome = new File(userHome, ".eclipse"); File eclipseUserHomeMacros = new File(eclipseUserHome, "org.eclipse.e4.core.macros"); File eclipseUserHomeMacrosLoadDir = new File(eclipseUserHomeMacros, "macros"); if (!eclipseUserHomeMacrosLoadDir.exists()) { eclipseUserHomeMacrosLoadDir.mkdirs(); } File[] macrosDirectory = { stateLocation.toFile(), eclipseUserHomeMacrosLoadDir }; fMacroManager = new MacroManager(macrosDirectory); } return fMacroManager; }
Source:
<code>public void checkAttributeValue(PerunSessionImpl perunSession, String key, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() == null) return; LinkedHashMap<String, String> map = (LinkedHashMap<String, String>) attribute.getValue(); if(map.isEmpty()) return; if(!KEY.equals(key)) { throw new WrongAttributeValueException(attribute, key, "entityless key for this attribute must be " + KEY); } Set<String> mapKeys = map.keySet(); for(String mapKey : mapKeys) { if(mapKey == null) throw new WrongAttributeValueException(attribute, key, "Key in dnsStateMapping map can not be null."); <START> if(!mapKey.startsWith(".")) throw new WrongAttributeValueException(attribute, key, "Key in dnsStateMapping map must start with dot symbol ('.')."); <END> String value = map.get(mapKey); if(value == null) throw new WrongAttributeValueException(attribute, key, "Value in dnsStateMapping map can not be null."); } }</code><technical_language>requirement for domain names start a dot is in specification in redmine issue 3798. harmful. Please remove check</technical_language>

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, String key, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(!KEY.equals(key)) { throw new WrongAttributeValueException(attribute, key, "entityless key for this attribute must be " + KEY); } if(attribute.getValue() == null) return; LinkedHashMap<String, String> map = (LinkedHashMap<String, String>) attribute.getValue(); if(map.isEmpty()) return; Set<String> mapKeys = map.keySet(); for(String mapKey : mapKeys) { if(mapKey == null) throw new WrongAttributeValueException(attribute, key, "Key in dnsStateMapping map can not be null."); String value = map.get(mapKey); if(value == null) throw new WrongAttributeValueException(attribute, key, "Value in dnsStateMapping map can not be null."); } }
Source:
<code>protected void followTransitionByOption(CoreSession session, Document doc, Map<String, Serializable> options) { String lifecycleState = doc.getLifeCycleState(); if (APPROVED_STATE.equals(lifecycleState) || OBSOLETE_STATE.equals(lifecycleState)) { doc.followTransition(BACK_TO_PROJECT_TRANSITION); if (session != null) { String sid = session.getSessionId(); DocumentModel docModel = DocumentModelFactory.createDocumentModel(doc, sid, null); DocumentEventContext ctx = new DocumentEventContext(session, session.getPrincipal(), docModel); ctx.setProperty(TRANSTION_EVENT_OPTION_FROM, lifecycleState); ctx.setProperty(TRANSTION_EVENT_OPTION_TO, doc.getLifeCycleState()); ctx.setProperty(TRANSTION_EVENT_OPTION_TRANSITION, BACK_TO_PROJECT_TRANSITION); ctx.setProperty(REPOSITORY_NAME, session.getRepositoryName()); ctx.setProperty(SESSION_ID, sid); ctx.setProperty(DOC_LIFE_CYCLE, BACK_TO_PROJECT_TRANSITION); ctx.setProperty(CATEGORY, DocumentEventCategories.EVENT_LIFE_CYCLE_CATEGORY); ctx.setProperty(COMMENT, options.get(COMMENT)); <START> Framework.getService(EventService.class).fireEvent(ctx.newEvent(TRANSITION_EVENT)); <END> } } }</code><technical_language>Please extract block a separate sendEvent method for clarity</technical_language>

Target:
protected void followTransitionByOption(CoreSession session, Document doc, Map<String, Serializable> options) { String lifecycleState = doc.getLifeCycleState(); if (APPROVED_STATE.equals(lifecycleState) || OBSOLETE_STATE.equals(lifecycleState)) { doc.followTransition(BACK_TO_PROJECT_TRANSITION); if (session != null) { sendEvent(session, doc, lifecycleState, options); } } }
Source:
<code>private void verifyLifecycleEvent(final Message<?> msg, final LifecycleState lifecycleState) { assertNotNull(msg); assertNotNull(msg.getPayload()); assertTrue(msg.getPayload() instanceof LifecycleEvent); <START> assertEquals(((LifecycleEvent) msg.getPayload()).getState(), lifecycleState); <END> }</code><technical_language>OK. Revise, please, project for this vulnerability</technical_language>

Target:
private void verifyLifecycleEvent(final Message<?> msg, final LifecycleState lifecycleState) { assertNotNull(msg); assertNotNull(msg.getPayload()); assertTrue(msg.getPayload() instanceof LifecycleEvent); assertEquals(lifecycleState, ((LifecycleEvent) msg.getPayload()).getState()); }
Source:
<code>protected RequestBuilder applyAuth(RequestBuilder request) throws NexmoClientException { AuthMethod authMethod = getAuthMethod(getAcceptableAuthMethods()); <START> if (isUseBasicAuth()) { <END> return authMethod.applyAsBasicAuth(request); } return authMethod.apply(request); }</code><technical_language>I overiding applyAuth in RedactMethod is a approach. I kind of I implemented it</technical_language>

Target:
protected RequestBuilder applyAuth(RequestBuilder request) throws NexmoClientException { return getAuthMethod(getAcceptableAuthMethods()).apply(request); }
Source:
<code>public Mono<Void> globalSetupAsync() { return super.globalSetupAsync() <START> .doOnTerminate(() -> { <END> try { cloudFile.upload(TestDataCreationHelper.createRandomInputStream(options.getSize()), options.getSize()); } catch (URISyntaxException | StorageException | IOException e) { throw new RuntimeException(e); } }).then(); }</code><technical_language>this terminate</technical_language>

Target:
public Mono<Void> globalSetupAsync() { return super.globalSetupAsync() .then(Mono.fromCallable(() -> { try { cloudFile.upload(TestDataCreationHelper.createRandomInputStream(options.getSize()), options.getSize()); return 1; } catch (URISyntaxException | StorageException | IOException e) { throw new RuntimeException(e); } })).then(); }
Source:
<code>public void haveTwoFileFiltersIsIncorrect() throws Exception { final Environment env = new Environment.Mock() .withFile( <START> "target/classes/Remote.class", <END> new BytecodeMocker() .withSource("class Remote implements java.rmi.Remote { }") .mock() ) .withDefaultClasspath() .withExcludes( "findbugs-filter", "file.xml,file2.xml" ); new FindBugsValidator().validate(env); }</code><technical_language>@ilyakharlamov too,</technical_language>

Target:
public void haveTwoFileFiltersIsIncorrect() throws Exception { final Environment env = new Environment.Mock() .withFile( FindBugsValidatorTest.REMOTE_FILE, new BytecodeMocker() .withSource(FindBugsValidatorTest.REMOTE_SOURCE) .mock() ) .withDefaultClasspath() .withExcludes( FindBugsValidator.EXCLUDE_FILTER, "file.xml,file2.xml" ); new FindBugsValidator().validate(env); }
Source:
<code>private void downloadPlanFeatures() { WordPress.getRestClientUtilsV1_2().get("plans/features/", WordPress.getRestLocaleParams(), null, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { if (response != null) { AppLog.d(AppLog.T.PLANS, response.toString()); AppPrefs.setGlobalPlansFeatures(response.toString()); <START> downloadAvailablePlansForSite(); <END> } else { AppLog.w(AppLog.T.PLANS, "Unexpected empty response from server when downloading Features"); notifyFailure(); } } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { AppLog.e(AppLog.T.PLANS, "Error Loading Plans/Features", volleyError); notifyFailure(); } }); }</code><technical_language>of above. Volley multithreading ability, download of in parallel. boost performance of this service</technical_language>

Target:
private void downloadPlanFeatures() { WordPress.getRestClientUtilsV1_2().get("plans/features/", WordPress.getRestLocaleParams(), null, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { if (response != null) { AppLog.d(AppLog.T.PLANS, response.toString()); AppPrefs.setGlobalPlansFeatures(response.toString()); requestCompleted(); } else { AppLog.w(AppLog.T.PLANS, "Unexpected empty response from server when downloading Features"); requestFailed(); } } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { AppLog.e(AppLog.T.PLANS, "Error Loading Plans/Features", volleyError); requestFailed(); } }); }
Source:
<code>public void fileChosen(String path, Result result) { if (path == null) { controller.getPreferences().putString( Preferences.FILE_CHOOSER_LAST_FOLDER, fileChooser.getSelectedFile().path()); } else { controller.getPreferences().putString( Preferences.FILE_CHOOSER_LAST_FOLDER, path); } if (fileChooserListener != null) { <START> fileChooserListener.fileChosen(path, null); <END> } fileChooser.remove(); }</code><technical_language>Result.SUCCESS</technical_language>

Target:
public void fileChosen(String path, Result result) { if (path == null) { controller.getPreferences().putString( Preferences.FILE_CHOOSER_LAST_FOLDER, fileChooser.getSelectedFile().path()); } else { controller.getPreferences().putString( Preferences.FILE_CHOOSER_LAST_FOLDER, path); } if (fileChooserListener != null) { fileChooserListener.fileChosen(path, Result.SUCCESS); } fileChooser.remove(); }
Source:
<code>public void mappingFunctionReturnsIterableOfEntriesForEachInputEntry() throws Exception { <START> Store<K, V> kvStore = factory.newStore(factory.newConfiguration(factory.getKeyType(), factory.getValueType(), null, null, null, Expirations.noExpiration())); <END> Set<K> inputKeys = new HashSet<K>(); int nbElements = 10; for (long i = 0; i < nbElements; i++) { K k = factory.createKey(i); V v = factory.createValue(i); inputKeys.add(k); kvStore.put(k, v); } try { kvStore.bulkComputeIfAbsent(inputKeys, new Function<Iterable<? extends K>, Iterable<? extends Map.Entry<? extends K, ? extends V>>>() { @Override public Iterable<? extends Map.Entry<? extends K, ? extends V>> apply(Iterable<? extends K> entries) { assertThat(entries.iterator().hasNext(), is(false)); return new HashMap<K, V>().entrySet(); } } ); } catch (CacheAccessException e) { System.err.println("Warning, an exception is thrown due to the SPI test"); e.printStackTrace(); } }</code><technical_language>this change (and similar changes) part of another pull request</technical_language>

Target:
public void mappingFunctionReturnsIterableOfEntriesForEachInputEntry() throws Exception { Store<K, V> kvStore = factory.newStore(factory.newConfiguration(factory.getKeyType(), factory.getValueType(), null, null, null)); Set<K> inputKeys = new HashSet<K>(); int nbElements = 10; for (long i = 0; i < nbElements; i++) { K k = factory.createKey(i); V v = factory.createValue(i); inputKeys.add(k); kvStore.put(k, v); } try { kvStore.bulkComputeIfAbsent(inputKeys, new Function<Iterable<? extends K>, Iterable<? extends Map.Entry<? extends K, ? extends V>>>() { @Override public Iterable<? extends Map.Entry<? extends K, ? extends V>> apply(Iterable<? extends K> entries) { assertThat(entries.iterator().hasNext(), is(false)); return new HashMap<K, V>().entrySet(); } } ); } catch (CacheAccessException e) { System.err.println("Warning, an exception is thrown due to the SPI test"); e.printStackTrace(); } }
Source:
<code>protected void launchDialog() { final Bundle extras = new Bundle(); <START> extras.putString(UsernameChangerFullScreenDialogFragment.EXTRA_DISPLAY, mEditTextDisplayName.getText().toString()); <END> extras.putString(UsernameChangerFullScreenDialogFragment.EXTRA_USERNAME, mEditTextUsername.getText().toString()); mDialog = new FullScreenDialogFragment.Builder(getContext()) .setTitle(R.string.username_changer_title) .setAction(R.string.username_changer_action) .setOnConfirmListener(this) .setOnDismissListener(this) .setContent(UsernameChangerFullScreenDialogFragment.class, extras) .build(); mDialog.show(getActivity().getSupportFragmentManager(), FullScreenDialogFragment.TAG); }</code><technical_language>do introducing a "newInstance" type of method hide setup of input bundle? For example, a UsernameChangerFullScreenDialogFragment.newInputBundle() static method accept displayName username parameters return a properly populated bundle ready passed .setContent() below</technical_language>

Target:
protected void launchDialog() { final Bundle bundle = UsernameChangerFullScreenDialogFragment.newBundle( mEditTextDisplayName.getText().toString(), mEditTextUsername.getText().toString()); mDialog = new FullScreenDialogFragment.Builder(getContext()) .setTitle(R.string.username_changer_title) .setAction(R.string.username_changer_action) .setOnConfirmListener(this) .setOnDismissListener(this) .setContent(UsernameChangerFullScreenDialogFragment.class, bundle) .build(); mDialog.show(getActivity().getSupportFragmentManager(), FullScreenDialogFragment.TAG); }
Source:
<code>private Map<String, Integer> buildIoTune(DiskImage diskImage, Map<Guid, Guid> diskProfileStorageQosMap, Map<Guid, Map<String, Integer>> storageQosIoTuneMap) { Guid diskProfileId = diskImage.getDiskProfileId(); if (diskProfileId == null) { return null; } Guid storageQosId = diskProfileStorageQosMap.get(diskProfileId); if (storageQosId == null) { StorageQos storageQos = DbFacade.getInstance().getStorageQosDao().getQosByDiskProfileId(diskProfileId); if (storageQos == null) { return null; } storageQosId = storageQos.getId(); diskProfileStorageQosMap.put(diskProfileId, storageQosId); storageQosIoTuneMap.put(storageQosId, buildIoTuneMap(storageQos)); } Map<String, Integer> ioTuneMap = storageQosIoTuneMap.get(storageQosId); <START> if (ioTuneMap.isEmpty()) { <END> return ioTuneMap; } return null; }</code><technical_language>! is empty</technical_language>

Target:
private Map<String, Integer> buildIoTune(DiskImage diskImage, Map<Guid, Guid> diskProfileStorageQosMap, Map<Guid, Map<String, Integer>> storageQosIoTuneMap) { Guid diskProfileId = diskImage.getDiskProfileId(); if (diskProfileId == null) { return null; } Guid storageQosId = diskProfileStorageQosMap.get(diskProfileId); if (storageQosId == null) { StorageQos storageQos = DbFacade.getInstance().getStorageQosDao().getQosByDiskProfileId(diskProfileId); if (storageQos == null) { return null; } storageQosId = storageQos.getId(); diskProfileStorageQosMap.put(diskProfileId, storageQosId); storageQosIoTuneMap.put(storageQosId, buildIoTuneMap(storageQos)); } Map<String, Integer> ioTuneMap = storageQosIoTuneMap.get(storageQosId); if (!ioTuneMap.isEmpty()) { return ioTuneMap; } return null; }
Source:
<code>public View onCreateActionView() { View view = View.inflate(parentActivity, R.layout.group_find_in_page, null); findInPageNext = view.findViewById(R.id.find_in_page_next); findInPageNext.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Utils.hideSoftKeyboard(parentActivity); if (!pageFragmentValid()) { return; } parentActivity.getCurPageFragment().getWebView().findNext(true); } }); findInPagePrev = view.findViewById(R.id.find_in_page_prev); findInPagePrev.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Utils.hideSoftKeyboard(parentActivity); if (!pageFragmentValid()) { return; } parentActivity.getCurPageFragment().getWebView().findNext(false); } }); findInPageMatch = (TextView) view.findViewById(R.id.find_in_page_match); SearchView searchView = (SearchView) view.findViewById(R.id.find_in_page_input); searchView.setQueryHint(parentActivity.getString(R.string.find_in_page)); searchView.setIconified(false); searchView.setOnQueryTextListener(searchQueryListener); searchView.setOnCloseListener(searchCloseListener); <START> searchView.setIconified(false); <END> searchView.setInputType(EditorInfo.TYPE_CLASS_TEXT); searchView.setImeOptions(EditorInfo.IME_ACTION_DONE); searchView.setSubmitButtonEnabled(false); return view; }</code><technical_language>called (3 lines above)</technical_language>

Target:
public View onCreateActionView() { View view = View.inflate(parentActivity, R.layout.group_find_in_page, null); findInPageNext = view.findViewById(R.id.find_in_page_next); findInPageNext.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Utils.hideSoftKeyboard(parentActivity); if (!pageFragmentValid()) { return; } parentActivity.getCurPageFragment().getWebView().findNext(true); } }); findInPagePrev = view.findViewById(R.id.find_in_page_prev); findInPagePrev.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Utils.hideSoftKeyboard(parentActivity); if (!pageFragmentValid()) { return; } parentActivity.getCurPageFragment().getWebView().findNext(false); } }); findInPageMatch = (TextView) view.findViewById(R.id.find_in_page_match); SearchView searchView = (SearchView) view.findViewById(R.id.find_in_page_input); searchView.setQueryHint(parentActivity.getString(R.string.find_in_page)); searchView.setFocusable(true); searchView.requestFocusFromTouch(); searchView.setOnQueryTextListener(searchQueryListener); searchView.setOnCloseListener(searchCloseListener); searchView.setIconified(false); searchView.setInputType(EditorInfo.TYPE_CLASS_TEXT); searchView.setImeOptions(EditorInfo.IME_ACTION_DONE); searchView.setSubmitButtonEnabled(false); return view; }
Source:
<code>public Optional<String> getInitParameterAsOptional(String name) { <START> String value = getInitParameter(name, String.class); <END> if (Strings.isNullOrEmpty(value)) { return Optional.empty(); } return Optional.of(value); }</code><technical_language>String = getInitParameter(name); enough, no</technical_language>

Target:
public Optional<String> getInitParameterAsOptional(String name) { String value = getInitParameter(name); if (Strings.isNullOrEmpty(value)) { return Optional.empty(); } return Optional.of(value); }
Source:
<code>public static synchronized MongoClient getMongoClient(final Configuration conf) throws ConfigurationRuntimeException, MongoException { if (mongoClient == null) { if (conf.getBoolean(MongoDBRdfConfiguration.USE_TEST_MONGO, false)) { try { MongodForTestsFactory testsFactory = MongodForTestsFactory.with(Version.Main.PRODUCTION); mongoClient = testsFactory.newMongo(); } catch (IOException e) { throw new MongoException("While creating a factory for a test/mock MongoDB instance.",e); } } else { <START> final String host = requireNonNull(conf.get(MongoDBRdfConfiguration.MONGO_INSTANCE), "MongoDB host name is required"); <END> final int port = requireNonNullInt(conf.get(MongoDBRdfConfiguration.MONGO_INSTANCE_PORT), "MongoDB Port number is required."); ServerAddress server; try { server = new ServerAddress(host, port); } catch (UnknownHostException e) { throw new MongoException("Connecting MongoDB instance, cannot find host="+host,e); } if (conf.get(MongoDBRdfConfiguration.MONGO_USER) != null) { final String username = conf.get(MongoDBRdfConfiguration.MONGO_USER); final String dbName = requireNonNull(conf.get(MongoDBRdfConfiguration.MONGO_DB_NAME), MongoDBRdfConfiguration.MONGO_DB_NAME + " is null but required configuration if " + MongoDBRdfConfiguration.MONGO_USER + " is configured."); final char[] pswd = requireNonNull(conf.get(MongoDBRdfConfiguration.MONGO_USER_PASSWORD), MongoDBRdfConfiguration.MONGO_USER_PASSWORD + " is null but required configuration if " + MongoDBRdfConfiguration.MONGO_USER + " is configured.").toCharArray(); final MongoCredential cred = MongoCredential.createCredential(username, dbName, pswd); mongoClient = new MongoClient(server, Arrays.asList(cred)); } else { mongoClient = new MongoClient(server); } } } return mongoClient; }</code><technical_language>guava preconditions instead (e.g. [here](<LINK_0></technical_language>

Target:
public static synchronized MongoClient getMongoClient(final Configuration conf) throws ConfigurationRuntimeException, MongoException { if (mongoClient == null) { if (conf.getBoolean(MongoDBRdfConfiguration.USE_TEST_MONGO, false)) { createMongoClientForTests(); } else { createMongoClientForServer(conf); } } return mongoClient; }
Source:
<code>public Status delete(String table, String endpoint) { int responseCode; try { responseCode = httpDelete(urlPrefix + endpoint); } catch (Exception e) { responseCode = handleExceptions(e, urlPrefix + endpoint, HttpMethod.DELETE); } if (logEnabled) { <START> System.out.println(new StringBuilder("DELETE Request: ").append(urlPrefix).append(endpoint) <END> .append(" | Response Code: ").append(responseCode).toString()); } return getStatus(responseCode); }</code><technical_language>System.out instead of System.err</technical_language>

Target:
public Status delete(String table, String endpoint) { int responseCode; try { responseCode = httpDelete(urlPrefix + endpoint); } catch (Exception e) { responseCode = handleExceptions(e, urlPrefix + endpoint, HttpMethod.DELETE); } if (logEnabled) { System.err.println(new StringBuilder("DELETE Request: ").append(urlPrefix).append(endpoint) .append(" | Response Code: ").append(responseCode).toString()); } return getStatus(responseCode); }
Source:
<code>public void shouldSaveProcess() throws Exception { Process parent = new Process(); parent.setTitle("Parent"); Process process = new Process(); process.setTitle("Child"); process.setParent(parent); parent.getChildren().add(process); processService.save(process); Process foundProcess = processService.getById(process.getId()); assertEquals("Child process was not found in database!", "Child", foundProcess.getTitle()); <START> assertEquals("Parent process was not assigned to child!", "Parent", process.getParent().getTitle()); <END> Integer parentId = foundProcess.getParent().getId(); processService.remove(parentId); }</code><technical_language>I "foundProcess" instead of process</technical_language>

Target:
public void shouldSaveProcess() throws Exception { Process parent = new Process(); parent.setTitle("Parent"); Process process = new Process(); process.setTitle("Child"); process.setParent(parent); parent.getChildren().add(process); processService.save(process); Process foundProcess = processService.getById(process.getId()); Process foundParent = foundProcess.getParent(); assertEquals("Child process was not found in database!", "Child", foundProcess.getTitle()); assertEquals("Parent process was not assigned to child!", "Parent", foundParent.getTitle()); foundParent.getChildren().clear(); foundProcess.setParent(null); processService.remove(foundProcess); processService.remove(foundParent.getId()); }
Source:
<code>public boolean isExist(KEY key) throws IOException { <START> if (cacheCleanupPolicy == TableCacheImpl.CacheCleanupPolicy.NEVER) { <END> return isExistForCleanupPolicyNever(key); } return isExistForCleanupPolicyNever(key) || rawTable.isExist(codecRegistry.asRawData(key)); }</code><technical_language>I understand added this policy-specific check here. is misplaced here. original solution cache types isExist overloaded better</technical_language>

Target:
public boolean isExist(KEY key) throws IOException { CacheResult<CacheValue<VALUE>> cacheResult = cache.lookup(new CacheKey<>(key)); if (cacheResult.getCacheStatus() == EXISTS) { return true; } else if (cacheResult.getCacheStatus() == NOT_EXIST) { return false; } else { return rawTable.isExist(codecRegistry.asRawData(key)); } }
Source:
<code>public CompletableFuture<List<Map<Address, InternalCacheEntry<K, V>>>> getAllReplicasForSegment(int segmentId, LocalizedCacheTopology topology) { return requestMap.computeIfAbsent(segmentId, id -> new SegmentRequest(id, topology)).requestState(); <START> } <END></code><technical_language>I if this is called in parallel stop()/onDataRehash request cancelled</technical_language>

Target:
public synchronized CompletableFuture<List<Map<Address, CacheEntry<K, V>>>> getAllReplicasForSegment(int segmentId, LocalizedCacheTopology topology) { return requestMap.computeIfAbsent(segmentId, id -> new SegmentRequest(id, topology)).requestState(); }
Source:
<code>public DatastreamEvent next() throws SQLException { if (!hasNext()) { <START> throw new NoSuchElementException("No more elements in this iterator."); <END> } try { Map<String, String> rowValues = new HashMap<>(); Map<String, String> keyValues = new HashMap<>(); for (ColumnInfo column : _columnInfo) { rowValues.put(column.getColumnName(), _rs.getString(column.getColumnName())); if (column.isKey()) { keyValues.put(column.getColumnName(), _rs.getString(column.getColumnName())); } } return buildDatastreamEvent(System.currentTimeMillis(), _source.getDatabaseName(), _source.getTableName(), JsonUtils.toJson(keyValues), JsonUtils.toJson(rowValues)); } finally { _next = false; } }</code><technical_language>message incorrect if closed needToClose is true</technical_language>

Target:
public DatastreamEvent next() throws SQLException { if (!_isEof || _closed) { String msg = "TableReader needs to be closed or it is closed already."; LOG.warn(msg); throw new DatastreamRuntimeException(msg); } if (!hasNext()) { throw new NoSuchElementException("No more elements in this iterator."); } try { Map<String, String> rowValues = new HashMap<>(); Map<String, String> keyValues = new HashMap<>(); for (ColumnInfo column : _columnInfo) { rowValues.put(column.getColumnName(), _rs.getString(column.getColumnName())); if (column.isKey()) { keyValues.put(column.getColumnName(), _rs.getString(column.getColumnName())); } } return buildDatastreamEvent(System.currentTimeMillis(), _source.getDatabaseName(), _source.getTableName(), JsonUtils.toJson(keyValues), JsonUtils.toJson(rowValues)); } finally { _next = false; } }
Source:
<code>public void onTaskRefreshedEvent(@Observes final TaskRefreshedEvent event) { if (isSameTaskFromEvent().test(event)) { taskService.call( (TaskSummary task) -> { if (task != null) { setTaskDetails(translationService.format(task.getStatus()), task.getDescription(), task.getActualOwner(), task.getExpirationTime(), String.valueOf(task.getPriority()), task.getProcessInstanceId(), task.getProcessId(), task.getWorkItemId(), task.getSlaCompliance()); } <START> }).getTaskWithSLA(getServerTemplateId(), getContainerId(), getTaskId(), view.getWorkItemId()); <END> } }</code><technical_language>workitemid in presenter hold logic, in view</technical_language>

Target:
public void onTaskRefreshedEvent(@Observes final TaskRefreshedEvent event) { if (isSameTaskFromEvent().test(event)) { taskService.call( (TaskSummary task) -> { if (task != null) { setTaskDetails(translationService.format(task.getStatus()), task.getDescription(), task.getActualOwner(), task.getExpirationTime(), String.valueOf(task.getPriority()), task.getProcessInstanceId(), task.getProcessId(), task.getSlaCompliance()); } }).getTask(getServerTemplateId(), getContainerId(), getTaskId()); } }
Source:
<code><START> public static <T> Set<T> load(Class<T> contract, ClassLoader... loaders) { <END> Map<String, T> services = new LinkedHashMap<>(); if (loaders.length == 0) { try { ServiceLoader<T> loadedServices = ServiceLoader.load(contract); addServices( loadedServices, services ); } catch (Exception e) { } } else { for (ClassLoader loader : loaders) { if (loader == null) continue; try { ServiceLoader<T> loadedServices = ServiceLoader.load(contract, loader); addServices( loadedServices, services ); } catch (Exception e) { } } } addOsgiServices( contract, services ); if (services.isEmpty()) { LOG.debugf("No service impls found: %s", contract.getSimpleName()); } return new LinkedHashSet<>(services.values()); }</code><technical_language>return a Collection<T>..</technical_language>

Target:
public static <T> Collection<T> load(Class<T> contract, ClassLoader... loaders) { Map<String, T> services = new LinkedHashMap<>(); if (loaders.length == 0) { try { ServiceLoader<T> loadedServices = ServiceLoader.load(contract); addServices( loadedServices, services ); } catch (Exception e) { } } else { for (ClassLoader loader : loaders) { if (loader == null) continue; try { ServiceLoader<T> loadedServices = ServiceLoader.load(contract, loader); addServices( loadedServices, services ); } catch (Exception e) { } } } addOsgiServices( contract, services ); if (services.isEmpty()) { LOG.debugf("No service impls found: %s", contract.getSimpleName()); } return services.values(); }
Source:
<code>public boolean validate() { getDescription().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation(), new LengthValidation(BusinessEntitiesDefinitions.DISK_DESCRIPTION_MAX_SIZE)}); Collection<IValidation> <START> diskAliasValidation = <END> new ArrayList<>(Arrays.asList( new I18NNameValidation(), new LengthValidation(BusinessEntitiesDefinitions.DISK_ALIAS_MAX_SIZE))); if (getVm() == null) { diskAliasValidation.add(new NotEmptyValidation()); } getAlias().validateEntity(diskAliasValidation.toArray(new IValidation[diskAliasValidation.size()])); StoragePool dataCenter = getDataCenter().getSelectedItem(); if (dataCenter != null && dataCenter.getQuotaEnforcementType() == QuotaEnforcementTypeEnum.HARD_ENFORCEMENT) { getQuota().validateSelectedItem(new IValidation[] { new NotEmptyQuotaValidation() }); } if (getCinderVolumeType().getIsAvailable()) { getCinderVolumeType().validateSelectedItem(new IValidation[]{new NotEmptyValidation()}); } return getAlias().getIsValid() && getDescription().getIsValid() && getQuota().getIsValid() && getDiskInterface().getIsValid() && getCinderVolumeType().getIsValid(); }</code><technical_language>* s/diskAliasValidation/diskAliasValidations * please extract a method for future reusage. e.g. getDiskAliasValidations</technical_language>

Target:
public boolean validate() { getDescription().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation(), new LengthValidation(BusinessEntitiesDefinitions.DISK_DESCRIPTION_MAX_SIZE)}); getAlias().validateEntity(getDiskAliasValidations()); StoragePool dataCenter = getDataCenter().getSelectedItem(); if (dataCenter != null && dataCenter.getQuotaEnforcementType() == QuotaEnforcementTypeEnum.HARD_ENFORCEMENT) { getQuota().validateSelectedItem(new IValidation[] { new NotEmptyQuotaValidation() }); } if (getCinderVolumeType().getIsAvailable()) { getCinderVolumeType().validateSelectedItem(new IValidation[]{new NotEmptyValidation()}); } return getAlias().getIsValid() && getDescription().getIsValid() && getQuota().getIsValid() && getDiskInterface().getIsValid() && getCinderVolumeType().getIsValid(); }