auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void test_currencyExposure() { for (ResolvedFxSingleBarrierOption option : OPTION_ALL) { CurrencyAmount pv = PRICER.presentValue(option, RATE_PROVIDER, VOL_PROVIDER); MultiCurrencyAmount computed = PRICER.currencyExposure(option, RATE_PROVIDER, VOL_PROVIDER); FxMatrix fxMatrix = FxMatrix.builder().addRate(EUR, USD, SPOT + FD_EPS).build(); ImmutableRatesProvider provBumped = RATE_PROVIDER.toBuilder().fxRateProvider(fxMatrix).build(); CurrencyAmount pvBumped = PRICER.presentValue(option, provBumped, VOL_PROVIDER); double ceCounterFD = pvBumped.getAmount() - pv.getAmount(); double ceBaseFD = pvBumped.getAmount() * (SPOT + FD_EPS) - pv.getAmount() * SPOT; assertEquals(computed.getAmount(EUR).getAmount() * FD_EPS, ceCounterFD, NOTIONAL * FD_EPS); assertEquals(-(computed.getAmount(USD).getAmount() - pv.getAmount()) * FD_EPS, ceBaseFD, NOTIONAL * FD_EPS); <START> } <END> }</code><technical_language>smile impact currency exposure. Run test a VOL_PROVIDER_FLAT RISK_REVERSAL_5_FLAT STRANGLE_5_FLAT 0.0 everywhere. 3 lines of test incorrect. Replace by: double ceBaseFD = pvBumped.getAmount() / (SPOT + FD_EPS) - pv.getAmount() / SPOT; assertEquals(computed.getAmount(EUR).getAmount() \* FD_EPS, ceCounterFD, NOTIONAL \* TOL); assertEquals(computed.getAmount(USD).getAmount() \* (1.0d/ (SPOT + FD_EPS) - 1.0d/ SPOT), ceBaseFD, NOTIONAL \* TOL); code in 'BlackFxSingleBarrierOptionProductPricer' correct, is test is incorrect</technical_language>

Target:
public void test_currencyExposure() { for (ResolvedFxSingleBarrierOption option : OPTION_ALL) { CurrencyAmount pv = PRICER.presentValue(option, RATE_PROVIDER, VOL_PROVIDER_FLAT); MultiCurrencyAmount computed = PRICER.currencyExposure(option, RATE_PROVIDER, VOL_PROVIDER_FLAT); FxMatrix fxMatrix = FxMatrix.builder().addRate(EUR, USD, SPOT + FD_EPS).build(); ImmutableRatesProvider provBumped = RATE_PROVIDER.toBuilder().fxRateProvider(fxMatrix).build(); CurrencyAmount pvBumped = PRICER.presentValue(option, provBumped, VOL_PROVIDER_FLAT); double ceCounterFD = pvBumped.getAmount() - pv.getAmount(); double ceBaseFD = pvBumped.getAmount() / (SPOT + FD_EPS) - pv.getAmount() / SPOT; assertEquals(computed.getAmount(EUR).getAmount() * FD_EPS, ceCounterFD, NOTIONAL * TOL); assertEquals(computed.getAmount(USD).getAmount() * (1.0d / (SPOT + FD_EPS) - 1.0d / SPOT), ceBaseFD, NOTIONAL * TOL); } }
Source:
<code>private boolean processSecondCommand(TotalOrderRemoteTransactionState state, boolean commit) { if (state == null) { return true; } <START> <END> try { return state.waitUntilPrepared(commit); } catch (InterruptedException e) { Thread.currentThread().interrupt(); log.timeoutWaitingUntilTransactionPrepared(state.getGlobalTransaction().prettyPrint()); } return false; }</code><technical_language>Is this possible? RemoteTransaction.getTransactionState return null</technical_language>

Target:
private boolean processSecondCommand(TotalOrderRemoteTransactionState state, boolean commit) { if (state == null) { return true; } try { return state.waitUntilPrepared(commit); } catch (InterruptedException e) { Thread.currentThread().interrupt(); log.timeoutWaitingUntilTransactionPrepared(state.getGlobalTransaction().globalId()); } return false; }
Source:
<code>private static boolean importsOSGIUtil(ICompilationUnit unit) throws JavaModelException { for (IImportDeclaration <START> i : <END> unit.getImports()) { if (i.getElementName().startsWith("org.eclipse.osgi.util.")) { return true; } } return false; }</code><technical_language>rename importDecl</technical_language>

Target:
private static boolean importsOSGIUtil(ICompilationUnit unit) throws JavaModelException { for (IImportDeclaration importDecl : unit.getImports()) { if (importDecl.getElementName().startsWith("org.eclipse.osgi.util.")) { return true; } } return false; }
Source:
<code>public String getColumnText(Object element, int columnIndex) { PMSymbolMatch p = (PMSymbolMatch) element; switch (columnIndex) { case 0: return p.getName(); case 1: PMSymbol fresh = p.getFresh(); return (fresh == null) ? "-" : String.valueOf(fresh.getPercent()); case 2: PMSymbol stale = p.getStale(); return (stale == null) ? "-" : String.valueOf(stale.getPercent()); case 3: String result = p.getResult(); try { Float.parseFloat(result); return result + "%"; <START> } catch (Exception e) { <END> return result; } case 4: return p.getEvent(); case 5: return ""; default: throw new RuntimeException("Something went wrong"); } }</code><technical_language>catch Exception. Catch actual exception care for</technical_language>

Target:
public String getColumnText(Object element, int columnIndex) { PMSymbolMatch p = (PMSymbolMatch) element; switch (columnIndex) { case 0: return p.getName(); case 1: PMSymbol fresh = p.getFresh(); return (fresh == null) ? "--" : String.valueOf(fresh.getPercent()); case 2: PMSymbol stale = p.getStale(); return (stale == null) ? "--" : String.valueOf(stale.getPercent()); case 3: String result = p.getResult(); if(result != null && result.equals(PMSymbolMatch.SYMBOL_MATCHED)){ String difference = String.valueOf(p.getOverheadDifference()); return difference + "%"; } else{ return result; } case 4: return p.getEvent(); case 5: return ""; default: return ""; } }
Source:
<code>public static StreamAddressSpaceMsg getStreamAddressSpaceMsg(StreamAddressSpace addressSpace) { StreamAddressSpaceMsg.Builder addressSpaceMsgBuilder = StreamAddressSpaceMsg.newBuilder(); addressSpaceMsgBuilder.setTrimMark(addressSpace.getTrimMark()); <START> try(ByteString.Output bso = ByteString.newOutput()) { try(DataOutputStream dos = new DataOutputStream(bso)) { <END> addressSpace.getAddressMap().serialize(dos); addressSpaceMsgBuilder.setAddressMap(bso.toByteString()); } } catch (Exception ex) { log.error("getStreamAddressSpaceMsg: error=[{}, {}] " + "while serializing roaring64NavigableMap", ex, ex.getCause()); } return addressSpaceMsgBuilder.build(); }</code><technical_language>Style: missing space</technical_language>

Target:
public static StreamAddressSpaceMsg getStreamAddressSpaceMsg(StreamAddressSpace addressSpace) { StreamAddressSpaceMsg.Builder addressSpaceMsgBuilder = StreamAddressSpaceMsg.newBuilder(); addressSpaceMsgBuilder.setTrimMark(addressSpace.getTrimMark()); try (ByteString.Output bso = ByteString.newOutput()) { try (DataOutputStream dos = new DataOutputStream(bso)) { Roaring64NavigableMap rm = addressSpace.getAddressMap(); rm.runOptimize(); rm.serialize(dos); addressSpaceMsgBuilder.setAddressMap(bso.toByteString()); } } catch (IOException ex) { throw new SerializerException("Unexpected error while serializing roaring64NavigableMap", ex); } return addressSpaceMsgBuilder.build(); }
Source:
<code>public boolean onContextItemSelected(MenuItem item) { if (item.getItemId() == DELETE_REPEAT) { <START> formEntryViewModel.setOnDeleted(() -> { <END> FormController formController = getFormController(); if (formController != null && !formController.indexIsInFieldList()) { showNextView(); } else { refreshCurrentView(); } }); formEntryViewModel.setOnCancelled(() -> refreshCurrentView()); DialogUtils.showIfNotShowing(DeleteRepeatDialogFragment.class, getSupportFragmentManager()); } else { ODKView odkView = getCurrentViewIfODKView(); if (odkView != null) { for (QuestionWidget qw : odkView.getWidgets()) { if (item.getItemId() == qw.getId()) { createClearDialog(qw); break; } } } } return super.onContextItemSelected(item); }</code><technical_language>I this works ViewModel a reference Activity, causing a leak. I thought callbacks fine. I imagining ViewModel a for dialog get access FormController. give access data dialog needs I is deleted repeat name deleted repeat index</technical_language>

Target:
public boolean onContextItemSelected(MenuItem item) { if (item.getItemId() == DELETE_REPEAT) { DialogUtils.showIfNotShowing(DeleteRepeatDialogFragment.class, getSupportFragmentManager()); } else { ODKView odkView = getCurrentViewIfODKView(); if (odkView != null) { for (QuestionWidget qw : odkView.getWidgets()) { if (item.getItemId() == qw.getId()) { createClearDialog(qw); break; } } } } return super.onContextItemSelected(item); }
Source:
<code>public void testScriptCallFromJavascript() throws Exception { <START> cacheManager.getCache().remove("a"); <END> assertNull(cacheManager.getCache().get("a")); String result = (String) scriptingManager.runScript("testInnerScriptCall.js", new TaskContext().cache(cacheManager.getCache("test_cache")).addParameter("a", "ahoj")).get(); assertEquals("script1:additionFromJavascript", result); assertEquals("ahoj", cacheManager.getCache().get("a")); }</code><technical_language>Do need 2 lines here</technical_language>

Target:
public void testScriptCallFromJavascript() throws Exception { String result = (String) scriptingManager.runScript("testInnerScriptCall.js", new TaskContext().cache(cacheManager.getCache("test_cache")).addParameter("a", "ahoj")).get(); assertEquals("script1:additionFromJavascript", result); assertEquals("ahoj", cacheManager.getCache().get("a")); }
Source:
<code>public Set<Entitlement> batchListModifying(List<Entitlement> entitlements) { Set<Entitlement> modifying = new HashSet<Entitlement>(); ProductEntitlements pidEnts = getOverlappingForModifying(entitlements); if (pidEnts.isEmpty()) { return modifying; } List<Product> overlappingProducts = productAdapter.getProductsByIds(pidEnts.getAllProductIds()); for (Product overlappingProduct : overlappingProducts) { boolean modifies = false; for (Entitlement inputEntitlement : entitlements) { if (overlappingProduct.modifies(inputEntitlement.getProductId())) { modifies = true; <START> break; <END> } Iterator<ProvidedProduct> providedProductOfInput = inputEntitlement .getPool().getProvidedProducts() .iterator(); while (!modifies && providedProductOfInput.hasNext()) { if (overlappingProduct.modifies(providedProductOfInput.next().getProductId())) { modifies = true; } } if (modifies) { modifying.addAll(pidEnts.getEntitlementsByProductId(overlappingProduct.getId())); } } } return modifying; }</code><technical_language>breaking checking modifies in loop? lead modifying.addAll _next_ item in list</technical_language>

Target:
public Set<Entitlement> batchListModifying(List<Entitlement> entitlements) { Set<Entitlement> modifying = new HashSet<Entitlement>(); ProductEntitlements pidEnts = getOverlappingForModifying(entitlements); if (pidEnts.isEmpty()) { return modifying; } List<Product> overlappingProducts = productAdapter.getProductsByIds(pidEnts.getAllProductIds()); for (Product overlappingProduct : overlappingProducts) { boolean modifies = false; for (Entitlement inputEntitlement : entitlements) { if (overlappingProduct.modifies(inputEntitlement.getProductId())) { modifies = true; } Iterator<ProvidedProduct> providedProductOfInput = inputEntitlement .getPool().getProvidedProducts() .iterator(); while (!modifies && providedProductOfInput.hasNext()) { if (overlappingProduct.modifies(providedProductOfInput.next().getProductId())) { modifies = true; } } if (modifies) { modifying.addAll(pidEnts.getEntitlementsByProductId(overlappingProduct.getId())); } } } return modifying; }
Source:
<code>protected List<Path> getDefaultIdentities(@NonNull File sshDir) { <START> return (List) Arrays.asList(this.defaultIdentities).stream().map((s) -> { <END> return (new File(sshDir, s)).toPath(); }).filter((var0) -> { return Files.exists(var0, new LinkOption[0]); }).collect(Collectors.toList()); }</code><technical_language>need this cast collector handle that. a Stream.of() instead of creating a List</technical_language>

Target:
protected List<Path> getDefaultIdentities(@NonNull File sshDir) { return Stream.of(defaultIdentities) .map(s -> sshDir.toPath().resolve(s)) .filter(path -> Files.exists(path)) .collect(Collectors.toList()); }
Source:
<code>public void createAccount(AccountAttributes accountToAdd) throws InvalidParametersException { try { if (accountToAdd != null && accountToAdd.studentProfile == null) { accountToAdd.studentProfile = new StudentProfileAttributes(); accountToAdd.studentProfile.googleId = accountToAdd.googleId; } createEntity(accountToAdd); } catch (EntityAlreadyExistsException e) { try { updateAccount(accountToAdd, true); } catch (EntityDoesNotExistException edne) { <START> Assumption.fail("Account found be already existing and not existing simultaneously"); <END> } } try { profilesDb.createEntity(accountToAdd.studentProfile); } catch (EntityAlreadyExistsException e) { try { profilesDb.updateStudentProfile(accountToAdd.studentProfile); } catch (EntityDoesNotExistException edne) { Assumption.fail("StudentProfile found be already existing and not existing simultaneously"); } } }</code><technical_language>"found be"</technical_language>

Target:
public void createAccount(AccountAttributes accountToAdd) throws InvalidParametersException { try { if (accountToAdd != null && accountToAdd.studentProfile == null) { accountToAdd.studentProfile = new StudentProfileAttributes(); accountToAdd.studentProfile.googleId = accountToAdd.googleId; } createEntity(accountToAdd); } catch (EntityAlreadyExistsException e) { try { updateAccount(accountToAdd, true); } catch (EntityDoesNotExistException edne) { Assumption.fail("Account found to be already existing and not existing simultaneously"); } } try { profilesDb.createEntity(accountToAdd.studentProfile); } catch (EntityAlreadyExistsException e) { try { profilesDb.updateStudentProfile(accountToAdd.studentProfile); } catch (EntityDoesNotExistException edne) { Assumption.fail("StudentProfile found to be already existing and not existing simultaneously"); } } }
Source:
<code>public void nextTuple() { try { if (refreshSubscriptionTimer.isExpiredResetOnTrue()) { kafkaSpoutConfig.getSubscription().refreshAssignment(); } if (commitTimer != null && commitTimer.isExpiredResetOnTrue()) { if (isAtLeastOnceProcessing()) { commitOffsetsForAckedTuples(kafkaConsumer.assignment()); } else if (kafkaSpoutConfig.getProcessingGuarantee() == ProcessingGuarantee.NONE) { Map<TopicPartition, OffsetAndMetadata> offsetsToCommit = createOffsetsToCommitForConsumedOffsets(kafkaConsumer.assignment()); <START> kafkaConsumer.commitAsync(offsetsToCommit, null); <END> LOG.debug("Committed offsets to Kafka", offsetsToCommit); } } PollablePartitionsInfo pollablePartitionsInfo = getPollablePartitionsInfo(); if (pollablePartitionsInfo.shouldPoll()) { try { setWaitingToEmit(pollKafkaBroker(pollablePartitionsInfo)); } catch (RetriableException e) { LOG.error("Failed to poll from kafka.", e); } } emitIfWaitingNotEmitted(); } catch (InterruptException e) { throwKafkaConsumerInterruptedException(); } }</code><technical_language>createFetchedOffsetsMetadata</technical_language>

Target:
public void nextTuple() { try { if (refreshSubscriptionTimer.isExpiredResetOnTrue()) { kafkaSpoutConfig.getSubscription().refreshAssignment(); } if (commitTimer != null && commitTimer.isExpiredResetOnTrue()) { if (isAtLeastOnceProcessing()) { commitOffsetsForAckedTuples(kafkaConsumer.assignment()); } else if (kafkaSpoutConfig.getProcessingGuarantee() == ProcessingGuarantee.NO_GUARANTEE) { Map<TopicPartition, OffsetAndMetadata> offsetsToCommit = createFetchedOffsetsMetadata(kafkaConsumer.assignment()); kafkaConsumer.commitAsync(offsetsToCommit, null); LOG.debug("Committed offsets to Kafka", offsetsToCommit); } } PollablePartitionsInfo pollablePartitionsInfo = getPollablePartitionsInfo(); if (pollablePartitionsInfo.shouldPoll()) { try { setWaitingToEmit(pollKafkaBroker(pollablePartitionsInfo)); } catch (RetriableException e) { LOG.error("Failed to poll from kafka.", e); } } emitIfWaitingNotEmitted(); } catch (InterruptException e) { throwKafkaConsumerInterruptedException(); } }
Source:
<code>protected ListenerList<IDebugContextListener> getPostListeners(IWorkbenchPart part) { String id = null; if (part != null) { id = getCombinedPartId(part); ListenerList<IDebugContextListener> listenerList = fPostListenersByPartId.get(id); return listenerList != null ? listenerList : new ListenerList<IDebugContextListener>(); } else { ListenerList<IDebugContextListener> retVal = fPostListenersByPartId.get(null); if (retVal == null) { <START> return new <END> ListenerList<IDebugContextListener>(); } outer: for (Iterator<String> itr = fPostListenersByPartId.keySet().iterator(); itr.hasNext();) { String listenerPartId = itr.next(); for (int i = 0; i < fProviders.size(); i++) { String providerPartId = getCombinedPartId(fProviders.get(i).getPart()); if ((listenerPartId == null && providerPartId == null) || (listenerPartId != null && listenerPartId.equals(providerPartId))) { continue outer; } } for (IDebugContextListener iDebugContextListener : fPostListenersByPartId.get(listenerPartId)) { retVal.add(iDebugContextListener); } } return retVal; } }</code><technical_language>do want return ? if retVal is null, initialize retVal list added output of fPostListenersByPartId.get(listenerPartId)</technical_language>

Target:
protected ListenerList<IDebugContextListener> getPostListeners(IWorkbenchPart part) { String id = null; if (part != null) { id = getCombinedPartId(part); ListenerList<IDebugContextListener> listenerList = fPostListenersByPartId.get(id); return listenerList != null ? listenerList : new ListenerList<IDebugContextListener>(); } else { ListenerList<IDebugContextListener> retVal = fPostListenersByPartId.get(null); if (retVal == null) { retVal = new ListenerList<IDebugContextListener>(); } outer: for (Iterator<String> itr = fPostListenersByPartId.keySet().iterator(); itr.hasNext();) { String listenerPartId = itr.next(); for (int i = 0; i < fProviders.size(); i++) { String providerPartId = getCombinedPartId(fProviders.get(i).getPart()); if ((listenerPartId == null && providerPartId == null) || (listenerPartId != null && listenerPartId.equals(providerPartId))) { continue outer; } } for (IDebugContextListener iDebugContextListener : fPostListenersByPartId.get(listenerPartId)) { if (iDebugContextListener != null) { retVal.add(iDebugContextListener); } } } return retVal; } }
Source:
<code>private void nudgeAutosave() { if (autoSaveTimer_.isRunning()) <START> autoSaveTimer_.cancel(); <END> if (prefs_.autoSaveOnIdle().getValue() == UserPrefs.AUTO_SAVE_ON_IDLE_COMMIT) autoSaveTimer_.schedule(prefs_.autoSaveMs()); }</code><technical_language>FWIW call cancel() (it a no-op if timer is running)</technical_language>

Target:
private void nudgeAutosave() { autoSaveTimer_.cancel(); if (prefs_.autoSaveOnIdle().getValue() == UserPrefs.AUTO_SAVE_ON_IDLE_COMMIT) autoSaveTimer_.schedule(prefs_.autoSaveMs()); }
Source:
<code>private MXBeanParameterInfo getMXBeanArgumentAnnotation(Method m, int seq) { Annotation[][] annotations = m.getParameterAnnotations(); <START> assert seq < annotations.length; <END> for (Annotation annotation : annotations[seq]) { if (annotation instanceof MXBeanParameterInfo) { return (MXBeanParameterInfo) annotation; } } return null; }</code><technical_language>I tis assertion is redundant. get sequence number for standard library</technical_language>

Target:
private MXBeanParameter getMXBeanArgumentAnnotation(Method m, int seq) { Parameter[] params = m.getParameters(); if (seq < params.length) return params[seq].getAnnotation(MXBeanParameter.class); return null; }
Source:
<code><START> public synchronized Pair<Boolean, String> canUpdateCatalog() { <END> if (m_dataSourcesClosing.isEmpty()) { return new Pair<>(Boolean.TRUE, null); } else { String msg = "Unable to update catalog, these tables are still closing: " + m_dataSourcesClosing.keySet(); return new Pair<>(Boolean.FALSE, msg); } }</code><technical_language>return a String if null is returned success else is error</technical_language>

Target:
public synchronized String canUpdateCatalog() { if (m_dataSourcesClosing.isEmpty()) { return null; } else { String msg = "Unable to update catalog, these export streams are still closing: " + m_dataSourcesClosing.keySet(); return msg; } }
Source:
<code>private void emitNoResolvedType(NoType type, String defaultEmit) { if (!opts.partialInput || !type.isNoResolvedType()) { emit(defaultEmit); return; } NoResolvedType nType = (NoResolvedType) type; if (nType.getReferenceName() == null) { emit(defaultEmit); return; } String displayName = type.getDisplayName(); if (importRenameMap.containsKey(displayName)) { displayName = importRenameMap.get(displayName); } <START> if (maybeEmitGlobalAlias(type)) return; <END> emit(displayName); List<JSType> templateTypes = nType.getTemplateTypes(); if (templateTypes != null && templateTypes.size() > 0) { emitGenericTypeArguments(type.getTemplateTypes().iterator()); } }</code><technical_language>Move this String displayName = type.getDisplayName(); - early return guards top</technical_language>

Target:
private void emitNoResolvedType(NoType type, String defaultEmit) { if (!opts.partialInput || !type.isNoResolvedType()) { emit(defaultEmit); return; } if (maybeEmitGlobalAlias(type)) return; NoResolvedType nType = (NoResolvedType) type; if (nType.getReferenceName() == null) { emit(defaultEmit); return; } String displayName = type.getDisplayName(); if (importRenameMap.containsKey(displayName)) { displayName = importRenameMap.get(displayName); } emit(displayName); List<JSType> templateTypes = nType.getTemplateTypes(); if (templateTypes != null && templateTypes.size() > 0) { emitGenericTypeArguments(type.getTemplateTypes().iterator()); } }
Source:
<code>private static String toPathString(String moduleName) { <START> return moduleName.replace('.', File.separatorChar) + File.separatorChar + moduleName + File.separatorChar; <END> }</code><technical_language>Similar i.e. method body be: return moduleName.replace('.', File.separatorChar);</technical_language>

Target:
private static String toPathString(String moduleName) { return moduleName.replace('.', File.separatorChar) + File.separatorChar + moduleName; }
Source:
<code><START> public String toString() { <END> String base = reverse ? "" + to + ".." + from : "" + from + ".." + to; return Integer.valueOf(1).equals(stepSize) ? base : base + ".withStepSize(" + stepSize + ")"; }</code><technical_language>@Override</technical_language>

Target:
public String toString() { return getToString(to.toString(), from.toString()); }
Source:
<code>public boolean hasNext() { if (constraintFiles != null && currentConstraintIndex < constraintFiles.length) { return true; } while (constraintFiles != null && currentConstraintIndex == constraintFiles.length) { currentDbIndex ++; if (currentDbIndex < dbDirs.length) { currentConstraintIndex = 0; <START> constraintFiles = listConstraintFilesInDBDir(fs, dbDirs[0].getPath()); <END> } else { constraintFiles = null; } } if (constraintFiles != null) { return true; } else { return false; } }</code><technical_language>dbDirs[currentDbIndex] else point DB directory always</technical_language>

Target:
public boolean hasNext() { if (dbDirs == null) { try { dbDirs = fs.listStatus(path, EximUtil.getDirectoryFilter(fs)); } catch (IOException e) { throw new RuntimeException(e); } currentDbIndex = 0; if (dbDirs.length != 0) { currentConstraintIndex = 0; constraintFiles = listConstraintFilesInDBDir(fs, dbDirs[0].getPath()); } } if ((currentDbIndex < dbDirs.length) && (currentConstraintIndex < constraintFiles.length)) { return true; } while ((currentDbIndex < dbDirs.length) && (currentConstraintIndex == constraintFiles.length)) { currentDbIndex ++; if (currentDbIndex < dbDirs.length) { currentConstraintIndex = 0; constraintFiles = listConstraintFilesInDBDir(fs, dbDirs[currentDbIndex].getPath()); } else { constraintFiles = null; } } return constraintFiles != null; }
Source:
<code>public boolean filter(String path0, boolean folder, boolean isArchive) { if (!folder && fExtraResourceFileFilters != null) { char[] name= path0.toCharArray(); for (char[] <START> fExtraResourceFileFilter : <END> fExtraResourceFileFilters) if (match(fExtraResourceFileFilter, name, true)) return true; } if (folder && fExtraResourceFolderFilters != null) { for (String fExtraResourceFolderFilter : fExtraResourceFolderFilters) if (fExtraResourceFolderFilter.equals(path0)) return true; } return false; }</code><technical_language>rename filter</technical_language>

Target:
public boolean filter(String path0, boolean folder, boolean isArchive) { if (!folder && fExtraResourceFileFilters != null) { char[] name= path0.toCharArray(); for (char[] filter : fExtraResourceFileFilters) if (match(filter, name, true)) return true; } if (folder && fExtraResourceFolderFilters != null) { for (String filter : fExtraResourceFolderFilters) if (filter.equals(path0)) return true; } return false; }
Source:
<code>public String toString() { StringBuilder builder = new StringBuilder("SQLException."); if (code != null) { builder.append(code.toString()); } if (message != null) { builder.append(" ").append(message); } <START> if (schemaName != null) { <END> builder.append(" ").append(SCHEMA_NAME).append("=").append(schemaName).append(";"); } if (tableName != null) { builder.append(" ").append(TABLE_NAME).append("=").append(tableName).append(";"); } if (familyName != null) { builder.append(" ").append(FAMILY_NAME).append("=").append(familyName).append(";"); } if (columnName != null) { builder.append(" ").append(COLUMN_NAME).append("=").append(columnName).append(";"); } if (lineNumber != null) { builder.append(" ").append(LINE_NUMBER).append("=").append(lineNumber).append(";"); } return builder.toString(); }</code><technical_language>I schemaName.tableName.familyName.columnName kind of syntax. Basically, part is specific, parameter name. For example, if schemaName="foo", tableName="bar", others empty null, tableName=foo.bar. If SchemaUtil functions get display name, good. another for getColumnDisplayName</technical_language>

Target:
public String toString() { StringBuilder builder = new StringBuilder("SQLException! "); if (code != null) { builder.append(code.toString()); } if (message != null) { builder.append(" ").append(message); } String columnDisplayName = SchemaUtil.getColumnDisplayName(schemaName, tableName, familyName, columnName); if (columnName != null) { builder.append(" ").append(COLUMN_NAME).append("=").append(columnDisplayName); } else if (familyName != null) { builder.append(" ").append(FAMILY_NAME).append("=").append(columnDisplayName); } else if (tableName != null) { builder.append(" ").append(TABLE_NAME).append("=").append(columnDisplayName); } else if (schemaName != null) { builder.append(" ").append(SCHEMA_NAME).append("=").append(columnDisplayName); } if (lineNumber != null) { builder.append(" ").append(LINE_NUMBER).append("=").append(lineNumber).append(";"); } return builder.toString(); }
Source:
<code>private void setUpViewPager(ViewPager viewPager) { FeedViewPagerAdapter feedViewPagerAdapter = new FeedViewPagerAdapter(getChildFragmentManager()); feedViewPagerAdapter.addFragment(FacebookFeedFragment.getInstance(openCommentsDialogListener, onImageZoomListener), "FACEBOOK"); <START> feedViewPagerAdapter.addFragment(TwitterFeedFragment.getInstance(onImageZoomListener), "TWITTER"); <END> feedViewPagerAdapter.notifyDataSetChanged(); viewPager.setAdapter(feedViewPagerAdapter); }</code><technical_language>strings.xml capitalize default, is handled automatically Andriod Tab Layout</technical_language>

Target:
private void setUpViewPager(ViewPager viewPager) { FeedViewPagerAdapter feedViewPagerAdapter = new FeedViewPagerAdapter(getChildFragmentManager()); feedViewPagerAdapter.addFragment(FacebookFeedFragment.getInstance(openCommentsDialogListener, onImageZoomListener), getString(R.string.facebook)); feedViewPagerAdapter.addFragment(TwitterFeedFragment.getInstance(onImageZoomListener), getString(R.string.twitter)); feedViewPagerAdapter.notifyDataSetChanged(); viewPager.setAdapter(feedViewPagerAdapter); }
Source:
<code>protected boolean isProblem(IReference reference) { IApiMethod method = (IApiMethod) reference.getMember(); IApiType type = (IApiType) reference.getResolvedReference(); try { IApiAnnotations annotations = type.getApiComponent().getApiDescription().resolveAnnotations(type.getHandle()); if (annotations != null) { if (VisibilityModifiers.isPrivate(annotations.getVisibility())) { if ((Flags.AccProtected & method.getModifiers()) > 0) { IApiDescription description = method.getApiComponent().getApiDescription(); annotations = description.resolveAnnotations(method.getHandle().getEnclosingType()); if (annotations == null || RestrictionModifiers.isExtendRestriction(annotations.getRestrictions())) { return false; } } return true; } } else { if (isEnclosingTypeVisible(type)) { if <START> (type.getName() != <END> null) { if (!type.getName().startsWith("javax.")) { ApiPlugin.log(new Status(IStatus.INFO, ApiPlugin.PLUGIN_ID, MessageFormat.format(BuilderMessages.AbstractTypeLeakDetector_vis_type_has_no_api_description, type.getName()))); } } } else { return true; } } } catch (CoreException e) { ApiPlugin.log(e); } return false; }</code><technical_language>extracted a local variable</technical_language>

Target:
protected boolean isProblem(IReference reference) { IApiMethod method = (IApiMethod) reference.getMember(); IApiType type = (IApiType) reference.getResolvedReference(); try { IApiAnnotations annotations = type.getApiComponent().getApiDescription().resolveAnnotations(type.getHandle()); if (annotations != null) { if (VisibilityModifiers.isPrivate(annotations.getVisibility())) { if ((Flags.AccProtected & method.getModifiers()) > 0) { IApiDescription description = method.getApiComponent().getApiDescription(); annotations = description.resolveAnnotations(method.getHandle().getEnclosingType()); if (annotations == null || RestrictionModifiers.isExtendRestriction(annotations.getRestrictions())) { return false; } } return true; } } else { if (isEnclosingTypeVisible(type)) { String typeName = type.getName(); if (typeName != null) { if (!typeName.startsWith("javax.")) { ApiPlugin.log(new Status(IStatus.INFO, ApiPlugin.PLUGIN_ID, MessageFormat.format(BuilderMessages.AbstractTypeLeakDetector_vis_type_has_no_api_description, typeName))); } } } else { return true; } } } catch (CoreException e) { ApiPlugin.log(e); } return false; }
Source:
<code>public VMs list() { VMs vms = new VMs(); if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) { List<org.ovirt.engine.core.common.businessentities.VM> unregisteredVms = getBackendCollection(VdcQueryType.GetUnregisteredVms, new UnregisteredEntitiesQueryParameters(storageDomainId, VmEntityType.VM.name())); List<VM> collection = new ArrayList<VM>(); for (org.ovirt.engine.core.common.businessentities.VM entity : unregisteredVms) { VM vm = map(entity); collection.add(addLinks(populate(vm, entity))); } <START> vms.getVMs().addAll(collection); <END> } return vms; }</code><technical_language>This return VMs unregister param is provided, good..</technical_language>

Target:
public VMs list() { VMs vms = new VMs(); if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) { List<org.ovirt.engine.core.common.businessentities.VM> unregisteredVms = getBackendCollection(VdcQueryType.GetUnregisteredVms, new UnregisteredEntitiesQueryParameters(storageDomainId, VmEntityType.VM.name())); List<VM> collection = new ArrayList<VM>(); for (org.ovirt.engine.core.common.businessentities.VM entity : unregisteredVms) { VM vm = map(entity); collection.add(addLinks(populate(vm, entity))); } vms.getVMs().addAll(collection); } else { vms.getVMs().addAll(getCollection()); } return vms; }
Source:
<code>private void loadAsset(String filename) { <START> subscription = Observable.fromCallable(()-> { <END> InputStream input = null; try { TypedArray res = AboutActivity.this.getTheme().obtainStyledAttributes( new int[] { android.R.attr.textColorPrimary }); int colorResource = res.getColor(0, 0); String colorString = String.format("#%06X", 0xFFFFFF & colorResource); res.recycle(); input = getAssets().open(filename); String webViewData = IOUtils.toString(input, Charset.defaultCharset()); if (!webViewData.startsWith("<!DOCTYPE html>")) { webViewData = webViewData.replace("%", "&#37;"); webViewData = "<!DOCTYPE html>" + "<html>" + "<head>" + " <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">" + " <style type=\"text/css\">" + " @font-face {" + " font-family: 'Roboto-Light';" + " src: url('file:/ " }" + " * {" + " color: %s;" + " font-family: roboto-Light;" + " font-size: 8pt;" + " }" + " </style>" + "</head><body><p>" + webViewData + "</p></body></html>"; webViewData = webViewData.replace("\n", "<br/>"); } webViewData = String.format(webViewData, colorString); return webViewData; } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); throw e; } finally { IOUtils.closeQuietly(input); } }) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( webviewData -> webView.loadDataWithBaseURL("file:/ error -> Log.e(TAG, Log.getStackTraceString(error)) ); }</code><technical_language>a Single</technical_language>

Target:
private void loadAsset(String filename) { subscription = Single.create(subscriber -> { InputStream input = null; try { TypedArray res = AboutActivity.this.getTheme().obtainStyledAttributes( new int[] { android.R.attr.textColorPrimary }); int colorResource = res.getColor(0, 0); String colorString = String.format("#%06X", 0xFFFFFF & colorResource); res.recycle(); input = getAssets().open(filename); String webViewData = IOUtils.toString(input, Charset.defaultCharset()); if (!webViewData.startsWith("<!DOCTYPE html>")) { webViewData = webViewData.replace("%", "&#37;"); webViewData = "<!DOCTYPE html>" + "<html>" + "<head>" + " <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">" + " <style type=\"text/css\">" + " @font-face {" + " font-family: 'Roboto-Light';" + " src: url('file:/ " }" + " * {" + " color: %s;" + " font-family: roboto-Light;" + " font-size: 8pt;" + " }" + " </style>" + "</head><body><p>" + webViewData + "</p></body></html>"; webViewData = webViewData.replace("\n", "<br/>"); } webViewData = String.format(webViewData, colorString); subscriber.onSuccess(webViewData); } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); subscriber.onError(e); } finally { IOUtils.closeQuietly(input); } }) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( webViewData -> webView.loadDataWithBaseURL("file:/ error -> Log.e(TAG, Log.getStackTraceString(error)) ); }
Source:
<code>public boolean matches(ITmfEvent event) { boolean match = false; ITmfTrace trace = event.getTrace(); if (trace.getClass().equals(fTraceClass)) { if (fTraceTypeId != null) { if (fTraceTypeId.equals(trace.getTraceTypeId())) { match = true; } } else { match = true; } } if (match ^ isNot()) { <START> for (ITmfFilterTreeNode node : getChildren()) { if (! node.matches(event)) { return isNot(); } } return !isNot(); <END> } return isNot(); }</code><technical_language>passed true condition of this node, result depends child, 'not' matter anymore</technical_language>

Target:
public boolean matches(ITmfEvent event) { boolean match = false; ITmfTrace trace = event.getTrace(); if (trace.getClass().equals(fTraceClass)) { if (fTraceTypeId != null) { if (fTraceTypeId.equals(trace.getTraceTypeId())) { match = true; } } else { match = true; } } if (match ^ isNot()) { for (ITmfFilterTreeNode node : getChildren()) { if (!node.matches(event)) { return false; } } return true; } return false; }
Source:
<code>public QueryRegistrationHandler(final TSDB tsdb, final HttpHandler next) { this.tsdb = tsdb; this.next = next; closeTask = new Runnable() { @Override public void run() { <START> LOG.info("Closing the query!"); <END> } }; }</code><technical_language>debug log hash of query for tracking</technical_language>

Target:
public QueryRegistrationHandler(final TSDB tsdb, final HttpHandler next) { this.tsdb = tsdb; this.next = next; }
Source:
<code><START> protected boolean containerAllowsStaticFieldAccess() { <END> final String allowStaticFieldAcccess = container.getInstance(String.class, StrutsConstants.STRUTS_ALLOW_STATIC_FIELD_ACCESS); if (allowStaticFieldAcccess == null) { return true; } else { return BooleanUtils.toBoolean(allowStaticFieldAcccess); } }</code><technical_language>I investigated containerAllowsStaticMethodAccess() need fix [this in default.properties](<LINK_0>! I conduct static methods for static fields</technical_language>

Target:
protected boolean containerAllowsStaticFieldAccess() { return BooleanUtils.toBoolean(container.getInstance(String.class, StrutsConstants.STRUTS_ALLOW_STATIC_FIELD_ACCESS)); }
Source:
<code>public boolean visible() throws IOException { final boolean shown; if (this.file.exists()) { final UserDefinedFileAttributeView view = Files.getFileAttributeView( this.file.toPath(), UserDefinedFileAttributeView.class ); if (view.list().contains(MkAttributes.VISIBILITY)) { final ByteBuffer buf = ByteBuffer.allocate( view.size(MkAttributes.VISIBILITY) ); view.read(MkAttributes.VISIBILITY, buf); buf.flip(); <START> shown = Boolean.valueOf(Charsets.UTF_8.decode(buf).toString()); <END> } else { shown = false; } } else { shown = false; } return shown; }</code><technical_language>@carlosmiranda StandardCharsets</technical_language>

Target:
public boolean visible() throws IOException { final boolean shown; final UserDefinedFileAttributeView view = Files.getFileAttributeView( this.file.toPath(), UserDefinedFileAttributeView.class ); if (view.list().contains(MkAttributes.VISIBILITY)) { final ByteBuffer buf = ByteBuffer.allocate( view.size(MkAttributes.VISIBILITY) ); view.read(MkAttributes.VISIBILITY, buf); buf.flip(); shown = Boolean.valueOf( StandardCharsets.UTF_8.decode(buf).toString() ); } else { shown = false; } return shown; }
Source:
<code>protected void extraValidation( final List<Throwable> validationErrors, final Configuration configuration) { if (this.reportTemplate != null && this.reportKey == null || this.reportTemplate == null && this.reportKey != null) { validationErrors.add(new ConfigurationException("'reportKey' and 'reportTemplate' must ither " + "both be null or both be non-null. reportKey: " + this.reportKey + " reportTemplate: " + this.reportTemplate)); } <START> for (Attribute attribute : this.allAttributes.values()) { <END> attribute.validate(validationErrors, configuration); } ProcessorDependencyGraphFactory.fillProcessorAttributes(this.processors, this.allAttributes); for (Processor processor : this.processors) { processor.validate(validationErrors, configuration); } final Map<String, Class<?>> attcls = new HashMap<String, Class<?>>(); for (String attributeName: this.allAttributes.keySet()) { attcls.put(attributeName, this.allAttributes.get(attributeName).getValueType()); } try { this.processorGraph = this.processorGraphFactory.build(this.processors, attcls); } catch (IllegalArgumentException e) { validationErrors.add(e); } if (this.processorGraph == null) { validationErrors.add(new ConfigurationException( "There are no child processors for this processor")); } else { final Set<Processor<?, ?>> allProcessors = this.processorGraph.getAllProcessors(); for (Processor<?, ?> processor : allProcessors) { processor.validate(validationErrors, configuration); } } }</code><technical_language>s/all/internal/</technical_language>

Target:
protected void extraValidation( final List<Throwable> validationErrors, final Configuration configuration) { if (this.reportTemplate != null && this.reportKey == null || this.reportTemplate == null && this.reportKey != null) { validationErrors.add(new ConfigurationException("'reportKey' and 'reportTemplate' must ither " + "both be null or both be non-null. reportKey: " + this.reportKey + " reportTemplate: " + this.reportTemplate)); } for (Attribute attribute : this.internalAttributes.values()) { attribute.validate(validationErrors, configuration); } ProcessorDependencyGraphFactory.fillProcessorAttributes(this.processors, this.allAttributes); for (Processor processor : this.processors) { processor.validate(validationErrors, configuration); } final Map<String, Class<?>> attcls = new HashMap<String, Class<?>>(); for (String attributeName: this.allAttributes.keySet()) { attcls.put(attributeName, this.allAttributes.get(attributeName).getValueType()); } try { this.processorGraph = this.processorGraphFactory.build(this.processors, attcls); } catch (IllegalArgumentException e) { validationErrors.add(e); } if (this.processorGraph == null) { validationErrors.add(new ConfigurationException( "There are no child processors for this processor")); } else { final Set<Processor<?, ?>> allProcessors = this.processorGraph.getAllProcessors(); for (Processor<?, ?> processor : allProcessors) { processor.validate(validationErrors, configuration); } } }
Source:
<code>Helper(@GerritServerConfig final Config config, final GroupCache groupCache) { this.groupCache = groupCache; this.config = config; this.server = LdapRealm.required(config, "server"); this.username = LdapRealm.optional(config, "username"); this.password = LdapRealm.optional(config, "password"); this.referral = LdapRealm.optional(config, "referral"); this.sslVerify = config.getBoolean("ldap", "sslverify", true); String timeout = LdapRealm.optional(config, "readTimeout"); if (timeout != null) { this.readTimeOutMillis = Long.toString(ConfigUtil.getTimeUnit(timeout, 0, TimeUnit.MILLISECONDS)); } else { <START> this.readTimeOutMillis = null; <END> } }</code><technical_language>Nit: "this" needed line 75 71</technical_language>

Target:
Helper(@GerritServerConfig final Config config, final GroupCache groupCache) { this.groupCache = groupCache; this.config = config; this.server = LdapRealm.required(config, "server"); this.username = LdapRealm.optional(config, "username"); this.password = LdapRealm.optional(config, "password"); this.referral = LdapRealm.optional(config, "referral"); this.sslVerify = config.getBoolean("ldap", "sslverify", true); String timeout = LdapRealm.optional(config, "readTimeout"); if (timeout != null) { readTimeOutMillis = Long.toString(ConfigUtil.getTimeUnit(timeout, 0, TimeUnit.MILLISECONDS)); } else { readTimeOutMillis = null; } }
Source:
<code>private void rollBackVdsGroupConsumptionParameters(List<QuotaVdsGroupConsumptionParameter> executed) { for (QuotaVdsGroupConsumptionParameter parameter : executed) { long requestedMemory = parameter.getQuotaAction() == QuotaConsumptionParameter.QuotaAction.CONSUME ? -parameter.getRequestedMemory() : parameter.getRequestedMemory(); int requestedCpu = <START> parameter.getQuotaAction() == QuotaConsumptionParameter.QuotaAction.CONSUME ? <END> -parameter.getRequestedCpu() : parameter.getRequestedCpu(); QuotaVdsGroup quotaVdsGroup = null; Quota quota = parameter.getQuota(); if (quota.getGlobalQuotaVdsGroup() != null) { quotaVdsGroup = quota.getGlobalQuotaVdsGroup(); } else { for (QuotaVdsGroup vdsGroup : quota.getQuotaVdsGroups()) { if (vdsGroup.getVdsGroupId().equals(parameter.getVdsGroupId())) { quotaVdsGroup = vdsGroup; break; } } } long newMemory = requestedMemory + quotaVdsGroup.getMemSizeMBUsage(); int newVcpu = requestedCpu + quotaVdsGroup.getVirtualCpuUsage(); cacheNewValues(quotaVdsGroup, newMemory, newVcpu); } }</code><technical_language>redundant check (466), consider changing</technical_language>

Target:
private void rollBackVdsGroupConsumptionParameters(List<QuotaVdsGroupConsumptionParameter> executed) { for (QuotaVdsGroupConsumptionParameter parameter : executed) { long requestedMemory = parameter.getQuotaAction() == QuotaConsumptionParameter.QuotaAction.CONSUME ? -parameter.getRequestedMemory() : parameter.getRequestedMemory(); int requestedCpu = parameter.getQuotaAction() == QuotaConsumptionParameter.QuotaAction.CONSUME ? -parameter.getRequestedCpu() : parameter.getRequestedCpu(); QuotaVdsGroup quotaVdsGroup = null; Quota quota = parameter.getQuota(); if (quota.getGlobalQuotaVdsGroup() != null) { quotaVdsGroup = quota.getGlobalQuotaVdsGroup(); } else { for (QuotaVdsGroup vdsGroup : quota.getQuotaVdsGroups()) { if (vdsGroup.getVdsGroupId().equals(parameter.getVdsGroupId())) { quotaVdsGroup = vdsGroup; break; } } } if (quotaVdsGroup != null) { long newMemory = requestedMemory + quotaVdsGroup.getMemSizeMBUsage(); int newVcpu = requestedCpu + quotaVdsGroup.getVirtualCpuUsage(); cacheNewValues(quotaVdsGroup, newMemory, newVcpu); } } }
Source:
<code>public ObjectInstance createMBean(String className, ObjectName name) { <START> throw new UnsupportedOperationException("createMBean not supported over Jolokia"); <END> }</code><technical_language>suggestion throw new UnsupportedOperationException("createMBean supported Jolokia");</technical_language>

Target:
public ObjectInstance createMBean(String className, ObjectName name) { throw new UnsupportedOperationException("createMBean not supported by Jolokia"); }
Source:
<code>private void updateErrorMessage() { setErrorMessage(null); try { ISourceContainer[] containers = fContainer.getSourceContainers(); if (containers.length == 0) return; for (ISourceContainer c : containers) { MapEntrySourceContainer entry = (MapEntrySourceContainer)c; String backendPath = entry.getBackend(); if (backendPath.isEmpty()) { setErrorMessage(SourceLookupUIMessages.PathMappingDialog_5); break; <START> } <END> IPath localPath = entry.getLocalPath(); if (localPath.isEmpty()) { setErrorMessage(SourceLookupUIMessages.PathMappingDialog_7); break; } if (!localPath.toFile().exists()) { setErrorMessage(SourceLookupUIMessages.PathMappingDialog_8); break; } if (!localPath.toFile().isDirectory()) { setErrorMessage(SourceLookupUIMessages.PathMappingDialog_9); break; } if (!localPath.toFile().isAbsolute()) { setErrorMessage(SourceLookupUIMessages.PathMappingDialog_10); break; } } } catch (CoreException e) { } }</code><technical_language>I guess check validity of path anymore of scenario debug a remote target? Is it? if is not, do check</technical_language>

Target:
private void updateErrorMessage() { setErrorMessage(null); try { ISourceContainer[] containers = fContainer.getSourceContainers(); if (containers.length == 0) return; for (ISourceContainer c : containers) { MapEntrySourceContainer entry = (MapEntrySourceContainer)c; String backendPath = entry.getBackendPathStr(); if (backendPath.isEmpty()) { setErrorMessage(SourceLookupUIMessages.PathMappingDialog_5); break; } IPath localPath = entry.getLocalPath(); if (localPath.isEmpty()) { setErrorMessage(SourceLookupUIMessages.PathMappingDialog_7); break; } if (!localPath.toFile().exists()) { setErrorMessage(SourceLookupUIMessages.PathMappingDialog_8); break; } if (!localPath.toFile().isDirectory()) { setErrorMessage(SourceLookupUIMessages.PathMappingDialog_9); break; } if (!localPath.toFile().isAbsolute()) { setErrorMessage(SourceLookupUIMessages.PathMappingDialog_10); break; } } } catch (CoreException e) { } }
Source:
<code>public S3Client( @Named(CONF_S3_AUTH_KEY_ID) String keyId, @Named(CONF_S3_AUTH_SECRET) String secret, @Named(CONF_S3_BUCKET_NAME) String bucketName) { checkNotNull(keyId, "aws api access key id is null"); checkNotNull(secret, "aws api secret access key is null"); this.bucketName = checkNotNull(bucketName, "s3 bucket name is null"); BasicAWSCredentials credentials = null; <START> try { <END> credentials = new BasicAWSCredentials(keyId, secret); } catch (Exception e) { throw new AmazonClientException("Cannot initialize credentials", e); } client = AmazonS3ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); }</code><technical_language>extract BasicAWSCredential buildAWSCredentials(keyId, secret) hide exception handling</technical_language>

Target:
public S3Client( @Named(CONF_S3_AUTH_KEY_ID) String keyId, @Named(CONF_S3_AUTH_SECRET) String secret, @Named(CONF_S3_BUCKET_NAME) String bucketName) { checkNotNull(keyId, "aws api access key id is null"); checkNotNull(secret, "aws api secret access key is null"); this.bucketName = checkNotNull(bucketName, "s3 bucket name is null"); client = AmazonS3ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(buildAWSCredentials(keyId, secret))) .build(); }
Source:
<code>protected void onPause() { super.onPause(); <START> getSupportFragmentManager().popBackStack(); <END> mIsRunning = false; }</code><technical_language>clarify this is necessary? Also, rest of Activity getFragmentManager() this is getSupportFragmentManager(). specific reason</technical_language>

Target:
protected void onPause() { super.onPause(); getFragmentManager().popBackStack(); mIsRunning = false; }