auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onGroupRebalanceFinished(int grpId) { Set<Integer> groupsToEnable = tmpDisabledWal.enable(grpId); if (F.isEmpty(groupsToEnable)) return; <START> grpId = groupsToEnable.stream().findFirst().get(); <END> CacheGroupContext grp = cctx.cache().cacheGroup(grpId); assert grp != null: "Can not find group with id: " + grpId; AffinityTopologyVersion lastGroupTop = grp.topology().readyTopologyVersion(); CheckpointProgress cpFut = triggerCheckpoint("wal-local-state-changed-rebalance-finished-" + lastGroupTop); assert cpFut != null; cpFut.futureFor(FINISHED).listen(new IgniteInClosureX<IgniteInternalFuture>() { @Override public void applyx(IgniteInternalFuture future) { if (X.hasCause(future.error(), NodeStoppingException.class)) return; for (Integer grpId0 : groupsToEnable) { try { cctx.database().walEnabled(grpId0, true, true); } catch (Exception e) { if (!X.hasCause(e, NodeStoppingException.class)) throw e; } CacheGroupContext grp = cctx.cache().cacheGroup(grpId0); if (grp != null) grp.topology().ownMoving(lastGroupTop); else if (log.isDebugEnabled()) log.debug("Cache group was destroyed before checkpoint finished, [grpId=" + grpId0 + ']'); } if (log.isDebugEnabled()) log.debug("Refresh partitions due to rebalance finished"); cctx.exchange().refreshPartitions(); } }); }</code><technical_language>replaced grpId = F.first(groupsToEnable);</technical_language>

Target:
public void onGroupRebalanceFinished(int grpId) { Set<Integer> groupsToEnable = tmpDisabledWal.enable(grpId); if (F.isEmpty(groupsToEnable)) return; grpId = F.first(groupsToEnable); CacheGroupContext grp = cctx.cache().cacheGroup(grpId); assert grp != null : "Can not find group with id: " + grpId; AffinityTopologyVersion lastGroupTop = grp.topology().readyTopologyVersion(); CheckpointProgress cpFut = triggerCheckpoint("wal-local-state-changed-rebalance-finished-" + lastGroupTop); assert cpFut != null; cpFut.futureFor(FINISHED).listen(new IgniteInClosureX<IgniteInternalFuture>() { @Override public void applyx(IgniteInternalFuture future) { if (X.hasCause(future.error(), NodeStoppingException.class)) return; for (Integer grpId0 : groupsToEnable) { try { cctx.database().walEnabled(grpId0, true, true); } catch (Exception e) { if (!X.hasCause(e, NodeStoppingException.class)) throw e; } CacheGroupContext grp = cctx.cache().cacheGroup(grpId0); if (grp != null) grp.topology().ownMoving(lastGroupTop); else if (log.isDebugEnabled()) log.debug("Cache group was destroyed before checkpoint finished, [grpId=" + grpId0 + ']'); } if (log.isDebugEnabled()) log.debug("Refresh partitions due to rebalance finished"); cctx.exchange().refreshPartitions(); } }); }
Source:
<code><START> void integrationTestTexGroup() throws IOException, ParseException { <END> ParserResult result = parser.parse(new StringReader( "@comment{jabref-meta: grouping:" + OS.NEWLINE + "0 AllEntriesGroup:;" + OS.NEWLINE + "1 TexGroup:cited entries\\;0\\;paper.aux\\;1\\;0x8a8a8aff\\;\\;\\;;" + "}" + OS.NEWLINE + "@Comment{jabref-meta: databaseType:biblatex;}" + OS.NEWLINE + "@Comment{jabref-meta: fileDirectory:src/test/resources/org/jabref/model/groups;}" + OS.NEWLINE + "@Comment{jabref-meta: fileDirectory-" + System.getProperty("user.name") + "-" + InetAddress.getLocalHost().getHostName() + ":src/test/resources/org/jabref/model/groups;}" + OS.NEWLINE + "@Comment{jabref-meta: fileDirectoryLatex-" + System.getProperty("user.name") + "-" + InetAddress.getLocalHost().getHostName() + ":src/test/resources/org/jabref/model/groups;}" + OS.NEWLINE )); GroupTreeNode root = result.getMetaData().getGroups().get(); assertEquals("src/test/resources/org/jabref/model/groups/paper.aux", ((TexGroup) root.getChildren().get(0).getGroup()).getFilePath().toString()); }</code><technical_language>suggestion void integrationTestTexGroup() throws Exception { convention Exception is thrown tests</technical_language>

Target:
void integrationTestTexGroup() throws Exception { ParserResult result = parser.parse(new StringReader( "@comment{jabref-meta: grouping:" + OS.NEWLINE + "0 AllEntriesGroup:;" + OS.NEWLINE + "1 TexGroup:cited entries\\;0\\;paper.aux\\;1\\;0x8a8a8aff\\;\\;\\;;" + "}" + OS.NEWLINE + "@Comment{jabref-meta: databaseType:biblatex;}" + OS.NEWLINE + "@Comment{jabref-meta: fileDirectory:src/test/resources/org/jabref/model/groups;}" + OS.NEWLINE + "@Comment{jabref-meta: fileDirectory-" + System.getProperty("user.name") + "-" + InetAddress.getLocalHost().getHostName() + ":src/test/resources/org/jabref/model/groups;}" + OS.NEWLINE + "@Comment{jabref-meta: fileDirectoryLatex-" + System.getProperty("user.name") + "-" + InetAddress.getLocalHost().getHostName() + ":src/test/resources/org/jabref/model/groups;}" + OS.NEWLINE )); GroupTreeNode root = result.getMetaData().getGroups().get(); assertEquals("src/test/resources/org/jabref/model/groups/paper.aux", ((TexGroup) root.getChildren().get(0).getGroup()).getFilePath().toString()); }
Source:
<code>public void setDefaultGroupStore(AccountStore accountStore) { AccountStoreMappingList accountStoreMappingList = getAccountStoreMappings(); boolean needToCreateNewStore = true; for (AccountStoreMapping accountStoreMapping : accountStoreMappingList) { if (accountStoreMapping.getAccountStore().getHref().equals(accountStore.getHref())) { needToCreateNewStore = false; accountStoreMapping.setDefaultGroupStore(true); setProperty(DEFAULT_GROUP_STORE_MAPPING, accountStoreMapping); accountStoreMapping.save(); break; } } if (needToCreateNewStore) { AccountStoreMapping mapping = addAccountStore(accountStore); mapping.setDefaultGroupStore(true); setProperty(DEFAULT_GROUP_STORE_MAPPING, mapping); mapping.save(); } this.save(); <START> } <END></code><technical_language>I methods (setDefault*Store) is setting account store. This is methods "setters" persist Stormpath get out of sync if user calls _application.save()_. Also, override _save_ method update create account store mapping. This work expected user calls _application.save()_ happen moment of executing method</technical_language>

Target:
public void setDefaultGroupStore(AccountStore accountStore) { AccountStoreMappingList accountStoreMappingList = getAccountStoreMappings(); boolean needToCreateNewStore = true; for (AccountStoreMapping accountStoreMapping : accountStoreMappingList) { if (accountStoreMapping.getAccountStore().getHref().equals(accountStore.getHref())) { needToCreateNewStore = false; accountStoreMapping.setDefaultGroupStore(true); accountStoreMapping.save(); setProperty(DEFAULT_GROUP_STORE_MAPPING, accountStoreMapping); break; } } if (needToCreateNewStore) { AccountStoreMapping mapping = addAccountStore(accountStore); mapping.setDefaultGroupStore(true); mapping.save(); setProperty(DEFAULT_GROUP_STORE_MAPPING, mapping); } save(); }
Source:
<code><START> public void initiate(VeluxBridge bridge) { <END> logger.trace("retrieve() called."); CheckLostNodes bcp = bridge.bridgeAPI().checkLostNodes(); if ((bridge.bridgeCommunicate(bcp)) && (bcp.isCommunicationSuccessful())) { logger.trace("retrieve() finished successfully."); } else { logger.trace("retrieve() finished with failure."); } return; }</code><technical_language>public methods deprecated, removed</technical_language>

Target:
public void initiate(VeluxBridge bridge) { logger.trace("initiate() called."); CheckLostNodes bcp = bridge.bridgeAPI().checkLostNodes(); if (bridge.bridgeCommunicate(bcp) && bcp.isCommunicationSuccessful()) { logger.trace("initiate() finished successfully."); } else { logger.trace("initiate() finished with failure."); } return; }
Source:
<code>private void closeConnections() { int numThreads = connections.size() + 2; ExecutorService executor = Executors.newFixedThreadPool(numThreads, new ThreadFactoryBuilder().setDaemon(true).setNameFormat("connection-close-%d").build()); CompletionService<Void> completionService = new ExecutorCompletionService<>(executor); try { connections.stream().forEach(connection -> completionService.submit(() -> { try { if (connection != null && !connection.isClosed()) connection.close(); <START> } catch (SQLException e) { <END> } return null; })); int futures = 0; while(futures++ < connections.size()) { Future<Void> future = completionService.poll(10, TimeUnit.SECONDS); if (future == null) throw new TimeoutException(); future.get(); } return; } catch (InterruptedException e) { LOG.error("Interrupted while closing", e); Thread.currentThread().interrupt(); } catch (TimeoutException | ExecutionException e) { LOG.warn("Couldn't close gracefully", e); for(Connection connection : connections) { try { if (connection != null && !connection.isClosed()) { LOG.info("Aborting " + connection); connection.abort(executor); } } catch (SQLException sqle) { LOG.error("Couldn't abort connection", sqle); } } } finally { executor.shutdown(); try { if (!executor.awaitTermination(30, TimeUnit.SECONDS)) { executor.shutdownNow(); } } catch (InterruptedException e) { } } }</code><technical_language>sense log this exception</technical_language>

Target:
private void closeConnections() { try { List<Callable<Void>> callables = connections.stream().map(connection -> (Callable<Void>) () -> { try { if (connection != null && !connection.isClosed()) connection.close(); } catch (SQLException e) { LOG.error("Exception while closing connection", e); } return null; }).collect(Collectors.toList()); List<Future<Void>> results = executor.invokeAll(callables, 10, TimeUnit.SECONDS); List<Future<Void>> stillRunning = results.stream().filter(f -> f.isCancelled() || !f.isDone()).collect(Collectors.toList()); if (stillRunning.isEmpty()) { return; } stillRunning.stream().forEach(f -> f.cancel(true)); } catch (InterruptedException e) { LOG.error("Interrupted while closing", e); Thread.currentThread().interrupt(); } catch (Exception e) { LOG.warn("Exception while closing gracefully", e); } LOG.warn("Some tasks still running, aborting connections"); for(Connection connection : connections) { try { if (connection != null && !connection.isClosed()) { LOG.info("Aborting " + connection); connection.abort(executor); } } catch (SQLException sqle) { LOG.error("Couldn't abort connection", sqle); } } }
Source:
<code>public Exchange<T> call() throws IOException { Kryo readSerde = new Kryo(); readSerde.setClassLoader(classLoader); Map<Object, T> bucketDataPerWindow = Maps.newHashMap(); Path dataFile = new Path(bucketRoot + PATH_SEPARATOR + window); FileSystem fs = FileSystem.newInstance(dataFile.toUri(), configuration); try { if(fs.exists(dataFile)){ FSDataInputStream stream = fs.open(dataFile); stream.seek(bucketPositions[bucketIdx].get(window)); Input input = new Input(stream); <START> int length = stream.readInt(); <END> for (int i = 0; i < length; i++) { Object key = readSerde.readObject(input, eventKeyClass); int partitionKey = key.hashCode() & partitionMask; boolean keyPasses = partitionKeys.contains(partitionKey); if (!writeEventKeysOnly) { int entrySize = input.readInt(); if (keyPasses) { T entry = readSerde.readObject(input, eventClass); bucketDataPerWindow.put(key, entry); } else { input.skip(entrySize); } } else if (keyPasses) { bucketDataPerWindow.put(key, null); } } input.close(); stream.close(); } } finally { fs.close(); } return new Exchange<T>(window, bucketDataPerWindow); }</code><technical_language>Check if this is a tab. Reformat if required</technical_language>

Target:
public Exchange<T> call() throws IOException { Kryo readSerde = new Kryo(); readSerde.setClassLoader(classLoader); Map<Object, T> bucketDataPerWindow = Maps.newHashMap(); Path dataFile = new Path(bucketRoot + PATH_SEPARATOR + window); FileSystem fs = FileSystem.newInstance(dataFile.toUri(), configuration); try { FSDataInputStream stream = fs.open(dataFile); stream.seek(bucketPositions[bucketIdx].get(window)); Input input = new Input(stream); int length = stream.readInt(); for (int i = 0; i < length; i++) { Object key = readSerde.readObject(input, eventKeyClass); int partitionKey = key.hashCode() & partitionMask; boolean keyPasses = partitionKeys.contains(partitionKey); if (!writeEventKeysOnly) { int entrySize = input.readInt(); if (keyPasses) { T entry = readSerde.readObject(input, eventClass); bucketDataPerWindow.put(key, entry); } else { input.skip(entrySize); } } else if (keyPasses) { bucketDataPerWindow.put(key, null); } } input.close(); stream.close(); } finally { fs.close(); } return new Exchange<T>(window, bucketDataPerWindow); }
Source:
<code>public void rememberExternalLibTimestamps() { IBuildpathEntry[] buildpath = this.resolvedBuildpath; if (buildpath == null) return; Map<IPath, Long> externalTimeStamps = ModelManager .getModelManager().deltaState.getExternalLibTimeStamps(); for (int i = 0, length = buildpath.length; i < length; i++) { IBuildpathEntry entry = buildpath[i]; if (entry.getEntryKind() == IBuildpathEntry.BPE_LIBRARY) { IPath path = entry.getPath(); if (externalTimeStamps.get(path) == null) { Object target = Model.getTarget(ResourcesPlugin .getWorkspace().getRoot(), path, true); if (target instanceof IFileHandle) { long timestamp = DeltaProcessor .getTimeStamp((IFileHandle) target); externalTimeStamps.put(path, Long.valueOf(timestamp)); } } } } Map<IPath, Long> customTimeStamps = ModelManager.getModelManager().deltaState .getCustomTimeStamps(); try { IScriptProject scriptProject = DLTKCore.create(project); IProjectFragment[] fragments = scriptProject .getAllProjectFragments(); for (int i = 0; i < fragments.length; i++) { if (fragments[i] instanceof IProjectFragmentTimestamp) { IProjectFragmentTimestamp stamp = (IProjectFragmentTimestamp) fragments[i]; long timeStamp = stamp.getTimeStamp(); <START> customTimeStamps.put(fragments[i].getPath(), Long.valueOf( <END> timeStamp)); } } } catch (ModelException e) { if (DLTKCore.DEBUG) { e.printStackTrace(); } } }</code><technical_language>needed for timestamp</technical_language>

Target:
public void rememberExternalLibTimestamps() { IBuildpathEntry[] buildpath = this.resolvedBuildpath; if (buildpath == null) return; Map<IPath, Long> externalTimeStamps = ModelManager .getModelManager().deltaState.getExternalLibTimeStamps(); for (int i = 0, length = buildpath.length; i < length; i++) { IBuildpathEntry entry = buildpath[i]; if (entry.getEntryKind() == IBuildpathEntry.BPE_LIBRARY) { IPath path = entry.getPath(); if (externalTimeStamps.get(path) == null) { Object target = Model.getTarget(ResourcesPlugin .getWorkspace().getRoot(), path, true); if (target instanceof IFileHandle) { long timestamp = DeltaProcessor .getTimeStamp((IFileHandle) target); externalTimeStamps.put(path, new Long(timestamp)); } } } } Map<IPath, Long> customTimeStamps = ModelManager.getModelManager().deltaState .getCustomTimeStamps(); try { IScriptProject scriptProject = DLTKCore.create(project); IProjectFragment[] fragments = scriptProject .getAllProjectFragments(); for (int i = 0; i < fragments.length; i++) { if (fragments[i] instanceof IProjectFragmentTimestamp) { IProjectFragmentTimestamp stamp = (IProjectFragmentTimestamp) fragments[i]; long timeStamp = stamp.getTimeStamp(); customTimeStamps.put(fragments[i].getPath(), new Long( timeStamp)); } } } catch (ModelException e) { if (DLTKCore.DEBUG) { e.printStackTrace(); } } }
Source:
<code>public void testUnmarshalSeralizedObjectInvalidByteArray() throws Exception { AttributeAdapter attributeAdapter = getObjectAttributeAdapter(); ObjectElement mockObjectElement = mock(ObjectElement.class); doReturn("name").when(mockObjectElement).getName(); doReturn(ImmutableList.of(new byte[] {-31, 0, 0, 0})).when(mockObjectElement).getValue(); Attribute result = attributeAdapter.unmarshal(mockObjectElement); <START> assertThat("Unmarshalled byte array not returned", result.getValue() instanceof byte[]); <END> }</code><technical_language>suggestion assertThat("Unmarshalled byte array returned", result.getValue(), is(instanceOf(byte[])));</technical_language>

Target:
public void testUnmarshalSeralizedObjectInvalidByteArray() throws Exception { AttributeAdapter attributeAdapter = getObjectAttributeAdapter(); ObjectElement mockObjectElement = mock(ObjectElement.class); doReturn("name").when(mockObjectElement).getName(); doReturn(ImmutableList.of(new byte[] {-31, 0, 0, 0})).when(mockObjectElement).getValue(); Attribute result = attributeAdapter.unmarshal(mockObjectElement); assertThat( "Unmarshalled byte array not returned", result.getValue(), is(instanceOf(byte[].class))); }
Source:
<code>public void setMonitorEventTypes(String monitorEventTypes) { HazelcastIntegrationDefinitionValidator.validateEnumType( ClusterMonitorType.class, monitorEventTypes); final Set<String> monitorTypes = StringUtils <START> .commaDelimitedListToSet(monitorEventTypes); <END> Assert.notEmpty(monitorTypes, "'monitorTypes' must have elements"); this.monitorTypes = monitorTypes; }</code><technical_language>I validate... method return Set<ClusterMonitorType> avoiding double commaDelimitedListToSet call. In addition I add vararg methods for Java Config convenience. done in separate JIRA</technical_language>

Target:
public void setMonitorEventTypes(String monitorEventTypes) { final Set<String> monitorTypes = HazelcastIntegrationDefinitionValidator.validateEnumType( ClusterMonitorType.class, monitorEventTypes); Assert.notEmpty(monitorTypes, "'monitorTypes' must have elements"); this.monitorTypes = monitorTypes; }
Source:
<code>public static <V> V runLocked(final Callable<V> callable, final InterProcessLock lock) throws Exception { try { lock.acquire(); <START> return callable.call(); <END> } finally { try { lock.release(); } catch (final Exception e) { LOG.warn("Error occurred when releasing ZK lock", e); } } }</code><technical_language>lock.acure(); of try section</technical_language>

Target:
public static <V> V runLocked(final Callable<V> callable, final InterProcessLock lock) throws Exception { lock.acquire(); try { return callable.call(); } finally { try { lock.release(); } catch (final Exception e) { LOG.warn("Error occurred when releasing ZK lock", e); } } }
Source:
<code>private void writeNumericBinary(BigDecimal value) throws IOException { int weight = 0; List<Integer> groups = new ArrayList<>(); int scale = value.scale(); int signum = value.signum(); if (signum != 0) { BigInteger[] unscaled = new BigInteger[] {value.unscaledValue()}; if (signum < 0) { unscaled[0] = unscaled[0].negate(); } weight = -scale / MAX_GROUP_SCALE - 1; int remainder = 0; int scaleChunk = scale % MAX_GROUP_SCALE; if (scaleChunk > 0) { remainder = divide(unscaled, POWERS10[scaleChunk]) * POWERS10[MAX_GROUP_SCALE - scaleChunk]; if (remainder != 0) { weight--; } } if (remainder == 0) { while ((remainder = divide(unscaled, MAX_GROUP_SIZE)) == 0) { weight++; } } groups.add(remainder); while (unscaled[0].signum() != 0) { groups.add(divide(unscaled, MAX_GROUP_SIZE)); } } <START> writeInt(8 + groups.size() * 2); writeShort(groups.size()); writeShort(groups.size() + weight); <END> writeShort(signum < 0 ? 16384 : 0); writeShort(scale); for (int i = groups.size() - 1; i >= 0; i--) { writeShort(groups.get(i)); } }</code><technical_language>groups.size() extracted a new variable</technical_language>

Target:
private void writeNumericBinary(BigDecimal value) throws IOException { int weight = 0; List<Integer> groups = new ArrayList<>(); int scale = value.scale(); int signum = value.signum(); if (signum != 0) { BigInteger[] unscaled = {null}; if (scale < 0) { unscaled[0] = value.setScale(0).unscaledValue(); scale = 0; } else { unscaled[0] = value.unscaledValue(); } if (signum < 0) { unscaled[0] = unscaled[0].negate(); } weight = -scale / MAX_GROUP_SCALE - 1; int remainder = 0; int scaleChunk = scale % MAX_GROUP_SCALE; if (scaleChunk > 0) { remainder = divide(unscaled, POWERS10[scaleChunk]) * POWERS10[MAX_GROUP_SCALE - scaleChunk]; if (remainder != 0) { weight--; } } if (remainder == 0) { while ((remainder = divide(unscaled, MAX_GROUP_SIZE)) == 0) { weight++; } } groups.add(remainder); while (unscaled[0].signum() != 0) { groups.add(divide(unscaled, MAX_GROUP_SIZE)); } } int groupCount = groups.size(); if (groupCount + weight > Short.MAX_VALUE || scale > Short.MAX_VALUE) { throw DbException.get(ErrorCode.NUMERIC_VALUE_OUT_OF_RANGE_1, value.toString()); } writeInt(8 + groupCount * 2); writeShort(groupCount); writeShort(groupCount + weight); writeShort(signum < 0 ? 16384 : 0); writeShort(scale); for (int i = groupCount - 1; i >= 0; i--) { writeShort(groups.get(i)); } }
Source:
<code>public void testPurchase() throws Exception { final Account accountData = TestUtils.createRandomAccount(); final BillingInfo billingInfoData = TestUtils.createRandomBillingInfo(); final Adjustments adjustmentsData = new Adjustments(); final Adjustment adjustmentData = TestUtils.createRandomAdjustment(); adjustmentData.setCurrency(null); adjustmentsData.add(adjustmentData); billingInfoData.setAccount(null); accountData.setBillingInfo(billingInfoData); try { final Purchase purchaseData = new Purchase(); purchaseData.setAccount(accountData); purchaseData.setAdjustments(adjustmentsData); purchaseData.setCollectionMethod("automatic"); purchaseData.setAdjustments(adjustmentsData); purchaseData.setCurrency("USD"); final Invoice invoice = recurlyClient.purchase(purchaseData); Assert.assertEquals(invoice.getLineItems().get(0).getProductCode(), adjustmentData.getProductCode()); } catch (Exception e) { <START> System.out.println(e.getMessage()); <END> System.out.println(e.getStackTrace()); } finally { recurlyClient.closeAccount(accountData.getAccountCode()); } }</code><technical_language>Nit: throw exception instead? TestNG report stacktrace</technical_language>

Target:
public void testPurchase() throws Exception { final Account accountData = TestUtils.createRandomAccount(); final BillingInfo billingInfoData = TestUtils.createRandomBillingInfo(); final Adjustments adjustmentsData = new Adjustments(); final Adjustment adjustmentData = TestUtils.createRandomAdjustment(); adjustmentData.setCurrency(null); adjustmentsData.add(adjustmentData); billingInfoData.setAccount(null); accountData.setBillingInfo(billingInfoData); try { final Purchase purchaseData = new Purchase(); purchaseData.setAccount(accountData); purchaseData.setAdjustments(adjustmentsData); purchaseData.setCollectionMethod("automatic"); purchaseData.setAdjustments(adjustmentsData); purchaseData.setCurrency("USD"); final Invoice invoice = recurlyClient.purchase(purchaseData); Assert.assertEquals(invoice.getLineItems().get(0).getProductCode(), adjustmentData.getProductCode()); } finally { recurlyClient.closeAccount(accountData.getAccountCode()); } }
Source:
<code>public Values(Object... vals) { super(vals != null ? vals.length : 0); <START> if (vals != null && vals.length != 0 ) { <END> for (Object o : vals) { add(o); } } else { add(null); } }</code><technical_language>vals.length != 0 removed in this condition, condition for else statement vals == null || vals.length == 0, Values(List()) else statement out of Values(null) instead of element</technical_language>

Target:
public Values(Object... vals) { super(vals != null ? vals.length : 1); if (vals != null ) { for (Object o : vals) { add(o); } } else { add(null); } }
Source:
<code>public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); try { response = urlopen.open("<LINK_0>"+((int)(System.currentTimeMillis() / 1000L))); Matcher matcher = reAccounts.matcher(response); int accId = 1; while (matcher.find()) { Account account = new Account(Html.fromHtml(matcher.group(1)).toString().trim(), Helpers.parseBalance(matcher.group(2)), ""+accId); account.setCurrency(matcher.group(3).trim()); accounts.add(account); accId++; } matcher = reBalance.matcher(response); if (matcher.find()) { balance = Helpers.parseBalance(matcher.group(1)); currency = matcher.group(2).trim(); if (accounts.isEmpty()) { Account account = new Account(currency, balance, "1"); account.setCurrency(currency); accounts.add(account); } } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } <START> } finally { <END> super.updateComplete(); } }</code><technical_language>remove finally {</technical_language>

Target:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); response = urlopen.open("<LINK_0>"+((int)(System.currentTimeMillis() / 1000L))); Matcher matcher = reAccounts.matcher(response); int accId = 1; while (matcher.find()) { Account account = new Account(Html.fromHtml(matcher.group(1)).toString().trim(), Helpers.parseBalance(matcher.group(2)), ""+accId); account.setCurrency(matcher.group(3).trim()); accounts.add(account); accId++; } matcher = reBalance.matcher(response); if (matcher.find()) { balance = Helpers.parseBalance(matcher.group(1)); currency = matcher.group(2).trim(); if (accounts.isEmpty()) { Account account = new Account(currency, balance, "1"); account.setCurrency(currency); accounts.add(account); } } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }
Source:
<code>public void copyCurrentSelectionToClipboard() { <START> terminalTextViewOverlay.copyCurrentSelectionToClipboard(); <END> }</code><technical_language>This null, is this anymore</technical_language>

Target:
public void copyCurrentSelectionToClipboard() { if (terminalTextViewOverlay != null) { terminalTextViewOverlay.copyCurrentSelectionToClipboard(); } }
Source:
<code>public void generate() { Path path = PathFactory.newPath( "test", "file:/ GlobalsModel globalsModel = mock( GlobalsModel.class ); when( ioService.exists( any( org.uberfire.java.nio.file.Path.class ) ) ).thenReturn( false ); globalsEditorService.generate( path, "test", globalsModel, "comment" ); verify( ioService, times( 1 ) ).write( any( org.uberfire.java.nio.file.Path.class ), anyString(), <START> anyMap(), <END> any( CommentedOption.class ) ); }</code><technical_language>I nice capture Map check "generated" flag set true</technical_language>

Target:
public void generate() { Path path = PathFactory.newPath( "test", "file:/ GlobalsModel globalsModel = mock( GlobalsModel.class ); when( ioService.exists( any( org.uberfire.java.nio.file.Path.class ) ) ).thenReturn( false ); Map<String, Object> metadataMap = new HashMap<String, Object>() { { put( GeneratedAttributesView.GENERATED_ATTRIBUTE_NAME, true ); } }; when( metadataService.configAttrs( anyMapOf( String.class, Object.class ), any( Metadata.class ) ) ).thenReturn( metadataMap ); globalsEditorService.generate( path, "test", globalsModel, "comment" ); ArgumentCaptor<Map> mapArgumentCaptor = ArgumentCaptor.forClass( Map.class ); verify( ioService, times( 1 ) ).write( any( org.uberfire.java.nio.file.Path.class ), anyString(), mapArgumentCaptor.capture(), any( CommentedOption.class ) ); Map capturedMap = mapArgumentCaptor.getValue(); assertEquals( metadataMap, capturedMap ); Object generatedAttribute = capturedMap.get( GeneratedAttributesView.GENERATED_ATTRIBUTE_NAME ); assertNotNull( generatedAttribute ); assertTrue( Boolean.parseBoolean( generatedAttribute.toString() ) ); }
Source:
<code>public CharSequence safeApply(final Object value, final Options options) { <START> String target = (String) options.param(0, null); <END> String replacement = (String) options.param(1, null); return value.toString().replace(target, replacement); }</code><technical_language>check if is null helper null safe</technical_language>

Target:
protected CharSequence safeApply(final Object value, final Options options) { return StringUtils.capitalize(value.toString()); }
Source:
<code>public void allGaugesAreSetForUnknownSafetyAsUnsafe() { setLoggingSafety(ImmutableMap.of()); sweepMetricsManager.updateMetrics(SWEEP_RESULTS, TABLE_REF); assertRecordedCurrentValue(ImmutableMap.of( CELLS_EXAMINED, EXAMINED, CELLS_SWEPT, DELETED, TIME_SPENT_SWEEPING, TIME_SWEEPING, TABLE_BEING_SWEPT, UNSAFE_FULLY_QUALIFIED)); sweepMetricsManager.updateMetrics(OTHER_SWEEP_RESULTS, TABLE_REF2); assertRecordedCurrentValue(ImmutableMap.of( CELLS_EXAMINED, OTHER_EXAMINED, CELLS_SWEPT, OTHER_DELETED, TIME_SPENT_SWEEPING, OTHER_TIME_SWEEPING, <START> TABLE_BEING_SWEPT, UNSAFE_FULLY_QUALIFIED)); <END> }</code><technical_language>nit: some of blocks feel extracted a common helper, this is test code I mind verbosity much</technical_language>

Target:
public void allGaugesAreSetForUnknownSafetyAsUnsafe() { setLoggingSafety(ImmutableMap.of()); sweepMetricsManager.updateMetrics(SWEEP_RESULTS, TABLE_REF); assertRecordedExaminedDeletedTimeTableName(VALUES, UNSAFE_FULLY_QUALIFIED); sweepMetricsManager.updateMetrics(OTHER_SWEEP_RESULTS, TABLE_REF2); assertRecordedExaminedDeletedTimeTableName(OTHER_VALUES, UNSAFE_FULLY_QUALIFIED); }
Source:
<code>public void visit(RepositoryBuild build) throws Exception { if (!build.getSha().isPresent()) { return; } GitInfo gitInfo = branchService.get(build.getBranchId()).get(); if (!gitHubConfigurationMap.get(gitInfo.getHost()).getSetCommitStatus()) { LOG.info("Git Hub Host has setCommitStatus set to false not sending message", gitInfo.getHost()); return; } String url = blazarUrlHelper.getBlazarUiLink(build); GHCommitState state = toGHCommitState(build.getState()); String sha = build.getSha().get(); String description = getStateDescription(build.getState()); final GHRepository repository; try { repository = gitHubHelper.repositoryFor(gitInfo); } catch (FileNotFoundException e) { LOG.warn("Couldn't find repository {}", gitInfo.getFullRepositoryName(), e); return; } LOG.info("Setting status of commit to for build {}", sha, state, build.getId().get()); try { repository.createCommitStatus(sha, state, url, description, "Blazar"); } catch (IOException e) { Optional<GitHubErrorResponse> gitHubErrorResponse = gitHubHelper.extractErrorResponseFromException(e); if (gitHubErrorResponse.isPresent()) { List<GitHubApiError> errors = gitHubErrorResponse.get().getErrors(); if (errors.stream().filter(er -> er.getMessage().contains(GITHUB_TOO_MANY_STATUSES_MESSAGE)).count() > 0) { <START> LOG.info("Commit {}#{} has too many statuses status posting failed.", gitInfo.getFullRepositoryName(), sha); <END> return; } } LOG.error("Error setting status of commit to for build {}", sha, state, build.getId().get(), e); } }</code><technical_language>This is a warning</technical_language>

Target:
public void visit(RepositoryBuild build) throws Exception { if (!build.getSha().isPresent()) { return; } GitInfo gitInfo = branchService.get(build.getBranchId()).get(); if (!gitHubConfigurationMap.get(gitInfo.getHost()).getSetCommitStatus()) { LOG.info("Git Hub Host has setCommitStatus set to false not sending message", gitInfo.getHost()); return; } String url = blazarUrlHelper.getBlazarUiLink(build); GHCommitState state = toGHCommitState(build.getState()); String sha = build.getSha().get(); String description = getStateDescription(build.getState()); final GHRepository repository; try { repository = gitHubHelper.repositoryFor(gitInfo); } catch (FileNotFoundException e) { LOG.warn("Couldn't find repository {}", gitInfo.getFullRepositoryName(), e); return; } LOG.info("Setting status of commit to for build {}", sha, state, build.getId().get()); try { repository.createCommitStatus(sha, state, url, description, "Blazar"); } catch (IOException e) { Optional<GitHubErrorResponse> gitHubErrorResponse = gitHubHelper.extractErrorResponseFromException(e); if (gitHubErrorResponse.isPresent()) { List<GitHubApiError> errors = gitHubErrorResponse.get().getErrors(); if (errors.stream().filter(er -> er.getMessage().contains(GITHUB_TOO_MANY_STATUSES_MESSAGE)).count() > 0) { LOG.warn("Commit {}#{} has the maximum number of statuses GitHub allows, cannot post status.", gitInfo.getFullRepositoryName(), sha); return; } } LOG.error("Error setting status of commit to for build {}", sha, state, build.getId().get(), e); } }
Source:
<code>void init() { <START> controllerHomeDir = resolveControllerHomeDir(); <END> this.initAccessOfDirectories(); this.initAccessOfHosts(); }</code><technical_language>resolve controller home? is name HomeDir? this class called controller agent</technical_language>

Target:
void init() { this.initAccessOfDirectories(); this.initAccessOfHosts(); }
Source:
<code>private Object readResolve() { <START> return ToStringStyle.NO_CLASS_NAME_MULTI_LINE_STYLE; <END> }</code><technical_language>nit-picking here, other classes in this file referencing class name (as this is class...). if possible, for consistency same, i.e. return NO_CLASS_NAME_MULTI_LINE_STYLE;</technical_language>

Target:
private Object readResolve() { return NO_CLASS_NAME_MULTI_LINE_STYLE; }
Source:
<code>private GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(getUpServerId(clusterId), volume.getName())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue(); GlusterAsyncTask asyncTask = volume.getAsyncTask(); if (asyncTask != null) { Guid taskId = asyncTask.getTaskId(); if (taskId != null) { List<Step> stepsList = getStepDao().getStepsByExternalId(taskId); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } asyncTask.setStatus(entity.getStatusSummary().getStatus()); getGlusterTaskUtils().updateSteps(getClusterDao().get(clusterId), asyncTask, stepsList); if (getGlusterTaskUtils().hasTaskCompleted(asyncTask)) { getGlusterTaskUtils().releaseLock(volume.getId()); <START> } <END> } } updateHostIP(entity); return entity; }</code><technical_language>common logic moved out. I suggest extend RemoveBrickStatus RebalanceStatus a common class</technical_language>

Target:
protected GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(getUpServerId(clusterId), volume.getName())); GlusterVolumeTaskStatusEntity entity = setStartTime((GlusterVolumeTaskStatusEntity) returnValue.getReturnValue()); updateStatusDetails(entity); return updateHostDetails(entity); }
Source:
<code>public void setup() { <START> Section section = new Section(new Shell(), SWT.NONE); <END> event = new ExpansionEvent(section, true); expansionEventConsumer = new ExpansionEventConsumer(); }</code><technical_language>shell disposed in teardown</technical_language>

Target:
public void setup() { event = new ExpansionEvent(section, true); expansionEventConsumer = new ExpansionEventConsumer(); }
Source:
<code>protected boolean canDoAction() { if (!super.canDoAction()) { return false; } VDSGroup cluster = getVdsGroup(); if (cluster == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if (!cluster.supportsGlusterService()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER); return false; } if (!GlusterFeatureSupported.glusterSnapshot(cluster.getcompatibility_version())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED); return false; } GlusterVolumeEntity volume = getGlusterVolume(); if (volume == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID); } else if (volume.getStatus() == GlusterStatus.DOWN) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); } if (!isVolumeThinlyProvisioned(volume)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_NOT_THINLY_PROVISIONED); } <START> <END> return true; }</code><technical_language>do need check for duplicate snapshot names</technical_language>

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } VDSGroup cluster = getVdsGroup(); if (cluster == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if (!cluster.supportsGlusterService()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER); return false; } if (!GlusterFeatureSupported.glusterSnapshot(cluster.getcompatibility_version())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED); return false; } GlusterVolumeEntity volume = getGlusterVolume(); if (volume == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID); } else if (volume.getStatus() == GlusterStatus.DOWN) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); } if (!isVolumeThinlyProvisioned(volume)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_NOT_THINLY_PROVISIONED); } if (getDbFacade().getGlusterVolumeSnapshotDao().getByName(getGlusterVolumeId(), snapshot.getSnapshotName()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SNAPSHOT_ALREADY_EXISTS); } return true; }
Source:
<code>protected CompileToJarStepFactory buildCompileStepFactory() { return new KotlincToJarStepFactory( Preconditions.checkNotNull(kotlinBuckConfig).getKotlinc(), extraKotlincArguments, EMPTY_EXTRA_CLASSPATH, <START> getJavac(), javacOptions, javacOptionsAmender); <END> }</code><technical_language>style nit. line argument</technical_language>

Target:
protected CompileToJarStepFactory buildCompileStepFactory() { return new KotlincToJarStepFactory( Preconditions.checkNotNull(kotlinBuckConfig).getKotlinc(), extraKotlincArguments, EMPTY_EXTRA_CLASSPATH, getJavac(), Preconditions.checkNotNull(javacOptions), javacOptionsAmender); }
Source:
<code>private void setupEntityExpansionLimit(final SAXParser parser) throws SAXNotSupportedException { try { parser.setProperty( JDK_ENTITY_EXPANSION_LIMIT, entityExpansionLimit != null ? entityExpansionLimit : DEFAULT_ENTITY_EXPANSION_LIMIT); } catch (SAXNotRecognizedException ex) { LOGGER.warning( "Sax parser property '" + JDK_ENTITY_EXPANSION_LIMIT + "' not recognized. " <START> + "Please check if XercesImpl jar dependency must be updated."); <END> } }</code><technical_language>newer require a property. xerces version is incompatible</technical_language>

Target:
private void setupEntityExpansionLimit(final SAXParser parser) throws SAXNotSupportedException { try { parser.setProperty( JDK_ENTITY_EXPANSION_LIMIT, entityExpansionLimit != null ? entityExpansionLimit : DEFAULT_ENTITY_EXPANSION_LIMIT); } catch (SAXNotRecognizedException ex) { LOGGER.warning( "Sax parser property '" + JDK_ENTITY_EXPANSION_LIMIT + "' not recognized. " + "Xerces version is incompatible."); } }
Source:
<code>public static void initializeFlash() { <START> Log.d(TAG, "initializeFlash()"); <END> available = CameraManager.getInstance().isCameraFlashAvailable(); if (!available) { return; } CameraManager.getInstance().switchToCameraWithFlash(); if (!CameraManager.getInstance().isReady()) { CameraManager.getInstance().startCamera(); } paramsOn = CameraManager.getInstance().getCurrentCamera().getParameters(); if (paramsOn != null) { paramsOn.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); } paramsOff = CameraManager.getInstance().getCurrentCamera().getParameters(); if (paramsOff != null) { paramsOff.setFlashMode("off"); } }</code><technical_language>please remove (as other logs)</technical_language>

Target:
public static void initializeFlash() { available = CameraManager.getInstance().isCameraFlashAvailable(); if (!available) { destroy(); return; } CameraManager.getInstance().switchToCameraWithFlash(); if (!CameraManager.getInstance().isReady()) { CameraManager.getInstance().startCamera(); } paramsOn = CameraManager.getInstance().getCurrentCamera().getParameters(); if (paramsOn != null) { paramsOn.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); } paramsOff = CameraManager.getInstance().getCurrentCamera().getParameters(); if (paramsOff != null) { paramsOff.setFlashMode("off"); } }
Source:
<code>public void testInputStarvation() throws Exception { try (StreamTaskMailboxTestHarness<String> testHarness = new StreamTaskMailboxTestHarnessBuilder<>(MultipleInputStreamTask::new, BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .setupOutputForSingletonOperatorChain(new TestInputStarvationMultipleInputOperatorFactory()) .build()) { <START> for (int i = 0; i < testHarness.inputGates.length; i++) { testHarness.processSingleStep(); } <END> Queue<StreamRecord> expectedOutput = new ArrayDeque<>(); testHarness.setAutoProcess(false); testHarness.processSingleStep(); assertTrue(testHarness.getOutput().isEmpty()); testHarness.processElement(new StreamRecord<>("NOT_SELECTED"), 0); testHarness.processElement(new StreamRecord<>("1"), 1); testHarness.processElement(new StreamRecord<>("2"), 1); testHarness.processElement(new StreamRecord<>("3"), 1); testHarness.processElement(new StreamRecord<>("4"), 1); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[2]: 1")); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[2]: 2")); assertThat(testHarness.getOutput(), contains(expectedOutput.toArray())); testHarness.processElement(new StreamRecord<>("1"), 2); testHarness.processSingleStep(); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[3]: 1")); expectedOutput.add(new StreamRecord<>("[2]: 3")); assertThat(testHarness.getOutput(), containsInAnyOrder(expectedOutput.toArray())); } }</code><technical_language>work if replaced testHarness.processAll</technical_language>

Target:
public void testInputStarvation() throws Exception { try (StreamTaskMailboxTestHarness<String> testHarness = new StreamTaskMailboxTestHarnessBuilder<>(MultipleInputStreamTask::new, BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .setupOutputForSingletonOperatorChain(new TestInputStarvationMultipleInputOperatorFactory()) .build()) { testHarness.processAll(); Queue<StreamRecord> expectedOutput = new ArrayDeque<>(); testHarness.setAutoProcess(false); testHarness.processSingleStep(); assertTrue(testHarness.getOutput().isEmpty()); testHarness.processElement(new StreamRecord<>("NOT_SELECTED"), 0); testHarness.processElement(new StreamRecord<>("1"), 1); testHarness.processElement(new StreamRecord<>("2"), 1); testHarness.processElement(new StreamRecord<>("3"), 1); testHarness.processElement(new StreamRecord<>("4"), 1); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[2]: 1")); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[2]: 2")); assertThat(testHarness.getOutput(), contains(expectedOutput.toArray())); testHarness.processElement(new StreamRecord<>("1"), 2); testHarness.processSingleStep(); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[3]: 1")); expectedOutput.add(new StreamRecord<>("[2]: 3")); assertThat(testHarness.getOutput(), containsInAnyOrder(expectedOutput.toArray())); } }
Source:
<code>public ActivationKeyDTO updateActivationKey( @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId, @ApiParam(name = "update", required = true) ActivationKeyDTO update) { ActivationKey toUpdate = activationKeyCurator.verifyAndLookupKey(activationKeyId); if (update.getName() != null) { toUpdate.setName(update.getName()); } String serviceLevel = update.getServiceLevel(); <START> if (serviceLevel != null) { <END> serviceLevelValidator.validate(toUpdate.getOwner(), serviceLevel); toUpdate.setServiceLevel(serviceLevel); } if (update.getReleaseVer() != null && update.getReleaseVer().getReleaseVer() != null) { toUpdate.setReleaseVer(new Release(update.getReleaseVer().getReleaseVer())); } if (update.getDescription() != null) { toUpdate.setDescription(update.getDescription()); } if (update.isAutoAttach() != null) { toUpdate.setAutoAttach(update.isAutoAttach()); } activationKeyCurator.merge(toUpdate); return this.translator.translate(toUpdate, ActivationKeyDTO.class); }</code><technical_language>revert this code. "release object" needs away, compounded. If this is causing difficulties in code, discuss figure out a work cleaning this section doubling-down wrapped version string paradigm</technical_language>

Target:
public ActivationKeyDTO updateActivationKey( @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId, @ApiParam(name = "update", required = true) ActivationKeyDTO update) { ActivationKey toUpdate = activationKeyCurator.verifyAndLookupKey(activationKeyId); if (update.getName() != null) { toUpdate.setName(update.getName()); } String serviceLevel = update.getServiceLevel(); if (serviceLevel != null) { serviceLevelValidator.validate(toUpdate.getOwner(), serviceLevel); toUpdate.setServiceLevel(serviceLevel); } if (update.getReleaseVersion() != null) { toUpdate.setReleaseVer(new Release(update.getReleaseVersion())); } if (update.getDescription() != null) { toUpdate.setDescription(update.getDescription()); } if (update.isAutoAttach() != null) { toUpdate.setAutoAttach(update.isAutoAttach()); } toUpdate = activationKeyCurator.merge(toUpdate); return this.translator.translate(toUpdate, ActivationKeyDTO.class); }
Source:
<code>public String getNetworkWithPopularTerms() throws QStoreStorageException { try { return publicNetworks.get(); } catch (InterruptedException | ExecutionException e) { <START> throw new QStoreStorageException(e); <END> } }</code><technical_language>throw a storage exception? store anythign</technical_language>

Target:
public String getNetworkWithPopularTerms() throws AsyncExecutionException { try { return publicNetworks.get(); } catch (InterruptedException | ExecutionException e) { throw new AsyncExecutionException(e); } }
Source:
<code>private void updateBackup() { if (getCurrentStorageItem() != null && getAvailableStorageTypeItems().getSelectedItem() != null) { boolean isStorageDomainUnattached = getDataCenter().getSelectedItem().getId().equals(UnassignedDataCenterId); if (isStorageDomainUnattached) { if (getCurrentStorageItem().getRole().isDataDomain()) { getBackup().setIsAvailable(true); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); } else { getBackup().setIsAvailable(false); getBackup().setEntity(false); } return; } <START> if (getCurrentStorageItem().getRole() <END> == StorageDomainType.ISO || getCurrentStorageItem().getRole() == StorageDomainType.ImportExport) { getBackup().setIsAvailable(false); getBackup().setEntity(false); } else { boolean backupSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted( ConfigValues.BackupSupported, getDataCenter().getSelectedItem().getCompatibilityVersion().toString()); getBackup().setIsAvailable(backupSupported); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); } return; } else { getBackup().setIsAvailable(false); getBackup().setEntity(false); } return; }</code><technical_language>simply "else if" remove return in line 626</technical_language>

Target:
private void updateBackup() { if (getCurrentStorageItem() != null && getAvailableStorageTypeItems().getSelectedItem() != null) { boolean isStorageDomainUnattached = getDataCenter().getSelectedItem().getId().equals(UnassignedDataCenterId); if (isStorageDomainUnattached) { if (getCurrentStorageItem().getRole().isDataDomain()) { getBackup().setIsAvailable(true); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); } else { getBackup().setIsAvailable(false); getBackup().setEntity(false); } } else if (getCurrentStorageItem().getRole() == StorageDomainType.ISO || getCurrentStorageItem().getRole() == StorageDomainType.ImportExport) { getBackup().setIsAvailable(false); getBackup().setEntity(false); } else { boolean backupSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted( ConfigValues.BackupSupported, getDataCenter().getSelectedItem().getCompatibilityVersion().toString()); getBackup().setIsAvailable(backupSupported); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); } } else { getBackup().setIsAvailable(false); getBackup().setEntity(false); } }