auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void postUninstalledEvent(String extensionId) { <START> if (eventPublisher != null) { <END> Event event = ExtensionEventFactory.createExtensionUninstalledEvent(extensionId); eventPublisher.post(event); } }</code><technical_language>I assume this function called if service is activated. EventPublisher is a mandatory reference, need check for nullness</technical_language>

Target:
private void postUninstalledEvent(String extensionId) { Event event = ExtensionEventFactory.createExtensionUninstalledEvent(extensionId); eventPublisher.post(event); }
Source:
<code>public void applySnapshot(DaoState snapshot) { allowDaoStateChange = true; assertDaoStateChange(); log.info("Apply snapshot with chain height {}", snapshot.getChainHeight()); daoState.setChainHeight(snapshot.getChainHeight()); daoState.getTxMap().clear(); daoState.getTxMap().putAll(snapshot.getTxMap()); daoState.getBlocks().clear(); <START> daoState.getBlocks().addAll(snapshot.getBlocks()); <END> daoState.getCycles().clear(); daoState.getCycles().addAll(snapshot.getCycles()); daoState.getUnspentTxOutputMap().clear(); daoState.getUnspentTxOutputMap().putAll(snapshot.getUnspentTxOutputMap()); daoState.getSpentInfoMap().clear(); daoState.getSpentInfoMap().putAll(snapshot.getSpentInfoMap()); daoState.getConfiscatedLockupTxList().clear(); daoState.getConfiscatedLockupTxList().addAll(snapshot.getConfiscatedLockupTxList()); daoState.getIssuanceMap().clear(); daoState.getIssuanceMap().putAll(snapshot.getIssuanceMap()); daoState.getParamChangeList().clear(); daoState.getParamChangeList().addAll(snapshot.getParamChangeList()); daoState.getEvaluatedProposalList().clear(); daoState.getEvaluatedProposalList().addAll(snapshot.getEvaluatedProposalList()); daoState.getDecryptedBallotsWithMeritsList().clear(); daoState.getDecryptedBallotsWithMeritsList().addAll(snapshot.getDecryptedBallotsWithMeritsList()); }</code><technical_language>caching DaoState level compare caching Block level? Keeping object in-sync is complicated interested in understanding if simpler block-level cache of gain of synchronization complication</technical_language>

Target:
public void applySnapshot(DaoState snapshot) { allowDaoStateChange = true; assertDaoStateChange(); log.info("Apply snapshot with chain height {}", snapshot.getChainHeight()); daoState.setChainHeight(snapshot.getChainHeight()); daoState.setTxCache(snapshot.getTxCache()); daoState.getBlocks().clear(); daoState.getBlocks().addAll(snapshot.getBlocks()); daoState.getCycles().clear(); daoState.getCycles().addAll(snapshot.getCycles()); daoState.getUnspentTxOutputMap().clear(); daoState.getUnspentTxOutputMap().putAll(snapshot.getUnspentTxOutputMap()); daoState.getSpentInfoMap().clear(); daoState.getSpentInfoMap().putAll(snapshot.getSpentInfoMap()); daoState.getConfiscatedLockupTxList().clear(); daoState.getConfiscatedLockupTxList().addAll(snapshot.getConfiscatedLockupTxList()); daoState.getIssuanceMap().clear(); daoState.getIssuanceMap().putAll(snapshot.getIssuanceMap()); daoState.getParamChangeList().clear(); daoState.getParamChangeList().addAll(snapshot.getParamChangeList()); daoState.getEvaluatedProposalList().clear(); daoState.getEvaluatedProposalList().addAll(snapshot.getEvaluatedProposalList()); daoState.getDecryptedBallotsWithMeritsList().clear(); daoState.getDecryptedBallotsWithMeritsList().addAll(snapshot.getDecryptedBallotsWithMeritsList()); }
Source:
<code>public void visitToken(DetailAST token) { switch (token.getType()) { case TokenTypes.CLASS_DEF: final DetailAST serviceClientAnnotationToken = getServiceClientAnnotation(token); final String className = token.findFirstToken(TokenTypes.IDENT).getText(); hasServiceClientBuilderAnnotation = serviceClientAnnotationToken != null; if (hasServiceClientBuilderAnnotation) { if (!hasServiceClientsAnnotationProperty(serviceClientAnnotationToken)) { log(serviceClientAnnotationToken, String.format( "Annotation @%s should have ''serviceClients'' as property of annotation and should list all of the service clients it can build.", SERVICE_CLIENT_BUILDER)); } if (!className.endsWith("ClientBuilder")) { <START> log(token, String.format("@ServiceClientBuilder class ''%s''should be named <ServiceName>ClientBuilder.", className)); <END> } } else { if (className.endsWith("ClientBuilder")) { log(token, String.format("Class ''%s'' should be annotated with @ServiceClientBuilder.", className)); } } break; case TokenTypes.METHOD_DEF: if (!hasServiceClientBuilderAnnotation) { return; } if (hasAsyncClientBuilder && hasClientBuilder) { return; } final String methodName = token.findFirstToken(TokenTypes.IDENT).getText(); if (BUILD_ASYNC_CLIENT.equals(methodName)) { hasAsyncClientBuilder = true; } if (BUILD_CLIENT.equals(methodName)) { hasClientBuilder = true; } break; default: break; } }</code><technical_language>suggestion log(token, String.format("Class annotated @ServiceClientBuilder ''%s''should named <ServiceName>ClientBuilder.", className));</technical_language>

Target:
public void visitToken(DetailAST token) { switch (token.getType()) { case TokenTypes.CLASS_DEF: hasServiceClientBuilderAnnotationStack.push(hasServiceClientBuilderAnnotation); hasBuildMethodStack.push(hasBuildMethod); final DetailAST serviceClientAnnotationBuilderToken = getServiceClientBuilderAnnotation(token); final String className = token.findFirstToken(TokenTypes.IDENT).getText(); hasServiceClientBuilderAnnotation = serviceClientAnnotationBuilderToken != null; if (hasServiceClientBuilderAnnotation) { if (!className.endsWith("ClientBuilder")) { log(token, String.format("Class annotated with @ServiceClientBuilder ''%s'' should be named <ServiceName>ClientBuilder.", className)); } } else { if (className.endsWith("ClientBuilder")) { log(token, String.format("Class ''%s'' should be annotated with @ServiceClientBuilder.", className)); } } break; case TokenTypes.METHOD_DEF: if (!hasServiceClientBuilderAnnotation) { return; } final String methodName = token.findFirstToken(TokenTypes.IDENT).getText(); if (!methodName.startsWith("build")) { break; } hasBuildMethod = true; if (!methodName.endsWith("Client")) { log(token, String.format( "@ServiceClientBuilder class should not have a method name, ''%s'' starting with ''build'' but not ending with ''Client''." , methodName)); } break; default: break; } }
Source:
<code>public void setListeners(StatsStorageRouter statsStorage, Collection<? extends IterationListener> listeners) { StatsStorageRouterProvider routerProvider = null; if(listeners != null ){ for(IterationListener l : listeners){ if(l instanceof RoutingIterationListener){ <START> RoutingIterationListener rl = (RoutingIterationListener)l; <END> if(rl.getStorageRouter() == null){ log.warn("RoutingIterationListener provided without providing any StatsStorage instance. Iterator may not function without one. Listener: {}", l); } else if(!(rl.getStorageRouter() instanceof Serializable)){ throw new IllegalStateException("RoutingIterationListener provided with non-serializable storage router"); } if(routerProvider == null){ routerProvider = new VanillaStatsStorageRouterProvider(); } } } } this.listeners.clear(); if(listeners != null) { this.listeners.addAll(listeners); if (trainingMaster != null) trainingMaster.setListeners(statsStorage, this.listeners); } }</code><technical_language>spacing braces</technical_language>

Target:
public void setListeners( StatsStorageRouter statsStorage, Collection<? extends IterationListener> listeners) { StatsStorageRouterProvider routerProvider = null; if (listeners != null) { for (IterationListener l : listeners) { if (l instanceof RoutingIterationListener) { RoutingIterationListener rl = (RoutingIterationListener) l; if (statsStorage == null) { log.warn( "RoutingIterationListener provided without providing any StatsStorage instance. Iterator may not function without one. Listener: {}", l); } else if (!(rl.getStorageRouter() instanceof Serializable)) { throw new IllegalStateException( "RoutingIterationListener provided with non-serializable storage router " + "\nRoutingIterationListener class: " + rl.getClass().getName() + "\nStatsStorageRouter class: " + statsStorage.getClass().getName()); } if (routerProvider == null) { routerProvider = new VanillaStatsStorageRouterProvider(); } } } } this.listeners.clear(); if (listeners != null) { this.listeners.addAll(listeners); if (trainingMaster != null) trainingMaster.setListeners(statsStorage, this.listeners); } }
Source:
<code>public void testInvalidJsonInput() throws IOException { <START> String json = "{\n" + <END> " \"h\\ello\": true,\n" + " \"foo\": [\"world\"]\n" + "}"; try { JsonReader reader = new JsonReader(reader(json)); reader.beginObject(); assertEquals("hello", reader.nextName()); fail(); } catch (IOException expected) { } }</code><technical_language>indent this +2 please</technical_language>

Target:
public void testInvalidJsonInput() throws IOException { String json = "{\n" + " \"h\\ello\": true,\n" + " \"foo\": [\"world\"]\n" + "}"; JsonReader reader = new JsonReader(reader(json)); reader.beginObject(); try { reader.nextName(); fail(); } catch (IOException expected) { } }
Source:
<code>public boolean selfComparison(ColumnReference cr, boolean forIndexExpression) throws StandardException{ ValueNode otherSide = null; JBitSet tablesReferenced; List<ColumnReference> lcr, rcr; lcr = leftOperand.getHashableJoinColumnReference(); if(lcr != null && !lcr.isEmpty()){ <START> int bound = forIndexExpression ? lcr.size() : 1; for (int i = 0; i < bound; i++) { if (lcr.get(i) == cr) { otherSide = rightOperand; break; } } } <END> if (otherSide == null) { rcr = rightOperand.getHashableJoinColumnReference(); if (rcr != null && !rcr.isEmpty()) { int bound = forIndexExpression ? rcr.size() : 1; for (int i = 0; i < bound; i++) { if (rcr.get(i) == cr) { otherSide = leftOperand; break; } } } } if (otherSide == null) { if(SanityManager.DEBUG){ SanityManager.THROWASSERT( "ColumnReference not found on either side of binary comparison."); } } assert otherSide != null; tablesReferenced=otherSide.getTablesReferenced(); return tablesReferenced.get(cr.getTableNumber()); }</code><technical_language>This logic is consistent original logic. forIndexExpression is false, logic set otherSide if left more column reference, long column reference matches input column reference. original logic, otherSide set if more column references. Is this change intended</technical_language>

Target:
public boolean selfComparison(ColumnReference cr, boolean forIndexExpression) throws StandardException{ ValueNode otherSide = null; JBitSet tablesReferenced; List<ColumnReference> lcr, rcr; lcr = leftOperand.getHashableJoinColumnReference(); if(lcr != null && !lcr.isEmpty()){ if (forIndexExpression || lcr.size() == 1) { for (ColumnReference columnReference : lcr) { if (columnReference.equals(cr)) { otherSide = rightOperand; break; } } } } if (otherSide == null) { rcr = rightOperand.getHashableJoinColumnReference(); if (rcr != null && !rcr.isEmpty()) { if (forIndexExpression || rcr.size() == 1) { for (ColumnReference columnReference : rcr) { if (columnReference.equals(cr)) { otherSide = leftOperand; break; } } } } } if (otherSide == null) { if(SanityManager.DEBUG){ SanityManager.THROWASSERT( "ColumnReference not found on either side of binary comparison."); } } assert otherSide != null; tablesReferenced=otherSide.getTablesReferenced(); return tablesReferenced.get(cr.getTableNumber()); }
Source:
<code>public void shouldRecordSuccessTestExecutionWhenSaveAll() { String oldValue = System.getProperty("RECORDER_SAVE_ALL"); <START> System.setProperty("RECORDER_SAVE_ALL", "true"); <END> TestRecorderRule testRecorderRule = new TestRecorderRule(); Description shouldNotRecordSuccessTestExecutionByDefault = Description.createTestDescription("org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest", "shouldRecordSuccessTestExecutionWhenSaveAll"); testRecorderRule.starting(shouldNotRecordSuccessTestExecutionByDefault); System.out.println("Hello World"); testRecorderRule.succeeded(shouldNotRecordSuccessTestExecutionByDefault); testRecorderRule.finished(shouldNotRecordSuccessTestExecutionByDefault); File outputFile = new File("target", "org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest-shouldRecordSuccessTestExecutionWhenSaveAll.mov"); assertThat(outputFile.exists(), is(true)); if(oldValue != null) { System.setProperty("RECORDER_SAVE_ALL", oldValue); } else { System.clearProperty("RECORDER_SAVE_ALL"); } outputFile.delete(); }</code><technical_language>This approach unstable in case of multithreaded testing. IIRC is JUnit run tests in a single-thread mode</technical_language>

Target:
public void shouldRecordSuccessTestExecutionWhenSaveAll() { TestRecorderRule.RECORDER_OPTION = TestRecorderRule.ALWAYS; TestRecorderRule testRecorderRule = new TestRecorderRule(); Description shouldNotRecordSuccessTestExecutionByDefault = Description.createTestDescription("org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest", "shouldRecordSuccessTestExecutionWhenSaveAll"); testRecorderRule.starting(shouldNotRecordSuccessTestExecutionByDefault); System.out.println("Hello World"); testRecorderRule.succeeded(shouldNotRecordSuccessTestExecutionByDefault); testRecorderRule.finished(shouldNotRecordSuccessTestExecutionByDefault); File outputFile = new File("target", "org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest-shouldRecordSuccessTestExecutionWhenSaveAll.mov"); assertThat(outputFile.exists(), is(true)); TestRecorderRule.RECORDER_OPTION = TestRecorderRule.FAILURES; outputFile.delete(); }
Source:
<code>public org.jclouds.openstack.ceilometer.v2.CeilometerApiMetadata build() { <START> return new org.jclouds.openstack.ceilometer.v2.CeilometerApiMetadata(this); <END> }</code><technical_language>full package names necessary. CeilometerApiMetadata suffice previous 2 lines</technical_language>

Target:
public CeilometerApiMetadata build() { return new CeilometerApiMetadata(this); }
Source:
<code>private X509Certificate[] loadCertificateCollection(String[] certificates) throws IOException, CertificateException { logger.debug("Load certificates collection"); CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); List<X509Certificate> collections = new ArrayList<X509Certificate>(); for(int i = 0; i < certificates.length; i++) { String certificate = certificates[i]; <START> try(InputStream in = new FileInputStream(certificate)) { <END> List<X509Certificate> certificatesChains = (List<X509Certificate>) certificateFactory.generateCertificates(in); collections.addAll(certificatesChains); } } return collections.toArray(new X509Certificate[collections.size()]); }</code><technical_language>add logger.debug("Loading certificates file {}", certificate)</technical_language>

Target:
private X509Certificate[] loadCertificateCollection(String[] certificates) throws IOException, CertificateException { logger.debug("Load certificates collection"); CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); List<X509Certificate> collections = new ArrayList<X509Certificate>(); for(int i = 0; i < certificates.length; i++) { String certificate = certificates[i]; logger.debug("Loading certificates from file " + certificate); try(InputStream in = new FileInputStream(certificate)) { List<X509Certificate> certificatesChains = (List<X509Certificate>) certificateFactory.generateCertificates(in); collections.addAll(certificatesChains); } } return collections.toArray(new X509Certificate[collections.size()]); }
Source:
<code>public void requestWhenDisabled() throws Exception { Map<String, String> s = new HashMap<>(); s.put("url", "http://localhost:" + wireMockRule.port()); s.put("database", "test-db"); s.put("enabled", "false"); stubFor(any(urlPathEqualTo("/write")) .atPriority(10) .willReturn(aResponse() .withStatus(404) .withBody("{\"status\":\"Error\",\"message\":\"Should not be called\"}"))); InfluxDbOutputWriter writer = new InfluxDbOutputWriter(FAKE_CLOCK); writer.postConstruct(s); writer.writeQueryResult("foo", null, 1); writer.postCollect(); <START> } <END></code><technical_language>a verification wire mock called instead relying HTTP 400 throw exception. means declaration of stub simpler (as *should* called, need a complex stub)</technical_language>

Target:
public void requestWhenDisabled() throws Exception { Map<String, String> s = new HashMap<>(); s.put("url", "http://localhost:" + wireMockRule.port()); s.put("database", "test-db"); s.put("enabled", "false"); InfluxDbOutputWriter writer = new InfluxDbOutputWriter(FAKE_CLOCK); writer.postConstruct(s); writer.writeQueryResult("foo", null, 1); writer.postCollect(); verify(exactly(0), getRequestedFor(urlEqualTo("/write"))); }
Source:
<code>private void parseAndBuildConfig(Config config) throws Exception { Node w3cRootNode; YamlMapping yamlRootNode; try { yamlRootNode = ((YamlMapping) YamlLoader.load(in)); } catch (Exception ex) { throw new InvalidConfigurationException("Invalid YAML configuration", ex); } YamlNode imdgRoot = yamlRootNode.childAsMapping(ConfigSections.HAZELCAST.name().toLowerCase()); if (imdgRoot == null) { throw new InvalidConfigurationException("No mapping with hazelcast key is found in the provided configuration"); } <START> w3cRootNode = W3cDomUtil.asW3cNode(imdgRoot); <END> new YamlMemberDomConfigProcessor(true, config).buildConfig(w3cRootNode); }</code><technical_language>Nice :)</technical_language>

Target:
private void parseAndBuildConfig(Config config) throws Exception { YamlMapping yamlRootNode; try { yamlRootNode = ((YamlMapping) YamlLoader.load(in)); } catch (Exception ex) { throw new InvalidConfigurationException("Invalid YAML configuration", ex); } YamlNode imdgRoot = yamlRootNode.childAsMapping(ConfigSections.HAZELCAST.name().toLowerCase()); if (imdgRoot == null) { throw new InvalidConfigurationException("No mapping with hazelcast key is found in the provided configuration"); } new YamlMemberDomConfigProcessor(true, config).buildConfig(W3cDomUtil.asW3cNode(imdgRoot)); }
Source:
<code>public void visitToken(DetailAST ast) { if (!isSkipCase(ast)) { final DetailAST ident = ast.findFirstToken(TokenTypes.IDENT); final DetailAST assign = ast.findFirstToken(TokenTypes.ASSIGN); final DetailAST exprStart = assign.getFirstChild().getFirstChild(); final DetailAST type = ast.findFirstToken(TokenTypes.TYPE); if (isObjectType(type) && exprStart.getType() == TokenTypes.LITERAL_NULL) { log(ident, MSG_KEY, ident.getText(), "null"); <START> } <END> if (!onlyObjectReferences) { final int primitiveType = type.getFirstChild().getType(); if (primitiveType == TokenTypes.LITERAL_BOOLEAN && exprStart.getType() == TokenTypes.LITERAL_FALSE) { log(ident, MSG_KEY, ident.getText(), "false"); } if (isNumericType(primitiveType) && isZero(exprStart)) { log(ident, MSG_KEY, ident.getText(), "0"); } if (primitiveType == TokenTypes.LITERAL_CHAR && isZeroChar(exprStart)) { log(ident, MSG_KEY, ident.getText(), "\\0"); } } } }</code><technical_language>move in this block a new method called validateNonObjects</technical_language>

Target:
public void visitToken(DetailAST ast) { if (!isSkipCase(ast)) { final DetailAST ident = ast.findFirstToken(TokenTypes.IDENT); final DetailAST assign = ast.findFirstToken(TokenTypes.ASSIGN); final DetailAST exprStart = assign.getFirstChild().getFirstChild(); final DetailAST type = ast.findFirstToken(TokenTypes.TYPE); if (isObjectType(type) && exprStart.getType() == TokenTypes.LITERAL_NULL) { log(ident, MSG_KEY, ident.getText(), "null"); } if (!onlyObjectReferences) { validateNonObjects(ast); } } }
Source:
<code><START> private void setIcons() { <END> for (int i = 0; i < tabs.size(); i++) { String tabNumber = tabs.get(i); TabLayout.Tab tabToSet = tabLayout.getTabAt(i); Context c = getContext(); if (tabToSet != null && c != null) { if (tabNumber.startsWith(TAB_NUMBER_KIOSK + "\t")) { String kiosk[] = tabNumber.split("\t"); if (kiosk.length == 2) { try { tabToSet.setIcon(KioskTranslator.getKioskIcons(kiosk[1], getContext())); } catch (Exception e) { } } } else if (tabNumber.startsWith(TAB_NUMBER_CHANNEL + "\t")) { tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_channel)); } else { switch (tabNumber) { case TAB_NUMBER_BLANK: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_hot)); break; case TAB_NUMBER_SUBSCIRPTIONS: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_channel)); break; case TAB_NUMBER_FEED: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.rss)); break; case TAB_NUMBER_BOOKMARKS: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_bookmark)); break; case TAB_NUMBER_HISTORY: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.history)); break; } } } } }</code><technical_language>icons titles setup simultaniously? This redundant code. consider a structure call 'setupTabs() write switch case etc. twice</technical_language>

Target:
private void setIcons() { for (int i = 0; i < tabs.size(); i++) { String tabInformation = tabs.get(i); TabLayout.Tab tabToSet = tabLayout.getTabAt(i); Context c = getContext(); if (tabToSet != null && c != null) { if (tabInformation.startsWith(TAB_NUMBER_KIOSK + "\t")) { String kiosk[] = tabInformation.split("\t"); if (kiosk.length == 3) { tabToSet.setIcon(KioskTranslator.getKioskIcons(kiosk[1], getContext())); } } else if (tabInformation.startsWith(TAB_NUMBER_CHANNEL + "\t")) { tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_channel)); } else { switch (tabInformation) { case TAB_NUMBER_BLANK: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_hot)); break; case TAB_NUMBER_SUBSCIRPTIONS: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_channel)); break; case TAB_NUMBER_FEED: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.rss)); break; case TAB_NUMBER_BOOKMARKS: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_bookmark)); break; case TAB_NUMBER_HISTORY: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.history)); break; } } } } }
Source:
<code>@Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> setRetainInstance(true); <END> setCancelable(false); if (getArguments() != null) { this.title = getArguments().getString(ARGS_TITLE); this.message = getArguments().getString(ARGS_MESSAGE); this.cancel = getArguments().getString(ARGS_CANCEL); } }</code><technical_language>starting question this is a good idea. Generally I understand I left in previous PR. investigate</technical_language>

Target:
@Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); setCancelable(false); if (getArguments() != null) { mTitle = getArguments().getString(ARGS_TITLE); mMessage = getArguments().getString(ARGS_MESSAGE); mCancel = getArguments().getString(ARGS_CANCEL); } }
Source:
<code>private void prepareSolutionFile(File file) { try { List<String> lines = FileUtils.readLines(file); <START> List<String> parsedLines = new ArrayList<>(); <END> for (String line : lines) { if (line.contains(beginSolution) || line.contains(endSolution) || line.contains(stubMarker)) { continue; } parsedLines.add(line); } FileUtils.writeLines(file, parsedLines); } catch (IOException ex) { System.out.println("Unexpected IOException, preparation of file {" + file.getAbsolutePath() + "} interrupted"); } }</code><technical_language>filteredLines</technical_language>

Target:
private void prepareSolutionFile(File file) { try { List<String> lines = Files.readAllLines(file.toPath(), charset); List<String> filteredLines = new ArrayList<>(); for (String line : lines) { if (line.contains(beginSolution) || line.contains(endSolution) || line.contains(stubMarker)) { continue; } filteredLines.add(line); } Files.write(file.toPath(), filteredLines, charset); } catch (IOException ex) { throw new RuntimeException("Unexpected IOException, preparation of file {" + file.getAbsolutePath() + "} interrupted", ex); } }
Source:
<code>private void afterInitialSchemaRefresh(CqlIdentifier keyspace) { try { nodeStateManager.markInitialized(); context.getLoadBalancingPolicyWrapper().init(); context.getConfigLoader().onDriverInit(context); LOG.debug("[{}] Initialization complete, ready", logPrefix); poolManager .init(keyspace) .whenComplete( (v, error) -> { if (error != null) { initFuture.completeExceptionally(error); } else { <START> notifyLifecycleListeners(); <END> initFuture.complete(DefaultSession.this); } }); } catch (Throwable throwable) { forceCloseAsync() .whenComplete( (v, error) -> { initFuture.completeExceptionally(throwable); }); } }</code><technical_language>call initFuture.complete(DefaultSession.this);</technical_language>

Target:
private void afterInitialSchemaRefresh(CqlIdentifier keyspace) { try { nodeStateManager.markInitialized(); context.getLoadBalancingPolicyWrapper().init(); context.getConfigLoader().onDriverInit(context); LOG.debug("[{}] Initialization complete, ready", logPrefix); poolManager .init(keyspace) .whenComplete( (v, error) -> { if (error != null) { initFuture.completeExceptionally(error); } else { initFuture.complete(DefaultSession.this); notifyLifecycleListeners(); } }); } catch (Throwable throwable) { forceCloseAsync() .whenComplete( (v, error) -> { initFuture.completeExceptionally(throwable); }); } }
Source:
<code>protected String velocify(String tpl) { try { StringWriter w = new StringWriter(); Velocity.evaluate(velocityContext, w, "OutgoingEmail", tpl); return w.toString(); } catch(Exception e) { <START> return tpl.toString(); <END> } }</code><technical_language>return template. wrap exception EmailException throw caller. caller handle skipping delivery of email logging failure for administrator</technical_language>

Target:
protected String velocify(String tpl) throws EmailException { try { StringWriter w = new StringWriter(); Velocity.evaluate(velocityContext, w, "OutgoingEmail", tpl); return w.toString(); } catch(Exception e) { throw new EmailException("Velocity template "+ tpl.toString(), e); } }
Source:
<code>public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); newsList = (RecyclerView) view.findViewById(R.id.news_list); <START> newsList.setHasFixedSize(true); <END> LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); newsList.setLayoutManager(layoutManager); dataset = new ArrayList<>(0); newsAdapter = new NewsAdapter(dataset); newsList.setAdapter(newsAdapter); RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST); this.newsList.addItemDecoration(itemDecoration); subscription = stories.subscribe(new Subscriber<List<ItemPOJO>>() { @Override public void onCompleted() { newsAdapter.notifyDataSetChanged(); Log.d("stories", "completed"); } @Override public void onError(Throwable e) { Log.d("stories err", e.toString()); } @Override public void onNext(List<ItemPOJO> itemPOJOs) { Log.d("stories", String.valueOf(itemPOJOs.size())); for (ItemPOJO item : itemPOJOs) { dataset.add(item); } } }); }</code><technical_language>This removed, data dynamic</technical_language>

Target:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); newsList = (RecyclerView) view.findViewById(R.id.news_list); LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); newsList.setLayoutManager(layoutManager); dataset = new ArrayList<>(); newsAdapter = new NewsAdapter(dataset); newsList.setAdapter(newsAdapter); RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST); this.newsList.addItemDecoration(itemDecoration); subscription = stories.subscribe(new Subscriber<List<ItemPOJO>>() { @Override public void onCompleted() { newsAdapter.notifyDataSetChanged(); Log.d("stories", "completed"); } @Override public void onError(Throwable e) { Log.d("stories err", e.toString()); } @Override public void onNext(List<ItemPOJO> itemPOJOs) { Log.d("stories", String.valueOf(itemPOJOs.size())); dataset.addAll(itemPOJOs); } }); }
Source:
<code>private static String getModules(Map<String, ModuleService> modules) { StringBuilder sb = new StringBuilder(String.format("Available Modules:%n")); for(ModuleService entry : modules.values()) { sb.append( <START> String.format(" %-10s - %s", entry.getName(), entry.getDescription()) <END> ); } return sb.toString(); }</code><technical_language>I guess want a new line entry? I see... if want include in errors such, do want description, if want include in usage do need... xxx ERROR Please provide module name. modules: x, y, z xxx --help Usage: .... Modules: x description y description</technical_language>

Target:
private static String getModules(Map<String, ModuleService> modules) { StringBuilder sb = new StringBuilder("Available Modules:"); for(ModuleService entry : modules.values()) { sb.append( String.format("%n %-10s - %s", entry.getName(), entry.getDescription()) ); } return sb.toString(); }
Source:
<code>Loader create(QueryExecutor queryExecutor, String tableName) throws SQLException { List<JDBCType> columnTypes = queryExecutor.executeQuery("SELECT * FROM " + tableName + " LIMIT 1").getColumnTypes(); try { return new BatchLoader(queryExecutor, tableName, columnTypes.size()); } catch (SQLException sqlException) { <START> LOGGER.debug("Unable to insert data with PreparedStatement", sqlException); <END> return new InsertLoader(queryExecutor, tableName, columnTypes); } }</code><technical_language>LOGGER.warn</technical_language>

Target:
Loader create(QueryExecutor queryExecutor, String tableName) throws SQLException { List<JDBCType> columnTypes = queryExecutor.executeQuery("SELECT * FROM " + tableName + " LIMIT 1").getColumnTypes(); try { return new BatchLoader(queryExecutor, tableName, columnTypes.size()); } catch (SQLException sqlException) { LOGGER.warn("Unable to insert data with PreparedStatement", sqlException); return new InsertLoader(queryExecutor, tableName, columnTypes); } }
Source:
<code>private static Timestamp formatBirthDate(Timestamp birthDate, final int dateOnlyLength, PRPAMT201306UV02LivingSubjectBirthTime birthTime) { Timestamp parseBirthDate = birthDate; IVLTSExplicit birthday = birthTime.getValue().get(0); <START> LOG.info("Found birthTime in query parameters = " + birthday.getValue()); <END> UTCDateUtil utcDateUtil = new UTCDateUtil(); if (birthday.getValue().length() == dateOnlyLength) { parseBirthDate = new Timestamp(utcDateUtil.parseDate(birthday.getValue(), UTCDateUtil.DATE_ONLY_FORMAT, null).getTime()); } else if (birthday.getValue().length() > dateOnlyLength) { parseBirthDate = new Timestamp( utcDateUtil.parseDate(birthday.getValue(), UTCDateUtil.DATE_FORMAT_UTC, null).getTime()); } else { LOG.info("message does not contain a valid formatted birthtime"); } return parseBirthDate; }</code><technical_language>parameterized log whenever. log.infor("Found birthTime in query parameters {}, birthday.getValue())",</technical_language>

Target:
private static Timestamp formatBirthDate(Timestamp birthDate, final int dateOnlyLength, PRPAMT201306UV02LivingSubjectBirthTime birthTime) { Timestamp parseBirthDate = birthDate; IVLTSExplicit birthday = birthTime.getValue().get(0); LOG.info("Found birthTime in query parameters ", birthday.getValue()); UTCDateUtil utcDateUtil = new UTCDateUtil(); if (birthday.getValue().length() == dateOnlyLength) { parseBirthDate = new Timestamp(utcDateUtil.parseDate(birthday.getValue(), UTCDateUtil.DATE_ONLY_FORMAT, null).getTime()); } else if (birthday.getValue().length() > dateOnlyLength) { parseBirthDate = new Timestamp( utcDateUtil.parseDate(birthday.getValue(), UTCDateUtil.DATE_FORMAT_UTC, null).getTime()); } else { LOG.info("message does not contain a valid formatted birthtime"); } return parseBirthDate; }
Source:
<code>private boolean initGlusterHost() { glusterHostUuidFound = true; if (GlusterFeatureSupported.glusterHostUuidSupported(getVdsGroup().getcompatibility_version())) { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterHostUUID, new VdsIdVDSCommandParametersBase(getVds().getId())); <START> Guid addServerGlusterUuid = Guid.createGuidFromString((String) returnValue.getReturnValue()); <END> if (returnValue.getSucceeded() && returnValue.getReturnValue() != null) { if (!validateGlusterHostUuid(addServerGlusterUuid)) { glusterHostUuidFound = true; setNonOperational(NonOperationalReason.GLUSTER_HOST_UUID_ALREADY_FOUND, null); return false; } saveGlusterHostUuid(addServerGlusterUuid); } else { glusterHostUuidFound = false; setNonOperational(NonOperationalReason.GLUSTER_HOST_UUID_NOT_FOUND, null); } } return glusterHostUuidFound && initGlusterPeerProcess(); }</code><technical_language>s/addServerGlusterUuid/addedServerUuid/g</technical_language>

Target:
private boolean initGlusterHost() { glusterHostUuidFound = true; if (GlusterFeatureSupported.glusterHostUuidSupported(getVdsGroup().getcompatibility_version())) { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterHostUUID, new VdsIdVDSCommandParametersBase(getVds().getId())); Guid addedServerUuid = Guid.createGuidFromString((String) returnValue.getReturnValue()); if (returnValue.getSucceeded() && returnValue.getReturnValue() != null) { if (!checkIfHostUuidExists(addedServerUuid)) { glusterHostUuidFound = true; setNonOperational(NonOperationalReason.GLUSTER_HOST_UUID_ALREADY_EXISTS, null); return false; } saveGlusterHostUuid(addedServerUuid); } else { glusterHostUuidFound = false; setNonOperational(NonOperationalReason.GLUSTER_HOST_UUID_NOT_FOUND, null); } } return glusterHostUuidFound && initGlusterPeerProcess(); }
Source:
<code>protected SimpleResult compareMetricValues(final Object value1, final Object value2, final String metricName) { boolean equal = true; String description = ""; if (value1 == null || value2 == null) { if (value1 != null || value2 != null) { equal = false; description = "One of the values is null"; } } else { if (value1 instanceof Number) { double numValue1 = ((Number) value1).doubleValue(); double numValue2 = ((Number) value2).doubleValue(); double relativeChange = 0; <START> if ((!Double.isNaN(numValue1)) || (!Double.isNaN(numValue2))) { <END> relativeChange = (numValue1 == 0 && numValue2 == 0) ? 0 : (numValue1 == 0) ? Double.MAX_VALUE : (numValue1 - numValue2) / numValue2; } if (relativeChange != 0) { if (MetricToAllowableRelativeChange.containsKey(metricName)) { double allowableRelativeChange = MetricToAllowableRelativeChange.get(metricName); if (Math.abs(relativeChange) >= allowableRelativeChange) { equal = false; description = "Changed by " + relativeChange + " which is outside of the allowable tolerance of " + allowableRelativeChange; } else { equal = true; description = "Changed by " + relativeChange + " which is within the allowable tolerance of " + allowableRelativeChange; } } else { equal = false; description = "Changed by " + relativeChange; } } } else { if (!value1.equals(value2)) { equal = false; description = ""; } } } return new SimpleResult(equal, description); }</code><technical_language>parens suggestion if (!Double.isNaN(numValue1) || !Double.isNaN(numValue2)) {</technical_language>

Target:
protected SimpleResult compareMetricValues(final Object value1, final Object value2, final String metricName) { boolean equal = true; String description = ""; if (value1 == null || value2 == null) { if (value1 != null || value2 != null) { equal = false; description = "One of the values is null"; } } else { if (value1 instanceof Number) { double numValue1 = ((Number) value1).doubleValue(); double numValue2 = ((Number) value2).doubleValue(); double absoluteChange = 0; if (!Double.isNaN(numValue1) || !Double.isNaN(numValue2)) { absoluteChange = numValue2 - numValue1; } if (absoluteChange != 0) { double relativeChange = numValue1 == 0 ? Double.MAX_VALUE : absoluteChange / numValue1; if (MetricToAllowableRelativeChange.containsKey(metricName)) { double allowableRelativeChange = MetricToAllowableRelativeChange.get(metricName); if (Math.abs(relativeChange) >= allowableRelativeChange) { equal = false; description = "Changed by " + absoluteChange + " (relative change of " + relativeChange + ") which is outside of the allowable relative change tolerance of " + allowableRelativeChange; } else { equal = true; description = "Changed by " + absoluteChange + " (relative change of " + relativeChange + ") which is within the allowable relative change tolerance of " + allowableRelativeChange; } } else { equal = false; description = "Changed by " + absoluteChange + " (relative change of " + relativeChange + ")"; } } } else { if (!value1.equals(value2)) { equal = false; description = ""; } } } return new SimpleResult(equal, description); }
Source:
<code>public boolean matches(RelOptRuleCall call) { TableConfig config = call.getPlanner().getContext().unwrap(FlinkContext.class).getTableConfig(); if (!config.getConfiguration().getBoolean( OptimizerConfigOptions.TABLE_OPTIMIZER_SOURCE_PREDICATE_PUSHDOWN_ENABLED)) { return false; } Filter filter = call.rel(0); if (filter.getCondition() == null) { return false; } LogicalTableScan scan = call.rel(1); TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class); return tableSourceTable != null && tableSourceTable.tableSource() instanceof SupportsFilterPushDown <START> && !Arrays.stream(tableSourceTable.extraDigests()).anyMatch(str -> str.contains("filter")); <END> }</code><technical_language>if a table a field named filter ? str.startWith("filter=[")</technical_language>

Target:
public boolean matches(RelOptRuleCall call) { TableConfig config = call.getPlanner().getContext().unwrap(FlinkContext.class).getTableConfig(); if (!config.getConfiguration().getBoolean( OptimizerConfigOptions.TABLE_OPTIMIZER_SOURCE_PREDICATE_PUSHDOWN_ENABLED)) { return false; } Filter filter = call.rel(0); if (filter.getCondition() == null) { return false; } LogicalTableScan scan = call.rel(1); TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class); return tableSourceTable != null && tableSourceTable.tableSource() instanceof SupportsFilterPushDown && !Arrays.stream(tableSourceTable.extraDigests()).anyMatch(str -> str.startsWith("filter=[")); }
Source:
<code>public void handleEvent(Event event) { Object element = event.getProperty(IEventBroker.DATA); if (!(element instanceof MApplication)) { return; } for (MWindow window : ((MApplication) element).getChildren()) { <START> CSSEngine engine = getEngine(window); <END> if (engine != null) { invalidateResourcesInRegistry(engine.getResourcesRegistry()); engine.reapply(); } } }</code><technical_language>Is more CSSEngine for application? I thought one, want do invalidate re-apply (not workbench window)</technical_language>

Target:
public void handleEvent(Event event) { Object element = event.getProperty(IEventBroker.DATA); if (!(element instanceof MApplication)) { return; } List<Object> unusedResources = new ArrayList<Object>(); Set<IResourcesRegistry> processedRegistries = new HashSet<IResourcesRegistry>(); for (MWindow window : ((MApplication) element).getChildren()) { CSSEngine engine = getEngine(window); if (engine != null) { IResourcesRegistry registry = engine.getResourcesRegistry(); if (!processedRegistries.contains(registry)) { unusedResources.addAll(removeResources(registry)); processedRegistries.add(registry); } engine.reapply(); } } for (Object resource : unusedResources) { disposeResource(resource); } }
Source:
<code>public void removeDroneConfiguration(InjectionPoint<?> injectionPoint) { DronePair<?, ?> pair = dronePairMap.get(injectionPoint); if (pair == null) { <START> LOGGER.warning("Injection point doesn't exist!"); <END> return; } if (pair.getDroneCallable() != null) { LOGGER.warning("Drone is still set, but you won't be able to access it anymore!"); } if (pair.getConfiguration() == null) { LOGGER.warning("Couldn't remove configuration, because it wasn't set!"); } pair.setConfiguration(null); dronePairMap.remove(injectionPoint); }</code><technical_language>Useless log. anything</technical_language>

Target:
public void removeDroneConfiguration(InjectionPoint<?> injectionPoint) { DronePair<?, ?> pair = dronePairMap.get(injectionPoint); if (pair == null) { LOGGER.log(Level.WARNING, "Couldn''t remove configuration, because the injection point wasn''t prepared. " + "Injection point: {0}", injectionPoint); return; } if (pair.getDroneCallable() != null) { LOGGER.log(Level.WARNING, "Drone is still set, but you won''t be able to access it anymore! Injection " + "point: {0}", injectionPoint); } if (pair.getConfiguration() == null) { LOGGER.log(Level.WARNING, "Couldn''t remove configuration, because it wasn''t set! Injection point: {0}", injectionPoint); } pair.setConfiguration(null); dronePairMap.remove(injectionPoint); }
Source:
<code>public NakadiCursor convert(final String eventTypeStr, final Cursor cursor) throws InternalNakadiException, NoSuchEventTypeException, InvalidCursorException { final String orderStr = cursor.getOffset().substring( <START> NakadiCursor.VERSION_LENGTH, NakadiCursor.VERSION_LENGTH + TIMELINE_ORDER_LENGTH); <END> final int order = Integer.parseInt(orderStr, TIMELINE_ORDER_BASE); final List<Timeline> timelines = eventTypeCache.getTimelines(eventTypeStr); final EventType eventType = eventTypeCache.getEventType(eventTypeStr); final String realOffset = cursor.getOffset().substring(NakadiCursor.VERSION_LENGTH + TIMELINE_ORDER_LENGTH); if (timelines.isEmpty()) { Preconditions.checkArgument( order == (Timeline.STARTING_ORDER + 1), "Fallback supported only for order next after initial"); return new NakadiCursor( timelineService.getFakeTimeline(eventType), cursor.getPartition(), StringUtils.leftPad(realOffset, VersionZeroConverter.VERSION_ZERO_MIN_OFFSET_LENGTH, '0') ); } final Timeline timeline = timelines.stream() .filter(t -> t.getOrder().equals(order)) .findAny() .orElseThrow(() -> new InvalidCursorException(CursorError.UNAVAILABLE)); return new NakadiCursor( timeline, cursor.getPartition(), realOffset); }</code><technical_language>do handle "BEGIN" here</technical_language>

Target:
public NakadiCursor convert(final String eventTypeStr, final Cursor cursor) throws InternalNakadiException, NoSuchEventTypeException, InvalidCursorException { final String[] parts = cursor.getOffset().split("-", 3); if (parts.length != 3) { throw new InvalidCursorException(CursorError.INVALID_OFFSET); } final String versionStr = parts[0]; if (versionStr.length() != NakadiCursor.VERSION_LENGTH) { throw new InvalidCursorException(CursorError.INVALID_OFFSET); } final String orderStr = parts[1]; if (orderStr.length() != TIMELINE_ORDER_LENGTH) { throw new InvalidCursorException(CursorError.INVALID_OFFSET); } final String offsetStr = parts[2]; if (offsetStr.isEmpty()) { throw new InvalidCursorException(CursorError.INVALID_OFFSET); } final int order; try { order = Integer.parseInt(orderStr, TIMELINE_ORDER_BASE); } catch (final NumberFormatException ex) { throw new InvalidCursorException(CursorError.INVALID_OFFSET); } final List<Timeline> timelines = eventTypeCache.getTimelinesOrdered(eventTypeStr); final EventType eventType = eventTypeCache.getEventType(eventTypeStr); if (timelines.isEmpty()) { Preconditions.checkArgument( order == (Timeline.STARTING_ORDER + 1), "Fallback supported only for order next after initial"); return new NakadiCursor( timelineService.getFakeTimeline(eventType), cursor.getPartition(), StringUtils.leftPad(offsetStr, VersionZeroConverter.VERSION_ZERO_MIN_OFFSET_LENGTH, '0') ); } final Timeline timeline = timelines.stream() .filter(t -> t.getOrder().equals(order)) .findAny() .orElseThrow(() -> new InvalidCursorException(CursorError.UNAVAILABLE)); return new NakadiCursor( timeline, cursor.getPartition(), offsetStr); }
Source:
<code>static Command createCustomer() { final LocalDate localDate = LocalDates.now(); final CustomerId customerId = CustomerId.newBuilder() .setRegistrationDate(localDate) .setNumber(customerNumber) .build(); customerNumber++; <START> final Message msg = <END> CreateCustomer.newBuilder() .setCustomerId(customerId) .setCustomer(Customer.newBuilder() .setId(customerId) .setName(PersonName.newBuilder() .setGivenName("Kreat") .setFamilyName( "C'Ustomer") .setHonorificSuffix( "Cmd"))) .build(); final UserId userId = newUserId(Identifiers.newUuid()); final Command result = create(msg, userId, getCurrentTime()); return result; }</code><technical_language>adjust formatting :)</technical_language>

Target:
static Command createCustomer() { final LocalDate localDate = LocalDates.now(); final CustomerId customerId = CustomerId.newBuilder() .setRegistrationDate(localDate) .setNumber(customerNumber.get()) .build(); customerNumber.incrementAndGet(); final PersonName personName = PersonName.newBuilder() .setGivenName("Kreat") .setFamilyName("C'Ustomer") .setHonorificSuffix("Cmd") .build(); final Customer customer = Customer.newBuilder() .setId(customerId) .setName(personName) .build(); final Message msg = CreateCustomer.newBuilder() .setCustomerId(customerId) .setCustomer(customer) .build(); final UserId userId = newUserId(Identifiers.newUuid()); final Command result = create(msg, userId, getCurrentTime()); return result; }
Source:
<code>public ToggleDebugKeyValueCommand(IServerWorkingCopy server, Button useImageDebugPortKeyButton, SelectionListener toggleListener, Text debugPortKeyText, ModifyListener keyModifier, Text debugPortText, ModifyListener valModifier) { super(server, "Enable Debugging"); this.wc = server; this.useImageDebugPortKeyButton = useImageDebugPortKeyButton; this.toggleListener = toggleListener; this.debugPortKeyText = debugPortKeyText; this.debugPortText = debugPortText; this.keyModifier = keyModifier; this.valModifier = valModifier; preSelected = !useImageDebugPortKeyButton.getSelection(); preKey = debugPortKeyText.getText(); <START> preVal = debugPortText.getText(); <END> }</code><technical_language>mixing this/no this</technical_language>

Target:
public ToggleDebugKeyValueCommand(IServerWorkingCopy server, Button useImageDebugPortKeyButton, SelectionListener toggleListener, Text debugPortKeyText, ModifyListener keyModifier, Text debugPortText, ModifyListener valModifier) { super(server, "Enable Debugging"); this.wc = server; this.useImageDebugPortKeyButton = useImageDebugPortKeyButton; this.toggleListener = toggleListener; this.debugPortKeyText = debugPortKeyText; this.debugPortText = debugPortText; this.keyModifier = keyModifier; this.valModifier = valModifier; this.preSelected = !useImageDebugPortKeyButton.getSelection(); this.preKey = debugPortKeyText.getText(); this.preVal = debugPortText.getText(); }
Source:
<code>private boolean checkAndDisableCLIScheduler() { GlusterVolumeEntity metaVolume = getGlusterVolumeDao().getByName(getVdsGroupId(), Config.<String> getValue(ConfigValues.GlusterMetaVolumeName)); VDSGroup cluster = getVdsGroup(); <START> if (metaVolume != null && cluster.isGlusterCliBasedSchedulingOn()) { <END> VdcReturnValueBase returnValue = runInternalAction(VdcActionType.DisableGlusterCliSnapshotScheduleInternal, new DisableGlusterCliSnapshotScheduleParameters(getGlusterVolumeId(), true)); return returnValue.getSucceeded(); } return true; }</code><technical_language>lines extracted a separate method avoid repetition</technical_language>

Target:
private boolean checkAndDisableCLIScheduler() { VDSGroup cluster = getVdsGroup(); if (getMetaVolume() != null && cluster.isGlusterCliBasedSchedulingOn()) { VdcReturnValueBase returnValue = runInternalAction(VdcActionType.DisableGlusterCliSnapshotScheduleInternal, new DisableGlusterCliSnapshotScheduleParameters(getGlusterVolumeId(), true)); return returnValue.getSucceeded(); } return true; }