auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void downloadInterpreter() throws IOException { String interpreterName = "test-interpreter"; String artifactName = "junit:junit:4.11"; Path specificInterpreterPath = Files.createDirectory(Paths.get(interpreterDir.toString(), interpreterName)); DependencyResolver dependencyResolver = new DependencyResolver(localRepoDir.toString()); doNothing().when(mockInterpreterSettingManager).refreshInterpreterTemplates(); ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class); doNothing().when(mockNotebookServer).broadcast(messageArgumentCaptor.capture()); interpreterService.downloadInterpreter( new InterpreterInstallationRequest(interpreterName, artifactName), dependencyResolver, specificInterpreterPath, null); Message message = messageArgumentCaptor.getValue(); assertNotNull(message.data); assertEquals("Success", message.data.get("result")); assertEquals(interpreterName + " downloaded", message.data.get("message")); }

Target:
public void downloadInterpreter() throws IOException { final String interpreterName = "test-interpreter"; String artifactName = "junit:junit:4.11"; Path specificInterpreterPath = Files.createDirectory(Paths.get(interpreterDir.toString(), interpreterName)); DependencyResolver dependencyResolver = new DependencyResolver(localRepoDir.toString()); doNothing().when(mockInterpreterSettingManager).refreshInterpreterTemplates(); interpreterService.downloadInterpreter( new InterpreterInstallationRequest(interpreterName, artifactName), dependencyResolver, specificInterpreterPath, new ServiceCallback() { @Override public void onStart(String message) { assertEquals("Starting to download " + interpreterName + " interpreter", message); } @Override public void onSuccess(String message) { assertEquals(interpreterName + " downloaded", message); } @Override public void onFailure(String message) { fail(); } }); verify(mockInterpreterSettingManager, times(1)).refreshInterpreterTemplates(); }
Source:
public @Nullable String getThreadName(ITmfEvent event) { ITmfEventField content = event.getContent(); ITmfEventField field = content.getField(fLayout.contextProcname()); String procName = field == null ? "" : (String) field.getValue() + '-'; long vtid = getThreadId(event); return (procName + Long.toString(vtid)); }

Target:
public @Nullable String getThreadName(ITmfEvent event) { ITmfEventField content = event.getContent(); ITmfEventField field = content.getField(fLayout.contextProcname()); String procName = field == null ? StringUtils.EMPTY : (String) field.getValue() + '-'; long vtid = getThreadId(event); return (procName + Long.toString(vtid)); }
Source:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((ntlmDomain == null) ? 0 : ntlmDomain.hashCode()); return result; }

Target:
public int hashCode() { return hash(super.hashCode(), ntlmDomain); }
Source:
private boolean checkSupport(MatrixLib x) { double sum = 0.0; for (int i = 0; i < x.numRows(); i++) { sum += x.elementAt(i, 0); } return (sum <= (1 + TOLERANCE)) && (sum >= (1 - TOLERANCE)); }

Target:
private boolean checkSupport(MatrixLib x) { double sum = 0.0; for (int i = 0; i < x.numRows(); i++) { sum += x.elementAt(i, 0); } return (sum <= (1 + Util.TOLERANCE)) && (sum >= (1 - Util.TOLERANCE)); }
Source:
public boolean containsDeviceWithType(List<VmDevice> devices, VmDeviceGeneralType generalType, VmDeviceType deviceType) { VmDevice foundDevice = getFirstDeviceWithType(devices, generalType, deviceType); return foundDevice == null ? false : true; }

Target:
public boolean containsDeviceWithType(List<VmDevice> devices, VmDeviceGeneralType generalType, VmDeviceType deviceType) { VmDevice foundDevice = getFirstDeviceWithType(devices, generalType, deviceType); return foundDevice != null; }
Source:
private static String createTempLobFileName(DataHandler handler) throws IOException { String path = handler.getDatabasePath(); if (path.isEmpty()) { path = SysProperties.PREFIX_TEMP_FILE; } return FileUtils.createTempFile(path, Constants.SUFFIX_TEMP_FILE, false, true); }

Target:
private static String createTempLobFileName(DataHandler handler) throws IOException { String path = handler.getDatabasePath(); if (path.isEmpty()) { path = SysProperties.PREFIX_TEMP_FILE; } return FileUtils.createTempFile(path, Constants.SUFFIX_TEMP_FILE, true); }
Source:
final public boolean isExtendedLifeTimeToken() { return mIsExtendedLifeTimeToken; }

Target:
public boolean isExtendedLifeTimeToken() { return mIsExtendedLifeTimeToken; }
Source:
protected void execute() { logger.debug("Checking if host is available"); boolean success = false; int timeout = 5000; try { success = Ping.checkVitality(ip, 0, timeout); if (success) { logger.debug("established connection [host '{}' port '{}' timeout '{}']", new Object[] {ip, 0, timeout}); } else { logger.debug("couldn't establish network connection [host '{}' port '{}' timeout '{}']", new Object[] {ip, 0, timeout}); } } catch (SocketTimeoutException se) { logger.debug("timed out while connecting to host '{}' port '{}' timeout '{}'", new Object[] {ip, 0, timeout}); } catch (IOException ioe) { logger.debug("couldn't establish network connection [host '{}' port '{}' timeout '{}']", new Object[] {ip, 0, timeout}); } if (!success) { return; } for (JointSpaceBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { String tvcommand = provider.getTVCommand(itemName, "POLL"); if (tvcommand != null) { updateItemState(itemName,tvcommand); } } } }

Target:
protected void execute() { logger.debug("Checking if host is available"); boolean success = false; int timeout = 5000; try { success = Ping.checkVitality(ip, 0, timeout); if (success) { logger.debug("established connection [host '{}' port '{}' timeout '{}']", new Object[] {ip, 0, timeout}); for (JointSpaceBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { String tvcommand = provider.getTVCommand(itemName, "POLL"); if (tvcommand != null) { updateItemState(itemName,tvcommand); } } } } else { logger.debug("couldn't establish network connection [host '{}' port '{}' timeout '{}']", new Object[] {ip, 0, timeout}); } } catch (SocketTimeoutException se) { logger.debug("timed out while connecting to host '{}' port '{}' timeout '{}'", new Object[] {ip, 0, timeout}); } catch (IOException ioe) { logger.debug("couldn't establish network connection [host '{}' port '{}' timeout '{}']", new Object[] {ip, 0, timeout}); } }
Source:
private String findIntermediateTable() { if (DbConnectionFactory.isMySql()) { return MYSQL_FIND_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isPostgres()) { return POSTGRES_FIND_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isMsSql()) { return MSSQL_FIND_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isOracle()) { return ORACLE_FIND_INTERMEDIATE_TABLE; } else { return null; } }

Target:
private String findIntermediateTable() { String sql = null; if (DbConnectionFactory.isMySql()) { sql = MYSQL_FIND_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isPostgres()) { sql = POSTGRES_FIND_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isMsSql()) { sql = MSSQL_FIND_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isOracle()) { sql = ORACLE_FIND_INTERMEDIATE_TABLE; } return sql; }
Source:
protected void processTuple(T tuple) { long time = getTime(tuple); Future<Slice> valFuture = managedState.getAsync(time, getKey(tuple)); if (valFuture.isDone()) { try { processEvent(tuple, valFuture.get()); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException("process", e); } } else { processWaitingEvent(tuple, valFuture); } }

Target:
protected void processTuple(T tuple) { long time = getTime(tuple); Future<Slice> valFuture = managedState.getAsync(time, getKey(tuple)); if (valFuture.isDone()) { try { processEvent(tuple, valFuture.get()); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } } else { processWaitingEvent(tuple, valFuture); } }
Source:
public void consolesAdded(final IConsole[] consoles) { if (isAvailable()) { Runnable r = () -> { for (IConsole c : consoles) { if (isAvailable()) { IConsole console = c; IConsole[] allConsoles = getConsoleManager().getConsoles(); for (IConsole registered : allConsoles) { if (registered.equals(console)) { ConsoleWorkbenchPart part = new ConsoleWorkbenchPart(console, getSite()); fConsoleToPart.put(console, part); fPartToConsole.put(part, console); partActivated(part); break; } } } } }; asyncExec(r); } }

Target:
public void consolesAdded(final IConsole[] consoles) { if (isAvailable()) { Runnable r = () -> { for (IConsole console : consoles) { if (isAvailable()) { IConsole[] allConsoles = getConsoleManager().getConsoles(); for (IConsole registered : allConsoles) { if (registered.equals(console)) { ConsoleWorkbenchPart part = new ConsoleWorkbenchPart(console, getSite()); fConsoleToPart.put(console, part); fPartToConsole.put(part, console); partActivated(part); break; } } } } }; asyncExec(r); } }
Source:
private void sendTicket() { final DbUser user = getCurrentUser(); final boolean sent = runVdsCommand(VDSCommandType.SetVmTicket, new SetVmTicketVDSCommandParameters(getVdsId(), getVmId(), ticket, getParameters().getValidTime(), user.getLoginName(), user.getId(), getParameters().getGraphicsType(), getVm().getConsoleDisconnectAction(), getVm().getClusterCompatibilityVersion())).getSucceeded(); if (sent) { setActionReturnValue(ticket); } setSucceeded(sent); }

Target:
private void sendTicket() { final DbUser user = getCurrentUser(); final boolean sent = runVdsCommand(VDSCommandType.SetVmTicket, new SetVmTicketVDSCommandParameters(getVdsId(), getVmId(), ticket, getParameters().getValidTime(), user.getLoginName(), user.getId(), getParameters().getGraphicsType(), getVm().getConsoleDisconnectAction(), getVm().getCompatibilityVersion())).getSucceeded(); if (sent) { setActionReturnValue(ticket); } setSucceeded(sent); }
Source:
public TerminationRequest(String message) { super(message); }

Target:
public TerminationRequest(String message) { super(message); this.when = System.currentTimeMillis(); }
Source:
public void letTheSupervisorDo(Consumer<EmptyTask> action) { if (supervisor != null) { action.accept(supervisor); } }

Target:
public void letTheSupervisorDo(Consumer<EmptyTask> action) { if (Objects.nonNull(supervisor)) { action.accept(supervisor); } }
Source:
public String addPromo(HttpServletRequest request, HttpServletResponse response, Model model, String customerOffer) throws IOException, PricingException, ItemNotFoundException, OfferMaxUseExceededException { Order cart = CartState.getCart(request); Boolean promoAdded = false; OfferCode offerCode = offerService.lookupOfferCodeByCode(customerOffer); if(offerCode!=null&&offerService.verifyMaxCustomerUsageThreshold(cart.getCustomer(), offerCode.getOffer())) { cartService.addOfferCode(cart, offerCode, false); promoAdded = true; } cartService.save(cart, true); CartState.setCart(request, cart); if (isAjaxRequest(request)) { Map<String, Object> extraData = new HashMap<String, Object>(); extraData.put("promoAdded", promoAdded); model.addAttribute("blcextradata", new ObjectMapper().writeValueAsString(extraData)); return "ajax/cart"; } else { return "redirect:/cart"; } }

Target:
public String addPromo(HttpServletRequest request, HttpServletResponse response, Model model, String customerOffer) throws IOException, PricingException { Order cart = CartState.getCart(request); Boolean promoAdded = false; String exception = ""; OfferCode offerCode = offerService.lookupOfferCodeByCode(customerOffer); if(offerCode!=null) { try { cartService.addOfferCode(cart, offerCode, false); promoAdded = true; cart = cartService.save(cart, true); } catch(OfferMaxUseExceededException e) { exception = "Use Limit Exceeded"; } } else { exception = "Invalid Code"; } CartState.setCart(request, cart); if (isAjaxRequest(request)) { Map<String, Object> extraData = new HashMap<String, Object>(); extraData.put("promoAdded", promoAdded); extraData.put("exception" , exception); model.addAttribute("blcextradata", new ObjectMapper().writeValueAsString(extraData)); return "ajax/cart"; } else { return "redirect:/cart"; } }
Source:
public static double greatCircleDistance(double latitude1, double longitude1, double latitude2, double longitude2) { checkLatitude(latitude1); checkLongitude(longitude1); checkLatitude(latitude2); checkLongitude(longitude2); double radianLatitude1 = toRadians(latitude1); double radianLatitude2 = toRadians(latitude2); double sin1 = sin(radianLatitude1); double cos1 = cos(radianLatitude1); double sin2 = sin(radianLatitude2); double cos2 = cos(radianLatitude2); double deltaLongitude = toRadians(longitude1) - toRadians(longitude2); double cosDeltaLongitude = cos(deltaLongitude); double t1 = cos2 * sin(deltaLongitude); double t2 = cos1 * sin2 - sin1 * cos2 * cosDeltaLongitude; double t3 = sin1 * sin2 + cos1 * cos2 * cosDeltaLongitude; return atan2(sqrt(t1 * t1 + t2 * t2), t3) * GeometryUtils.EARTH_RADIUS_KM; }

Target:
private static double greatCircleDistance(double latitude1, double longitude1, double latitude2, double longitude2) { checkLatitude(latitude1); checkLongitude(longitude1); checkLatitude(latitude2); checkLongitude(longitude2); double radianLatitude1 = toRadians(latitude1); double radianLatitude2 = toRadians(latitude2); double sin1 = sin(radianLatitude1); double cos1 = cos(radianLatitude1); double sin2 = sin(radianLatitude2); double cos2 = cos(radianLatitude2); double deltaLongitude = toRadians(longitude1) - toRadians(longitude2); double cosDeltaLongitude = cos(deltaLongitude); double t1 = cos2 * sin(deltaLongitude); double t2 = cos1 * sin2 - sin1 * cos2 * cosDeltaLongitude; double t3 = sin1 * sin2 + cos1 * cos2 * cosDeltaLongitude; return atan2(sqrt(t1 * t1 + t2 * t2), t3) * GeometryUtils.EARTH_RADIUS_M; }
Source:
public String toString() { StringBuffer buff = new StringBuffer(getParentString()); buff.append(", queueName=" + queueName); buff.append(", filterString=" + filterString); buff.append(", priority=" + priority); buff.append(", id=" + id); buff.append(", browseOnly=" + browseOnly); buff.append(", requiresResponse=" + requiresResponse); buff.append("]"); return buff.toString(); }

Target:
public String toString() { StringBuffer buff = new StringBuffer(getParentString()); buff.append(", queueName=" + queueName); buff.append(", filterString=" + filterString); buff.append(", id=" + id); buff.append(", browseOnly=" + browseOnly); buff.append(", requiresResponse=" + requiresResponse); buff.append(", priority=" + priority); buff.append("]"); return buff.toString(); }
Source:
public void tesIsModifiedBySameLastModifiedAndDifferentSize() throws Exception { File f1 = createFile("foo", "lorem".getBytes()); File f2 = createFile("bar", "lorem ipsum".getBytes()); long now = System.currentTimeMillis(); f1.setLastModified(f2.lastModified()); FileSnapshot save = FileSnapshot.save(f1); Thread.sleep(3000L); assertEquals(save.lastModified(), f2.lastModified()); assertTrue(save.isModified(f2)); }

Target:
public void tesIsModifiedBySameLastModifiedAndDifferentSize() throws Exception { File f1 = createFile("foo", "lorem".getBytes()); File f2 = createFile("bar", "lorem ipsum".getBytes()); f1.setLastModified(f2.lastModified()); FileSnapshot save = FileSnapshot.save(f1); Thread.sleep(3000L); assertEquals(save.lastModified(), f2.lastModified()); assertTrue(save.isModified(f2)); }
Source:
public NetworkRequest requestNetwork(NetworkCapabilities networkCapabilities, Messenger messenger, int timeoutMs, IBinder binder, int legacyType) { final NetworkRequest.Type type = (networkCapabilities == null) ? NetworkRequest.Type.TRACK_DEFAULT : NetworkRequest.Type.REQUEST; if (type == NetworkRequest.Type.TRACK_DEFAULT) { networkCapabilities = new NetworkCapabilities(mDefaultRequest.networkCapabilities); enforceAccessPermission(); } else { networkCapabilities = new NetworkCapabilities(networkCapabilities); enforceNetworkRequestPermissions(networkCapabilities); enforceMeteredApnPolicy(networkCapabilities); } ensureRequestableCapabilities(networkCapabilities); if (timeoutMs < 0) { throw new IllegalArgumentException("Bad timeout specified"); } MatchAllNetworkSpecifier.checkNotMatchAllNetworkSpecifier( networkCapabilities.getNetworkSpecifier()); if (networkCapabilities.getNetworkSpecifier() instanceof NetworkSpecifier.UidContainer) { if (((NetworkSpecifier.UidContainer) networkCapabilities.getNetworkSpecifier()).getUid() != Binder.getCallingUid()) { throw new SecurityException("Invalid UID provided by caller"); } } NetworkRequest networkRequest = new NetworkRequest(networkCapabilities, legacyType, nextNetworkRequestId(), type); NetworkRequestInfo nri = new NetworkRequestInfo(messenger, networkRequest, binder); if (DBG) log("requestNetwork for " + nri); mHandler.sendMessage(mHandler.obtainMessage(EVENT_REGISTER_NETWORK_REQUEST, nri)); if (timeoutMs > 0) { mHandler.sendMessageDelayed(mHandler.obtainMessage(EVENT_TIMEOUT_NETWORK_REQUEST, nri), timeoutMs); } return networkRequest; }

Target:
public NetworkRequest requestNetwork(NetworkCapabilities networkCapabilities, Messenger messenger, int timeoutMs, IBinder binder, int legacyType) { final NetworkRequest.Type type = (networkCapabilities == null) ? NetworkRequest.Type.TRACK_DEFAULT : NetworkRequest.Type.REQUEST; if (type == NetworkRequest.Type.TRACK_DEFAULT) { networkCapabilities = new NetworkCapabilities(mDefaultRequest.networkCapabilities); enforceAccessPermission(); } else { networkCapabilities = new NetworkCapabilities(networkCapabilities); enforceNetworkRequestPermissions(networkCapabilities); enforceMeteredApnPolicy(networkCapabilities); } ensureRequestableCapabilities(networkCapabilities); if (timeoutMs < 0) { throw new IllegalArgumentException("Bad timeout specified"); } MatchAllNetworkSpecifier.checkNotMatchAllNetworkSpecifier( networkCapabilities.getNetworkSpecifier()); if (networkCapabilities.getNetworkSpecifier() != null) { networkCapabilities.getNetworkSpecifier().checkUidIfNecessary(Binder.getCallingUid()); } NetworkRequest networkRequest = new NetworkRequest(networkCapabilities, legacyType, nextNetworkRequestId(), type); NetworkRequestInfo nri = new NetworkRequestInfo(messenger, networkRequest, binder); if (DBG) log("requestNetwork for " + nri); mHandler.sendMessage(mHandler.obtainMessage(EVENT_REGISTER_NETWORK_REQUEST, nri)); if (timeoutMs > 0) { mHandler.sendMessageDelayed(mHandler.obtainMessage(EVENT_TIMEOUT_NETWORK_REQUEST, nri), timeoutMs); } return networkRequest; }
Source:
public long compress(InputStream is, OutputStream os, long maxReadLength, long maxWriteLength, long amountOfDataToCheckCompressionRatio, int minimumCompressionPercentage) throws IOException { if(maxReadLength <= 0) throw new IllegalArgumentException(); BZip2CompressorOutputStream bz2os = null; try { CountedOutputStream cos = new CountedOutputStream(os); bz2os = new BZip2CompressorOutputStream(HeaderStreams.dimOutput(BZ_HEADER, cos)); long read = 0; int bufferSize = 32768; byte[] buffer = new byte[bufferSize]; long iterationToCheckCompressionRatio = amountOfDataToCheckCompressionRatio / bufferSize; int i = 0; while(true) { int l = (int) Math.min(buffer.length, maxReadLength - read); int x = l == 0 ? -1 : is.read(buffer, 0, buffer.length); if(x <= -1) break; if(x == 0) throw new IOException("Returned zero from read()"); bz2os.write(buffer, 0, x); read += x; if(cos.written() > maxWriteLength) throw new CompressionOutputSizeException(); if (++i == iterationToCheckCompressionRatio) checkCompressionEffect(read, cos.written(), minimumCompressionPercentage); } bz2os.flush(); cos.flush(); bz2os.close(); bz2os = null; if(cos.written() > maxWriteLength) throw new CompressionOutputSizeException(); return cos.written(); } finally { if(bz2os != null) { bz2os.flush(); bz2os.close(); } } }

Target:
public long compress(InputStream is, OutputStream os, long maxReadLength, long maxWriteLength, long amountOfDataToCheckCompressionRatio, int minimumCompressionPercentage) throws IOException { if(maxReadLength <= 0) throw new IllegalArgumentException(); BZip2CompressorOutputStream bz2os = null; try { CountedOutputStream cos = new CountedOutputStream(os); bz2os = new BZip2CompressorOutputStream(HeaderStreams.dimOutput(BZ_HEADER, cos)); long read = 0; int bufferSize = 32768; byte[] buffer = new byte[bufferSize]; long iterationToCheckCompressionRatio = amountOfDataToCheckCompressionRatio / bufferSize; int i = 0; while(true) { int l = (int) Math.min(buffer.length, maxReadLength - read); int x = l == 0 ? -1 : is.read(buffer, 0, buffer.length); if(x <= -1) break; if(x == 0) throw new IOException("Returned zero from read()"); bz2os.write(buffer, 0, x); read += x; if(cos.written() > maxWriteLength) throw new CompressionOutputSizeException(); if (++i == iterationToCheckCompressionRatio) { checkCompressionEffect(read, cos.written(), minimumCompressionPercentage); } } bz2os.flush(); cos.flush(); bz2os.close(); bz2os = null; if(cos.written() > maxWriteLength) throw new CompressionOutputSizeException(); return cos.written(); } finally { if(bz2os != null) { bz2os.flush(); bz2os.close(); } } }
Source:
public void testAssociatedArtId() throws Exception { String expected = "SELECT br1.*\n" + " FROM \n" + "osee_branch br1\n" + " WHERE \n" + "br1.associated_art_id = ?\n" + " ORDER BY br1.branch_id"; ArtifactId artifactId = ArtifactId.valueOf(4); queryData.addCriteria(new CriteriaAssociatedArtId(artifactId)); QuerySqlContext context = queryEngine.createQueryContext(session, queryData); assertEquals(expected, context.getSql()); List<Object> parameters = context.getParameters(); assertEquals(1, parameters.size()); List<AbstractJoinQuery> joins = context.getJoins(); assertEquals(0, joins.size()); Iterator<Object> iterator = parameters.iterator(); assertEquals(artifactId, iterator.next()); }

Target:
public void testAssociatedArtId() throws Exception { String expected = "SELECT br1.*\n" + " FROM \n" + "osee_branch br1\n" + " WHERE \n" + "br1.associated_art_id = ?\n" + " ORDER BY br1.branch_id"; queryData.addCriteria(new CriteriaAssociatedArtId(DefaultHierarchyRoot)); QuerySqlContext context = queryEngine.createQueryContext(session, queryData); assertEquals(expected, context.getSql()); List<Object> parameters = context.getParameters(); assertEquals(1, parameters.size()); List<AbstractJoinQuery> joins = context.getJoins(); assertEquals(0, joins.size()); Iterator<Object> iterator = parameters.iterator(); assertEquals(DefaultHierarchyRoot, iterator.next()); }
Source:
private ITestModelProvider getModelProviderForNonUnsettableMultiValuedFeature(Resource resource) throws Exception { EReference listA = getModel6Package().getRoot_ListA(); Assert.assertFalse(listA.isUnsettable()); final Root root = getModel6Factory().createRoot(); resource.getContents().add(root); resource.save(Collections.emptyMap()); return new ITestModelProvider() { public void addObject() { root.getListA().add(getModel6Factory().createBaseObject()); } public EObject getRoot() { return root; } public void unset() { root.eUnset(getModel6Package().getRoot_ListA()); } public boolean isUnsettable() { return false; } }; }

Target:
private ITestModelProvider getModelProviderForNonUnsettableMultiValuedFeature(Resource resource) throws Exception { EReference refList = getModel6Package().getReferenceObject_ReferenceList(); Assert.assertFalse(refList.isUnsettable()); final ReferenceObject root = getModel6Factory().createReferenceObject(); resource.getContents().add(root); resource.save(Collections.emptyMap()); return new ITestModelProvider() { public void addObject() { root.getReferenceList().add(getModel6Factory().createBaseObject()); } public EObject getRoot() { return root; } public void unset() { root.eUnset(getModel6Package().getReferenceObject_ReferenceList()); } public boolean isUnsettable() { return false; } }; }
Source:
private CreateVolumeVDSCommandParameters getCreateVDSCommandParameters() { CreateVolumeVDSCommandParameters parameters = new CreateVolumeVDSCommandParameters(getStoragePoolId(), getDestinationStorageDomainId(), getImageGroupId(), getImage().getImageId(), getDiskImage().getSize(), newDiskImage.getVolumeType(), newDiskImage.getVolumeFormat(), getDiskImage().getId(), getDestinationImageId(), "", getStoragePool().getCompatibilityVersion(), getDiskImage().getContentType()); parameters.setImageInitialSizeInBytes(newDiskImage.getActualSizeInBytes()); return parameters; }

Target:
private CreateVolumeVDSCommandParameters getCreateVDSCommandParameters() { CreateVolumeVDSCommandParameters parameters = new CreateVolumeVDSCommandParameters(getStoragePoolId(), getDestinationStorageDomainId(), getImageGroupId(), getImage().getImageId(), getDiskImage().getSize(), newDiskImage.getVolumeType(), newDiskImage.getVolumeFormat(), getDiskImage().getId(), getDestinationImageId(), "", getStoragePool().getCompatibilityVersion(), getDiskImage().getContentType()); if (newDiskImage.getActualSizeInBytes() != 0) { parameters.setImageInitialSizeInBytes(newDiskImage.getActualSizeInBytes()); } return parameters; }
Source:
public Optional<ChangeEdit> byChange(Change change) throws AuthException, IOException, InvalidChangeOperationException { if (!user.get().isIdentifiedUser()) { throw new AuthException("Authentication required"); } Repository repo = gitManager.openRepository(change.getProject()); try { IdentifiedUser me = (IdentifiedUser) user.get(); Map<String, Ref> refs = repo.getRefDatabase().getRefs(editRefPrefix( me.getAccountId(), change.getId())); if (refs.isEmpty()) { return Optional.absent(); } Ref ref = Iterables.getOnlyElement(refs.values()); RevWalk rw = new RevWalk(repo); try { RevCommit commit = rw.parseCommit(ref.getObjectId()); PatchSet basePs = getBasePatchSet(change, commit); return Optional.of(new ChangeEdit(me, change, ref, commit, basePs)); } finally { rw.release(); } } finally { repo.close(); } }

Target:
public Optional<ChangeEdit> byChange(Change change) throws AuthException, IOException, InvalidChangeOperationException { if (!user.get().isIdentifiedUser()) { throw new AuthException("Authentication required"); } Repository repo = gitManager.openRepository(change.getProject()); try { IdentifiedUser me = (IdentifiedUser) user.get(); String editRefPrefix = editRefPrefix(me.getAccountId(), change.getId()); Map<String, Ref> refs = repo.getRefDatabase().getRefs(editRefPrefix); if (refs.isEmpty()) { return Optional.absent(); } Ref ref = Iterables.getOnlyElement(refs.values()); RevWalk rw = new RevWalk(repo); try { RevCommit commit = rw.parseCommit(ref.getObjectId()); PatchSet basePs = getBasePatchSet(change, ref); return Optional.of(new ChangeEdit(me, change, ref, commit, basePs)); } finally { rw.release(); } } finally { repo.close(); } }
Source:
private void showFeaturedImage(int postId, WPNetworkImageView imgFeatured) { String imageUrl = mFeaturedImageUrls.get(postId); if (imageUrl == null) { imgFeatured.setVisibility(View.GONE); } else if (imageUrl.startsWith("http")) { String photonUrl = ReaderUtils.getResizedImageUrl(imageUrl, mPhotonWidth, mPhotonHeight, mSite.isPrivate()); imgFeatured.setVisibility(View.VISIBLE); imgFeatured.setImageUrl(photonUrl, WPNetworkImageView.ImageType.PHOTO); } else { Bitmap bmp = fastResizeBitmap(imageUrl, mPhotonWidth); if (bmp != null) { imgFeatured.setVisibility(View.VISIBLE); imgFeatured.setImageBitmap(bmp); } else { imgFeatured.setVisibility(View.GONE); } } }

Target:
private void showFeaturedImage(int postId, WPNetworkImageView imgFeatured) { String imageUrl = mFeaturedImageUrls.get(postId); if (imageUrl == null) { imgFeatured.setVisibility(View.GONE); } else if (imageUrl.startsWith("http")) { String photonUrl = ReaderUtils.getResizedImageUrl( imageUrl, mPhotonWidth, mPhotonHeight, !SiteUtils.isPhotonCapable(mSite)); imgFeatured.setVisibility(View.VISIBLE); imgFeatured.setImageUrl(photonUrl, WPNetworkImageView.ImageType.PHOTO); } else { Bitmap bmp = ImageUtils.getWPImageSpanThumbnailFromFilePath( imgFeatured.getContext(), imageUrl, mPhotonWidth); if (bmp != null) { imgFeatured.setVisibility(View.VISIBLE); imgFeatured.setImageBitmap(bmp); } else { imgFeatured.setVisibility(View.GONE); } } }
Source:
CorsConfiguration findCorsConfiguration(String lookupPath) { ResourceMetadata resource = getResourceMetadata(getRepositoryBasePath(lookupPath)); if (resource != null) { return createConfiguration( repositories.getRepositoryInformationFor(resource.getDomainType()).getRepositoryInterface()); } return null; }

Target:
CorsConfiguration findCorsConfiguration(String lookupPath) { ResourceMetadata resource = getResourceMetadata(getRepositoryBasePath(lookupPath)); return resource != null ? createConfiguration( repositories.getRepositoryInformationFor(resource.getDomainType()).getRepositoryInterface()) : null; }
Source:
public void setup(OperatorContext arg0) { table1 = new ArrayList<Map<String, Object>>(); table2 = new ArrayList<Map<String, Object>>(); }

Target:
public void setup(OperatorContext arg0) { table1 = new ArrayList<>(); table2 = new ArrayList<>(); }
Source:
public final Group drawGraph(final int position) { return viewVar.drawGraph(modelVar.getSegments(position)); }

Target:
public final Group drawGraph(final int position) { return view.drawGraph(model.getSegments(position)); }
Source:
public void delete() { DomainException.throwWhenDeleteBlocked(getDeletionBlockers()); ProfessorshipManagementLog.createLog(getExecutionCourse(), Bundle.MESSAGING, "log.executionCourse.professorship.removed", getPerson().getPresentationName(), getExecutionCourse().getNome(), getExecutionCourse() .getDegreePresentationString()); ExecutionCourse executionCourse = getExecutionCourse(); setExecutionCourse(null); setPerson(null); if (super.getPermissions() != null) { getPermissions().delete(); } setRootDomainObject(null); setCreator(null); deleteDomainObject(); }

Target:
public void delete() { DomainException.throwWhenDeleteBlocked(getDeletionBlockers()); ProfessorshipManagementLog.createLog(getExecutionCourse(), Bundle.MESSAGING, "log.executionCourse.professorship.removed", getPerson().getPresentationName(), getExecutionCourse().getNome(), getExecutionCourse() .getDegreePresentationString()); setExecutionCourse(null); setPerson(null); if (super.getPermissions() != null) { getPermissions().delete(); } setRootDomainObject(null); setCreator(null); deleteDomainObject(); }
Source:
public Query getRevisionAndjobsInfoQuery(final String user, final boolean pending, final boolean running, final boolean finished, String startCursor, String endCursor, int pageSize, boolean first, FilterModel filterModel) { try { Jobs.Builder jobsBuilder = new Jobs.Builder().excludeDataManagement().excludeRemovedTime(); if (startCursor != null) jobsBuilder.after(startCursor); if (endCursor != null) jobsBuilder.before(endCursor); if (first) jobsBuilder.first(pageSize); else jobsBuilder.last(pageSize); List<JobInput> input = getJobInputs(user, pending, running, finished, filterModel); jobsBuilder.input(input); Query.Builder queryBuilder = new Query.Builder().query(jobsBuilder.build().getQueryString()); LOGGER.log(Level.SEVERE, queryBuilder.build().getQuery()); return queryBuilder.build(); } catch (Exception e) { LOGGER.log(Level.SEVERE, e.getMessage()); return null; } }

Target:
public Query getRevisionAndjobsInfoQuery(final String user, final boolean pending, final boolean running, final boolean finished, String startCursor, String endCursor, int pageSize, boolean first, FilterModel filterModel) { try { Jobs.Builder jobsBuilder = new Jobs.Builder().excludeDataManagement().excludeRemovedTime(); if (startCursor != null) jobsBuilder.after(startCursor); if (endCursor != null) jobsBuilder.before(endCursor); if (first) jobsBuilder.first(pageSize); else jobsBuilder.last(pageSize); List<JobInput> input = getJobInputs(user, pending, running, finished, filterModel); jobsBuilder.input(input); Query.Builder queryBuilder = new Query.Builder().query(jobsBuilder.build().getQueryString()); return queryBuilder.build(); } catch (Exception e) { LOGGER.log(Level.SEVERE, e.getMessage()); return null; } }
Source:
public RunnerApi.Environment createEnvironment() throws IOException, InterruptedException { Map<String, String> env = constructEnvironmentVariables(); File runnerScript = ResourceUtil.extractUdfRunner(baseDirectory); String pythonWorkerCommand = String.join(File.separator, baseDirectory, runnerScript.getName()); return Environments.createProcessEnvironment( "", "", pythonWorkerCommand, env); }

Target:
public RunnerApi.Environment createEnvironment() throws IOException, InterruptedException { Map<String, String> env = constructEnvironmentVariables(); File runnerScript = ResourceUtil.extractUdfRunner(baseDirectory); return Environments.createProcessEnvironment( "", "", runnerScript.getPath(), env); }
Source:
private void writeImagingOutput(final ImagingResult result, final ItcImagingResult s) { final Flamingos2 instrument = (Flamingos2) result.instrument(); _println(""); _print(CalculatablePrinter.getTextResult(result.sfCalc())); _println(CalculatablePrinter.getTextResult(result.iqCalc())); _println(CalculatablePrinter.getTextResult(result.is2nCalc(), result.observation())); _println(CalculatablePrinter.WarnIfReadNoiseLimited(result.is2nCalc())); _printPeakPixelInfo(s.ccd(0)); _printWarnings(s.warnings()); _print(OverheadTablePrinter.print(this, p, result)); printConfiguration((Flamingos2) result.instrument(), result.parameters()); }

Target:
private void writeImagingOutput(final ImagingResult result, final ItcImagingResult s) { final Flamingos2 instrument = (Flamingos2) result.instrument(); _println(""); _print(CalculatablePrinter.getTextResult(result.sfCalc())); _println(CalculatablePrinter.getTextResult(result.iqCalc())); _println(CalculatablePrinter.getTextResult(result.is2nCalc(), result.observation())); CalculatablePrinter.ReadNoiseLimitedWarning(result.is2nCalc()).foreach(str -> _println(str)); _printPeakPixelInfo(s.ccd(0)); _printWarnings(s.warnings()); _print(OverheadTablePrinter.print(this, p, result)); printConfiguration((Flamingos2) result.instrument(), result.parameters()); }
Source:
public List<QueryResult> lookup(List<GHPoint> points, FlagEncoder encoder) { if (points.size() < 2) throw new IllegalArgumentException("At least 2 points have to be specified, but was:" + points.size()); EdgeFilter edgeFilter = new DefaultEdgeFilter(encoder); queryResults = new ArrayList<>(points.size()); for (int placeIndex = 0; placeIndex < points.size(); placeIndex++) { GHPoint point = points.get(placeIndex); if(ghRequest.hasPointHints()){ edgeFilter = new LevensteinDistanceEdgeFilter(encoder, ghRequest.getPointHint(placeIndex)); } QueryResult res = locationIndex.findClosest(point.lat, point.lon, edgeFilter); if (!res.isValid()) ghResponse.addError(new PointNotFoundException("Cannot find point " + placeIndex + ": " + point, placeIndex)); queryResults.add(res); } return queryResults; }

Target:
public List<QueryResult> lookup(List<GHPoint> points, FlagEncoder encoder) { if (points.size() < 2) throw new IllegalArgumentException("At least 2 points have to be specified, but was:" + points.size()); EdgeFilter edgeFilter = new DefaultEdgeFilter(encoder); queryResults = new ArrayList<>(points.size()); for (int placeIndex = 0; placeIndex < points.size(); placeIndex++) { GHPoint point = points.get(placeIndex); QueryResult res; if(ghRequest.hasPointHints()){ res = locationIndex.findClosest(point.lat, point.lon, new NameSimilarityEdgeFilter(edgeFilter, ghRequest.getPointHint(placeIndex))); if(!res.isValid()){ res = locationIndex.findClosest(point.lat, point.lon, edgeFilter); } }else{ res = locationIndex.findClosest(point.lat, point.lon, edgeFilter); } if (!res.isValid()) ghResponse.addError(new PointNotFoundException("Cannot find point " + placeIndex + ": " + point, placeIndex)); queryResults.add(res); } return queryResults; }
Source:
public String getDetailedMessage(Type keyType, ConnectorSession session) { return format("Duplicate keys (%s) are not allowed in map", keyType.getObjectValue(session, block, position)); }

Target:
public String getDetailedMessage(Type keyType, ConnectorSession session) { return format("Duplicate map keys (%s) are not allowed", keyType.getObjectValue(session, block, position)); }
Source:
public void testUnapplyAll() throws ExecutionException { EasyMock.expect(reverseLookupCache.get(EasyMock.eq("value"), EasyMock.anyObject(Callable.class))) .andReturn(Lists.newArrayList("key")) .once(); EasyMock.replay(reverseLookupCache); Assert.assertEquals( ImmutableMap.of("value", Lists.newArrayList("key")), loadingLookup.unapplyAll(ImmutableSet.<String>of("value")) ); EasyMock.verify(reverseLookupCache); }

Target:
public void testUnapplyAll() throws ExecutionException { EasyMock.expect(reverseLookupCache.get(EasyMock.eq("value"), EasyMock.anyObject(Callable.class))) .andReturn(Collections.singletonList("key")) .once(); EasyMock.replay(reverseLookupCache); Assert.assertEquals(ImmutableMap.of("value", Collections.singletonList("key")), loadingLookup.unapplyAll(ImmutableSet.of("value"))); EasyMock.verify(reverseLookupCache); }
Source:
private static boolean isGoogRequireCall(Node statement) { if (statement == null) { return false; } if (!statement.isExprResult()) { return false; } if (statement.getFirstChild() == null) { return false; } Node googRequireCall = statement.getFirstChild(); return googRequireCall != null && googRequireCall.isCall() && googRequireCall.getFirstChild().matchesQualifiedName("goog.require"); }

Target:
private static boolean isGoogRequireCall(Node statement) { if (statement == null) { return false; } if (!statement.isExprResult()) { return false; } Node googRequireCall = statement.getFirstChild(); return googRequireCall != null && googRequireCall.isCall() && googRequireCall.getFirstChild().matchesQualifiedName("goog.require"); }
Source:
public void testConstructorWithUnparseablePath() throws IOException { Path unparseablePath = (new File(".")).toPath().resolve("UnparseableTagFolderName"); try { Tag tag = new ConfigurationTag(unparseablePath); } catch (ParseException e) { Assert.assertTrue(true); return; } Assert.assertTrue("Error: ParseException has not been thrown!", false); }

Target:
public void testConstructorWithUnparseablePath() throws IOException, ParseException { Path unparseablePath = (new File(".")).toPath().resolve("UnparseableTagFolderName"); Tag tag = new ConfigurationTag(unparseablePath); }
Source:
static boolean isDefaultArgumentsConstructor(final MethodNode methodNode) { if (!methodNode.name.equals("<init>")) { return false; } final Type[] argumentTypes = Type.getMethodType(methodNode.desc) .getArgumentTypes(); if (argumentTypes.length < 2) { return false; } return "kotlin.jvm.internal.DefaultConstructorMarker" .equals(argumentTypes[argumentTypes.length - 1].getClassName()); }

Target:
static boolean isDefaultArgumentsConstructor(final MethodNode methodNode) { if (!"<init>".equals(methodNode.name)) { return false; } final Type[] argumentTypes = Type.getMethodType(methodNode.desc) .getArgumentTypes(); if (argumentTypes.length < 2) { return false; } return "kotlin.jvm.internal.DefaultConstructorMarker" .equals(argumentTypes[argumentTypes.length - 1].getClassName()); }
Source:
private void changeDate() { DateChooser dc = new DateChooser(frame, date); if (dc.showDateChooser() == DateChooser.OK_OPTION) { if (scenario.isCurrent()) { if (dc.getDate().isBefore(campaign.getLocalDate())) { JOptionPane.showMessageDialog(frame, "You cannot choose a date before the current date for a pending battle.", "Invalid date", JOptionPane.ERROR_MESSAGE); return; } else { LocalDate nextMonday = campaign.getLocalDate() .plusDays(8 - campaign.getLocalDate().getDayOfWeek().getValue()); if (!dc.getDate().isBefore(nextMonday)) { JOptionPane.showMessageDialog(frame, "You cannot choose a date beyond the current week.", "Invalid date", JOptionPane.ERROR_MESSAGE); return; } } } else if (dc.getDate().isAfter(campaign.getLocalDate())) { JOptionPane.showMessageDialog(frame, "You cannot choose a date after the current date.", "Invalid date", JOptionPane.ERROR_MESSAGE); return; } date = dc.getDate(); btnDate.setText(campaign.getCampaignOptions().getDisplayFormattedDate(date)); } }

Target:
private void changeDate() { DateChooser dc = new DateChooser(frame, date); if (dc.showDateChooser() == DateChooser.OK_OPTION) { if (scenario.isCurrent()) { if (dc.getDate().isBefore(campaign.getLocalDate())) { JOptionPane.showMessageDialog(frame, "You cannot choose a date before the current date for a pending battle.", "Invalid date", JOptionPane.ERROR_MESSAGE); return; } else { LocalDate nextMonday = campaign.getLocalDate().with(TemporalAdjusters.nextOrSame(DayOfWeek.MONDAY)); if (!dc.getDate().isBefore(nextMonday)) { JOptionPane.showMessageDialog(frame, "You cannot choose a date beyond the current week.", "Invalid date", JOptionPane.ERROR_MESSAGE); return; } } } else if (dc.getDate().isAfter(campaign.getLocalDate())) { JOptionPane.showMessageDialog(frame, "You cannot choose a date after the current date.", "Invalid date", JOptionPane.ERROR_MESSAGE); return; } date = dc.getDate(); btnDate.setText(campaign.getCampaignOptions().getDisplayFormattedDate(date)); } }
Source:
public void connect() throws IOException { synchronized (lock) { if (!connected) { if (sslSocketFactory == null) { throw new SocketException("sslSocketFactory is null when connecting through SSL"); } sslSocket = (SSLSocket) sslSocketFactory.createSocket(host, port); if (readBufferSize > 0) { sslSocket.setReceiveBufferSize(readBufferSize); } if (writeBufferSize > 0) { sslSocket.setSendBufferSize(writeBufferSize); } sslSocket.setSoTimeout(readTimeoutMs); sslSocket.setKeepAlive(true); sslSocket.setTcpNoDelay(true); sslSocket.startHandshake(); writeChannel = Channels.newChannel(sslSocket.getOutputStream()); readChannel = sslSocket.getInputStream(); connected = true; logger.debug( "Created socket with SO_TIMEOUT = (requested {}), SO_RCVBUF = (requested {}), SO_SNDBUF = (requested {})", sslSocket.getSoTimeout(), readTimeoutMs, sslSocket.getReceiveBufferSize(), readBufferSize, sslSocket.getSendBufferSize(), writeBufferSize); } } }

Target:
public void connect() throws IOException { synchronized (lock) { if (!connected) { sslSocket = (SSLSocket) sslSocketFactory.createSocket(host, port); if (readBufferSize > 0) { sslSocket.setReceiveBufferSize(readBufferSize); } if (writeBufferSize > 0) { sslSocket.setSendBufferSize(writeBufferSize); } sslSocket.setSoTimeout(readTimeoutMs); sslSocket.setKeepAlive(true); sslSocket.setTcpNoDelay(true); sslSocket.startHandshake(); writeChannel = Channels.newChannel(sslSocket.getOutputStream()); readChannel = sslSocket.getInputStream(); connected = true; logger.debug( "Created socket with SO_TIMEOUT = (requested {}), SO_RCVBUF = (requested {}), SO_SNDBUF = (requested {})", sslSocket.getSoTimeout(), readTimeoutMs, sslSocket.getReceiveBufferSize(), readBufferSize, sslSocket.getSendBufferSize(), writeBufferSize); } } }
Source:
protected void validate(int attachmentIndex) throws ServiceValidationException { if ((this.fileName == null || this.fileName.isEmpty()) && (this.content == null) && (this.contentStream == null)) { throw new ServiceValidationException(String.format( Strings.FileAttachmentContentIsNotSet, attachmentIndex)); } }

Target:
protected void validate(int attachmentIndex) throws ServiceValidationException { if ((this.fileName == null || this.fileName.isEmpty()) && this.content == null && this.contentStream == null) { throw new ServiceValidationException(String.format( Strings.FileAttachmentContentIsNotSet, attachmentIndex)); } }
Source:
public Mono<Void> uploadFromFile(String filePath, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions accessConditions) { final ParallelTransferOptions finalParallelTransferOptions = parallelTransferOptions == null ? new ParallelTransferOptions() : parallelTransferOptions; try { return Mono.using(() -> uploadFileResourceSupplier(filePath), channel -> { try { long fileSize = channel.size(); if (fileSize > 256 * Constants.MB) { return uploadBlocks(fileSize, finalParallelTransferOptions, headers, metadata, tier, accessConditions, channel); } else { return uploadFullBlob(headers, metadata, tier, accessConditions, channel, fileSize); } } catch (IOException ex) { return Mono.error(new UncheckedIOException(ex)); } }, this::uploadFileCleanup); } catch (RuntimeException ex) { return monoError(logger, ex); } }

Target:
public Mono<Void> uploadFromFile(String filePath, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions accessConditions) { try { return Mono.using(() -> uploadFileResourceSupplier(filePath), channel -> { try { BlockBlobAsyncClient blockBlobAsyncClient = getBlockBlobAsyncClient(); long fileSize = channel.size(); if (fileSize > 256 * Constants.MB) { return uploadBlocks(fileSize, parallelTransferOptions, headers, metadata, tier, accessConditions, channel, blockBlobAsyncClient); } else { return blockBlobAsyncClient.uploadWithResponse(FluxUtil.readFile(channel), fileSize, headers, metadata, tier, accessConditions) .then(); } } catch (IOException ex) { return Mono.error(ex); } }, this::uploadFileCleanup); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
public void remove(Guid id) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("id", id); getCallsHandler().executeModification("Deletevm_interface", parameterSource); DbFacade.getInstance().getVmInterfaceDynamic().remove(id); }

Target:
public void remove(Guid id) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("id", id); getCallsHandler().executeModification("Deletevm_interface", parameterSource); }
Source:
public void write(AsyncHttpRequest request, DataSink sink, CompletedCallback completed) { Util.pump(stream, sink, completed); }

Target:
public void write(AsyncHttpRequest request, DataSink sink, CompletedCallback completed) { Util.pump(stream, this.length, sink, completed); }
Source:
@Override public boolean add(E element) { lock.lock(); try { queue.add(element); nonEmpty.signal(); return true; } catch (IOException e) { QueueFile.<Error>getSneakyThrowable(e); return false; } finally { lock.unlock(); } }

Target:
@Override public boolean add(E element) { lock.lock(); try { queue.add(element); nonEmpty.signal(); return true; } catch (IOException e) { throw QueueFile.<Error>getSneakyThrowable(e); } finally { lock.unlock(); } }
Source:
public MavenExecutionPlan calculateExecutionPlan(final MavenProject project, final List<String> goals, final boolean setup, final IProgressMonitor monitor) throws CoreException { return context().execute(project, new ICallable<MavenExecutionPlan>() { public MavenExecutionPlan call(IMavenExecutionContext context, IProgressMonitor monitor) throws CoreException { return calculateExecutionPlan(context.getSession(), project, goals, setup, monitor); } }, monitor); }

Target:
public MavenExecutionPlan calculateExecutionPlan(final MavenProject project, final List<String> goals, final boolean setup, final IProgressMonitor monitor) throws CoreException { return context().execute(project, (context, pm) -> calculateExecutionPlan(context.getSession(), project, goals, setup, pm), monitor); }