auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
List<String> getJsFiles() throws IOException { final Set<String> allJsInputs = Sets.newLinkedHashSet(); List<String> patterns = Lists.newArrayList(); patterns.addAll(js); patterns.addAll(arguments); for (String pattern : patterns) { if (pattern.indexOf("*") == -1 && pattern.indexOf("!") != 0) { allJsInputs.add(pattern); } else { FileSystem fs = FileSystems.getDefault(); final boolean remove = pattern.indexOf("!") == 0; if (remove) pattern = pattern.substring(1); final PathMatcher matcher = fs.getPathMatcher("glob:" + pattern); java.nio.file.Files.walkFileTree( fs.getPath("."), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile( Path p, BasicFileAttributes attrs) { if (matcher.matches(p)) { if (remove) { allJsInputs.remove(p.toString()); } else { allJsInputs.add(p.toString()); } } return FileVisitResult.CONTINUE; } }); } } return Lists.newArrayList(allJsInputs); }

Target:
List<String> getJsFiles() throws CmdLineException, IOException { final Set<String> allJsInputs = new LinkedHashSet<>(); List<String> patterns = new ArrayList<>(); patterns.addAll(js); patterns.addAll(arguments); for (String pattern : patterns) { if (!pattern.contains("*") && !pattern.startsWith("!")) { allJsInputs.add(pattern); } else { FileSystem fs = FileSystems.getDefault(); final boolean remove = pattern.indexOf("!") == 0; if (remove) pattern = pattern.substring(1); final PathMatcher matcher = fs.getPathMatcher("glob:" + pattern); java.nio.file.Files.walkFileTree( fs.getPath("."), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile( Path p, BasicFileAttributes attrs) { if (matcher.matches(p)) { if (remove) { allJsInputs.remove(p.toString()); } else { allJsInputs.add(p.toString()); } } return FileVisitResult.CONTINUE; } }); } } if (!patterns.isEmpty() && allJsInputs.isEmpty()) { throw new CmdLineException("No inputs matched"); } return new ArrayList<>(allJsInputs); }
Source:
BackgroundDeleter() throws IOException { super("backgroundDeleter"); super.putManager.close(); }

Target:
BackgroundDeleter() throws IOException { super("backgroundDeleter"); putManager.close(); }
Source:
private LookupUserIdResponse(String serverResponse) { ObjectServerError error; String userId; Boolean isAdmin; String message; try { JSONObject obj = new JSONObject(serverResponse); JSONObject jsonUser = obj.getJSONObject(JSON_FIELD_USER); if (jsonUser != null) { userId = jsonUser.has(JSON_FIELD_USER_ID) ? jsonUser.getString(JSON_FIELD_USER_ID) : null; isAdmin = jsonUser.has(JSON_FIELD_USER_IS_ADMIN) ? jsonUser.getBoolean(JSON_FIELD_USER_IS_ADMIN) : null; error = null; message = String.format(Locale.US, "Identity %s; Path %b", userId, isAdmin); } else { userId = null; isAdmin = null; error = null; message = "user = null"; } } catch (JSONException e) { userId = null; isAdmin = null; error = new ObjectServerError(ErrorCode.JSON_EXCEPTION, e); message = String.format(Locale.US, "Error %s", error.getErrorMessage()); } RealmLog.debug("LookupUserIdResponse. " + message); setError(error); this.userId = userId; this.isAdmin = isAdmin; }

Target:
private LookupUserIdResponse(String serverResponse) { ObjectServerError error; String userId; Boolean isAdmin; String message; try { JSONObject obj = new JSONObject(serverResponse); JSONObject jsonUser = obj.getJSONObject(JSON_FIELD_USER); if (jsonUser != null) { userId = jsonUser.optString(JSON_FIELD_USER_ID, null); isAdmin = jsonUser.has(JSON_FIELD_USER_IS_ADMIN) ? jsonUser.getBoolean(JSON_FIELD_USER_IS_ADMIN) : null; error = null; message = String.format(Locale.US, "Identity %s; Path %b", userId, isAdmin); } else { userId = null; isAdmin = null; error = null; message = "user = null"; } } catch (JSONException e) { userId = null; isAdmin = null; error = new ObjectServerError(ErrorCode.JSON_EXCEPTION, e); message = String.format(Locale.US, "Error %s", error.getErrorMessage()); } RealmLog.debug("LookupUserIdResponse. " + message); setError(error); this.userId = userId; this.isAdmin = isAdmin; }
Source:
public void checkForTransientDependency() { CyclicGraphDetector<Plugin> cycleDetector = new CyclicGraphDetector<UpdateSite.Plugin>() { @Override protected List<UpdateSite.Plugin> getEdges(UpdateSite.Plugin p) { List<UpdateSite.Plugin> next = new ArrayList<>(); addTo(p.getNeededDependencies(), next); return next; } private void addTo(List<UpdateSite.Plugin> dependencies, List<UpdateSite.Plugin> r) { for (UpdateSite.Plugin d : dependencies) { r.add(d); } } @Override protected void reactOnCycle(UpdateSite.Plugin q, List<UpdateSite.Plugin> cycle) throws CycleDetectedException { List<String> cycleWithNames = new ArrayList<String>(); for (UpdateSite.Plugin plugin : cycle){ cycleWithNames.add(plugin.name); } throw new CycleDetectedException(cycleWithNames); } }; List<UpdateSite.Plugin> pluginsTest = new ArrayList<UpdateSite.Plugin>(); pluginsTest.add(this); try { cycleDetector.run(pluginsTest); } catch (CyclicGraphDetector.CycleDetectedException ex) { throw new Failure(ex.getMessage()); } }

Target:
public void checkForTransientDependency() { CyclicGraphDetector<Plugin> cycleDetector = new CyclicGraphDetector<UpdateSite.Plugin>() { @Override protected List<UpdateSite.Plugin> getEdges(UpdateSite.Plugin p) { return new ArrayList<>(p.getNeededDependencies()); } @Override protected void reactOnCycle(UpdateSite.Plugin q, List<UpdateSite.Plugin> cycle) throws CycleDetectedException { List<String> cycleWithNames = new ArrayList<String>(); for (UpdateSite.Plugin plugin : cycle){ cycleWithNames.add(plugin.name); } throw new CycleDetectedException(cycleWithNames); } }; try { cycleDetector.run(Collections.singleton(this)); } catch (CyclicGraphDetector.CycleDetectedException ex) { throw new Failure(ex.getMessage()); } }
Source:
public Response checkConnectivity( @Auth final AuthenticatedUser authenticatedUser, final String gameId) { if (!connectivityCheck.gameExists(authenticatedUser.getApiKey(), gameId)) { return Response.status(400).build(); } return Response.ok() .entity(connectivityCheck.canDoReverseConnect(authenticatedUser.getApiKey(), gameId)) .build(); }

Target:
public Response checkConnectivity( @Auth final AuthenticatedUser authenticatedUser, final String gameId) { final ConnectivityCheck.ReverseConnectionResult result = connectivityCheck.canDoReverseConnect(authenticatedUser.getApiKey(), gameId); switch (result) { case SUCCESS: return Response.ok().entity(true).build(); case FAILED: return Response.ok().entity(false).build(); case GAME_ID_NOT_FOUND: return Response.status(HttpStatus.UNPROCESSABLE_ENTITY_422).build(); default: throw new IllegalStateException("Switch case not handled: " + result); } }
Source:
protected void fillToolBar(ToolBarManager toolBar) { Action hideAttributesAction = new Action() { @Override public void run() { EditorUtil.openHideAttributesWizard(getTaskEditorPage()); } }; hideAttributesAction.setToolTipText("Configure Hidden Attributes..."); hideAttributesAction.setImageDescriptor(CommonImages.EDIT_SMALL); toolBar.add(hideAttributesAction); }

Target:
protected void fillToolBar(ToolBarManager toolBar) { Action hideAttributesAction = new Action() { @Override public void run() { EditorUtil.openHideAttributesWizard(getTaskEditorPage()); } }; hideAttributesAction.setToolTipText("Configure Attribute Visibility..."); hideAttributesAction.setImageDescriptor(CommonImages.EDIT_SMALL); toolBar.add(hideAttributesAction); }
Source:
private ComponentURI(CodeSystemURI codeSystemURI, short terminologyComponentId, String identifier) { checkNotNull(codeSystemURI, "Codesystem argument should not be null."); checkArgument(terminologyComponentId >= TerminologyRegistry.UNSPECIFIED_NUMBER_SHORT, "Terminology component id should be either unspecified (-1) or greater than zero. Got: '%s'.", terminologyComponentId); boolean isUnspecified = codeSystemURI.getCodeSystem().equals(TerminologyRegistry.UNSPECIFIED) || TerminologyRegistry.UNSPECIFIED_NUMBER_SHORT == terminologyComponentId; checkArgument(isUnspecified || !Strings.isNullOrEmpty(identifier), "Identifier should not be null or empty."); this.codeSystemUri = codeSystemURI; this.terminologyComponentId = terminologyComponentId; this.identifier = identifier; }

Target:
private ComponentURI(CodeSystemURI codeSystemURI, short terminologyComponentId, String identifier) { checkNotNull(codeSystemURI, "CodeSystemURI argument should not be null."); checkArgument(terminologyComponentId >= TerminologyRegistry.UNSPECIFIED_NUMBER_SHORT, "TerminologyComponentId should be either unspecified (-1) or greater than zero. Got: '%s'.", terminologyComponentId); checkArgument(TerminologyRegistry.UNSPECIFIED.equals(codeSystemURI.getCodeSystem()) || !Strings.isNullOrEmpty(identifier), "Identifier should not be null or empty."); this.codeSystemUri = codeSystemURI; this.terminologyComponentId = terminologyComponentId; this.identifier = Strings.nullToEmpty(identifier); }
Source:
public Observable<String> searchCategories(String filter, int itemLimit) { return CategoryInterface.searchCategories(filter, itemLimit) .flatMap(mwQueryResponse -> { List<MwQueryPage> pages = mwQueryResponse.query().pages(); if(pages != null) return Observable.fromIterable(pages); else Timber.d("No categories returned."); return Observable.empty(); }) .map(MwQueryPage::title) .doOnEach(s->Timber.d("Category returned: %s", s)) .map(cat->cat.replace("Category:", "")); }

Target:
public Observable<String> searchCategories(String filter, int itemLimit) { return searchCategories(filter, itemLimit, 0); }
Source:
public void doTag() throws JspException { try { if (StringUtils.isBlank(var) || (type == null)) { throw new JspTagException("Var and Type must be set " + appName); } final PageContext pageContext = (PageContext) getJspContext(); final Class typeClass = SliceTagUtils.getClassFromType(pageContext, type); final Object model = SliceTagUtils.getFromCurrentPath(pageContext, typeClass, appName); pageContext.setAttribute(var, model, PageContext.PAGE_SCOPE); } catch (ClassNotFoundException e) { throw new JspTagException("Could not get class for " + type); } finally { clean(); } }

Target:
public void doTag() throws JspException { try { if (StringUtils.isBlank(var) || (type == null && StringUtils.isEmpty(name))) { throw new JspTagException("Var and Type must be set " + appName); } final PageContext pageContext = (PageContext) getJspContext(); final Object model = StringUtils.isEmpty(name) ? SliceTagUtils.getFromCurrentPath(pageContext, type, appName) : SliceTagUtils.getFromCurrentPath(pageContext, name, appName); pageContext.setAttribute(var, model, PageContext.PAGE_SCOPE); } catch (ClassNotFoundException cause) { throw new JspTagException("Could not get class for " + name + cause.getMessage()); } finally { clean(); } }
Source:
public static void main(String[] args) throws Exception { Opts opts = new Opts(); List<String> argsList = new ArrayList<>(args.length + 2); argsList.add("--old"); argsList.add("--new"); argsList.addAll(Arrays.asList(args)); opts.parseArgs(ChangeSecret.class.getName(), argsList.toArray(new String[0])); VolumeManager fs = VolumeManagerImpl.get(); Instance inst = opts.getInstance(); if (!verifyAccumuloIsDown(inst, opts.oldPass)) System.exit(-1); if (!verifyHdfsWritePermission(fs)) System.exit(-1); final String newInstanceId = UUID.randomUUID().toString(); updateHdfs(fs, inst, newInstanceId); rewriteZooKeeperInstance(inst, newInstanceId, opts.oldPass, opts.newPass); if (opts.oldPass != null) { deleteInstance(inst, opts.oldPass); } System.out.println("New instance id is " + newInstanceId); System.out.println("Be sure to put your new secret in accumulo-site.xml"); }

Target:
public static void main(String[] args) throws Exception { VolumeManager fs = VolumeManagerImpl.get(); verifyHdfsWritePermission(fs); Opts opts = new Opts(); List<String> argsList = new ArrayList<>(args.length + 2); argsList.add("--old"); argsList.add("--new"); argsList.addAll(Arrays.asList(args)); opts.parseArgs(ChangeSecret.class.getName(), argsList.toArray(new String[0])); Instance inst = opts.getInstance(); verifyAccumuloIsDown(inst, opts.oldPass); final String newInstanceId = UUID.randomUUID().toString(); updateHdfs(fs, inst, newInstanceId); rewriteZooKeeperInstance(inst, newInstanceId, opts.oldPass, opts.newPass); if (opts.oldPass != null) { deleteInstance(inst, opts.oldPass); } System.out.println("New instance id is " + newInstanceId); System.out.println("Be sure to put your new secret in accumulo-site.xml"); }
Source:
protected String getDomain(User user) { if (user.isSetDomain() && user.getDomain().isSetName()) { return user.getDomain().getName(); } else if (user.isSetDomain() && user.getDomain().isSetId()) { List<String> domains = getBackendCollection( String.class, VdcQueryType.GetDomainList, new VdcQueryParametersBase()); for (String domain :domains) { NGuid domainId = new NGuid(domain.getBytes(), true); if (domainId.toString().equals(user.getDomain().getId())) { return domain; } } throw new WebFaultException(null, "Storage-Domain: '" + user.getDomain().getId().toString() + "' does not exist.", Response.Status.BAD_REQUEST); } else if (user.isSetUserName() && user.getUserName().contains("@")) { return user.getUserName().substring(user.getUserName().indexOf("@")+1); } return getCurrentDomain(); }

Target:
protected String getDomain(User user) { if (user.isSetDomain() && user.getDomain().isSetName()) { return user.getDomain().getName(); } else if (user.isSetDomain() && user.getDomain().isSetId()) { List<String> domains = getBackendCollection( String.class, VdcQueryType.GetDomainList, new VdcQueryParametersBase()); for (String domain :domains) { NGuid domainId = new NGuid(domain.getBytes(), true); if (domainId.toString().equals(user.getDomain().getId())) { return domain; } } throw new WebFaultException(null, "Domain: '" + user.getDomain().getId().toString() + "' does not exist.", Response.Status.BAD_REQUEST); } else if (user.isSetUserName() && user.getUserName().contains("@")) { return user.getUserName().substring(user.getUserName().indexOf("@")+1); } return getCurrentDomain(); }
Source:
public void start() { CacheMode mode = configuration.clustering().cacheMode(); isFetchEnabled = (mode.isDistributed() || mode.isReplicated()) && (configuration.clustering().stateTransfer().fetchInMemoryState() || configuration.persistence().fetchPersistentState()); rpcOptions = rpcManager.getRpcOptionsBuilder(ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS) .timeout(timeout, TimeUnit.MILLISECONDS).build(); stateRequestExecutor = new LimitedExecutor("StateRequest-" + cacheName, stateTransferExecutor, 1); }

Target:
public void start() { CacheMode mode = configuration.clustering().cacheMode(); isFetchEnabled = (mode.isDistributed() || mode.isReplicated()) && (configuration.clustering().stateTransfer().fetchInMemoryState() || configuration.persistence().fetchPersistentState()); synchronousRpcOptions = rpcManager.getRpcOptionsBuilder(ResponseMode.SYNCHRONOUS) .timeout(timeout, TimeUnit.MILLISECONDS).build(); synchronousIgnoreLeaversRpcOptions = rpcManager.getRpcOptionsBuilder(ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS) .timeout(timeout, TimeUnit.MILLISECONDS).build(); stateRequestExecutor = new LimitedExecutor("StateRequest-" + cacheName, stateTransferExecutor, 1); }
Source:
public Map<String, Statistic<?, ?>> queryStatistics() { Map<String, Statistic<?, ?>> stats = new TreeMap<String, Statistic<?, ?>>(); for (String fullStatName : statistics.keySet()) { stats.put(fullStatName, queryStatistic(fullStatName)); } return stats; }

Target:
public Map<String, Statistic<?, ?>> queryStatistics() { Map<String, Statistic<?, ?>> stats = new HashMap<String, Statistic<?, ?>>(); for (String fullStatName : statistics.keySet()) { Statistic<?, ?> statistic = queryStatistic(fullStatName); if (statistic != null) { stats.put(fullStatName, statistic); } } return stats; }
Source:
public void execute() throws MojoExecutionException, MojoFailureException { if (!skip) { boolean ansiRestore = Ansi.isEnabled(); log = new AnsiLogger(getLog(), useColor && MessageUtils.isColorEnabled() && !(EnvUtil.isWindows() && !EnvUtil.isMaven350OrLater(session)), verbose, !settings.getInteractiveMode(), getLogPrefix()); try { authConfigFactory.setLog(log); imageConfigResolver.setLog(log); LogOutputSpecFactory logSpecFactory = new LogOutputSpecFactory(useColor, logStdout, logDate); ConfigHelper.validateExternalPropertyActivation(project, images); DockerAccess access = null; try { this.minimalApiVersion = initImageConfiguration(getBuildTimestamp()); if (isDockerAccessRequired()) { DockerAccessFactory.DockerAccessContext dockerAccessContext = getDockerAccessContext(); access = dockerAccessFactory.createDockerAccess(dockerAccessContext); } ServiceHub serviceHub = serviceHubFactory.createServiceHub(project, session, access, log, logSpecFactory); executeInternal(serviceHub); } catch (IOException | ExecException exp) { logException(exp); throw new MojoExecutionException(log.errorMessage(exp.getMessage()), exp); } catch (MojoExecutionException exp) { logException(exp); throw exp; } finally { if (access != null) { access.shutdown(); } } } finally { Ansi.setEnabled(ansiRestore); } } }

Target:
public void execute() throws MojoExecutionException, MojoFailureException { if (!skip) { boolean ansiRestore = Ansi.isEnabled(); log = new AnsiLogger(getLog(), useColorForLogging(), verbose, !settings.getInteractiveMode(), getLogPrefix()); try { authConfigFactory.setLog(log); imageConfigResolver.setLog(log); LogOutputSpecFactory logSpecFactory = new LogOutputSpecFactory(useColor, logStdout, logDate); ConfigHelper.validateExternalPropertyActivation(project, images); DockerAccess access = null; try { this.minimalApiVersion = initImageConfiguration(getBuildTimestamp()); if (isDockerAccessRequired()) { DockerAccessFactory.DockerAccessContext dockerAccessContext = getDockerAccessContext(); access = dockerAccessFactory.createDockerAccess(dockerAccessContext); } ServiceHub serviceHub = serviceHubFactory.createServiceHub(project, session, access, log, logSpecFactory); executeInternal(serviceHub); } catch (IOException | ExecException exp) { logException(exp); throw new MojoExecutionException(log.errorMessage(exp.getMessage()), exp); } catch (MojoExecutionException exp) { logException(exp); throw exp; } finally { if (access != null) { access.shutdown(); } } } finally { Ansi.setEnabled(ansiRestore); } } }
Source:
public static EhcacheEntityMessage decode(byte[] payload) { ByteBuffer msg = ByteBuffer.wrap(payload); msg.get(); int cacheIdLen = msg.getInt(); byte[] idArr = new byte[cacheIdLen]; msg.get(idArr); String cacheId = new String(idArr, UTF_8); long key = msg.getLong(); byte opCode = msg.get(); byte[] remaining = new byte[msg.remaining()]; msg.get(remaining); switch (opCode) { case 0: return EhcacheEntityMessage.getOperation(cacheId, key); case 1: return EhcacheEntityMessage.getAndAppendOperation(cacheId, key, ByteBuffer.wrap(remaining).asReadOnlyBuffer()); case 2: return EhcacheEntityMessage.appendOperation(cacheId, key, ByteBuffer.wrap(remaining).asReadOnlyBuffer()); case 3: ByteBuffer replaceBuf = ByteBuffer.wrap(remaining); int expectChainLen = replaceBuf.getInt(); byte[] encodedExpectChain = new byte[expectChainLen]; replaceBuf.get(encodedExpectChain); int updateChainLen = replaceBuf.getInt(); byte[] encodedUpdateChain = new byte[updateChainLen]; replaceBuf.get(encodedUpdateChain); return EhcacheEntityMessage.replaceAtHeadOperation(cacheId, key, ChainCodec.decode(encodedExpectChain), ChainCodec.decode(encodedUpdateChain)); default: throw new UnsupportedOperationException("This operation code is not supported" + opCode); } }

Target:
public static EhcacheEntityMessage decode(byte[] payload) { ByteBuffer msg = ByteBuffer.wrap(payload); msg.get(); int cacheIdLen = msg.getInt(); byte[] idArr = new byte[cacheIdLen]; msg.get(idArr); String cacheId = new String(idArr, UTF_8); long key = msg.getLong(); byte opCode = msg.get(); ServerStoreOpMessage.ServerStoreOp storeOp = ServerStoreOpMessage.ServerStoreOp.getServerStoreOp(opCode); byte[] remaining = new byte[msg.remaining()]; msg.get(remaining); switch (storeOp) { case GET: return EhcacheEntityMessage.getOperation(cacheId, key); case GET_AND_APPEND: return EhcacheEntityMessage.getAndAppendOperation(cacheId, key, ByteBuffer.wrap(remaining).asReadOnlyBuffer()); case APPEND: return EhcacheEntityMessage.appendOperation(cacheId, key, ByteBuffer.wrap(remaining).asReadOnlyBuffer()); case REPLACE: ByteBuffer replaceBuf = ByteBuffer.wrap(remaining); int expectChainLen = replaceBuf.getInt(); byte[] encodedExpectChain = new byte[expectChainLen]; replaceBuf.get(encodedExpectChain); int updateChainLen = replaceBuf.getInt(); byte[] encodedUpdateChain = new byte[updateChainLen]; replaceBuf.get(encodedUpdateChain); return EhcacheEntityMessage.replaceAtHeadOperation(cacheId, key, ChainCodec.decode(encodedExpectChain), ChainCodec.decode(encodedUpdateChain)); default: throw new UnsupportedOperationException("This operation code is not supported : " + opCode); } }
Source:
public void takeSnapshot(final String snapshotName) throws Exception { new RetryableCallable<Void>() { public Void retriableCall() throws Exception { JMXNodeTool nodetool = JMXNodeTool.instance(configuration); nodetool.takeSnapshot(snapshotName, null); return null; } }.call(); }

Target:
public synchronized void takeSnapshot(final String snapshotName) throws Exception { try { new RetryableCallable<Void>(6, 10000) { public Void retriableCall() throws Exception { JMXNodeTool nodetool = JMXNodeTool.instance(configuration); nodetool.takeSnapshot(snapshotName, null); return null; } }.call(); }catch (Exception e){ logger.error("Error while taking snapshot {}. Asking Cassandra to clear snapshot to avoid accumulation of snapshots.", snapshotName); clearSnapshot(snapshotName); throw e; } }
Source:
private boolean isAffectedBy(IResourceDelta delta) { boolean[] result = new boolean[] { false }; try { delta.accept(d -> { if (result[0]) { return false; } if (d.getKind() != IResourceDelta.CHANGED) { result[0] = true; return false; } int flags = d.getFlags(); if (flags != 0 && flags != IResourceDelta.MARKERS) { result[0] = true; return false; } return true; }); } catch (CoreException e) { } return result[0]; }

Target:
private boolean isAffectedBy(IResourceDelta delta) { if (delta.getKind() != IResourceDelta.CHANGED) { return true; } int flags = delta.getFlags(); if (flags != 0 && flags != IResourceDelta.MARKERS) { return true; } IResourceDelta[] children = delta.getAffectedChildren(); for (IResourceDelta child : children) { if (isAffectedBy(child)) { return true; } } return false; }
Source:
public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof Hardware)) { return false; } Hardware hw = (Hardware) o; return mScreen.equals(hw.getScreen()) && mNetworking.equals(hw.getNetworking()) && mSensors.equals(hw.getSensors()) && mMic == hw.hasMic() && mCameras.equals(hw.getCameras()) && mKeyboard == hw.getKeyboard() && mNav == hw.getNav() && mRam.equals(hw.getRam()) && mButtons == hw.getButtonType() && mInternalStorage.equals(hw.getInternalStorage()) && mRemovableStorage.equals(hw.getRemovableStorage()) && mCpu.equals(hw.getCpu()) && mGpu.equals(hw.getGpu()) && mAbis.equals(hw.getSupportedAbis()) && mUiModes.equals(hw.getSupportedUiModes()) && mPluggedIn == hw.getChargeType() && ((mSkinPath != null && mSkinPath.equals(hw.getSkinPath())) || (mSkinPath == null && hw.getSkinPath() == null)); }

Target:
public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof Hardware)) { return false; } Hardware hw = (Hardware) o; return mScreen.equals(hw.getScreen()) && mNetworking.equals(hw.getNetworking()) && mSensors.equals(hw.getSensors()) && mMic == hw.hasMic() && mCameras.equals(hw.getCameras()) && mKeyboard == hw.getKeyboard() && mNav == hw.getNav() && mRam.equals(hw.getRam()) && mButtons == hw.getButtonType() && mInternalStorage.equals(hw.getInternalStorage()) && mRemovableStorage.equals(hw.getRemovableStorage()) && mCpu.equals(hw.getCpu()) && mGpu.equals(hw.getGpu()) && mAbis.equals(hw.getSupportedAbis()) && mUiModes.equals(hw.getSupportedUiModes()) && mPluggedIn == hw.getChargeType() && Objects.equals(mSkinFile, hw.getSkinFile()); }
Source:
protected void validateSource(Factory factory) throws ConflictException { for (ProjectConfigDto project : factory.getWorkspace().getProjects()) { String type = project.getSource().getType(); String location = project.getSource().getLocation(); String parameterTypeName = "project.storage.type"; String parameterLocationName = "project.storage.location"; if (!("git".equals(type) || "esbwso2".equals(type) || "github".equals(type))) { throw new ConflictException("Parameter '" + parameterTypeName + "' has illegal value."); } if (isNullOrEmpty(location)) { throw new ConflictException( format(FactoryConstants.PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, parameterLocationName, location)); } else { try { URLDecoder.decode(location, "UTF-8"); } catch (IllegalArgumentException | UnsupportedEncodingException e) { throw new ConflictException( format(FactoryConstants.PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, parameterLocationName, location)); } } } }

Target:
protected void validateSource(Factory factory) throws ConflictException { for (ProjectConfigDto project : factory.getWorkspace().getProjects()) { String location = project.getSource().getLocation(); String parameterLocationName = "project.storage.location"; if (isNullOrEmpty(location)) { throw new ConflictException( format(FactoryConstants.PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, parameterLocationName, location)); } else { try { URLDecoder.decode(location, "UTF-8"); } catch (IllegalArgumentException | UnsupportedEncodingException e) { throw new ConflictException( format(FactoryConstants.PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, parameterLocationName, location)); } } } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user); Toolbar toolbar = (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); Button loginButton = (Button)findViewById(R.id.login_button); loginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (DropboxActivity.USE_SLT) { Auth.startOAuth2PKCE(UserActivity.this, getString(R.string.app_key), DbxRequestConfigFactory.getRequestConfig()); } else { Auth.startOAuth2Authentication(UserActivity.this, getString(R.string.app_key)); } } }); Button filesButton = (Button)findViewById(R.id.files_button); filesButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(FilesActivity.getIntent(UserActivity.this, "")); } }); Button openWithButton = (Button)findViewById(R.id.open_with); openWithButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent openWithIntent = new Intent(UserActivity.this, OpenWithActivity.class); startActivity(openWithIntent); } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user); Toolbar toolbar = (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); Button loginButton = (Button)findViewById(R.id.login_button); loginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DropboxActivity.startOAuth2Authentication(UserActivity.this); } }); Button filesButton = (Button)findViewById(R.id.files_button); filesButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(FilesActivity.getIntent(UserActivity.this, "")); } }); Button openWithButton = (Button)findViewById(R.id.open_with); openWithButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent openWithIntent = new Intent(UserActivity.this, OpenWithActivity.class); startActivity(openWithIntent); } }); }
Source:
protected void demandRemoteResolve(SynchronizedResourceSet resourceSet, URI uri, final ThreadSafeProgressMonitor monitor) { if (isInterruptedOrCanceled(monitor)) { demandResolvingAndUnloadingPoolShutdown(); return; } Collection<URI> uriCollection = dependencyProviderRegistry.getDependencies(uri); lock.lock(); try { for (URI currentUri : uriCollection) { if (resolvedResources.add(currentUri) && currentlyResolving.add(currentUri)) { monitor.setWorkRemaining(1000); ListenableFuture<?> future = resolvingPool.submit(new RemoteResourceResolver(resourceSet, currentUri, monitor)); Futures.addCallback(future, new ResolvingFutureCallback(monitor, currentUri)); } } } finally { lock.unlock(); } }

Target:
protected void demandRemoteResolve(SynchronizedResourceSet resourceSet, URI uri, final ThreadSafeProgressMonitor monitor) { if (isInterruptedOrCanceled(monitor)) { demandResolvingAndUnloadingPoolShutdown(); return; } Collection<URI> uriCollection = dependencyProviderRegistry.getDependencies(uri); lock.lock(); try { monitor.setWorkRemaining(1000); for (URI currentUri : uriCollection) { if (resolvedResources.add(currentUri) && currentlyResolving.add(currentUri)) { ListenableFuture<?> future = resolvingPool.submit(new RemoteResourceResolver(resourceSet, currentUri, monitor)); Futures.addCallback(future, new ResolvingFutureCallback(monitor, currentUri)); } } } finally { lock.unlock(); } }
Source:
public WebResponse getResponse(final Ds3Request request) throws IOException { WebResponse webResponse = super.getResponse(request); while (networkClientRetryBehavior.shouldRetry(webResponse)) webResponse = super.getResponse(request); return webResponse; }

Target:
public WebResponse getResponse(final Ds3Request request) throws IOException { WebResponse webResponse; do { webResponse = super.getResponse(request); } while (networkClientRetryBehavior.shouldRetry(webResponse)); return webResponse; }
Source:
public void init() { ProcessSummary processSummaryOne = new ProcessSummary("test-def-id", "test-def-name", "testone", "1", false); ProcessSummary processSummaryTwo = new ProcessSummary("test-def-id", "test-def-name", "testtwo", "1", false); ProcessSummary processSummaryThree = new ProcessSummary("test-def-id", "test-def-name", "testtwo", "2", false); List<ProcessSummary> processSummaries = Arrays.asList(processSummaryOne, processSummaryTwo, processSummaryThree); doAnswer(answer -> { return processSummaries; }).when(processRuntimeDataService).getProcessesByFilter(anyString(), anyString(), anyInt(), anyInt(), anyString(), anyBoolean()); dataSetdef = ProcessDefinitionDataSetDefBuilder.get() .uuid(PROCESS_DEFINITION_DATASET) .generatorClass("org.jbpm.workbench.pr.backend.server.ProcessDefinitonDataSetGenerator") .name("Process Definition") .label(COL_ID_PROCESSNAME) .label(COL_ID_PROCESSVERSION) .label(COL_ID_PROJECT) .label(COL_ID_PROCESSDEF) .label(COL_DYNAMIC) .buildDef(); }

Target:
public void init() { ProcessSummary processSummaryOne = new ProcessSummary("test-def-id", "test-def-name-one", "testone", "1", false); ProcessSummary processSummaryTwo = new ProcessSummary("test-def-id", "test-def-name", "testtwo", "1", false); ProcessSummary processSummaryThree = new ProcessSummary("test-def-id", "test-def-name", "testtwo", "2", false); List<ProcessSummary> processSummaries = Arrays.asList(processSummaryOne, processSummaryTwo, processSummaryThree); doAnswer(answer -> Arrays.asList(processSummaryOne)).when(processRuntimeDataService).getProcessesByFilter(SERVER_TEMPLATE_ID, TEXT_SEARCH, 0, -1, SORT_COLUMN_NAME, false); doAnswer(answer -> processSummaries).when(processRuntimeDataService).getProcessesByFilter(SERVER_TEMPLATE_ID, "", 0, -1, SORT_COLUMN_NAME, false); dataSetdef = new ProcessDefinitionDataSetGenerator().getDataSetDef(); }
Source:
static void registerOperation(final ManagementResourceRegistration registry, final ResourceDescriptionResolver resourceDescriptionResolver) { registry.registerOperationHandler(new SimpleOperationDefinitionBuilder(MIGRATE, resourceDescriptionResolver) .setRuntimeOnly() .build(), new MigrateOperation(false)); registry.registerOperationHandler(new SimpleOperationDefinitionBuilder(DESCRIBE_MIGRATION, resourceDescriptionResolver) .setRuntimeOnly() .build(), new MigrateOperation(true)); }

Target:
static void registerOperation(final ManagementResourceRegistration registry, final ResourceDescriptionResolver resourceDescriptionResolver) { registry.registerOperationHandler(new SimpleOperationDefinitionBuilder(MIGRATE, resourceDescriptionResolver) .setRuntimeOnly() .setReplyParameters(MIGRATION_WARNINGS_ATTR, MIGRATION_ERROR_ATTR) .build(), new MigrateOperation(false)); registry.registerOperationHandler(new SimpleOperationDefinitionBuilder(DESCRIBE_MIGRATION, resourceDescriptionResolver) .setRuntimeOnly() .setReplyParameters(MIGRATION_WARNINGS_ATTR, MIGRATION_ERROR_ATTR) .build(), new MigrateOperation(true)); }
Source:
public List<File> getExtensionsDirectories() { String path = getProperty("ENGINE_EXTENSION_PATH"); if (path == null) { log.warn("No extension configurations directories were provided"); return Collections.emptyList(); } List<File> results = new ArrayList<File>(); for (String currentPath : path.split(":")) { results.add(new File(currentPath)); } return results; }

Target:
public List<File> getExtensionsDirectories() { String path = getProperty("ENGINE_EXTENSION_PATH"); if (path == null) { log.warn("No extension configurations directories were provided"); return Collections.emptyList(); } List<File> results = new ArrayList<File>(); for (String currentPath : path.split(":")) { if (StringUtils.isNotBlank(currentPath)) { results.add(new File(currentPath)); } } return results; }
Source:
static byte[] getIDContext(byte[] oscoreOption) { if (oscoreOption.length == 0) { oscoreOption = new byte[] { 0x00 }; } byte flagByte = oscoreOption[0]; int n = flagByte & 0x07; int h = flagByte & 0x10; byte[] kidContext = null; int index = 1; index += n; if (h != 0) { int s = oscoreOption[index]; kidContext = Arrays.copyOfRange(oscoreOption, index + 1, index + 1 + s); index += s + 1; } return kidContext; }

Target:
static byte[] getIDContext(byte[] oscoreOption) { if (oscoreOption.length == 0) { return null; } byte flagByte = oscoreOption[0]; int n = flagByte & 0x07; int h = flagByte & 0x10; byte[] kidContext = null; int index = 1; index += n; if (h != 0) { int s = oscoreOption[index]; kidContext = Arrays.copyOfRange(oscoreOption, index + 1, index + 1 + s); index += s + 1; } return kidContext; }
Source:
public Digester(DigestSource digestSource) { this(KeySources.random(8), "", digestSource); }

Target:
public Digester(DigestSource digestSource) { this(KeySources.random(16), '-', digestSource); }
Source:
public long getMaxWait() { ThroughputElement<E> e = this.underlyingQueue.peek(); long max = -1; try { this.takeCountsLock.readLock().lock(); if (e != null && e.getWaited() > this.maxQueuedTime) { max = e.getWaited(); } else { max = this.maxQueuedTime; } } finally { this.takeCountsLock.readLock().unlock(); } return max; }

Target:
public long getMaxWait() { ThroughputElement<E> e = this.underlyingQueue.peek(); long max = -1; try { this.maxQueueTimeLock.readLock().lock(); if (e != null && e.getWaited() > this.maxQueuedTime) { max = e.getWaited(); } else { max = this.maxQueuedTime; } } finally { this.maxQueueTimeLock.readLock().unlock(); } return max; }
Source:
public void testRunOnEmulator() throws IOException, ClassNotFoundException { String projectName = "SimpleApplication"; String appName = "app"; WelcomeFrameFixture welcomeFrame = findWelcomeFrame(); welcomeFrame.clickOpenProjectButton(); IdeFrameFixture projectFrame = openProject(projectName); ChooseDeviceDialogFixture chooseDeviceDialogFixture = projectFrame.runApp(appName); chooseDeviceDialogFixture.selectEmulator("Nexus7"); chooseDeviceDialogFixture.clickOk(); RunToolWindowFixture runToolWindowFixture = projectFrame.getRunToolWindowFixture(); String processName = projectFrame.scanLogCatOutputForProcessName(runToolWindowFixture, appName); projectFrame.terminateApp(processName); }

Target:
public void testRunOnEmulator() throws IOException, ClassNotFoundException { String appName = "app"; IdeFrameFixture projectFrame = openSimpleApplication(); projectFrame.runApp(appName); ChooseDeviceDialogFixture chooseDeviceDialogFixture = projectFrame.findChooseDeviceDialog(); chooseDeviceDialogFixture.selectEmulator("Nexus7"); chooseDeviceDialogFixture.clickOk(); ToolWindowTextFinder toolWindowTextFinder = new ToolWindowTextFinder(Pattern.compile("^\\s*remote path: (?:[^\\/]*[\\/])*([\\w\\.]+)$", Pattern.MULTILINE)); RunToolWindowFixture runToolWindowFixture = projectFrame.getRunToolWindowFixture(); runToolWindowFixture.waitForOutput(projectFrame, appName, toolWindowTextFinder, SHORT_TIMEOUT); String processName = toolWindowTextFinder.getMatchers()[0].group(1); projectFrame.terminateApp(processName); }
Source:
public void renameMethodShouldThrowExceptionWhenNotIsNameEditable() { NameNotEditableItem item = new NameNotEditableItem(null,"NameNotEditableItem"); try { item.renameTo("NewName"); fail("An item with isNameEditable false must throw exception when trying to rename it."); } catch (IOException e) { assertEquals(e.getMessage(),"Trying to rename an item that has not editable name."); assertEquals("NameNotEditableItem",item.getName()); } }

Target:
public void renameMethodShouldThrowExceptionWhenNotIsNameEditable() { NameNotEditableItem item = new NameNotEditableItem(null,"NameNotEditableItem"); try { item.renameTo("NewName"); fail("An item with isNameEditable false must throw exception when trying to rename it."); } catch (IOException e) { assertEquals(e.getMessage(),"Trying to rename an item that does not support this operation."); assertEquals("NameNotEditableItem",item.getName()); } }
Source:
private void flushIfNecessary() { long totalBytes = 0; long maxBytes = 0; PageBuffer maxBuffer = null; if (pageStores.size() > maxOpenFiles) { throw new PrestoException(RAPTOR_TOO_MANY_OPEN_FILES, format("Exceeded the limit of %s files created per worker for a query", maxOpenFiles)); } for (PageStore store : pageStores.values()) { long bytes = store.getUsedMemoryBytes(); totalBytes += bytes; if ((maxBuffer == null) || (bytes > maxBytes)) { maxBuffer = store.getPageBuffer(); maxBytes = bytes; } } if ((totalBytes > maxBufferBytes) && (maxBuffer != null)) { maxBuffer.flush(); } }

Target:
private void flushIfNecessary() { long totalBytes = 0; long maxBytes = 0; PageBuffer maxBuffer = null; if (pageStores.size() > maxAllowedFilesPerWriter) { throw new PrestoException(RAPTOR_TOO_MANY_FILES_CREATED, format("Number of files created: %s , has exceeded the limit of %s files created per worker per query", pageStores.size(), maxAllowedFilesPerWriter)); } for (PageStore store : pageStores.values()) { long bytes = store.getUsedMemoryBytes(); totalBytes += bytes; if ((maxBuffer == null) || (bytes > maxBytes)) { maxBuffer = store.getPageBuffer(); maxBytes = bytes; } } if ((totalBytes > maxBufferBytes) && (maxBuffer != null)) { maxBuffer.flush(); } }
Source:
public ArrayList<String> fetchAll() throws IOException { ArrayList<String> atlasInformation = new ArrayList<>(); try (JsonReader reader = atlasInformationJsonFile.get()) { reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); switch(name){ case "ensembl": atlasInformation.add("Ensembl: " + reader.nextString()); break; case "genomes": atlasInformation.add("Ensembl Genomes: " + reader.nextString()); break; case "paraSite": atlasInformation.add("WormBase paraSite: " + reader.nextString()); break; case "efo": atlasInformation.add("EFO: " + reader.nextString()); break; default: reader.skipValue(); } } reader.endObject(); } return atlasInformation; }

Target:
public Map<String, String> fetchAll() { JsonReader reader = atlasInformationJsonFile.get(); Map<String, String> data = GsonProvider.GSON.fromJson(reader, HashMap.class); return data; }
Source:
protected void writeMemoryBlock(final long offset, final byte[] bytes) throws DebugException { final int addressableSize = getAddressableSize(); final Addr64 address = new Addr64(fBaseAddress); Query<MemoryByte[]> query = new Query<MemoryByte[]>() { @Override protected void execute(final DataRequestMonitor<MemoryByte[]> drm) { IMemory memoryService = (IMemory) fRetrieval.getServiceTracker().getService(); if (memoryService != null) { memoryService.setMemory( fContext, address, offset, addressableSize, bytes.length, bytes, new RequestMonitor(fRetrieval.getExecutor(), drm)); } else { drm.done(); } } }; fRetrieval.getExecutor().execute(query); try { query.get(); } catch (InterruptedException e) { throw new DebugException(new Status(IStatus.ERROR, DsfPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Error writing memory block (InterruptedException)", e)); } catch (ExecutionException e) { throw new DebugException(new Status(IStatus.ERROR, DsfPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Error writing memory block (ExecutionException)", e)); } }

Target:
protected void writeMemoryBlock(final long offset, final byte[] bytes) throws DebugException { int aSize; try { aSize = getAddressableSize(); } catch (DebugException e) { aSize = 1; } final int addressableSize = aSize; final int addressableUnits = bytes.length/addressableSize; final Addr64 address = new Addr64(fBaseAddress); Query<MemoryByte[]> query = new Query<MemoryByte[]>() { @Override protected void execute(final DataRequestMonitor<MemoryByte[]> drm) { IMemory memoryService = (IMemory) fRetrieval.getServiceTracker().getService(); if (memoryService != null) { memoryService.setMemory( fContext, address, offset, addressableSize, addressableUnits, bytes, new RequestMonitor(fRetrieval.getExecutor(), drm)); } else { drm.done(); } } }; fRetrieval.getExecutor().execute(query); try { query.get(); } catch (InterruptedException e) { throw new DebugException(new Status(IStatus.ERROR, DsfPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Error writing memory block (InterruptedException)", e)); } catch (ExecutionException e) { throw new DebugException(new Status(IStatus.ERROR, DsfPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Error writing memory block (ExecutionException)", e)); } }
Source:
public Iterable<ServerInZone> listNodesByIds(final Iterable<String> ids) { return Iterables.filter(listNodes(), new Predicate<ServerInZone>() { @Override public boolean apply(ServerInZone server) { return Iterables.contains(ids, server.slashEncode()); } }); }

Target:
public Iterable<ServerInZone> listNodesByIds(final Iterable<String> ids) { return filter(listNodes(), new Predicate<ServerInZone>() { @Override public boolean apply(ServerInZone server) { return contains(ids, server.slashEncode()); } }); }
Source:
public void validate(Object obj, Errors errors) throws APIException { log.debug("{}.validate...", this.getClass().getName()); if (obj == null || !(obj instanceof Alert)) { throw new IllegalArgumentException("error.general and must be of type " + Alert.class); } Alert alert = (Alert) obj; ValidationUtils.rejectIfEmptyOrWhitespace(errors, "text", "Alert.text.required"); ValidateUtil.validateFieldLengths(errors, obj.getClass(), "text"); }

Target:
public void validate(Object obj, Errors errors) throws APIException { logger.debug("{}.validate...", this.getClass().getName()); if (obj == null || !(obj instanceof Alert)) { throw new IllegalArgumentException("error.general and must be of type " + Alert.class); } Alert alert = (Alert) obj; ValidationUtils.rejectIfEmptyOrWhitespace(errors, "text", "Alert.text.required"); ValidateUtil.validateFieldLengths(errors, obj.getClass(), "text"); }
Source:
public List<MetricFamilySamples> collect() { List<MetricFamilySamples> sampleFamilies = new ArrayList<MetricFamilySamples>(); CounterMetricFamily allocated = new CounterMetricFamily( "jvm_memory_pool_allocated_bytes", "Total bytes allocated in a given JVM memory pool. Only updated after GC, not continuously.", Collections.singletonList("pool")); sampleFamilies.add(allocated); for (Map.Entry<String, AtomicLong> entry : allocatedMap.entrySet()) { String memoryPool = entry.getKey(); AtomicLong bytesAllocated = entry.getValue(); allocated.addMetric(Collections.singletonList(memoryPool), bytesAllocated.doubleValue()); } return sampleFamilies; }

Target:
public List<MetricFamilySamples> collect() { return allocatedCounter.collect(); }
Source:
public Date getTimestamp() { return timestamp; }

Target:
public Date getTimestamp() { return this.timestamp; }
Source:
public boolean isEnabled() { List<StructuredViewer> viewers = getViewers(); ISearchResultPage page = getCurrentPage(); return viewers.size() > 0 && page != null && WHITELISTED_IDS.contains(page.getID()); }

Target:
public boolean isEnabled() { List<StructuredViewer> viewers = getViewers(); ISearchResultPage page = getCurrentPage(); return viewers.size() > 0 && WHITELISTED_IDS.contains(page.getID()); }
Source:
public ReloadServiceInvoker(ClassLoader cl) throws ReflectiveOperationException { Class<?> frameworkClass = cl.loadClass("org.nuxeo.runtime.api.Framework"); Class<?> reloadServiceClass = cl.loadClass("org.nuxeo.runtime.reload.ReloadService"); Method getLocalService = frameworkClass.getDeclaredMethod("getLocalService", Class.class); reloadService = getLocalService.invoke(null, reloadServiceClass); deployBundles = reloadServiceClass.getDeclaredMethod("deployBundles", File[].class); undeployBundles = reloadServiceClass.getDeclaredMethod("undeployBundles", String[].class); runDeploymentPreprocessor = reloadServiceClass.getDeclaredMethod("runDeploymentPreprocessor"); installWebResources = reloadServiceClass.getDeclaredMethod("installWebResources", File.class); flush = reloadServiceClass.getDeclaredMethod("flush"); reload = reloadServiceClass.getDeclaredMethod("reload"); flushSeam = reloadServiceClass.getDeclaredMethod("flushSeamComponents"); reloadSeam = reloadServiceClass.getDeclaredMethod("reloadSeamComponents"); getOSGIBundleName = reloadServiceClass.getDeclaredMethod("getOSGIBundleName", File.class); }

Target:
public ReloadServiceInvoker(ClassLoader cl) throws ReflectiveOperationException { Class<?> frameworkClass = cl.loadClass("org.nuxeo.runtime.api.Framework"); Class<?> reloadServiceClass = cl.loadClass("org.nuxeo.runtime.reload.ReloadService"); Method getLocalService = frameworkClass.getDeclaredMethod("getLocalService", Class.class); reloadService = getLocalService.invoke(null, reloadServiceClass); deployBundles = reloadServiceClass.getDeclaredMethod("deployBundles", List.class); undeployBundles = reloadServiceClass.getDeclaredMethod("undeployBundles", List.class); runDeploymentPreprocessor = reloadServiceClass.getDeclaredMethod("runDeploymentPreprocessor"); installWebResources = reloadServiceClass.getDeclaredMethod("installWebResources", File.class); flush = reloadServiceClass.getDeclaredMethod("flush"); reload = reloadServiceClass.getDeclaredMethod("reload"); flushSeam = reloadServiceClass.getDeclaredMethod("flushSeamComponents"); reloadSeam = reloadServiceClass.getDeclaredMethod("reloadSeamComponents"); getOSGIBundleName = reloadServiceClass.getDeclaredMethod("getOSGIBundleName", File.class); }