auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean validateInputs() { if (!super.validateInputs()) { return false; } VdcQueryReturnValue returnValue = getQueryReturnValue(); returnValue.setExceptionString(""); try { String hostName = getParameters().getVdsHostName(); <START> if (StringUtils.isBlank(hostName)) { <END> returnValue.setExceptionString("Cannot register Host - no Hostname address specified."); return false; } List<VDS> vdssByUniqueId = getVdssByUniqueId(); if (vdssByUniqueId.size() > 1) { returnValue.setExceptionString("Cannot register Host - unique id is ambigious."); return false; } if (vdssByUniqueId.size() == 1) { VDS vds = vdssByUniqueId.get(0); if (!VdsHandler.isPendingOvirt(vds)) { returnValue.setExceptionString(VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_UPDATE.name()); return false; } Long otp = getParameters().getOtp(); if (otp != null && !isValidOtp(vds, otp)) { returnValue.setExceptionString(String.format("Invalid OTP for host %s", hostName)); return false; } } } catch (RuntimeException ex) { log.error(ex); returnValue.setExceptionString(String.format("Cannot register Host - An exception has been thrown: %1$s", ex.getMessage())); return false; } return true; }</code><technical_language>meant StringUtils.isEmpty(). isBlank returns true for a string of whitespaces too</technical_language>

Target:
protected boolean validateInputs() { if (!super.validateInputs()) { return false; } VdcQueryReturnValue returnValue = getQueryReturnValue(); returnValue.setExceptionString(""); try { String hostName = getParameters().getVdsHostName(); if (StringUtils.isEmpty(hostName)) { returnValue.setExceptionString("Cannot register Host - no Hostname address specified."); return false; } List<VDS> vdssByUniqueId = getVdssByUniqueId(); if (vdssByUniqueId.size() > 1) { returnValue.setExceptionString("Cannot register Host - unique id is ambigious."); return false; } if (vdssByUniqueId.size() == 1) { VDS vds = vdssByUniqueId.get(0); if (!VdsHandler.isPendingOvirt(vds)) { returnValue.setExceptionString(VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_UPDATE.name()); return false; } Long otp = getParameters().getOtp(); if (otp != null && !isValidOtp(vds, otp)) { returnValue.setExceptionString(String.format("Invalid OTP for host %s", hostName)); return false; } } } catch (RuntimeException ex) { log.error(ex); returnValue.setExceptionString(String.format("Cannot register Host - An exception has been thrown: %1$s", ex.getMessage())); return false; } return true; }
Source:
<code>private long extractLongKey(Data entryKey, Object entryValue) { Object key = QueryableEntry.extractAttributeValue(extractors, serializationService, keyAttribute, entryKey, entryValue, null); if (key == null) { throw new NullPointerException("non-null unique key value is required"); } if (!Numbers.isLongRepresentable(key.getClass())) { <START> throw new NullPointerException("integer-valued unique key value is required"); <END> } return ((Number) key).longValue(); }</code><technical_language>IllegalArgumentException is more here</technical_language>

Target:
private long extractLongKey(Data entryKey, Object entryValue) { Object key = extractAttributeValue(extractors, serializationService, keyAttribute, entryKey, entryValue, null); return extractLongKey(key); }
Source:
<code>public ActionForward prorateBill(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ContractsGrantsInvoiceDocumentForm contractsGrantsInvoiceDocumentForm = (ContractsGrantsInvoiceDocumentForm) form; KualiDecimal budgetTotalAmount = findAwardBUdgetTotal(contractsGrantsInvoiceDocumentForm); if (budgetTotalAmount == null || budgetTotalAmount.isLessEqual(KualiDecimal.ZERO)) { <START> String budetTotalAmountString = budgetTotalAmount != null ? budgetTotalAmount.toString() : "0"; <END> ErrorMessage errorMessage = new ErrorMessage(CUKFSKeyConstants.ERROR_DOCUMENT_CONTRACT_GRANT_INVOICE_DOCUMENT_PRORATE_NO_AWARD_BUDGET_TOTAL, budetTotalAmountString); KNSGlobalVariables.getMessageList().add(errorMessage); LOG.error("prorateBill, Prorate is not valid as the budgetTotalAmount is " + budgetTotalAmount); return mapping.findForward(KFSConstants.MAPPING_BASIC); } return super.prorateBill(mapping, form, request, response); }</code><technical_language>Minor typo in variable name; changed "budetTotal..." "budgetTotal..."</technical_language>

Target:
public ActionForward prorateBill(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ContractsGrantsInvoiceDocumentForm contractsGrantsInvoiceDocumentForm = (ContractsGrantsInvoiceDocumentForm) form; KualiDecimal budgetTotalAmount = findAwardBudgetTotal(contractsGrantsInvoiceDocumentForm); if (budgetTotalAmount == null || budgetTotalAmount.isLessEqual(KualiDecimal.ZERO)) { String budgetTotalAmountString = budgetTotalAmount != null ? budgetTotalAmount.toString() : "0"; GlobalVariables.getMessageMap().putError(KFSConstants.GLOBAL_ERRORS, CUKFSKeyConstants.ERROR_DOCUMENT_CONTRACT_GRANT_INVOICE_PRORATE_NO_AWARD_BUDGET_TOTAL, budgetTotalAmountString); LOG.error("prorateBill, Prorate is not valid as the budgetTotalAmount is " + budgetTotalAmount); return mapping.findForward(KFSConstants.MAPPING_BASIC); } return super.prorateBill(mapping, form, request, response); }
Source:
<code>public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.GET != request.getMethod()) { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Only support GET method check if bookie is ready."); return response; } StateManager sm = bookie.getStateManager(); if (sm.isRunning()) { response.setCode(HttpServer.StatusCode.OK); } else { response.setCode(HttpServer.StatusCode.SERVICE_UNAVAILABLE); response.setBody("Bookie is not fully started yet"); <START> } <END> return response; }</code><technical_language>if a bookie is shutting down, isRunning is false. message is correct. check if state manager is shutting not, return proper error message</technical_language>

Target:
public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.GET != request.getMethod()) { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Only support GET method check if bookie is ready."); return response; } StateManager sm = bookie.getStateManager(); if (sm.isRunning() && !sm.isShuttingDown()) { response.setCode(HttpServer.StatusCode.OK); response.setBody(""); } else { response.setCode(HttpServer.StatusCode.SERVICE_UNAVAILABLE); response.setBody("Bookie is not fully started yet"); } return response; }
Source:
<code><START> private ArrayList<String> loadFile(String file, Charset charset) { <END> ArrayList<String> list = new ArrayList<String>(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)); String line = reader.readLine(); while (line != null) { list.add(line); line = reader.readLine(); } } catch (IOException e) { controller.actionShowInfoDialog(getShell(), Resources.getMessage("DialogOrderSelection.3"), Resources.getMessage("DialogOrderSelection.4")+e.getMessage()); return null; } finally { if (reader != null) try { reader.close(); } catch (IOException e) { controller.actionShowInfoDialog(getShell(), Resources.getMessage("DialogOrderSelection.5"), Resources.getMessage("DialogOrderSelection.6")+e.getMessage()); return null; } } return list; }</code><technical_language>Please abstract return type List<String></technical_language>

Target:
private List<String> loadFile(String file, Charset charset) { List<String> list = new ArrayList<String>(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)); String line = reader.readLine(); Set<String> _elements = new HashSet<String>(); _elements.addAll(Arrays.asList(elements)); while (line != null) { list.add(line); if (list.size() > _elements.size() || !_elements.contains(line)) { controller.actionShowInfoDialog(getShell(), Resources.getMessage("DialogOrderSelection.16"), Resources.getMessage("DialogOrderSelection.17")); return null; } line = reader.readLine(); } if (list.size() != _elements.size()) { controller.actionShowInfoDialog(getShell(), Resources.getMessage("DialogOrderSelection.16"), Resources.getMessage("DialogOrderSelection.17")); return null; } } catch (IOException e) { controller.actionShowInfoDialog(getShell(), Resources.getMessage("DialogOrderSelection.3"), Resources.getMessage("DialogOrderSelection.4") + e.getMessage()); return null; } finally { if (reader != null) try { reader.close(); } catch (IOException e) { controller.actionShowInfoDialog(getShell(), Resources.getMessage("DialogOrderSelection.5"), Resources.getMessage("DialogOrderSelection.6") + e.getMessage()); return null; } } return list; }
Source:
<code>private boolean processOutput(CallContextImpl callContext){ InputStream output = processExec(callContext); switch(getPhase()) { case INTERRUPTING: setPhase(WorkPhase.INTERRUPTED); logger.info("exec interrupted endpoint={} count={} work={}", callContext.getEndpoint().getEndpointPath(), getCallCount(), callContext.getWorkUnit()); return false; case RUNNING: <START> if (output == null ) { <END> if(getCallerThreadPoolExecutor() == null || getCallerThreadPoolExecutor().getActiveCount() <= 1) setPhase(WorkPhase.COMPLETED); logger.info("exec completed endpoint={} count={} work={}", callContext.getEndpoint().getEndpointPath(), getCallCount(), callContext.getWorkUnit()); return false; } return true; default: throw new MarkLogicInternalException( "unexpected state for "+callContext.getEndpoint().getEndpointPath()+" during loop: "+getPhase().name() ); } }</code><technical_language>check aliveCallContextCount.get() == 0 instead of getCallerThreadPoolExecutor().getActiveCount() <= 1 well</technical_language>

Target:
private boolean processOutput(CallContextImpl callContext){ InputStream output = processExec(callContext); switch(getPhase()) { case INTERRUPTING: setPhase(WorkPhase.INTERRUPTED); logger.info("exec interrupted endpoint={} count={} work={}", callContext.getEndpoint().getEndpointPath(), getCallCount(), callContext.getWorkUnit()); return false; case RUNNING: if (output == null ) { if(getCallerThreadPoolExecutor() == null || aliveCallContextCount.get() == 0) setPhase(WorkPhase.COMPLETED); logger.info("exec completed endpoint={} count={} work={}", callContext.getEndpoint().getEndpointPath(), getCallCount(), callContext.getWorkUnit()); return false; } return true; default: throw new MarkLogicInternalException( "unexpected state for "+callContext.getEndpoint().getEndpointPath()+" during loop: "+getPhase().name() ); } }
Source:
<code><START> public void test_futureValueSensitivity_compoundNone_fx() { <END> DiscountingRatePaymentPeriodPricer pricer = DiscountingRatePaymentPeriodPricer.DEFAULT; RatesProvider mockProv = mock(RatesProvider.class); when(mockProv.getValuationDate()).thenReturn(VALUATION_DATE); when(mockProv.fxIndexRate(WM_GBP_USD, GBP, FX_DATE_1)).thenReturn(RATE_FX); when(mockProv.fxIndexRateSensitivity(WM_GBP_USD, GBP, FX_DATE_1)) .thenReturn(FxIndexSensitivity.of(WM_GBP_USD, GBP, FX_DATE_1, 1.0)); PointSensitivityBuilder sensiComputed = pricer.futureValueSensitivity(PAYMENT_PERIOD_FULL_GS_FX, mockProv); PointSensitivityBuilder sensiExpected = FxIndexSensitivity.of(WM_GBP_USD, USD, GBP, FX_DATE_1, NOTIONAL_100); assertTrue(sensiComputed.build().equalWithTolerance( sensiExpected.build(), EPS_FD * PAYMENT_PERIOD_FULL_GS_FX.getNotional())); }</code><technical_language>need a test for presentValueSensitivity in case of FX reset. result compare a finite difference computation. a test side: payment is in base currency of index counter currency of index</technical_language>

Target:
public void test_futureValueSensitivity_compoundNone_fx() { DiscountingRatePaymentPeriodPricer pricer = DiscountingRatePaymentPeriodPricer.DEFAULT; ImmutableRatesProvider provider = MULTI_GBP_USD; PointSensitivityBuilder pointSensiComputedUSD = pricer.futureValueSensitivity(PAYMENT_PERIOD_FULL_GS_FX_USD, provider); CurveParameterSensitivity sensiComputedUSD = provider.parameterSensitivity(pointSensiComputedUSD.build().normalized()); CurveParameterSensitivity sensiExpectedUSD = CAL_FD.sensitivity( provider, (p) -> CurrencyAmount.of(USD, pricer.futureValue(PAYMENT_PERIOD_FULL_GS_FX_USD, (p)))); assertTrue(sensiComputedUSD.equalWithTolerance( sensiExpectedUSD, EPS_FD * PAYMENT_PERIOD_FULL_GS_FX_USD.getNotional())); PointSensitivityBuilder pointSensiComputedGBP = pricer.futureValueSensitivity(PAYMENT_PERIOD_FULL_GS_FX_GBP, provider); CurveParameterSensitivity sensiComputedGBP = provider.parameterSensitivity(pointSensiComputedGBP.build().normalized()); CurveParameterSensitivity sensiExpectedGBP = CAL_FD.sensitivity( provider, (p) -> CurrencyAmount.of(GBP, pricer.futureValue(PAYMENT_PERIOD_FULL_GS_FX_GBP, (p)))); assertTrue(sensiComputedGBP.equalWithTolerance( sensiExpectedGBP, EPS_FD * PAYMENT_PERIOD_FULL_GS_FX_GBP.getNotional())); }
Source:
<code>public void afterConnectionEstablished() throws SQLException { if(currentConnection.getTransactionIsolation()==0){ System.out.println("afterConnectionEstablished method"); <START> currentConnection.setAutoCommit(true); <END> }else{ currentConnection.setAutoCommit(false); } }</code><technical_language>added some auto-commit related features - this need some refinement</technical_language>

Target:
public void afterConnectionEstablished() throws SQLException { if (currentConnection.getMetaData().supportsTransactions()) { Options.setOption(Options.OPTION_AUTO_COMMIT, "false"); currentConnection.setAutoCommit(false); } else { Options.setOption(Options.OPTION_AUTO_COMMIT, "true"); currentConnection.setAutoCommit(true); } }
Source:
<code>private void finishLookupSourceUnspilling() { if (!unspillInProgress.get().isDone()) { return; } Queue<Page> pages = new ArrayDeque<>(getDone(unspillInProgress.get())); long memoryRetainedByRemainingPages = pages.stream() .mapToLong(Page::getRetainedSizeInBytes) .sum(); <START> operatorContext.setMemoryReservation(memoryRetainedByRemainingPages + index.getEstimatedSize().toBytes()); <END> while (!pages.isEmpty()) { Page next = pages.remove(); index.addPage(next); memoryRetainedByRemainingPages -= next.getRetainedSizeInBytes(); operatorContext.setMemoryReservation(memoryRetainedByRemainingPages + index.getEstimatedSize().toBytes()); } LookupSourceSupplier partition = buildLookupSource(); operatorContext.setMemoryReservation(partition.get().getInMemorySizeInBytes()); spilledLookupSourceHandle.setLookupSource(partition); state = State.LOOKUP_SOURCE_UNSPILLED_AND_BUILT; }</code><technical_language>a concern processing of partition in single method call synchronously time. is in memory building LookupSource GBs of data a a lot. measure expect here</technical_language>

Target:
private void finishLookupSourceUnspilling() { checkState(state == State.INPUT_UNSPILLING); if (!unspillInProgress.get().isDone()) { return; } Queue<Page> pages = new ArrayDeque<>(getDone(unspillInProgress.get())); long memoryRetainedByRemainingPages = pages.stream() .mapToLong(Page::getRetainedSizeInBytes) .sum(); operatorContext.setMemoryReservation(memoryRetainedByRemainingPages + index.getEstimatedSize().toBytes()); while (!pages.isEmpty()) { Page next = pages.remove(); index.addPage(next); memoryRetainedByRemainingPages -= next.getRetainedSizeInBytes(); operatorContext.setMemoryReservation(memoryRetainedByRemainingPages + index.getEstimatedSize().toBytes()); } LookupSourceSupplier partition = buildLookupSource(); lookupSourceChecksum.ifPresent(checksum -> checkState(partition.checksum() == checksum, "Unspilled lookupSource checksum does not match original one")); operatorContext.setMemoryReservation(partition.get().getInMemorySizeInBytes()); spilledLookupSourceHandle.setLookupSource(partition); state = State.INPUT_UNSPILLED_AND_BUILT; }
Source:
<code>private void addUpstreamCommittersTriggeringBuild(AbstractBuild<?, ?> build, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc, EnvVars env, TaskListener listener) { <START> listener.getLogger().println(String.format("Adding upstream committer from job %s with build number %s", build.getProject().getDisplayName(), build.getNumber())); <END> for (ChangeLogSet.Entry change : build.getChangeSet()) { User user = change.getAuthor(); String email = user.getProperty(Mailer.UserProperty.class).getAddress(); if (email != null) { listener.getLogger().println(String.format("Adding upstream committer %s to recipient list with email %s", user.getFullName(), email)); EmailRecipientUtils.addAddressesFromRecipientList(to, cc, bcc, email, env, listener); } else { listener.getLogger().println(String.format("The user %s does not have a configured email email, trying the user's id", user.getFullName())); EmailRecipientUtils.addAddressesFromRecipientList(to, cc, bcc, user.getId(), env, listener); } } }</code><technical_language>Do log messages potential get noisy? debug</technical_language>

Target:
private void addUpstreamCommittersTriggeringBuild(AbstractBuild<?, ?> build, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc, EnvVars env, TaskListener listener) { descriptor.debug(listener.getLogger(), "Adding upstream committer from job %s with build number %s", build.getProject().getDisplayName(), build.getNumber()); for (ChangeLogSet.Entry change : build.getChangeSet()) { User user = change.getAuthor(); String email = user.getProperty(Mailer.UserProperty.class).getAddress(); if (email != null) { descriptor.debug(listener.getLogger(), "Adding upstream committer %s to recipient list with email %s", user.getFullName(), email); EmailRecipientUtils.addAddressesFromRecipientList(to, cc, bcc, email, env, listener); } else { descriptor.debug(listener.getLogger(), "The user %s does not have a configured email email, trying the user's id", user.getFullName()); EmailRecipientUtils.addAddressesFromRecipientList(to, cc, bcc, user.getId(), env, listener); } } }
Source:
<code>public static String opToSparkString(ValueNode operand) { String retval = null; try { SPARK_EXPRESSION.set(Boolean.TRUE); initRelationalOpDepth(); retval = opToString2(operand); } <START> catch (Exception e) { <END> } finally { SPARK_EXPRESSION.set(Boolean.FALSE); } return retval; }</code><technical_language>Catch LANG_DOES_NOT_IMPLEMENT exception</technical_language>

Target:
public static String opToSparkString(ValueNode operand) throws StandardException { String retval = ""; try { OperatorToString vars = new OperatorToString(true, new MutableInt(0)); retval = opToString2(operand, vars); } catch (StandardException e) { if (e.getSQLState() != SQLState.LANG_DOES_NOT_IMPLEMENT) throw e; } return retval; }
Source:
<code>public Future<String> putBlobWithIdVersion(BlobProperties blobProperties, byte[] usermetadata, ReadableStreamChannel channel, Short blobIdVersion) { FutureResult<String> futureResult = new FutureResult<>(); PostData postData = <START> new PostData(blobProperties, usermetadata, channel, null, new PutBlobOptionsBuilder().build(), null, <END> futureResult); operationPool.submit(new InMemoryBlobPoster(postData, blobs, notificationSystem, clusterMap, blobIdVersion)); return futureResult; }</code><technical_language>replace PutBlobOptionsBuilder().build() PutBlobOptions.DEFAULT</technical_language>

Target:
public Future<String> putBlobWithIdVersion(BlobProperties blobProperties, byte[] usermetadata, ReadableStreamChannel channel, Short blobIdVersion) { FutureResult<String> futureResult = new FutureResult<>(); PostData postData = new PostData(blobProperties, usermetadata, channel, null, PutBlobOptions.DEFAULT, null, futureResult); operationPool.submit(new InMemoryBlobPoster(postData, blobs, notificationSystem, clusterMap, blobIdVersion)); return futureResult; }
Source:
<code>private static int toPositive(int number) { <START> return number & 2147483647; <END> }</code><technical_language>nit: Change 2147483647 0x7fffffff for easier understanding</technical_language>

Target:
private static int toPositive(int number) { return number & Integer.MAX_VALUE; }
Source:
<code>private void update() { <START> if (colWidth.getIntValue() == 0) { <END> new ErrorDialog("The number of columns cannot be zero").center(); return; } AccountDiffPreference dp = new AccountDiffPreference(getValue()); dp.setIgnoreWhitespace(getIgnoreWhitespace()); dp.setContext(getContext()); dp.setTabSize(tabWidth.getIntValue()); dp.setLineLength(colWidth.getIntValue()); dp.setSyntaxHighlighting(syntaxHighlighting.getValue()); dp.setIntralineDifference(intralineDifference.getValue()); dp.setShowWhitespaceErrors(whitespaceErrors.getValue()); dp.setShowTabs(showTabs.getValue()); dp.setSkipDeleted(skipDeleted.getValue()); dp.setSkipUncommented(skipUncommented.getValue()); listenablePrefs.set(dp); if (Gerrit.isSignedIn()) { persistDiffPreferences(); } }</code><technical_language>prevent negative values? impossible in this box</technical_language>

Target:
private void update() { if (colWidth.getIntValue() <= 0) { new ErrorDialog(PatchUtil.C.illegalNumberOfColumns()).center(); return; } AccountDiffPreference dp = new AccountDiffPreference(getValue()); dp.setIgnoreWhitespace(getIgnoreWhitespace()); dp.setContext(getContext()); dp.setTabSize(tabWidth.getIntValue()); dp.setLineLength(colWidth.getIntValue()); dp.setSyntaxHighlighting(syntaxHighlighting.getValue()); dp.setIntralineDifference(intralineDifference.getValue()); dp.setShowWhitespaceErrors(whitespaceErrors.getValue()); dp.setShowTabs(showTabs.getValue()); dp.setSkipDeleted(skipDeleted.getValue()); dp.setSkipUncommented(skipUncommented.getValue()); listenablePrefs.set(dp); if (Gerrit.isSignedIn()) { persistDiffPreferences(); } }
Source:
<code><START> protected boolean isValidChar(final char c) { <END> return isValidChar(regExp, c); }</code><technical_language>private? package protected access</technical_language>

Target:
private boolean isValidChar(final char c) { return isValidChar(regExp, c); }
Source:
<code>private String shareKey(FileTreeNode file) { if(file == null) { return ""; } <START> String key = file.getPointer().filePointer.toString(); <END> return key; }</code><technical_language>location</technical_language>

Target:
private String shareKey(FileTreeNode file) { if(file == null) { return ""; } String key = file.getPointer().filePointer.getLocation().toString(); return key; }
Source:
<code>public void before() { for (int i = 0; i < srcPath.length; ++i) { final Path src = FileSystems.getDefault().getPath(srcPath[i]); final Path dst = FileSystems.getDefault().getPath( <START> FilenameUtils.concat(DeploymentUtils.getPathToWorkerDir(workingDir, workerIDs[i]), "worker_" <END> + workerIDs[i] + "_data.db")); try { Files.copy(src, dst); } catch (final Exception e) { throw new RuntimeException("unable to copy files from " + src.toAbsolutePath() + " to " + dst.toAbsolutePath() + ". you can find the dataset at /projects/db7/dataset/twitter/speedtest.", e); } } successfulSetup = true; }</code><technical_language>Another example of duplicating worker ID in file names requires unnecessary code</technical_language>

Target:
public void before() { for (int i = 0; i < srcPath.length; ++i) { final Path src = FileSystems.getDefault().getPath(srcPath[i]); final Path dst = Paths.get(DeploymentUtils.getPathToWorkerDir(workingDir, workerIDs[i]), "data.db"); try { Files.copy(src, dst); } catch (final Exception e) { throw new RuntimeException("unable to copy files from " + src.toAbsolutePath() + " to " + dst.toAbsolutePath() + ". you can find the dataset at /projects/db7/dataset/twitter/speedtest.", e); } } successfulSetup = true; }
Source:
<code>public Status update(String table, String key, HashMap<String, ByteIterator> values) { try { SolrQuery query = new SolrQuery(); query.setQuery("id:" + key); final QueryResponse response = (cloudMode) ? cloudClient.query(table, query) : httpClient.query(table, query); if ((response.getResults() != null) && (response.getResults().getNumFound() > 0)) { final SolrDocument updatedDoc = response.getResults().get(0); for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { updatedDoc.setField(entry.getKey(), entry.getValue()); } if (cloudMode) { cloudClient.add(table, ClientUtils.toSolrInputDocument(updatedDoc)); cloudClient.commit(table); } else { httpClient.add(table, ClientUtils.toSolrInputDocument(updatedDoc)); httpClient.commit(table); } return Status.OK; } return Status.NOT_FOUND; <START> } catch (Exception e) { <END> e.printStackTrace(); } return Status.ERROR; }</code><technical_language>avoid catching exceptions more explicit</technical_language>

Target:
public Status update(String table, String key, HashMap<String, ByteIterator> values) { try { SolrInputDocument updatedDoc = new SolrInputDocument(); updatedDoc.addField("id", key); for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { updatedDoc.addField(entry.getKey(), Collections.singletonMap("set", entry.getValue())); } UpdateResponse writeResponse; if (batchMode) { writeResponse = client.add(table, updatedDoc, commitTime); } else { writeResponse = client.add(table, updatedDoc); client.commit(table); } return checkStatus(writeResponse.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace(); } return Status.ERROR; }
Source:
<code>protected boolean validateContent(AzureBlobFileSystem fs, Path path, byte[] originalByteArray) throws IOException { FSDataInputStream in = fs.open(path); int pos = 0; int lenOfOriginalByteArray = originalByteArray.length; byte valueOfContentAtPos = (byte) in.read(); <START> while (valueOfContentAtPos != -1 && pos < lenOfOriginalByteArray) { <END> if (originalByteArray[pos] != valueOfContentAtPos) return false; valueOfContentAtPos = (byte) in.read(); pos++; } if (valueOfContentAtPos != -1) return false; return true; }</code><technical_language>1. { } in if () clauses. 2. If a mismatch, AssertEquals include pos problem occurred Imagine: "A remote test run failed -what information in test report debugging this?"</technical_language>

Target:
protected boolean validateContent(AzureBlobFileSystem fs, Path path, byte[] originalByteArray) throws IOException { int pos = 0; int lenOfOriginalByteArray = originalByteArray.length; try (FSDataInputStream in = fs.open(path)) { byte valueOfContentAtPos = (byte) in.read(); while (valueOfContentAtPos != -1 && pos < lenOfOriginalByteArray) { if (originalByteArray[pos] != valueOfContentAtPos) { assertEquals("Mismatch in content validation at position {}", pos, originalByteArray[pos], valueOfContentAtPos); return false; } valueOfContentAtPos = (byte) in.read(); pos++; } if (valueOfContentAtPos != -1) { assertEquals("Expected end of file", -1, valueOfContentAtPos); return false; } return true; } }
Source:
<code>public CompilerClassloaderUtilsTest() { <START> super("target/test-classes/kjar-2-single-resources", new HashSet<>(Arrays.asList(KieDecorator.STORE_KIE_OBJECTS , KieDecorator.STORE_BUILD_CLASSPATH, KieDecorator.ENABLE_INCREMENTAL_BUILD))); END> }</code><technical_language>EnumSet.of()</technical_language>

Target:
public CompilerClassloaderUtilsTest() { super("target/test-classes/kjar-2-single-resources", EnumSet.of(KieDecorator.STORE_KIE_OBJECTS , KieDecorator.STORE_BUILD_CLASSPATH, KieDecorator.ENABLE_INCREMENTAL_BUILD)); }
Source:
<code>ReplicatorCableAI(ReplicatorEntity entity) { load.setAsPrivate(); this.entity = entity; Eln.instance.highVoltageCableDescriptor.applyTo(load); <START> load.setRs(load.getRs() * 10); <END> this.setMutexBits(1); }</code><technical_language>pretty this is new code Baughn push out</technical_language>

Target:
ReplicatorCableAI(ReplicatorEntity entity) { load.setAsPrivate(); this.entity = entity; Cable.Companion.getHighVoltage().descriptor.applyTo(load); load.setRs(load.getRs() * 10); this.setMutexBits(1); }
Source:
<code>public ConditionEvaluator(String eval) { super(); this.eval = eval; this.queryVars = new HashMap<>(); this.expression = new Expression(replaceQueriesWithVariables(eval)); log.debugf("eval [%s] produced [%s] with variables %s", eval, expression.getOriginalExpression(), queryVars); try { for (String var : queryVars.keySet()) { this.expression.setVariable(var, "1"); } this.expression.eval(); } catch (Exception e) { <START> throw new ExpressionException("Invalid eval [" + eval + "]: " + e.getMessage()); <END> } }</code><technical_language>a IllegalArgumentException instead propagate this com.udojava.evalex.Expression.ExpressionException</technical_language>

Target:
public ConditionEvaluator(String eval) { super(); this.eval = eval; this.queryVars = new HashMap<>(); this.expression = new Expression(replaceQueriesWithVariables(eval)); log.debugf("eval [%s] produced [%s] with variables %s", eval, expression.getOriginalExpression(), queryVars); try { for (String var : queryVars.keySet()) { this.expression.setVariable(var, "1"); } this.expression.eval(); } catch (Exception e) { throw new IllegalArgumentException("Invalid eval expression [" + eval + "]: " + e.getMessage()); } }
Source:
<code><START> public Flux<HandleItem> getHandles(Integer maxResult, boolean recursive) { <END> return azureFileStorageClient.directorys().listHandlesWithRestResponseAsync(shareName, directoryName, null, maxResult, null, snapshot, recursive, Context.NONE) .flatMapMany(response -> nextPageForHandles(response, maxResult, recursive)); }</code><technical_language>maxResult -> pageSize While technically maxResult in REST, paged request</technical_language>

Target:
public Flux<HandleItem> getHandles(Integer maxResult, boolean recursive) { return azureFileStorageClient.directorys().listHandlesWithRestResponseAsync(shareName, directoryPath, null, maxResult, null, snapshot, recursive, Context.NONE) .flatMapMany(response -> nextPageForHandles(response, maxResult, recursive)); }
Source:
<code>public Token getAccessToken(final Token requestToken) { PostMethod accessTokenPostMethod = new PostMethod(this.config.getAccessTokenURL()); signRequest(requestToken, accessTokenPostMethod, true); int accessTokenRequestResponse = -1; try { accessTokenRequestResponse = this.httpClient.executeMethod(accessTokenPostMethod); System.out.println(accessTokenRequestResponse); } catch (HttpException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } Token accessToken = null; try { if ((accessTokenRequestResponse != 200)) { return null; } System.out.println(accessTokenRequestResponse); <START> System.out.println("Access Token" + accessTokenPostMethod.getResponseBodyAsString()); <END> InputStream responseBodyAsStream = accessTokenPostMethod.getResponseBodyAsStream(); TokenExtractorImpl tokenextractor = new TokenExtractorImpl(); accessToken = tokenextractor.extract(StreamUtils.getStreamContents(responseBodyAsStream)); } catch (IOException e1) { e1.printStackTrace(); } return accessToken; }</code><technical_language>Suggest logging instead of println'd</technical_language>

Target:
public Token getAccessToken(final Token requestToken) { PostMethod accessTokenPostMethod = new PostMethod(this.config.getAccessTokenURL()); signRequest(requestToken, accessTokenPostMethod, true); int accessTokenRequestResponse = -1; try { accessTokenRequestResponse = this.httpClient.executeMethod(accessTokenPostMethod); OseeLog.log(DWAOAuthService.class, Level.INFO, "Response: " + accessTokenRequestResponse); } catch (HttpException e1) { OseeLog.log(getClass(), Level.SEVERE, e1); } catch (IOException e1) { OseeLog.log(getClass(), Level.SEVERE, e1); } Token accessToken = null; try { if ((accessTokenRequestResponse != 200)) { return null; } OseeLog.log(DWAOAuthService.class, Level.INFO, "Response: " + accessTokenRequestResponse); OseeLog.log(DWAOAuthService.class, Level.INFO, "Access Token" + accessTokenPostMethod.getResponseBodyAsString()); InputStream responseBodyAsStream = accessTokenPostMethod.getResponseBodyAsStream(); TokenExtractorImpl tokenextractor = new TokenExtractorImpl(); accessToken = tokenextractor.extract(StreamUtils.getStreamContents(responseBodyAsStream)); } catch (IOException e1) { OseeLog.log(getClass(), Level.SEVERE, e1); } return accessToken; }
Source:
<code>private void safelyAddProperty(Properties properties, String key, String value) { String safeValue = value; if (StringUtils.isBlank(value)) { <START> safeValue = KFSConstants.EMPTY_STRING; <END> } properties.put(key, safeValue); }</code><technical_language>StringUtils.defaultIfBlank() method simplify this</technical_language>

Target:
private void safelyAddProperty(Properties properties, String key, String value) { properties.put(key, StringUtils.defaultIfBlank(value, KFSConstants.EMPTY_STRING)); }
Source:
<code>private boolean doesClassContainDeprecatedAnnotation(MetadataReader metadataReader) throws ClassNotFoundException { try { Class dwrClass = Class.forName(metadataReader.getClassMetadata().getClassName()); String canonicalName = dwrClass.getCanonicalName(); if (!canonicalName.contains("Service") || canonicalName.contains("Test")) return false; if (dwrClass.isAnnotationPresent(Deprecated.class)) { return true; } <START> Method[] methods = dwrClass.getDeclaredMethods(); <END> for (Method method : methods) { if (method.isAnnotationPresent(Deprecated.class)) return true; } } catch (Throwable e) return false; }</code><technical_language>I this find methods in superclasses ignore this for i of a DWRService extends another a DWRService class</technical_language>

Target:
private boolean doesClassContainDeprecatedAnnotation(MetadataReader metadataReader) throws ClassNotFoundException { try { Class dwrClass = Class.forName(metadataReader.getClassMetadata().getClassName()); if (dwrClass.isAnnotationPresent(Deprecated.class)) { return true; } Method[] methods = dwrClass.getDeclaredMethods(); for (Method method : methods) { if (method.isAnnotationPresent(Deprecated.class)) return true; } } catch (Throwable e) return false; }
Source:
<code>private List<Question> getOldieQuestions(final Long accountId, final DateTime today, final Integer numQuestions, final Set<Integer> seenIds) { final List<Question> questions = new ArrayList<>(); final Set<Integer> addedIds = new HashSet<>(); addedIds.addAll(seenIds); addedIds.addAll(this.getUserAnsweredQuestionIds(accountId)); <START> List<Question> selectedQs; <END> selectedQs = this.randomlySelectFromQuestionPool(accountId, seenIds, Question.FREQUENCY.DAILY, today, 1); if (selectedQs.size() > 0 && !addedIds.contains(selectedQs.get(0).id)) { addedIds.add(selectedQs.get(0).id); questions.addAll(selectedQs); } if (questions.size() < numQuestions) { final Boolean answeredAll = addedIds.containsAll(this.baseQuestionIds); if (!answeredAll) { selectedQs.clear(); selectedQs = this.randomlySelectFromQuestionPool(accountId, addedIds, Question.FREQUENCY.ONE_TIME, today, 1); if (selectedQs.size() > 0) { addedIds.add(selectedQs.get(0).id); questions.addAll(selectedQs); } } } if (questions.size() < numQuestions) { final int numToGet = numQuestions - questions.size(); selectedQs.clear(); selectedQs= this.randomlySelectFromQuestionPool(accountId, addedIds, Question.FREQUENCY.OCCASIONALLY, today, numToGet); if (selectedQs.size() > 0) { questions.addAll(selectedQs); } } return questions; }</code><technical_language>Writing line avoids risk of a instantiated variable</technical_language>

Target:
private List<Question> getOldieQuestions(final Long accountId, final DateTime today, final Integer numQuestions, final Set<Integer> seenIds) { final List<Question> questions = new ArrayList<>(); final Set<Integer> addedIds = new HashSet<>(); addedIds.addAll(seenIds); addedIds.addAll(this.getUserAnsweredQuestionIds(accountId)); List<Question> dailyQs = this.randomlySelectFromQuestionPool(accountId, seenIds, Question.FREQUENCY.DAILY, today, 1); if (dailyQs.size() > 0 && !addedIds.contains(dailyQs.get(0).id)) { addedIds.add(dailyQs.get(0).id); questions.add(dailyQs.get(0)); } if (questions.size() < numQuestions) { final Boolean answeredAll = addedIds.containsAll(this.baseQuestionIds); if (!answeredAll) { final List<Question> selectedBaseQs = this.randomlySelectFromQuestionPool(accountId, addedIds, Question.FREQUENCY.ONE_TIME, today, 1); if (selectedBaseQs.size() > 0) { addedIds.add(selectedBaseQs.get(0).id); questions.add(selectedBaseQs.get(0)); } } } if (questions.size() < numQuestions) { final int numToGet = numQuestions - questions.size(); final List<Question> moreQs= this.randomlySelectFromQuestionPool(accountId, addedIds, Question.FREQUENCY.OCCASIONALLY, today, numToGet); if (moreQs.size() > 0) { questions.addAll(moreQs); } } return questions; }
Source:
<code>private KieCompilationResponse compileAndLoadKieJarMetadataAllResourcesPackagedJar() { String alternateSettingsAbsPath = TestUtilMaven.getSettingsFile(); Path tmpRoot = Files.createTempDirectory("repo_" + UUID.randomUUID().toString()); Path tmp = Files.createDirectories(Paths.get(tmpRoot.toString(), "dummy")); try { TestUtil.copyTree(Paths.get(ResourcesConstants.KJAR_2_ALL_RESOURCES), tmp); } catch (Exception e) { logger.error(e.getMessage()); } final AFCompiler compiler = KieMavenCompilerFactory.getCompiler(EnumSet.of(KieDecorator.STORE_KIE_OBJECTS, KieDecorator.ENABLE_LOGGING)); final KieCompilationResponse res; try { final WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(tmp); final CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, info, new String[]{ MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE); res = (KieCompilationResponse) compiler.compile(req); <START> logger.info("\nFinished " + res.isSuccessful() + " all Metadata tmp:{} UUID:{} res.getMavenOutput().isEmpty():{}", tmp , req.getRequestUUID(), res.getMavenOutput().isEmpty()); <END> if (!res.isSuccessful()) { try { logger.error("writing output on target folder:{}", tmp); TestUtil.writeMavenOutputIntoTargetFolder(tmp, res.getMavenOutput(), "ConcurrentBuildTest.compileAndLoadKieJarMetadataAllResourcesPackagedJar_" + req.getRequestUUID()); } catch (Exception e) { logger.error(e.getMessage()); } } } finally { latch.countDown(); } return res; }</code><technical_language>res.isSuccessful inlined</technical_language>

Target:
private KieCompilationResponse compileAndLoadKieJarMetadataAllResourcesPackagedJar() { String alternateSettingsAbsPath = TestUtilMaven.getSettingsFile(); Path tmpRoot = Files.createTempDirectory("repo_" + UUID.randomUUID().toString()); Path tmp = Files.createDirectories(Paths.get(tmpRoot.toString(), "dummy")); try { TestUtil.copyTree(Paths.get(ResourcesConstants.KJAR_2_ALL_RESOURCES), tmp); } catch (Exception e) { logger.error(e.getMessage()); } final AFCompiler compiler = KieMavenCompilerFactory.getCompiler(EnumSet.of(KieDecorator.STORE_KIE_OBJECTS, KieDecorator.ENABLE_LOGGING)); final KieCompilationResponse res; try { final WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(tmp); final CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, info, new String[]{ MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE); res = (KieCompilationResponse) compiler.compile(req); logger.info("\nFinished, successful:{} , all Metadata tmp:{} UUID:{} res.getMavenOutput().isEmpty():{}", res.isSuccessful(), tmp , req.getRequestUUID(), res.getMavenOutput().isEmpty()); if (!res.isSuccessful()) { try { logger.error("writing output on target folder:{}", tmp); TestUtil.writeMavenOutputIntoTargetFolder(tmp, res.getMavenOutput(), "ConcurrentBuildTest.compileAndLoadKieJarMetadataAllResourcesPackagedJar_" + req.getRequestUUID()); } catch (Exception e) { logger.error(e.getMessage()); } } } finally { latch.countDown(); } return res; }
Source:
<code>public static Collection<IPod> getPodsForDeploymentConfig(IDeploymentConfig deploymentConfig) { String dcName = deploymentConfig.getName(); List<IPod> projectPods = deploymentConfig.getProject().getResources(ResourceKind.POD); List<IPod> deploymentConfigPods = projectPods.stream() <START> .filter(p -> dcName.equals(p.getAnnotation("openshift.io/deployment-config.name"))) <END> .collect(Collectors.toList()); return deploymentConfigPods; }</code><technical_language>constant OpenShiftAnnotations</technical_language>

Target:
public static Collection<IPod> getPodsForDeploymentConfig(IDeploymentConfig deploymentConfig) { List<IPod> pods = deploymentConfig.getProject().getResources(ResourceKind.POD); Map<String, String> selector = deploymentConfig.getReplicaSelector(); return getPodsForSelector(selector, pods); }
Source:
<code><START> void testDescribeSpotRequestsInRegionFilter() { <END> for (String region : Region.DEFAULT_REGIONS) { SortedSet<SpotInstanceRequest> allResults = ImmutableSortedSet.copyOf(client.getSpotInstanceApi().get() .describeSpotInstanceRequestsInRegion(region)); assertNotNull(allResults); if (allResults.size() >= 1) { SpotInstanceRequest request = allResults.last(); SortedSet<SpotInstanceRequest> result = ImmutableSortedSet.copyOf(client.getSpotInstanceApi().get() .describeSpotInstanceRequestsInRegionWithFilter(region, ImmutableMultimap.<String, String>builder() .put("spot-instance-request-id", request.getId()).build())); assertNotNull(result); SpotInstanceRequest compare = result.last(); assertEquals(compare, request); } } }</code><technical_language>public void, for tests</technical_language>

Target:
public void testDescribeSpotRequestsInRegionFilter() { for (String region : Region.DEFAULT_REGIONS) { SortedSet<SpotInstanceRequest> allResults = ImmutableSortedSet.copyOf(client.getSpotInstanceApi().get() .describeSpotInstanceRequestsInRegion(region)); assertNotNull(allResults); if (allResults.size() >= 1) { SpotInstanceRequest request = allResults.last(); SortedSet<SpotInstanceRequest> result = ImmutableSortedSet.copyOf(client.getSpotInstanceApi().get() .describeSpotInstanceRequestsInRegionWithFilter(region, ImmutableMultimap.<String, String>builder() .put("spot-instance-request-id", request.getId()).build())); assertNotNull(result); SpotInstanceRequest compare = result.last(); assertEquals(compare, request); } } }
Source:
<code>@Nullable private static ProjectSpecificLanguageServerWrapper getLSWrapper(@NonNull IFile file, @Nullable Predicate<ServerCapabilities> request, @Nullable String serverId) throws IOException { IProject project = file.getProject(); if (project == null) { return null; } IContentType[] fileContentTypes = null; try (InputStream contents = file.getContents()) { fileContentTypes = Platform.getContentTypeManager().findContentTypesFor(contents, file.getName()); } catch (CoreException e) { LanguageServerPlugin.logError(e); return null; } ProjectSpecificLanguageServerWrapper wrapper = getMatchingStartedWrapper(project, fileContentTypes, request, serverId); if (wrapper != null) { return wrapper; } <START> wrapper = getMatchingStartedWrapper(file, request, serverId); <END> if (wrapper != null) { return wrapper; } for (IContentType contentType : fileContentTypes) { if (contentType == null) { continue; } for (LanguageServerDefinition serverDefinition : LanguageServersRegistry.getInstance().findProviderFor(contentType)) { if (serverDefinition != null && (serverId == null || serverDefinition.getId().equals(serverId))) { wrapper = getLSWrapperForConnection(project, contentType, serverDefinition); if (request == null || wrapper.getServerCapabilities() == null || request.test(wrapper.getServerCapabilities())) { return wrapper; } } } } return null; }</code><technical_language>prefer LS/wrapper connected file for content type? this assignment moved other one</technical_language>

Target:
@Nullable private static ProjectSpecificLanguageServerWrapper getLSWrapper(@NonNull IFile file, @Nullable Predicate<ServerCapabilities> request, @Nullable String serverId) throws IOException { IProject project = file.getProject(); if (project == null) { return null; } ProjectSpecificLanguageServerWrapper wrapper = getMatchingStartedWrapper(file, request, serverId); if (wrapper != null) { return wrapper; } IContentType[] fileContentTypes = null; try (InputStream contents = file.getContents()) { fileContentTypes = Platform.getContentTypeManager().findContentTypesFor(contents, file.getName()); } catch (CoreException e) { LanguageServerPlugin.logError(e); return null; } wrapper = getMatchingStartedWrapper(project, fileContentTypes, request, serverId); if (wrapper != null) { return wrapper; } for (IContentType contentType : fileContentTypes) { if (contentType == null) { continue; } for (LanguageServerDefinition serverDefinition : LanguageServersRegistry.getInstance().findProviderFor(contentType)) { if (serverDefinition != null && (serverId == null || serverDefinition.getId().equals(serverId))) { wrapper = getLSWrapperForConnection(project, contentType, serverDefinition); if (request == null || wrapper.getServerCapabilities() == null || request.test(wrapper.getServerCapabilities())) { return wrapper; } } } } return null; }
Source:
<code>protected Configuration createConfiguration() { Configuration conf = super.createConfiguration(); <START> conf.set(S3_METADATA_STORE_IMPL, S3GUARD_METASTORE_LOCAL); <END> return conf; }</code><technical_language>need removeBaseAndBucketOverrides() code in S3ATestUtils per-bucket setting turned on. for other do</technical_language>

Target:
protected Configuration createConfiguration() { Configuration conf = super.createConfiguration(); removeBaseAndBucketOverrides(conf, S3_METADATA_STORE_IMPL, S3A_BUCKET_PROBE); conf.set(S3_METADATA_STORE_IMPL, S3GUARD_METASTORE_LOCAL); conf.setInt(S3A_BUCKET_PROBE, S3A_BUCKET_PROBE_DEFAULT); return conf; }
Source:
<code>private void handleGetCommand(AndroidSessionWrapper asw) { Intent i; String command = asw.getSession().getCommand(); if (useGridMenu(command)) { i = new Intent(getApplicationContext(), MenuGrid.class); } else { i = new Intent(getApplicationContext(), MenuList.class); } i.putExtra(SessionFrame.STATE_COMMAND_ID, command); <START> addPendingDatumIdExtra(i, asw.getSession()); <END> startActivityForResult(i, GET_COMMAND); }</code><technical_language>NPE if select a module cases</technical_language>

Target:
private void handleGetCommand(AndroidSessionWrapper asw) { Intent i; String command = asw.getSession().getCommand(); if (useGridMenu(command)) { i = new Intent(getApplicationContext(), MenuGrid.class); } else { i = new Intent(getApplicationContext(), MenuList.class); } i.putExtra(SessionFrame.STATE_COMMAND_ID, command); addPendingDataExtra(i, asw.getSession()); startActivityForResult(i, GET_COMMAND); }
Source:
<code>@Override Bitmap decodeStream(InputStream stream, PicassoBitmapOptions options) throws IOException { <START> if (stream == null) { <END> return null; } try { if (options != null && options.inJustDecodeBounds) { MarkableInputStream markStream = new MarkableInputStream(stream); stream = markStream; long mark = markStream.savePosition(1024); BitmapFactory.decodeStream(stream, null, options); calculateInSampleSize(options); markStream.reset(mark); } return BitmapFactory.decodeStream(stream, null, options); } finally { Utils.closeQuietly(stream); } }</code><technical_language>this happen again</technical_language>

Target:
private Bitmap decodeStream(InputStream stream, PicassoBitmapOptions options) throws IOException { if (stream == null) { return null; } if (options != null && options.inJustDecodeBounds) { MarkableInputStream markStream = new MarkableInputStream(stream); stream = markStream; long mark = markStream.savePosition(1024); BitmapFactory.decodeStream(stream, null, options); calculateInSampleSize(options); markStream.reset(mark); } return BitmapFactory.decodeStream(stream, null, options); }