auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static ArtifactProxy createProxy(final String artGuid, final String artifactName, final long branchGuid, final String branchName) { return new ArtifactProxy() { @Override public IOseeBranch getBranch() { return TokenFactory.createBranch(branchGuid, branchName); } @Override public String getName() { return artifactName; } @Override public String getGuid() { return artGuid; } @Override public ArtifactType getArtifactType() { return null; } @Override public boolean isAttributeTypeValid(IAttributeType attributeType) { return false; } @Override public Collection<RelationType> getValidRelationTypes() { return null; } @Override public Collection<ArtifactProxy> getHierarchy() { return null; } @Override public IBasicArtifact<?> getObject() { return null; } @Override public Long getUuid() { return new Long(0); } }; }

Target:
private static ArtifactProxy createProxy(final String artGuid, final String artifactName, final long branchGuid, final String branchName) { return new ArtifactProxy() { @Override public IOseeBranch getBranch() { return TokenFactory.createBranch(branchGuid, branchName); } @Override public String getName() { return artifactName; } @Override public String getGuid() { return artGuid; } @Override public ArtifactType getArtifactType() { return null; } @Override public boolean isAttributeTypeValid(IAttributeType attributeType) { return false; } @Override public Collection<RelationType> getValidRelationTypes() { return null; } @Override public Collection<ArtifactProxy> getHierarchy() { return null; } @Override public IBasicArtifact<?> getObject() { return null; } @Override public Long getUuid() { return 0L; } }; }
Source:
public int hashCode() { return abstractBlockHashCode(); }

Target:
public int hashCode() { return super.hashCode(); }
Source:
protected Message decodeDelivery(Delivery delivery) { final int messageSize = delivery.pending(); final byte[] buffer = new byte[messageSize]; final int read = receiver.recv(buffer, 0, messageSize); receiver.advance(); final Message message = Proton.message(); message.decode(buffer, 0, read); ExtendedAmqpMessage extendedAmqpMessage = null; if (receiver.getSenderSettleMode() == SenderSettleMode.SETTLED) { delivery.disposition(Accepted.getInstance()); delivery.settle(); extendedAmqpMessage = new ExtendedAmqpMessage(message, null); } else { extendedAmqpMessage = new ExtendedAmqpMessage(message, ByteBuffer.wrap(delivery.getTag())); } return extendedAmqpMessage; }

Target:
protected Message decodeDelivery(Delivery delivery) { final int messageSize = delivery.pending(); final byte[] buffer = new byte[messageSize]; final int read = receiver.recv(buffer, 0, messageSize); receiver.advance(); final Message message = Proton.message(); message.decode(buffer, 0, read); delivery.settle(); return message; }
Source:
private List<String> getPubMedIdsFromQuery(String query) throws FetcherException { boolean fetchIDs = false; boolean firstOccurrenceOfCount = false; List<String> idList = new ArrayList<>(); try { URL ncbi = createSearchUrl(query); XMLInputFactory inputFactory = XMLInputFactory.newFactory(); XMLStreamReader streamReader = inputFactory.createXMLStreamReader(ncbi.openStream()); System.out.println("parsing xml"); fetchLoop: while (streamReader.hasNext()) { int event = streamReader.getEventType(); switch (event) { case XMLStreamConstants.START_ELEMENT: if (streamReader.getName().toString().equals("Count")) { firstOccurrenceOfCount = true; } if (streamReader.getName().toString().equals("IdList")) { fetchIDs = true; } break; case XMLStreamConstants.CHARACTERS: if (firstOccurrenceOfCount) { numberOfResultsFound = Integer.parseInt(streamReader.getText()); firstOccurrenceOfCount = false; } if (fetchIDs) { idList.add(streamReader.getText()); } break; case XMLStreamConstants.END_ELEMENT: if (streamReader.getName().toString().equals("IdList")) { break fetchLoop; } } streamReader.next(); } streamReader.close(); return idList; } catch (IOException | URISyntaxException e) { throw new FetcherException("Unable to get PubMed IDs", Localization.lang("Unable to get PubMed IDs"), e); } catch (XMLStreamException e) { throw new FetcherException("Error while parsing ID list", Localization.lang("Error while parsing ID list"), e); } }

Target:
private List<String> getPubMedIdsFromQuery(String query) throws FetcherException { boolean fetchIDs = false; boolean firstOccurrenceOfCount = false; List<String> idList = new ArrayList<>(); try { URL ncbi = createSearchUrl(query); XMLInputFactory inputFactory = XMLInputFactory.newFactory(); XMLStreamReader streamReader = inputFactory.createXMLStreamReader(ncbi.openStream()); fetchLoop: while (streamReader.hasNext()) { int event = streamReader.getEventType(); switch (event) { case XMLStreamConstants.START_ELEMENT: if (streamReader.getName().toString().equals("Count")) { firstOccurrenceOfCount = true; } if (streamReader.getName().toString().equals("IdList")) { fetchIDs = true; } break; case XMLStreamConstants.CHARACTERS: if (firstOccurrenceOfCount) { numberOfResultsFound = Integer.parseInt(streamReader.getText()); firstOccurrenceOfCount = false; } if (fetchIDs) { idList.add(streamReader.getText()); } break; case XMLStreamConstants.END_ELEMENT: if (streamReader.getName().toString().equals("IdList")) { break fetchLoop; } } streamReader.next(); } streamReader.close(); return idList; } catch (IOException | URISyntaxException e) { throw new FetcherException("Unable to get PubMed IDs", Localization.lang("Unable to get PubMed IDs"), e); } catch (XMLStreamException e) { throw new FetcherException("Error while parsing ID list", Localization.lang("Error while parsing ID list"), e); } }
Source:
public URL getResource(String name) { if (name != null) { String resourceName = name; if (name.startsWith("/")) { resourceName = name.substring(1); } return bundle.getResource(resourceName); } return null; }

Target:
public URL getResource(String name) { if (name != null) { String resourceName; if (name.startsWith("/")) { resourceName = name.substring(1); } else { resourceName = name; } return bundle.getResource(resourceName); } return null; }
Source:
private static Class<?> getNumericClass(int total, int decimal) { if (decimal <= 0) { if (total > 18 || total == 0) { return BigInteger.class; } else if (total > 9 || total == 0) { return Long.class; } else if (total > 4) { return Integer.class; } else if (total > 2) { return Short.class; } else if (total > 0) { return Byte.class; } else { return Boolean.class; } } else { return BigDecimal.class; } }

Target:
private static Class<?> getNumericClass(int total, int decimal) { if (decimal <= 0) { if (total > 18 || total == 0) { return BigInteger.class; } else if (total > 9) { return Long.class; } else if (total > 4) { return Integer.class; } else if (total > 2) { return Short.class; } else { return Byte.class; } } else { return BigDecimal.class; } }
Source:
public org.apache.activemq.artemis.api.core.Message putByteProperty(SimpleString key, byte value) { org.apache.activemq.artemis.api.core.Message message = putByteProperty(key.toString(), value); messageChanged(); return message; }

Target:
public org.apache.activemq.artemis.api.core.Message putByteProperty(SimpleString key, byte value) { return putByteProperty(key.toString(), value); }
Source:
public IImage getIcon() { return ECoreImage.METADATA_TABLE_ICON; }

Target:
public IImage getIcon() { return ECoreImage.METADATA_VIEW_ICON; }
Source:
public RowFilter adapt(FilterAdapterContext context, ColumnPaginationFilter filter) throws IOException { if (filter.getColumnOffset() != null) { byte[] family = context.getScan().getFamilies()[0]; ByteString startQualifier = ByteString.copyFrom(filter.getColumnOffset()); return createChain( filter, F.qualifier().range(Bytes.toString(family)) .startClosed(startQualifier)); } else if (filter.getOffset() > 0) { return createChain( filter, F.offset().cellsPerRow(filter.getOffset())); } else { return createChain(filter, null); } }

Target:
public RowFilter adapt(FilterAdapterContext context, ColumnPaginationFilter filter) throws IOException { if (filter.getColumnOffset() != null) { byte[] family = context.getScan().getFamilies()[0]; ByteString startQualifier = ByteString.copyFrom(filter.getColumnOffset()); return createChain( filter, F.qualifier().rangeWithinFamily(Bytes.toString(family)) .startClosed(startQualifier)); } else if (filter.getOffset() > 0) { return createChain( filter, F.offset().cellsPerRow(filter.getOffset())); } else { return createChain(filter, null); } }
Source:
public void copyTo(SequentialFile dstFile) throws IOException { ActiveMQJournalLogger.LOGGER.debug("Copying " + this + " as " + dstFile); if (isOpen()) { throw new IllegalStateException("File opened!"); } if (dstFile.isOpen()) { throw new IllegalArgumentException("dstFile must be closed too"); } try (RandomAccessFile src = new RandomAccessFile(getFile(), "rw"); FileChannel srcChannel = src.getChannel(); FileLock srcLock = srcChannel.lock()) { final long readableBytes = srcChannel.size(); if (readableBytes > 0) { try (RandomAccessFile dst = new RandomAccessFile(dstFile.getJavaFile(), "rw"); FileChannel dstChannel = dst.getChannel(); FileLock dstLock = dstChannel.lock()) { final long oldLength = dst.length(); final long newLength = oldLength + readableBytes; dst.setLength(newLength); final long transferred = dstChannel.transferFrom(srcChannel, oldLength, readableBytes); if (transferred != readableBytes) { dstChannel.truncate(oldLength); throw new IOException("copied less then expected"); } } } } }

Target:
public void copyTo(SequentialFile dstFile) throws IOException { if (ActiveMQJournalLogger.LOGGER.isDebugEnabled()) { ActiveMQJournalLogger.LOGGER.debug("Copying " + this + " as " + dstFile); } if (isOpen()) { throw new IllegalStateException("File opened!"); } if (dstFile.isOpen()) { throw new IllegalArgumentException("dstFile must be closed too"); } try (RandomAccessFile src = new RandomAccessFile(getFile(), "rw"); FileChannel srcChannel = src.getChannel(); FileLock srcLock = srcChannel.lock()) { final long readableBytes = srcChannel.size(); if (readableBytes > 0) { try (RandomAccessFile dst = new RandomAccessFile(dstFile.getJavaFile(), "rw"); FileChannel dstChannel = dst.getChannel(); FileLock dstLock = dstChannel.lock()) { final long oldLength = dst.length(); final long newLength = oldLength + readableBytes; dst.setLength(newLength); final long transferred = dstChannel.transferFrom(srcChannel, oldLength, readableBytes); if (transferred != readableBytes) { dstChannel.truncate(oldLength); throw new IOException("copied less then expected"); } } } } }
Source:
private void startObserving() { mEditorMedia.getUiState().observe(this, uiState -> { if (uiState != null) { updateAddingMediaToEditorProgressDialogState(uiState.getProgressDialogUiState()); if (uiState.getEditorOverlayVisibility()) { showOverlay(false); } else { hideOverlay(); } } }); mEditorMedia.getSnackBarMessage().observe(this, event -> { SnackbarMessageHolder messageHolder = event.getContentIfNotHandled(); if (messageHolder != null && messageHolder.getMessage() instanceof UiStringRes) { UiStringRes message = (UiStringRes) messageHolder.getMessage(); WPSnackbar .make(findViewById(R.id.editor_activity), message.getStringRes(), Snackbar.LENGTH_SHORT) .show(); } }); mEditorMedia.getToastMessage().observe(this, event -> { ToastMessageHolder contentIfNotHandled = event.getContentIfNotHandled(); if (contentIfNotHandled != null) { contentIfNotHandled.show(this); } }); mViewModel.getOnSavePostTriggered().observe(this, unitEvent -> unitEvent.applyIfNotHandled(unit -> { updateAndSavePostAsync(); return null; })); mViewModel.getOnFinish().observe(this, finishEvent -> finishEvent.applyIfNotHandled(activityFinishState -> { switch (activityFinishState) { case SAVED_ONLINE: saveResult(true, false); break; case SAVED_LOCALLY: saveResult(true, true); break; case CANCELLED: saveResult(false, true); break; } removePostOpenInEditorStickyEvent(); mEditorMedia.definitelyDeleteBackspaceDeletedMediaItemsAsync(); finish(); return null; })); mEditPostRepository.getPostChanged().observe(this, postEvent -> postEvent.applyIfNotHandled(post -> { mViewModel.savePostToDb(mEditPostRepository, mSite); return null; })); }

Target:
private void startObserving() { mEditorMedia.getUiState().observe(this, uiState -> { if (uiState != null) { updateAddingMediaToEditorProgressDialogState(uiState.getProgressDialogUiState()); if (uiState.getEditorOverlayVisibility()) { showOverlay(false); } else { hideOverlay(); } } }); mEditorMedia.getSnackBarMessage().observe(this, event -> { SnackbarMessageHolder messageHolder = event.getContentIfNotHandled(); if (messageHolder != null) { WPSnackbar.make( findViewById(R.id.editor_activity), mUiHelpers.getTextOfUiString(this, messageHolder.getMessage()), Snackbar.LENGTH_SHORT ) .show(); } }); mEditorMedia.getToastMessage().observe(this, event -> { ToastMessageHolder contentIfNotHandled = event.getContentIfNotHandled(); if (contentIfNotHandled != null) { contentIfNotHandled.show(this); } }); mViewModel.getOnSavePostTriggered().observe(this, unitEvent -> unitEvent.applyIfNotHandled(unit -> { updateAndSavePostAsync(); return null; })); mViewModel.getOnFinish().observe(this, finishEvent -> finishEvent.applyIfNotHandled(activityFinishState -> { switch (activityFinishState) { case SAVED_ONLINE: saveResult(true, false); break; case SAVED_LOCALLY: saveResult(true, true); break; case CANCELLED: saveResult(false, true); break; } removePostOpenInEditorStickyEvent(); mEditorMedia.definitelyDeleteBackspaceDeletedMediaItemsAsync(); finish(); return null; })); mEditPostRepository.getPostChanged().observe(this, postEvent -> postEvent.applyIfNotHandled(post -> { mViewModel.savePostToDb(mEditPostRepository, mSite); return null; })); }
Source:
private DfsBlockCache(DfsBlockCacheConfig cfg) { tableSize = tableSize(cfg); if (tableSize < 1) throw new IllegalArgumentException(JGitText.get().tSizeMustBeGreaterOrEqual1); table = new AtomicReferenceArray<>(tableSize); loadLocks = new ReentrantLock[cfg.getConcurrencyLevel()]; for (int i = 0; i < loadLocks.length; i++) loadLocks[i] = new ReentrantLock(true ); refLocks = new ReentrantLock[cfg.getConcurrencyLevel()]; for (int i = 0; i < refLocks.length; i++) refLocks[i] = new ReentrantLock(true ); maxBytes = cfg.getBlockLimit(); maxStreamThroughCache = (long) (maxBytes * cfg.getStreamRatio()); blockSize = cfg.getBlockSize(); blockSizeShift = Integer.numberOfTrailingZeros(blockSize); clockLock = new ReentrantLock(true ); String none = ""; clockHand = new Ref<>( DfsStreamKey.of(new DfsRepositoryDescription(none), none, null), -1, 0, null); clockHand.next = clockHand; statHit = new AtomicReference<>(newCounters()); statMiss = new AtomicReference<>(newCounters()); statEvict = new AtomicReference<>(newCounters()); liveBytes = new AtomicReference<>(newCounters()); refLockWaitTime = cfg.getRefLockWaitTimeConsumer(); }

Target:
private DfsBlockCache(DfsBlockCacheConfig cfg) { tableSize = tableSize(cfg); if (tableSize < 1) { throw new IllegalArgumentException(JGitText.get().tSizeMustBeGreaterOrEqual1); } table = new AtomicReferenceArray<>(tableSize); loadLocks = new ReentrantLock[cfg.getConcurrencyLevel()]; for (int i = 0; i < loadLocks.length; i++) { loadLocks[i] = new ReentrantLock(true ); } refLocks = new ReentrantLock[cfg.getConcurrencyLevel()]; for (int i = 0; i < refLocks.length; i++) { refLocks[i] = new ReentrantLock(true ); } maxBytes = cfg.getBlockLimit(); maxStreamThroughCache = (long) (maxBytes * cfg.getStreamRatio()); blockSize = cfg.getBlockSize(); blockSizeShift = Integer.numberOfTrailingZeros(blockSize); clockLock = new ReentrantLock(true ); String none = ""; clockHand = new Ref<>( DfsStreamKey.of(new DfsRepositoryDescription(none), none, null), -1, 0, null); clockHand.next = clockHand; statHit = new AtomicReference<>(newCounters()); statMiss = new AtomicReference<>(newCounters()); statEvict = new AtomicReference<>(newCounters()); liveBytes = new AtomicReference<>(newCounters()); refLockWaitTime = cfg.getRefLockWaitTimeConsumer(); }
Source:
public InputStream deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonElement aa = ((JsonObject) json.getAsJsonObject().get("attachments")).get(taskData.getValue()); JsonPrimitive xxxx = aa.getAsJsonObject().get("data").getAsJsonPrimitive(); InputStream is = new ByteArrayInputStream(xxxx.getAsString().getBytes()); return new Base64InputStream(is); }

Target:
public InputStream deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonElement attachments = ((JsonObject) json.getAsJsonObject().get("attachments")) .get(taskAttribute.getValue()); JsonPrimitive attachment = attachments.getAsJsonObject().get("data").getAsJsonPrimitive(); if (attachment == null) { throw com.google.common.base.Throwables.propagate(new CoreException( new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, "Can not get Attachment Data"))); } InputStream is = new ByteArrayInputStream(attachment.getAsString().getBytes()); return new Base64InputStream(is); }
Source:
public void showError(String error) { }

Target:
public void showError(String error) { Toaster.show(rootView, error); }
Source:
public Destination getDestination(Destination defaultDestination) { return Destination.from(getOrDefault(DESTINATION,defaultDestination.toString())); }

Target:
public Destination getDestination(Destination defaultDestination) { return Destination.valueOf(getOrDefault(DESTINATION, defaultDestination.toString())); }
Source:
static synchronized void addToList(TerminalInfoView view) { views.add(view); }

Target:
private static synchronized void addToList(TerminalInfoView view) { views.add(view); }
Source:
public void openFilePage(String fileName) { getUrl(Global.DOMAIN + URLsContent.wikiDir + URLsContent.fileNS + fileName); waitForElementByElement(tabList.get(0)); PageObjectLogging.log("Open file page", "file page opened", true); }

Target:
public void openFilePage(String fileName) { getUrl(URLsContent.filePage + fileName); waitForElementByElement(tabList.get(0)); PageObjectLogging.log("Open file page", "file page opened", true); }
Source:
public void processOptionsNone() throws IOException { LinkedList<String> options = new LinkedList<String>(); Ls ls = new Ls(); ls.processOptions(options); assertFalse(ls.isPathOnly()); assertTrue(ls.isDirRecurse()); assertFalse(ls.isHumanReadable()); assertFalse(ls.isRecursive()); assertFalse(ls.isOrderReverse()); assertFalse(ls.isOrderSize()); assertFalse(ls.isOrderTime()); assertFalse(ls.isUseAtime()); assertFalse(ls.isDisplayECPolicy()); }

Target:
public void processOptionsNone() throws IOException { LinkedList<String> options = new LinkedList<String>(); Ls ls = new Ls(); ls.processOptions(options); assertFalse(ls.isPathOnly()); assertTrue(ls.isDirRecurse()); assertFalse(ls.isHumanReadable()); assertFalse(ls.isRecursive()); assertFalse(ls.isOrderReverse()); assertFalse(ls.isOrderSize()); assertFalse(ls.isOrderTime()); assertFalse(ls.isUseAtime()); }
Source:
public void initialize(Map<String, Object> config) { initializeRuleRuntimeProvider(); initializeRuleRuntimes(config); buildStreamToRulesRuntime(); }

Target:
public void initialize(Map<String, Object> config) { initializeRuleRuntimes(config); buildStreamToRulesRuntime(); this.processAll = this.rulesProcessor.getProcessAll(); }
Source:
public void onComplete(Task task) { try { cleanup(); } catch (Exception e) { onErrorInternal(task, e, false); } if (_nextTaskListener != null) { _nextTaskListener.onComplete(task); } }

Target:
public void onComplete(Task task) { try { cleanup(); } catch (Exception e) { onErrorInternal(task, e, false); return; } if (_nextTaskListener != null) { _nextTaskListener.onComplete(task); } }
Source:
public boolean run() throws IOException, CompileException{ ObjectId rulesId; rulesId = git.resolve(GitRepositoryManager.REF_CONFIG + ":rules.pl"); if (rulesId == null) { System.err.println("error: no rules.pl in " + git.getDirectory()); return false; } if (cacheDir == null) { System.err.println("error: caching not enabled on server"); return false; } File ruleDir = new File(cacheDir.getPath() + "/rules"); ruleDir.mkdir(); File tempDir = File.createTempFile("GerritCodeReview_", ".rulec"); if (!tempDir.delete() || !tempDir.mkdir()) throw new IOException("Cannot create temporary directory " + tempDir); try { compileProlog(rulesId, tempDir); compileJava(tempDir); File jarFile = new File(ruleDir.getPath() + "/rules-" + rulesId.getName() + ".jar"); List<String> tempFiles = getRelativePaths(tempDir, ".class"); createJarArchive(jarFile, tempFiles, tempDir); return true; } finally { deleteAllFiles(tempDir); } }

Target:
public void run() throws IOException, CompileException { ObjectId rulesId; rulesId = git.resolve(GitRepositoryManager.REF_CONFIG + ":rules.pl"); if (rulesId == null) { throw new CompileException("error: no rules.pl in " + git.getDirectory()); } if (cacheDir == null) { throw new CompileException("error: caching not enabled on server"); } File ruleDir = new File(cacheDir, "rules"); ruleDir.mkdir(); File tempDir = File.createTempFile("GerritCodeReview_", ".rulec"); if (!tempDir.delete() || !tempDir.mkdir()) throw new IOException("Cannot create temporary directory " + tempDir); try { compileProlog(rulesId, tempDir); compileJava(tempDir); File jarFile = new File(ruleDir, "rules-" + rulesId.getName() + ".jar"); List<String> tempFiles = getRelativePaths(tempDir, ".class"); createJarArchive(jarFile, tempFiles, tempDir); } finally { deleteAllFiles(tempDir); } }
Source:
public boolean removeInterceptor(ChannelInterceptor interceptor) { boolean removed = super.removeInterceptor(interceptor) && interceptor instanceof ExecutorChannelInterceptor && this.executorInterceptors.remove(interceptor); if (removed) { this.executorInterceptorsSize--; return true; } else { return false; } }

Target:
public boolean removeInterceptor(ChannelInterceptor interceptor) { boolean removed = super.removeInterceptor(interceptor); if (removed && interceptor instanceof ExecutorChannelInterceptor) { this.executorInterceptorsSize--; } return removed; }
Source:
public int compare(IPowerNode o1, IPowerNode o2){ TileEntity te1 = (TileEntity)o1; TileEntity te2 = (TileEntity)o2; BlockPos tePos1 = te1.getPos(); BlockPos tePos2 = te2.getPos(); if (tePos1.getX() == tePos2.getX() && tePos1.getZ() == tePos2.getZ() && tePos1.getY() == tePos2.getY()) return 0; if (tePos1.getX() > tePos2.getX()){ return 1; }else{ if (tePos1.getZ() > tePos2.getZ()){ return 1; }else{ if (tePos1.getY() > tePos2.getY()){ return 1; }else{ return -1; } } } }

Target:
public int compare(IPowerNode o1, IPowerNode o2){ TileEntity te1 = (TileEntity)o1; TileEntity te2 = (TileEntity)o2; BlockPos tePos1 = te1.getPos(); BlockPos tePos2 = te2.getPos(); if (te1.getPos().equals(te2.getPos())) return 0; if (tePos1.getX() > tePos2.getX()){ return 1; }else{ if (tePos1.getZ() > tePos2.getZ()){ return 1; }else{ if (tePos1.getY() > tePos2.getY()){ return 1; }else{ return -1; } } } }
Source:
public final void replaceInt(final int destColumn, final int destRow, final int value) { getColumn(destColumn, destRow).replaceInt(value, destRow); }

Target:
public final void replaceInt(final int destColumn, final int destRow, final int value) { getColumn(destColumn, destRow).replaceInt(value, destRow % TupleBatch.BATCH_SIZE); }
Source:
public void download(final URI uri, final File outputFile, final HttpContext clientContext) throws Exception { final HttpGet httpGet = new HttpGet(uri); httpClient.execute(httpGet, new ResponseHandler<Void>() { @Override public Void handleResponse(final HttpResponse response) throws IOException { final HttpEntity entity = response.getEntity(); if (entity != null) { if (log != null) { log.info(String.format( "%s: %s", "Downloading", uri)); } final long totalLength = entity.getContentLength(); final char unit = totalLength >= KBYTE ? K_UNIT : B_UNIT; long completed = 0L; byte[] tmp = new byte[8 * (int) KBYTE]; try (InputStream in = entity.getContent(); FileOutputStream out = new FileOutputStream(outputFile)) { int bytesRead; while ((bytesRead = in.read(tmp)) != -1) { out.write(tmp, 0, bytesRead); if (log != null) { completed += bytesRead; final String totalInUnits; final long completedInUnits; if (unit == K_UNIT) { totalInUnits = totalLength == -1 ? "?" : Long.toString(totalLength / KBYTE) + unit; completedInUnits = completed / KBYTE; } else { totalInUnits = totalLength == -1 ? "?" : Long.toString(totalLength); completedInUnits = completed; } log.info(String.format("%d/%s", completedInUnits, totalInUnits)); } } out.flush(); if (log != null) { log.info(String.format("%s %s", "downloaded", unit == K_UNIT ? Long.toString(completed / KBYTE) + unit : Long.toString(completed))); } } catch (IOException ex) { if (log != null) { log.error(ex); } throw ex; } } return null; } }, clientContext); }

Target:
public void download(final URI uri, final File outputFile, final HttpContext clientContext) throws Exception { final HttpGet httpGet = new HttpGet(uri); httpClient.execute(httpGet, new ResponseHandler<Void>() { @Override public Void handleResponse(final HttpResponse response) throws IOException { final HttpEntity entity = response.getEntity(); if (entity != null) { progressReport.initiate(uri, entity.getContentLength()); byte[] tmp = new byte[8 * 11024]; try (InputStream in = entity.getContent(); OutputStream out = new FileOutputStream(outputFile)) { int bytesRead; while ((bytesRead = in.read(tmp)) != -1) { out.write(tmp, 0, bytesRead); progressReport.update(bytesRead); } out.flush(); progressReport.completed(); } catch (IOException ex) { progressReport.error(ex); throw ex; } } return null; } }, clientContext); }
Source:
ProgramState resetFieldValues(ConstraintManager constraintManager, boolean resetOnlyStaticFields) { final List<Symbol> fields = new ArrayList<>(); values.forEach((symbol, symbolicValue) -> { if (isField(symbol) && !symbol.isFinal() && (symbol.isStatic() || !resetOnlyStaticFields) ) { fields.add(symbol); } }); if (fields.isEmpty()) { return this; } PMap<Symbol, SymbolicValue> newValues = values; PMap<SymbolicValue, Integer> newReferences = references; for (Symbol field : fields) { SymbolicValue oldValue = newValues.get(field); if (field != null) { newReferences = decreaseReference(newReferences, oldValue); } Tree declarationOrFirstUsage = declarationOrFirstUsage(field); SymbolicValue newValue = constraintManager.createSymbolicValue(declarationOrFirstUsage); newValues = newValues.put(field, newValue); newReferences = increaseReference(newReferences, newValue); } return new ProgramState(newValues, newReferences, constraints, visitedPoints, stack, exitSymbolicValue); }

Target:
ProgramState resetFieldValues(ConstraintManager constraintManager, boolean resetOnlyStaticFields) { List<Symbol> fields = new ArrayList<>(); values.forEach((symbol, symbolicValue) -> { if (isField(symbol) && !symbol.isFinal() && (symbol.isStatic() || !resetOnlyStaticFields) ) { fields.add(symbol); } }); ProgramState newProgramState = this; for (Symbol field : fields) { newProgramState = newProgramState.put(field, constraintManager.createDefaultSymbolicValue()); } return newProgramState; }
Source:
private void renderChangeInfo(ChangeInfo info) { changeInfo = info; lastDisplayedUpdate = info.updated(); statusText.setInnerText(Util.toLongString(info.status())); boolean current = info.status().isOpen() && revision.equals(info.current_revision()); boolean canSubmit = labels.set(info, current); renderOwner(info); renderReviewers(info); renderActionTextDate(info); renderRevisions(info); renderHistory(info); actions.display(info, revision); star.setValue(info.starred()); permalink.setHref(ChangeLink.permalink(changeId)); changeIdText.setInnerText(String.valueOf(info.legacy_id())); projectText.setInnerText(info.project()); branchText.setInnerText(info.branch()); idText.setText("Change-Id: " + info.change_id()); idText.setPreviewText(info.change_id()); reload.set(info); topic.set(info); commit.set(commentLinkProcessor, info, revision); related.set(info, revision); quickApprove.set(info, revision); if (Gerrit.isSignedIn()) { replyAction = new ReplyAction(info, revision, style, reply); if (topic.canEdit()) { keysAction.add(new KeyCommand(0, 't', Util.C.keyEditTopic()) { @Override public void onKeyPress(KeyPressEvent event) { topic.onEdit(); } }); } } if (current) { loadMergeable(info.status(), canSubmit); } StringBuilder sb = new StringBuilder(); sb.append(Util.M.changeScreenTitleId(info.id_abbreviated())); if (info.subject() != null) { sb.append(": "); sb.append(info.subject()); } setWindowTitle(sb.toString()); initEditCommitMessageAction(); }

Target:
private void renderChangeInfo(ChangeInfo info) { changeInfo = info; lastDisplayedUpdate = info.updated(); statusText.setInnerText(Util.toLongString(info.status())); boolean current = info.status().isOpen() && revision.equals(info.current_revision()); boolean canSubmit = labels.set(info, current); renderOwner(info); renderReviewers(info); renderActionTextDate(info); renderRevisions(info); renderHistory(info); actions.display(info, revision); star.setValue(info.starred()); permalink.setHref(ChangeLink.permalink(changeId)); changeIdText.setInnerText(String.valueOf(info.legacy_id())); projectText.setInnerText(info.project()); branchText.setInnerText(info.branch()); idText.setText("Change-Id: " + info.change_id()); idText.setPreviewText(info.change_id()); reload.set(info); topic.set(info); commit.set(commentLinkProcessor, info, revision); related.set(info, revision); quickApprove.set(info, revision); if (Gerrit.isSignedIn()) { initEditMessageAction(); replyAction = new ReplyAction(info, revision, style, reply); if (topic.canEdit()) { keysAction.add(new KeyCommand(0, 't', Util.C.keyEditTopic()) { @Override public void onKeyPress(KeyPressEvent event) { topic.onEdit(); } }); } } if (current) { loadMergeable(info.status(), canSubmit); } StringBuilder sb = new StringBuilder(); sb.append(Util.M.changeScreenTitleId(info.id_abbreviated())); if (info.subject() != null) { sb.append(": "); sb.append(info.subject()); } setWindowTitle(sb.toString()); }
Source:
public SmbConnectionBuilder(String type, ConnectionOptions options, AddressPortMapper mapper) { CifsConnectionType cifsConnectionType = options.getEnum(CONNECTION_TYPE, CifsConnectionType.class); switch (cifsConnectionType) { case TELNET: connection = new SmbTelnetConnection(type, options, mapper); break; case WINRM_INTERNAL: connection = new SmbWinRmConnection(type, options, mapper); break; case WINRM_NATIVE: connection = new SmbWinrsConnection(type, options, mapper); break; default: throw new IllegalArgumentException("Unknown CIFS connection type " + cifsConnectionType); } }

Target:
public SmbConnectionBuilder(String type, ConnectionOptions options, AddressPortMapper mapper) { connection = new SmbProcessConnection(type, options, mapper); }
Source:
protected ScanResult dbScanWithThroughputBackOff(ScanRequest scanRequest) { Long currentBackOff = minBackOff.get(); while(true) { try { return dbClient.scan(scanRequest); } catch (ProvisionedThroughputExceededException e) { currentBackOff = Math.min(currentBackOff * 2, maxBackOff.get()); log.info("Failed to poll Dynamo due to ProvisionedThroughputExceededException. Backing off."); try { Thread.sleep(currentBackOff); } catch (InterruptedException ex) { } } } }

Target:
protected ScanResult dbScanWithThroughputBackOff(ScanRequest scanRequest) { Long currentBackOffMs = minBackOffMs.get(); Long retryCount = 0L; while (true) { try { return dbClient.scan(scanRequest); } catch (ProvisionedThroughputExceededException e) { currentBackOffMs = Math.min(currentBackOffMs * 2, maxBackOffMs.get()); log.error(String.format("Failed to poll Dynamo due to ProvisionedThroughputExceededException. Backing off for %d ms.", currentBackOffMs)); if (retryCount > maxRetryCount.get()) { throw e; } retryCount++; try { Thread.sleep(currentBackOffMs); } catch (InterruptedException ex) { } } } }
Source:
public static void writeACNVModeledSegmentFileAsAllelicCapSegFile(final File outFile, final List<ACNVModeledSegment> acnvModeledSegments, final Genome genome) { Utils.nonNull(genome, "The genome cannot be null."); final double divisor = 2.0; final List<ACSModeledSegment> acsModeledSegments = convertACNVSegmentsToACSSegments(acnvModeledSegments, divisor, genome); try (final TableWriter<ACSModeledSegment> writer = TableUtils.writer(outFile, new TableColumnCollection(ACSTableColumns.COLUMN_NAME_ARRAY), (segment, dataLine) -> { dataLine.append(segment.getContig()).append(segment.getStart()).append(segment.getEnd()) .append(segment.getTargetCount()) .append(segment.getEnd() - segment.getStart()) .append(segment.getHetCount()) .append(segment.getF()) .append(segment.getTau()).append(segment.getSigmaTau()) .append(segment.getMuMinor()).append(segment.getSigmaMinor()) .append(segment.getMuMajor()).append(segment.getSigmaMajor()) .append(segment.getSegLabelCNLOH()); } )) { for (final ACSModeledSegment segment : acsModeledSegments) { writer.writeRecord(Utils.nonNull(segment, "List of segments contains a null.")); } } catch (final IOException e) { throw new UserException.CouldNotCreateOutputFile(outFile, e); } }

Target:
public static void writeACNVModeledSegmentFileAsAllelicCapSegFile(final File outFile, final List<ACNVModeledSegment> acnvModeledSegments, final Genome genome) { Utils.nonNull(genome, "The genome cannot be null."); Utils.nonNull(acnvModeledSegments, "ACNV modeled segments cannot be null."); final List<ACSModeledSegment> acsModeledSegments = convertACNVSegmentsToACSSegments(acnvModeledSegments, DIVISOR, genome); try (final TableWriter<ACSModeledSegment> writer = TableUtils.writer(outFile, new TableColumnCollection(ACSTableColumns.COLUMN_NAME_ARRAY), (segment, dataLine) -> { dataLine.append(segment.getContig()).append(segment.getStart()).append(segment.getEnd()) .append(segment.getTargetCount()) .append(segment.getEnd() - segment.getStart()) .append(segment.getHetCount()) .append(segment.getF()) .append(segment.getTau()).append(segment.getSigmaTau()) .append(segment.getMuMinor()).append(segment.getSigmaMinor()) .append(segment.getMuMajor()).append(segment.getSigmaMajor()) .append(segment.getSegLabelCNLOH()); } )) { for (final ACSModeledSegment segment : acsModeledSegments) { writer.writeRecord(Utils.nonNull(segment, "List of segments contains a null.")); } } catch (final IOException e) { throw new UserException.CouldNotCreateOutputFile(outFile, e); } }
Source:
public Object parseDefaultString(FieldType fieldType, String defaultStr) throws SQLException { try { return OffsetDateTime.parse(defaultStr, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss[.SSS]x")); } catch (NumberFormatException e) { throw SqlExceptionUtil.create("Problems with field " + fieldType + " parsing default LocalDateTime value: " + defaultStr, e); } }

Target:
public Object parseDefaultString(FieldType fieldType, String defaultStr) throws SQLException { try { return OffsetDateTime.parse(defaultStr, new DateTimeFormatterBuilder() .appendPattern("yyyy-MM-dd HH:mm:ss") .appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, true) .appendPattern("x") .toFormatter()); } catch (NumberFormatException e) { throw SqlExceptionUtil.create("Problems with field " + fieldType + " parsing default OffsetDateTime value: " + defaultStr, e); } }
Source:
public void testGaelicLanguageIsSetForAlbaChannel() { Film film = createAlbaNitroFilm(); ExtendedOnDemandProgramType onDemand = (ExtendedOnDemandProgramType) Iterables.getOnlyElement(generator.generate(film)); InstanceDescriptionType instanceDesc = onDemand.getInstanceDescription(); CaptionLanguageType captionLanguage = Iterables.getOnlyElement(instanceDesc.getCaptionLanguage()); assertTrue(captionLanguage.isClosed()); assertEquals(captionLanguage.getValue(), "gla"); }

Target:
public void testGaelicLanguageIsSetForAlbaChannel() { Film film = createAlbaNitroFilm(); ItemOnDemandHierarchy hierarchy = hierarchyFrom(film); String onDemandImi = idGenerator.generateOnDemandImi(hierarchy.item(), hierarchy.version(), hierarchy.encoding(), hierarchy.location()); ExtendedOnDemandProgramType onDemand = (ExtendedOnDemandProgramType) generator.generate(hierarchy, onDemandImi); InstanceDescriptionType instanceDesc = onDemand.getInstanceDescription(); CaptionLanguageType captionLanguage = Iterables.getOnlyElement(instanceDesc.getCaptionLanguage()); assertTrue(captionLanguage.isClosed()); assertEquals(captionLanguage.getValue(), "gla"); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { EObject selection = getSelection(event); if (selection == null) return new IContributionItem[0]; ResourceSet resourceSet = selection.eResource().getResourceSet(); if (!(resourceSet instanceof ModelSet)) return new IContributionItem[0]; final Shell shell = Display.getCurrent().getActiveShell(); ArchitectureDialogs.openSwitchArchitectureContext((ModelSet)resourceSet, shell); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { EObject selection = getSelection(event); if (selection == null) return new IContributionItem[0]; ResourceSet resourceSet = selection.eResource().getResourceSet(); if (!(resourceSet instanceof ModelSet)) return new IContributionItem[0]; final Shell shell = Display.getCurrent().getActiveShell(); ArchitectureUIUtils.switchArchitectureContext((ModelSet)resourceSet, shell, true); return null; }
Source:
public int getGenre() { if (id3v2Tag != null && id3v2Tag.getGenre() != -1) { return id3v2Tag.getGenre(); } else if (id3v1Tag != null) { return id3v1Tag.getGenre(); } else { return -1; } }

Target:
public int getGenre() { if (id3v1Tag != null && id3v1Tag.getGenre() != -1) { return id3v1Tag.getGenre(); } else if (id3v2Tag != null) { return id3v2Tag.getGenre(); } else { return -1; } }
Source:
public FlatRow finishRow() { ImmutableList.Builder<FlatRow.Cell> combined = ImmutableList.builderWithExpectedSize(totalCellCount); for (Set<FlatRow.Cell> familyCellList : cells.values()) { combined.addAll(familyCellList); } return new FlatRow(this.currentKey, combined.build()); }

Target:
public FlatRow finishRow() { ImmutableList.Builder<FlatRow.Cell> combined = ImmutableList.builderWithExpectedSize(totalCellCount); for (List<FlatRow.Cell> familyCellList : cells.values()) { FlatRow.Cell previous = null; for (FlatRow.Cell c : familyCellList) { if (previous == null || !c.getLabels().isEmpty() || !keysMatch(c, previous)) { combined.add(c); } previous = c; } } return new FlatRow(this.currentKey, combined.build()); }
Source:
protected Deconvolution2D(BaseConvBuilder<?> builder) { super(builder); this.hasBias = builder.hasBias; this.convolutionMode = builder.convolutionMode; this.dilation = builder.dilation; if (builder.kernelSize.length != 2) throw new IllegalArgumentException("Kernel size of should be rows x columns (a 2d array)"); this.kernelSize = builder.kernelSize; if (builder.stride.length != 2) throw new IllegalArgumentException("Stride should include stride for rows and columns (a 2d array)"); this.stride = builder.stride; if (builder.padding.length != 2) throw new IllegalArgumentException("Padding should include padding for rows and columns (a 2d array)"); this.padding = builder.padding; this.cudnnAlgoMode = builder.cudnnAlgoMode; this.cudnnFwdAlgo = builder.cudnnFwdAlgo; this.cudnnBwdFilterAlgo = builder.cudnnBwdFilterAlgo; this.cudnnBwdDataAlgo = builder.cudnnBwdDataAlgo; initializeConstraints(builder); }

Target:
protected Deconvolution2D(BaseConvBuilder<?> builder) { super(builder); initializeConstraints(builder); }
Source:
private void visitConnect(IProject project, final Map<IProject, File> projects) throws CoreException { if (RepositoryMapping.getMapping(project) != null) { return; } RepositoryProvider provider = RepositoryProvider .getProvider(project); if (provider != null) { return; } RepositoryFinder f = new RepositoryFinder(project); f.setFindInChildren(false); Collection<RepositoryMapping> mappings = f.find(new NullProgressMonitor()); if (mappings.isEmpty()) { return; } RepositoryMapping m = mappings.iterator().next(); IPath gitDirPath = m.getGitDirAbsolutePath(); if (gitDirPath == null || gitDirPath.segmentCount() == 0) { return; } IPath workingDir = gitDirPath.removeLastSegments(1); if (workingDir.isRoot()) { return; } File userHome = FS.DETECTED.userHome(); if (userHome != null) { Path userHomePath = new Path(userHome.getAbsolutePath()); if (workingDir.isPrefixOf(userHomePath)) { return; } } File repositoryDir = gitDirPath.toFile(); projects.put(project, repositoryDir); if (mappings.size() > 1) { IPath lastPath = null; for (RepositoryMapping mapping : mappings) { lastPath = mapping.getGitDirAbsolutePath(); } if (lastPath != null) { repositoryDir = lastPath.toFile(); } } try { Activator.getDefault().getRepositoryUtil() .addConfiguredRepository(repositoryDir); } catch (IllegalArgumentException e) { logError(CoreText.Activator_AutoSharingFailed, e); } }

Target:
private void visitConnect(IProject project, final Map<IProject, File> projects) throws CoreException { if (RepositoryMapping.getMapping(project) != null) { return; } RepositoryProvider provider = RepositoryProvider .getProvider(project); if (provider != null) { return; } RepositoryFinder f = new RepositoryFinder(project); f.setFindInChildren(false); List<RepositoryMapping> mappings = f .find(new NullProgressMonitor()); if (mappings.isEmpty()) { return; } RepositoryMapping m = mappings.get(0); IPath gitDirPath = m.getGitDirAbsolutePath(); if (gitDirPath == null || gitDirPath.segmentCount() == 0) { return; } IPath workingDir = gitDirPath.removeLastSegments(1); if (workingDir.isRoot()) { return; } File userHome = FS.DETECTED.userHome(); if (userHome != null) { Path userHomePath = new Path(userHome.getAbsolutePath()); if (workingDir.isPrefixOf(userHomePath)) { return; } } File repositoryDir = gitDirPath.toFile(); projects.put(project, repositoryDir); int nofMappings = mappings.size(); if (nofMappings > 1) { IPath lastPath = mappings.get(nofMappings - 1) .getGitDirAbsolutePath(); if (lastPath != null) { repositoryDir = lastPath.toFile(); } } try { Activator.getDefault().getRepositoryUtil() .addConfiguredRepository(repositoryDir); } catch (IllegalArgumentException e) { logError(CoreText.Activator_AutoSharingFailed, e); } }
Source:
void issue200EnumConstantsWithCommentsForceVerticalAlignment() { CompilationUnit cu = StaticJavaParser.parse("public enum X {" + EOL + " " + EOL + " BORDER_CONSTANT," + EOL + " " + EOL + " ANOTHER_CONSTANT" + EOL + "}"); assertEqualsNoEol("public enum X {\n" + "\n" + " \n" + " BORDER_CONSTANT,\n" + " \n" + " ANOTHER_CONSTANT\n" + "}\n", cu.toString()); }

Target:
void issue200EnumConstantsWithCommentsForceVerticalAlignment() { CompilationUnit cu = TestParser.parseCompilationUnit("public enum X {" + EOL + " " + EOL + " BORDER_CONSTANT," + EOL + " " + EOL + " ANOTHER_CONSTANT" + EOL + "}"); assertEqualsNoEol("public enum X {\n" + "\n" + " \n" + " BORDER_CONSTANT,\n" + " \n" + " ANOTHER_CONSTANT\n" + "}\n", cu.toString()); }
Source:
GraphLabelProvider() { absoluteFormatter = DateFormat.getInstance(); }

Target:
GraphLabelProvider() { absoluteFormatter = DateFormat.getDateTimeInstance(); }
Source:
private static boolean inheritsFromBaseException(@Nullable Symbol symbol) { if (symbol == null || symbol.kind() != CLASS) { return true; } return ((ClassSymbol) symbol).isOrExtends("BaseException") || ((ClassSymbol) symbol).hasUnresolvedTypeHierarchy(); }

Target:
private static boolean inheritsFromBaseException(@Nullable Symbol symbol) { if (symbol == null || symbol.kind() != CLASS) { return true; } ClassSymbol classSymbol = (ClassSymbol) symbol; return classSymbol.isOrExtends("BaseException") || classSymbol.hasUnresolvedTypeHierarchy(); }
Source:
protected void inject(Injector injector) throws Exception { super.inject(injector); environment = injector.getInstance(IEdxEnvironment.class); config = injector.getInstance(Config.class); }

Target:
protected void inject(Injector injector) throws Exception { super.inject(injector); environment = injector.getInstance(IEdxEnvironment.class); }
Source:
public void registerType(HierarchicalTypeDefinition<?> typeDef) throws Exception { if (metadataService.getTypeNamesList().contains(typeDef.typeName)) { log.info("Given type: is already registered.", typeDef.typeName); return; } final String typeDefJson = TypesSerialization.toJson(typeDef, false); final JSONObject type = metadataService.createType(typeDefJson); log.info("####### registered type ", type); final List<String> typeNamesList = metadataService.getTypeNamesList(); log.debug("####### registered typeNames ", typeNamesList); }

Target:
public void registerType(HierarchicalTypeDefinition<?> typeDef) throws Exception { if (metadataService.getTypeNamesList().contains(typeDef.typeName)) { LOG.info("Given type: is already registered.", typeDef.typeName); } else { final String typeDefJson = TypesSerialization.toJson(typeDef, false); final JSONObject type = metadataService.createType(typeDefJson); LOG.info("####### registered type ", type); final List<String> typeNamesList = metadataService.getTypeNamesList(); LOG.debug("####### registered typeNames ", typeNamesList); } }
Source:
public void setUp() throws Exception { executeString("create database " + getCurrentDatabase()).close(); }

Target:
public static void setUp() throws Exception { FileSystem fs = FileSystem.get(conf); Path rootDir = TajoConf.getWarehouseDir(testingCluster.getConfiguration()); Schema schema = new Schema(); schema.addColumn("n_nationkey", TajoDataTypes.Type.INT8); schema.addColumn("n_name", TajoDataTypes.Type.TEXT); schema.addColumn("n_regionkey", TajoDataTypes.Type.INT8); TableMeta meta = CatalogUtil.newTableMeta("TEXT", new KeyValueSet()); createExternalTableIncludedOnePartitionKeyColumn(fs, rootDir, schema, meta); createExternalTableIncludedMultiplePartitionKeyColumns(fs, rootDir, schema, meta); }
Source:
private void prepareTest() { runner = spy(new LocalApplicationRunner(mockApp, config)); localPlanner = spy((LocalJobConfigPlanner) Whitebox.getInternalState(runner, "planner")); Whitebox.setInternalState(runner, "planner", localPlanner); }

Target:
private void prepareTest() { ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc = ApplicationDescriptorUtil.getAppDescriptor(mockApp, config); localPlanner = spy(new LocalJobPlanner(appDesc)); runner = spy(new LocalApplicationRunner(appDesc, localPlanner)); }
Source:
public ElideResponse get(String path, MultivaluedMap<String, String> queryParams, User opaqueUser, String apiVersion, UUID requestId) { return handleRequest(true, opaqueUser, dataStore::beginReadTransaction, requestId, (tx, user) -> { JsonApiDocument jsonApiDoc = new JsonApiDocument(); RequestScope requestScope = new RequestScope(path, apiVersion, jsonApiDoc, tx, user, queryParams, requestId, elideSettings); EntityProjection projection = new EntityProjectionMaker(elideSettings.getDictionary(), requestScope).parsePath(path); requestScope.setEntityProjection(projection); BaseVisitor visitor = new GetVisitor(requestScope); elideAcceptQuery(requestScope, opaqueUser, requestScope.getQueryParams(), path); elideProcessQuery(projection, requestScope, tx); return visit(path, requestScope, visitor); }); }

Target:
public ElideResponse get(String path, MultivaluedMap<String, String> queryParams, User opaqueUser, String apiVersion, UUID requestId) { return handleRequest(true, opaqueUser, dataStore::beginReadTransaction, requestId, (tx, user) -> { JsonApiDocument jsonApiDoc = new JsonApiDocument(); RequestScope requestScope = new RequestScope(path, apiVersion, jsonApiDoc, tx, user, queryParams, requestId, elideSettings); elideAcceptQuery(requestScope, opaqueUser, requestScope.getQueryParams(), path); EntityProjection projection = new EntityProjectionMaker(elideSettings.getDictionary(), requestScope).parsePath(path); requestScope.setEntityProjection(projection); BaseVisitor visitor = new GetVisitor(requestScope); elideProcessQuery(projection, requestScope, tx); return visit(path, requestScope, visitor); }); }
Source:
public void close() throws Exception { super.close(); getMeasured().close(); }

Target:
public void close() throws Exception { try { super.close(); } finally { getMeasured().close(); } }