auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Node createNodeForElement(Object element, DocumentView view) { NodeDescriptor descriptor = mDocument.getNodeDescriptor(element); Node node = new DOM.Node(); node.nodeId = mDocument.getNodeIdForElement(element); node.nodeType = descriptor.getNodeType(element); node.nodeName = descriptor.getNodeName(element); node.localName = descriptor.getLocalName(element); node.nodeValue = descriptor.getNodeValue(element); Document.AttributeListAccumulator accumulator = new Document.AttributeListAccumulator(); mDocument.getNodeDescriptor(element).getAttributes(element, accumulator); node.attributes = accumulator; ElementInfo elementInfo = view.getElementInfo(element); List<Node> childrenNodes = (elementInfo.children.size() == 0) ? Collections.<Node>emptyList() : new ArrayList<Node>(elementInfo.children.size()); for (int i = 0, N = elementInfo.children.size(); i < N; ++i) { final Object childElement = elementInfo.children.get(i); Node childNode = createNodeForElement(childElement, view); childrenNodes.add(childNode); } node.children = childrenNodes; node.childNodeCount = childrenNodes.size(); return node; }

Target:
private Node createNodeForElement(Object element, DocumentView view) { NodeDescriptor descriptor = mDocument.getNodeDescriptor(element); Node node = new DOM.Node(); node.nodeId = mDocument.getNodeIdForElement(element); node.nodeType = descriptor.getNodeType(element); node.nodeName = descriptor.getNodeName(element); node.localName = descriptor.getLocalName(element); node.nodeValue = descriptor.getNodeValue(element); Document.AttributeListAccumulator accumulator = new Document.AttributeListAccumulator(); descriptor.getAttributes(element, accumulator); node.attributes = accumulator; ElementInfo elementInfo = view.getElementInfo(element); List<Node> childrenNodes = (elementInfo.children.size() == 0) ? Collections.<Node>emptyList() : new ArrayList<Node>(elementInfo.children.size()); for (int i = 0, N = elementInfo.children.size(); i < N; ++i) { final Object childElement = elementInfo.children.get(i); Node childNode = createNodeForElement(childElement, view); childrenNodes.add(childNode); } node.children = childrenNodes; node.childNodeCount = childrenNodes.size(); return node; }
Source:
public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain) throws IOException, ServletException { findNegotiatingProfiles(req); if (profiles.isEmpty()) { chain.doFilter(req, rsp); return; } doFilter((HttpServletRequest) req, (HttpServletResponse) rsp, chain); }

Target:
public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain) throws IOException, ServletException { findNegotiatingProfiles(req); if (profiles.isEmpty()) { chain.doFilter(req, rsp); return; } doAuth((HttpServletRequest) req, (HttpServletResponse) rsp, chain); }
Source:
protected void configureServlets() { serve("/say-hello/*").with(HelloWorldServlet.class); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new JavaScriptPlugin("hello-project.js")); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new JavaScriptPlugin("hello-revision.js")); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new GwtPlugin("cookbook-plugin")); }

Target:
protected void configureServlets() { serve("/say-hello/*").with(HelloWorldServlet.class); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new JavaScriptPlugin("hello-project.js")); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new JavaScriptPlugin("hello-revision.js")); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new GwtPlugin("cookbook")); }
Source:
private void verifyStatusInput() { if (asyncRestore || (status && StringUtils.isBlank(requestId))) { throw new IllegalArgumentException(SEE_COMMAND_USAGE_MESSAGE); } }

Target:
private void verifyStatusInput() { if (status && StringUtils.isBlank(requestId)) { throw new IllegalArgumentException( "Status request is missing requestId." + SEE_COMMAND_USAGE_MESSAGE); } if (asyncRestore) { throw new IllegalArgumentException( "asyncRestore passed to status request." + SEE_COMMAND_USAGE_MESSAGE); } }
Source:
public void loadCenterDetails(String format, String locale, String meetingDate, int officeId, int staffId) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscription.add(collectionDataManager.fetchCenterDetails(format, locale, meetingDate, officeId, staffId) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<CenterDetail>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); try { if (e instanceof HttpException) { String errorMessage = ((HttpException) e).response().errorBody() .string(); getMvpView().showError(MFErrorParser.parseError(errorMessage) .getErrors().get(0).getDefaultUserMessage()); } } catch (Throwable throwable) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } } @Override public void onNext(List<CenterDetail> centerDetails) { getMvpView().showProgressbar(false); getMvpView().onCenterLoadSuccess(centerDetails); } })); }

Target:
public void loadCenterDetails(String format, String locale, String meetingDate, int officeId, int staffId) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscription.add(collectionDataManager.fetchCenterDetails(format, locale, meetingDate, officeId, staffId) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<CenterDetail>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError(MFErrorParser.errorMessage(e)); } @Override public void onNext(List<CenterDetail> centerDetails) { getMvpView().showProgressbar(false); getMvpView().onCenterLoadSuccess(centerDetails); } })); }
Source:
boolean equivalent(QuantileDigest other) { return (getNodeCount() == other.getNodeCount() && min == other.min && max == other.max && weightedCount == other.weightedCount); }

Target:
boolean equivalent(QuantileDigest other) { return (getNodeCount() == other.getNodeCount() && min == other.min && max == other.max && weightedCount == other.weightedCount && alpha == other.alpha); }
Source:
private boolean clearLocally0(K key, boolean readers) { MvccUtils.verifyMvccOperationSupport(ctx, "Clear"); ctx.checkSecurity(SecurityPermission.CACHE_REMOVE); ctx.shared().cache().checkReadOnlyState("clear", ctx.config()); if (keyCheck) validateCacheKey(key); GridCacheVersion obsoleteVer = ctx.versions().next(); ctx.shared().database().checkpointReadLock(); try { KeyCacheObject cacheKey = ctx.toCacheKeyObject(key); GridCacheEntryEx entry = ctx.isNear() ? peekEx(cacheKey) : entryEx(cacheKey); if (entry != null) return entry.clear(obsoleteVer, readers); } catch (GridDhtInvalidPartitionException ignored) { } catch (IgniteCheckedException ex) { U.error(log, "Failed to clearLocally entry for key: " + key, ex); } finally { ctx.shared().database().checkpointReadUnlock(); } return false; }

Target:
private boolean clearLocally0(K key, boolean readers) { ctx.shared().cache().checkReadOnlyState("clear", ctx.config()); MvccUtils.verifyMvccOperationSupport(ctx, "Clear"); ctx.checkSecurity(SecurityPermission.CACHE_REMOVE); if (keyCheck) validateCacheKey(key); GridCacheVersion obsoleteVer = ctx.versions().next(); ctx.shared().database().checkpointReadLock(); try { KeyCacheObject cacheKey = ctx.toCacheKeyObject(key); GridCacheEntryEx entry = ctx.isNear() ? peekEx(cacheKey) : entryEx(cacheKey); if (entry != null) return entry.clear(obsoleteVer, readers); } catch (GridDhtInvalidPartitionException ignored) { } catch (IgniteCheckedException ex) { U.error(log, "Failed to clearLocally entry for key: " + key, ex); } finally { ctx.shared().database().checkpointReadUnlock(); } return false; }
Source:
private static IterableStream<FormContent> setReferenceElements(List<String> elements, List<ReadResult> readResults, Integer pageNumber) { List<FormContent> formContentList = new ArrayList<>(); elements.forEach(elementString -> { String[] indices = COMPILE.matcher(elementString).replaceAll(" ").trim().split(" "); int readResultIndex, lineIndex; if (indices.length >= 1) { readResultIndex = Integer.parseInt(indices[0]); lineIndex = Integer.parseInt(indices[1]); } else { throw LOGGER.logExceptionAsError(new RuntimeException("Reference Elements not found")); } if (indices.length == 3) { int wordIndex = Integer.parseInt(indices[2]); TextWord textWord = readResults.get(readResultIndex).getLines().get(lineIndex).getWords() .get(wordIndex); FormWord wordElement = new FormWord(textWord.getText(), toBoundingBox(textWord.getBoundingBox()), pageNumber, textWord.getConfidence()); formContentList.add(wordElement); } else { TextLine textLine = readResults.get(readResultIndex).getLines().get(lineIndex); FormLine lineElement = new FormLine(textLine.getText(), toBoundingBox(textLine.getBoundingBox()), pageNumber, toWords(textLine.getWords(), pageNumber)); formContentList.add(lineElement); } }); return new IterableStream<>(formContentList); }

Target:
private static IterableStream<FormContent> setReferenceElements(List<String> elements, List<ReadResult> readResults, Integer pageNumber) { if (CoreUtils.isNullOrEmpty(elements)) { return IterableStream.of(null); } List<FormContent> formContentList = new ArrayList<>(); elements.forEach(elementString -> { String[] indices = NON_DIGIT_PATTERN.matcher(elementString).replaceAll(" ").trim().split(" "); if (indices.length < 2) { throw LOGGER.logExceptionAsError(new RuntimeException("Cannot find corresponding reference elements " + "for the field value.")); } int readResultIndex = Integer.parseInt(indices[0]); int lineIndex = Integer.parseInt(indices[1]); if (indices.length == 3) { int wordIndex = Integer.parseInt(indices[2]); TextWord textWord = readResults.get(readResultIndex).getLines().get(lineIndex).getWords().get(wordIndex); FormWord wordElement = new FormWord(textWord.getText(), toBoundingBox(textWord.getBoundingBox()), pageNumber, setDefaultConfidenceValue(textWord.getConfidence())); formContentList.add(wordElement); } else { TextLine textLine = readResults.get(readResultIndex).getLines().get(lineIndex); FormLine lineElement = new FormLine(textLine.getText(), toBoundingBox(textLine.getBoundingBox()), pageNumber, toWords(textLine.getWords(), pageNumber)); formContentList.add(lineElement); } }); return new IterableStream<>(formContentList); }
Source:
public Object getPropertyValue(Object id) { if (id == null) { return null; } if (HOST.equals(id)) { return this.connection.toString(); } if (USERNAME.equals(id)) { return this.connection.getUsername(); } if (connection instanceof IOpenShiftConnection) { IOpenShiftConnection openshiftConnection = (IOpenShiftConnection) this.connection; if (OPENSHIFT_MASTER_VERSION.equals(id)) { return openshiftConnection.getOpenShiftMasterVersion(); } if (KUBERNETES_MASTER_VERSION.equals(id)) { return openshiftConnection.getKubernetesMasterVersion(); } if (OC_VERSION.equals(id)) { String path = OCBinary.getInstance().getLocation(openshiftConnection); OCBinaryVersionValidator validator = new OCBinaryVersionValidator(path); return validator.getVersion(new NullProgressMonitor()).toString(); } Object result = openshiftConnection.getExtendedProperties().get(id); return result == null ? "" : result.toString(); } return null; }

Target:
public Object getPropertyValue(Object id) { if (id == null) { return null; } if (HOST.equals(id)) { return this.connection.toString(); } if (USERNAME.equals(id)) { return this.connection.getUsername(); } if (connection instanceof IOpenShiftConnection) { IOpenShiftConnection openshiftConnection = (IOpenShiftConnection) this.connection; if (OPENSHIFT_MASTER_VERSION.equals(id)) { return openshiftConnection.getOpenShiftMasterVersion(); } if (KUBERNETES_MASTER_VERSION.equals(id)) { return openshiftConnection.getKubernetesMasterVersion(); } if (OC_CLIENT.equals(id)) { return OCBinary.getInstance().getLocation(openshiftConnection); } Object result = openshiftConnection.getExtendedProperties().get(id); return result == null ? "" : result.toString(); } return null; }
Source:
public Response getAccountAuditLogs(@PathParam("accountId") final UUID accountId, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException { final TenantContext tenantContext = context.createTenantContextWithAccountId(accountId, request); final Account account = accountUserApi.getAccountById(accountId, tenantContext); final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(account.getId(), AuditLevel.FULL, tenantContext); return Response.status(Status.OK).entity(getAuditLogs(accountAuditLogs)).build(); }

Target:
public Response getAccountAuditLogs(@PathParam("accountId") final UUID accountId, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException { final TenantContext tenantContext = context.createTenantContextWithAccountId(accountId, request); final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(accountId, AuditLevel.FULL, tenantContext); return Response.status(Status.OK).entity(getAuditLogs(accountAuditLogs)).build(); }
Source:
public Node apply(@Nonnull Node node) { for (Rule rule : rules) { if (!rule.matches(node)) { return rule.apply(node); } } for (Rule rule : rules) { node = rule.apply(node); if (isErrorResult(node)) return createNodeUsingFactory(node); } return createNodeUsingFactory(node); }

Target:
public Node apply(@Nonnull Node node) { for (Rule rule : rules) { if (!rule.matches(node)) { return rule.apply(node); } } for (Rule rule : rules) { node = rule.apply(node); if (isErrorResult(node)) return node; } return createNodeUsingFactory(node); }
Source:
protected PhoneNumberClientBuilder getClientBuilder(HttpClient httpClient) { if (getTestMode() == TestMode.PLAYBACK) { httpClient = interceptorManager.getPlaybackClient(); } PhoneNumberClientBuilder builder = new PhoneNumberClientBuilder(); builder.httpClient(httpClient).endpoint(ENV_ENDPOINT).accessKey(ENV_ACCESS_KEY); if (getTestMode() == TestMode.RECORD) { List<Function<String, String>> redactors = new ArrayList<>(); redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data), "REDACTED")); builder.addPolicy(interceptorManager.getRecordPolicy()); } return builder; }

Target:
protected PhoneNumberClientBuilder getClientBuilder(HttpClient httpClient) { if (getTestMode() == TestMode.PLAYBACK) { httpClient = interceptorManager.getPlaybackClient(); } PhoneNumberClientBuilder builder = new PhoneNumberClientBuilder(); builder.httpClient(httpClient).endpoint(ENV_ENDPOINT).accessKey(ENV_ACCESS_KEY); if (getTestMode() == TestMode.RECORD) { interceptorManager.addTextReplacementRule(String.valueOf(JSON_PROPERTY_VALUE_REDACTION_PATTERN), "REDACTED"); builder.addPolicy(interceptorManager.getRecordPolicy()); } return builder; }
Source:
private Command getSnapCommand(Request request) { List editparts = null; if (request instanceof GroupRequest) { editparts = ((GroupRequest) request).getEditParts(); } else if (request instanceof ArrangeRequest) { editparts = ((ArrangeRequest) request).getPartsToArrange(); } TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain(); if (editparts != null && !isDoNotHandleSnapTo(editparts)) { return new ICommandProxy(new SnapCommand(editingDomain, editparts)); } return null; }

Target:
private Command getSnapCommand(Request request) { List editparts = null; if (request instanceof GroupRequest) { editparts = ((GroupRequest) request).getEditParts(); } else if (request instanceof ArrangeRequest) { editparts = ((ArrangeRequest) request).getPartsToArrange(); } TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain(); if (editparts != null && !shouldLaunchSnapTo(editparts)) { return new ICommandProxy(new SnapCommand(editingDomain, editparts)); } return null; }
Source:
private static void validateBoundingBoxData(List<Float> expectedBoundingBox, BoundingBox actualBoundingBox) { List<Point> expectedPointList = new ArrayList<>(); for (int i = 0; i < expectedBoundingBox.size(); i++) { expectedPointList.add(new Point(expectedBoundingBox.get(i), expectedBoundingBox.get(++i))); } assertEquals(new BoundingBox(expectedPointList), actualBoundingBox); }

Target:
private static void validateBoundingBoxData(List<Float> expectedBoundingBox, BoundingBox actualBoundingBox) { if ((actualBoundingBox != null && actualBoundingBox.getPoints() != null) && (!CoreUtils.isNullOrEmpty(expectedBoundingBox))) { List<Point> expectedPointList = new ArrayList<>(); for (int i = 0; i < expectedBoundingBox.size(); i++) { expectedPointList.add(new Point(expectedBoundingBox.get(i), expectedBoundingBox.get(++i))); } assertEquals(new BoundingBox(expectedPointList), actualBoundingBox); } }
Source:
public Iterable<ITmfEventAspect> getEventAspects() { ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder(); builder.addAll(super.getEventAspects()); builder.add(KernelTidAspect.INSTANCE); builder.add(ThreadPriorityAspect.INSTANCE); return NonNullUtils.checkNotNull(builder.build()); }

Target:
public Iterable<ITmfEventAspect> getEventAspects() { ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder(); builder.addAll(super.getEventAspects()); builder.add(KernelTidAspect.INSTANCE); builder.add(ThreadPriorityAspect.INSTANCE); return builder.build(); }
Source:
public String getAddress() { return address; }

Target:
public String getAddress() { if (address == null) { address = getAddress(host, port); } return address; }
Source:
public Workflow upsertServiceVersion(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Repository path", required = true) @FormParam("repository") String repository, @ApiParam(value = "Name of user on GitHub", required = true) @FormParam("username") String username, @ApiParam(value = "Git reference for new GitHub tag", required = true) @FormParam("gitReference") String gitReference, @ApiParam(value = "GitHub installation ID", required = true) @FormParam("installationId") String installationId) { User sendingUser = GitHubHelper.findUserByGitHubUsername(this.tokenDAO, this.userDAO, username, false); String installationAccessToken = gitHubAppSetup(installationId); String dockstoreServicePath = upsertVersionHelper(repository, gitReference, null, SERVICE, installationAccessToken); Workflow service = workflowDAO.findByPath(dockstoreServicePath, false, Service.class).get(); if (sendingUser != null && !service.getUsers().contains(sendingUser)) { service.getUsers().add(sendingUser); } return service; }

Target:
public Service upsertServiceVersion(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Repository path", required = true) @FormParam("repository") String repository, @ApiParam(value = "Name of user on GitHub", required = true) @FormParam("username") String username, @ApiParam(value = "Git reference for new GitHub tag", required = true) @FormParam("gitReference") String gitReference, @ApiParam(value = "GitHub installation ID", required = true) @FormParam("installationId") String installationId) { return upsertVersion(repository, username, gitReference, installationId, SERVICE); }
Source:
private void validateBondMode(boolean isVmNetwork){ Bond bond = new Bond(); bond.setNetworkName(null); bond.setName("bondName"); bond.setNetworkName("networkName"); Network network = createNetworkWithName("networkName"); network.setVmNetwork(isVmNetwork); NetworkAttachment vmNetworkNetworkAttachment = createNetworkAttachment(network, bond); HostSetupNetworksValidator validator = new HostSetupNetworksValidatorBuilder() .setParams(new ParametersBuilder().addBonds(new Bond[]{bond})) .addNetworks(network) .addExistingInterfaces(bond) .build(); for (BondMode bondMode : BondMode.values()){ bond.setBondOptions(bondMode.getConfigurationValue()); ValidationResult result = validator.validateBondModeVsNetworksAttachedToIt(Arrays.asList(vmNetworkNetworkAttachment)); if (!isVmNetwork || BondMode.isBondModeValidForVmNetwork(bondMode.getValue())){ assertThat(result, isValid()); } else { assertThat(result, failsWith(EngineMessage.INVALID_BOND_MODE_FOR_BOND_WITH_VM_NETWORK, ReplacementUtils.createSetVariableString(HostSetupNetworksValidator.VAR_BOND_NAME, "bondName"), ReplacementUtils.createSetVariableString(HostSetupNetworksValidator.VAR_NETWORK_NAME, "networkName") )); } } }

Target:
private void validateBondMode(boolean isVmNetwork){ Bond bond = new Bond(); bond.setNetworkName(null); bond.setName("bondName"); bond.setNetworkName("networkName"); Network network = createNetworkWithName("networkName"); network.setVmNetwork(isVmNetwork); NetworkAttachment vmNetworkNetworkAttachment = createNetworkAttachment(network, bond); HostSetupNetworksValidator validator = new HostSetupNetworksValidatorBuilder() .setParams(new ParametersBuilder().addBonds(new Bond[]{bond})) .addNetworks(network) .addExistingInterfaces(bond) .build(); for (BondMode bondMode : BondMode.values()){ bond.setBondOptions(bondMode.getConfigurationValue()); ValidationResult result = validator.validateBondModeVsNetworksAttachedToIt(Arrays.asList(vmNetworkNetworkAttachment)); if (!isVmNetwork || bondMode.isBondModeValidForVmNetwork()){ assertThat(result, isValid()); } else { assertThat(result, failsWith(EngineMessage.INVALID_BOND_MODE_FOR_BOND_WITH_VM_NETWORK, ReplacementUtils.createSetVariableString(HostSetupNetworksValidator.VAR_BOND_NAME, "bondName"), ReplacementUtils.createSetVariableString(HostSetupNetworksValidator.VAR_NETWORK_NAME, "networkName") )); } } }
Source:
public boolean isAtLeastOneSettingsEnabled( JSONObject settingsJson, String[] settingsArray, String[] settingsValues ) { boolean atLeastOneOptionEnabled = false; if (settingsJson != null && settingsArray.length == settingsValues.length) { for (int i = 0; i < settingsArray.length; i++) { String settingValue = settingsValues[i]; boolean isChecked = JSONUtils.queryJSON(settingsJson, settingValue, true); if (isChecked) { atLeastOneOptionEnabled = true; } } } return atLeastOneOptionEnabled; }

Target:
public boolean isAtLeastOneSettingsEnabled( JSONObject settingsJson, String[] settingsArray, String[] settingsValues ) { if (settingsJson != null && settingsArray.length == settingsValues.length) { for (int i = 0; i < settingsArray.length; i++) { String settingValue = settingsValues[i]; boolean isChecked = JSONUtils.queryJSON(settingsJson, settingValue, true); if (isChecked) { return true; } } } return false; }
Source:
public LocalCryptographyAsyncClient buildAsyncClient() { if (jsonWebKey == null) { throw logger.logExceptionAsError(new IllegalStateException( "Json Web Key is required to create local cryptography client")); } return new LocalCryptographyAsyncClient(jsonWebKey); }

Target:
public LocalCryptographyAsyncClient buildAsyncClient() { if (jsonWebKey == null) { throw logger.logExceptionAsError(new NullPointerException( "Json Web Key is required to create local cryptography client")); } return new LocalCryptographyAsyncClient(jsonWebKey); }
Source:
public double getBaseMaxOutput() { return powerToAdd; }

Target:
public double getBaseMaxOutput() { if (this.panel != null) { return this.panel.generationRateD; } return 0; }
Source:
public void activateTheme(String themeId) { ThemeModel theme = new ThemeModel(); theme.setThemeId(themeId); ThemeStore.ActivateThemePayload payload = new ThemeStore.ActivateThemePayload(mSite, theme); if (mSite.isJetpackConnected() && mThemeStore.getInstalledThemeByThemeId(themeId) == null) { mDispatcher.dispatch(ThemeActionBuilder.newInstallThemeAction(payload)); } else { mDispatcher.dispatch(ThemeActionBuilder.newActivateThemeAction(payload)); } }

Target:
public void activateTheme(String themeId) { if (!mSite.isUsingWpComRestApi()) { AppLog.i(T.THEMES, "Theme activation requires a site using WP.com REST API. Aborting request."); return; } ThemeModel theme = mThemeStore.getInstalledThemeByThemeId(themeId); if (theme == null) { theme = mThemeStore.getWpComThemeByThemeId(themeId); if (theme == null) { AppLog.w(T.THEMES, "Theme unavailable to activate. Fetch it and try again."); return; } if (mSite.isJetpackConnected()) { mDispatcher.dispatch(ThemeActionBuilder.newInstallThemeAction(new ActivateThemePayload(mSite, theme))); return; } } mDispatcher.dispatch(ThemeActionBuilder.newActivateThemeAction(new ActivateThemePayload(mSite, theme))); }
Source:
public void getContentObjectFolderTest() throws Exception { PID pid = repository.mintContentPid(); String etag = "\"etag\""; mockFcrepoResponse(pid, etag, Cdr.Folder); etag = etag = etag.substring(1, etag.length() - 1); mockLoadTypes(Arrays.asList(Cdr.Folder.getURI())); ContentObject obj = repository.getContentObject(pid); assertTrue("Incorrect type of object returned", obj instanceof FolderObject); assertEquals(pid, obj.getPid()); assertEquals("Etag was not present or didn't match", etag, obj.getEtag()); assertTrue(obj.getResource().hasProperty(RDF.type, Cdr.Folder)); }

Target:
public void getContentObjectFolderTest() throws Exception { PID pid = repository.mintContentPid(); mockFcrepoResponse(pid, ETAG_HEADER, Cdr.Folder); mockLoadTypes(Arrays.asList(Cdr.Folder.getURI())); ContentObject obj = repository.getContentObject(pid); assertTrue("Incorrect type of object returned", obj instanceof FolderObject); assertEquals(pid, obj.getPid()); assertEquals("Etag was not present or didn't match", ETAG, obj.getEtag()); assertTrue(obj.getResource().hasProperty(RDF.type, Cdr.Folder)); }
Source:
private Map<String, Type> buildBigIntTypeProviderMap(String... variables) { ImmutableMap.Builder<String, Type> builder = ImmutableMap.builder(); Arrays.stream(variables).forEach(variable -> builder.put(variable, BIGINT)); return builder.build(); }

Target:
private static Map<String, Type> buildBigIntTypeProviderMap(String... variables) { ImmutableMap.Builder<String, Type> builder = ImmutableMap.builder(); Arrays.stream(variables).forEach(variable -> builder.put(variable, BIGINT)); return builder.build(); }
Source:
public void setCommand(IDropCommand command) { super.setCommand(command); IHTMLLibraryVersion vName = ((PaletteItemDropCommand)command).getPaletteItem().getCategory().getVersionGroup().getVersion(); for (IonicVersion v: IonicVersion.ALL_VERSIONS) { if(v.equals(vName)) { version = v; } } preferredVersions = new PreferredJSLibVersions(getFile(), getVersion()); preferredVersions.updateLibEnablementAndSelection(); }

Target:
public void setCommand(IDropCommand command) { super.setCommand(command); version = (IonicVersion)((PaletteItemDropCommand)command).getPaletteItem().getCategory().getVersionGroup().getVersion(); preferredVersions = new PreferredJSLibVersions(getFile(), getVersion()); preferredVersions.updateLibEnablementAndSelection(); }
Source:
public void return_Error_extracted_form_StatusException_metadata() { final Error expectedError = Error.getDefaultInstance(); final Metadata metadata = MetadataConverter.toMetadata(expectedError); final StatusException statusException = Status.INVALID_ARGUMENT.asException(metadata); assertEquals(expectedError, Errors.fromStreamError(statusException) .get()); }

Target:
public void return_Error_extracted_form_StatusException_metadata() { final Error expectedError = Error.getDefaultInstance(); final Metadata metadata = MetadataConverter.toMetadata(expectedError); final StatusException statusException = INVALID_ARGUMENT.asException(metadata); assertEquals(expectedError, Errors.fromStreamError(statusException) .get()); }
Source:
public void updateLastEditorEmailOfFeedbackResponseComments(String courseId, String oldEmail, String updatedEmail) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseId); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, oldEmail); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, updatedEmail); if (oldEmail.equals(updatedEmail)) { return; } List<FeedbackResponseComment> responseComments = this.getFeedbackResponseCommentEntitiesForLastEditorInCourse(courseId, oldEmail); for (FeedbackResponseComment responseComment : responseComments) { responseComment.setLastEditorEmail(updatedEmail); } log.info(Const.SystemParams.COURSE_BACKUP_LOG_MSG + courseId); getPm().close(); }

Target:
public void updateLastEditorEmailOfFeedbackResponseComments(String courseId, String oldEmail, String updatedEmail) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseId); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, oldEmail); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, updatedEmail); if (oldEmail.equals(updatedEmail)) { return; } List<FeedbackResponseComment> responseComments = this.getFeedbackResponseCommentEntitiesForLastEditorInCourse(courseId, oldEmail); for (FeedbackResponseComment responseComment : responseComments) { responseComment.setLastEditorEmail(updatedEmail); } log.info("updating last editor email from: " + oldEmail + " to: " + updatedEmail + " for feedback response comments in the course: " + courseId); getPm().close(); }
Source:
public void testCollect_testFail() throws IOException, DeviceNotAvailableException, ConfigurationException { OptionSetter options = new OptionSetter(mCollector); options.setOptionValue("per-run", "false"); mCollector.init(mContext, mListener); mCollector.testRunStarted("collect-metrics", 2); mCollector.testStarted(mTest); mCollector.testEnded(mTest, mMetrics); mCollector.testStarted(mTest); mCollector.testFailed(mTest, "Test Failed"); mCollector.testEnded(mTest, mMetrics); mCollector.testRunEnded(0L, mMetrics); for (ITestDevice device : mDevices) { verify(mCollector, times(2)).pushBinaryStatsConfig(eq(device), any(File.class)); verify(mCollector, times(1)).getReportByteStream(eq(device), anyLong()); verify(mCollector, times(1)).removeConfig(eq(device), anyLong()); } }

Target:
public void testCollect_testFail() throws IOException, DeviceNotAvailableException, ConfigurationException { OptionSetter options = new OptionSetter(mCollector); options.setOptionValue("per-run", "false"); mCollector.init(mContext, mListener); mCollector.testRunStarted("collect-metrics", 2); mCollector.testStarted(mTest); mCollector.testFailed(mTest, "Test Failed"); mCollector.testEnded(mTest, mMetrics); mCollector.testStarted(mTest); mCollector.testEnded(mTest, mMetrics); mCollector.testRunEnded(0L, mMetrics); for (ITestDevice device : mDevices) { verify(mCollector, times(2)).pushBinaryStatsConfig(eq(device), any(File.class)); verify(mCollector, times(2)).getReportByteStream(eq(device), anyLong()); verify(mCollector, times(2)).removeConfig(eq(device), anyLong()); assertEquals(1, mCollector.numberOfReportsProcessedOnDevice(device)); } }
Source:
public void visit(Object context, Stack<ExecutionBlockId> stack, ExecutionBlockId currentId) { ExecutionBlock current = plan.getExecBlock(currentId); if (!plan.isTerminal(current)) { if (isFullyBroadcastable(current)) { List<ScanNode> broadcastCandidates = new ArrayList<>(); broadcastCandidates.addAll(current.getBroadcastRelations()); Collections.sort(broadcastCandidates, relSizeComparator); current.removeBroadcastRelation(broadcastCandidates.remove(broadcastCandidates.size()-1)); } } }

Target:
public void visit(Object context, Stack<ExecutionBlockId> stack, ExecutionBlockId currentId) { ExecutionBlock current = plan.getExecBlock(currentId); if (!plan.isTerminal(current)) { if (isFullyBroadcastable(current)) { List<ScanNode> broadcastCandidates = new ArrayList<>(current.getBroadcastRelations()); Collections.sort(broadcastCandidates, relSizeComparator); current.removeBroadcastRelation(broadcastCandidates.remove(broadcastCandidates.size()-1)); } } }
Source:
private void purgeOldMessages() { Calendar deadline = Calendar.getInstance(); deadline.add(Calendar.YEAR, ONE_YEAR_AGO); log.info("Starting scan for Message entries older than: " + deadline.getTime()); MessageDao messageDao = new MessageDao(); List<Key> purgable = new ArrayList<>(); String cursor = ""; do { List<Message> messageList = messageDao.listCreatedBefore(deadline.getTime(), cursor, 1000); if (messageList == null || messageList.size() == 0) break; cursor = MessageDao.getCursor(messageList); for (Message message : messageList) { purgable.add(message.getKey()); } } while (true); log.fine("Deleting " + purgable.size() + " old Message entries"); messageDao.deleteByKeys(purgable); }

Target:
private void purgeOldMessages() { Calendar deadline = Calendar.getInstance(); deadline.add(Calendar.YEAR, ONE_YEAR_AGO); log.info("Starting scan for Message entries older than: " + deadline.getTime()); MessageDao messageDao = new MessageDao(); List<Key> purgable = messageDao.listKeysCreatedBefore(deadline.getTime()); log.fine("Deleting " + purgable.size() + " old Message entries"); messageDao.deleteByKeys(purgable); }
Source:
public int hashCode() { int result = super.hashCode(); result = 31 * result + center.hashCode(); result = 31 * result + new Double(scale.getResolution()).hashCode(); return result; }

Target:
public int hashCode() { int result = super.hashCode(); result = 31 * result + (this.center != null ? this.center.hashCode() : 0); result = 31 * result + (this.scale != null ? this.scale.hashCode() : 0); return result; }
Source:
public Map<String,String> getArgs() { return args; }

Target:
public Map<String,String> getArgs() { if (args == null) { args = new HashMap<>(); } return args; }
Source:
private void scanFile(SensorContext sensorContext, InputFile inputFile, List<TreeVisitor> visitors, ScriptTree scriptTree) { JavaScriptVisitorContext context = new JavaScriptVisitorContext(scriptTree, inputFile.file(), settings); highlightSymbols(sensorContext.newSymbolTable().onFile(inputFile), context); sensorContext.newSymbolTable(); List<Issue> fileIssues = new ArrayList<>(); for (TreeVisitor visitor : visitors) { if (visitor instanceof CharsetAwareVisitor) { ((CharsetAwareVisitor) visitor).setCharset(fileSystem.encoding()); } if (visitor instanceof JavaScriptCheck) { fileIssues.addAll(((JavaScriptCheck) visitor).scanFile(context)); } else { visitor.scanTree(context); } } saveFileIssues(sensorContext, fileIssues, inputFile); }

Target:
private void scanFile(SensorContext sensorContext, InputFile inputFile, List<TreeVisitor> visitors, ScriptTree scriptTree) { JavaScriptVisitorContext context = new JavaScriptVisitorContext(scriptTree, inputFile.file(), settings); highlightSymbols(sensorContext.newSymbolTable().onFile(inputFile), context); List<Issue> fileIssues = new ArrayList<>(); for (TreeVisitor visitor : visitors) { if (visitor instanceof CharsetAwareVisitor) { ((CharsetAwareVisitor) visitor).setCharset(fileSystem.encoding()); } if (visitor instanceof JavaScriptCheck) { fileIssues.addAll(((JavaScriptCheck) visitor).scanFile(context)); } else { visitor.scanTree(context); } } saveFileIssues(sensorContext, fileIssues, inputFile); }
Source:
public void receivingAFindEventsRequest(final Map<String, String> requestData) throws Throwable { final Map<String, String> settings = new HashMap<String, String>(); settings.put(PlatformSmartmeteringKeys.EVENT_TYPE, this.getEventLogCategory()); settings.put(PlatformSmartmeteringKeys.KEY_BEGIN_DATE, requestData.get(PlatformSmartmeteringKeys.KEY_BEGIN_DATE)); settings.put(PlatformSmartmeteringKeys.KEY_END_DATE, requestData.get(PlatformSmartmeteringKeys.KEY_END_DATE)); settings.put(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION, requestData.get(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION)); final FindEventsRequest request = FindEventsRequestFactory.fromParameterMap(settings); final FindEventsAsyncResponse asyncResponse = this.requestClient.doRequest(request); assertNotNull("asyncResponse should not be null", asyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid()); }

Target:
public void receivingAFindEventsRequest(final Map<String, String> requestData) throws Throwable { final Map<String, String> settings = new HashMap<String, String>(); settings.put(PlatformSmartmeteringKeys.EVENT_TYPE, this.getEventLogCategory()); settings.put(PlatformSmartmeteringKeys.KEY_BEGIN_DATE, requestData.get(PlatformSmartmeteringKeys.KEY_BEGIN_DATE)); settings.put(PlatformSmartmeteringKeys.KEY_END_DATE, requestData.get(PlatformSmartmeteringKeys.KEY_END_DATE)); settings.put(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION, requestData.get(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION)); final FindEventsRequest findEventsRequest = FindEventsRequestFactory.fromParameterMap(settings); final FindEventsAsyncResponse findEventsAsyncResponse = this.smartMeteringManagementRequestClient .doRequest(findEventsRequest); assertNotNull("AsyncResponse should not be null", findEventsAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, findEventsAsyncResponse.getCorrelationUid()); }
Source:
protected void updateCompatibilityVersion() { DataCenterWithCluster dataCenterWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster == null) { return; } final StoragePool dataCenter = dataCenterWithCluster.getDataCenter(); if (dataCenter == null) { return; } AsyncQuery asyncQuery = new AsyncQuery(new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { ArrayList<Version> versions = (ArrayList<Version>) result; versions.add(0, null); Version selectedVersion; selectedVersion = getModel().getCompatibilityVersion().getSelectedItem(); if (selectedVersion != null && versions.contains(selectedVersion)) { getModel().getCompatibilityVersion().setItems(versions, selectedVersion); } else { getModel().getCompatibilityVersion().setItems(versions); } } }); AsyncDataProvider.getInstance().getDataCenterVersions(asyncQuery, dataCenter.getId()); }

Target:
protected void updateCompatibilityVersion() { DataCenterWithCluster dataCenterWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster == null) { return; } final StoragePool dataCenter = dataCenterWithCluster.getDataCenter(); if (dataCenter == null) { return; } AsyncQuery asyncQuery = new AsyncQuery(new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { List<Version> versions = (List<Version>) result; versions.add(0, null); Version selectedVersion; selectedVersion = getModel().getCustomCompatibilityVersion().getSelectedItem(); if (selectedVersion != null && versions.contains(selectedVersion)) { getModel().getCustomCompatibilityVersion().setItems(versions, selectedVersion); } else { getModel().getCustomCompatibilityVersion().setItems(versions); } } }); AsyncDataProvider.getInstance().getDataCenterVersions(asyncQuery, dataCenter.getId()); }
Source:
private Map<Integer, String> getRemovableTimestampedSnapshots(Metadata metadata, int numberToKeep, int keepPeriod) { Map<Integer, SnapshotVersionDecomposition> snapshots = new HashMap<>(); Map<Integer, String> mapToRemove = new HashMap<>(); metadata.getVersioning() .getSnapshotVersions() .forEach(e -> { if ("jar".equals(e.getExtension())) { SnapshotVersionDecomposition snapshotVersion = SnapshotVersionDecomposition.of(e.getVersion()); if (!SnapshotVersionDecomposition.INVALID.equals(snapshotVersion)) { snapshots.put(snapshotVersion.getBuildNumber(), snapshotVersion); } } }); if (numberToKeep != 0 && snapshots.size() > numberToKeep) { snapshots.forEach((k, v) -> { if (mapToRemove.size() < snapshots.size() - numberToKeep) { mapToRemove.put(k, v.getVersion()); } }); } else if (numberToKeep == 0 && keepPeriod != 0) { snapshots.forEach((k, v) -> { try { if (keepPeriod < getDifferenceDays(v.getTimestamp())) { mapToRemove.put(k, v.getVersion()); } } catch (ParseException e) { logger.error(e.getMessage(), e); } }); } return mapToRemove; }

Target:
private Map<Integer, String> getRemovableTimestampedSnapshots(Metadata metadata, int numberToKeep, int keepPeriod) { Map<Integer, SnapshotVersionDecomposition> snapshots = new HashMap<>(); Map<Integer, String> mapToRemove = new HashMap<>(); metadata.getVersioning() .getSnapshotVersions() .forEach(e -> { if ("jar".equals(e.getExtension())) { SnapshotVersionDecomposition snapshotVersion = SnapshotVersionDecomposition.of(e.getVersion()); if (SnapshotVersionDecomposition.INVALID.equals(snapshotVersion)) { logger.warn("Received invalid snapshot version {}", snapshotVersion); return; } snapshots.put(snapshotVersion.getBuildNumber(), snapshotVersion); } }); if (numberToKeep != 0 && snapshots.size() > numberToKeep) { snapshots.forEach((k, v) -> { if (mapToRemove.size() < snapshots.size() - numberToKeep) { mapToRemove.put(k, v.getVersion()); } }); } else if (numberToKeep == 0 && keepPeriod != 0) { snapshots.forEach((k, v) -> { try { if (keepPeriod < getDifferenceDays(v.getTimestamp())) { mapToRemove.put(k, v.getVersion()); } } catch (ParseException e) { logger.error(e.getMessage(), e); } }); } return mapToRemove; }
Source:
public StreamsSnapshotReader(CorfuRuntime runtime, LogReplicationConfig config) { this.rt = runtime; this.rt.parseConfigurationString(runtime.getLayoutServers().get(0)).connect(); this.maxDataMsgSize = config.getMaxDataMsgSize(); this.maxDataSize = maxDataMsgSize *(100 - DATA_MSG_OVERHEAD_FRACTION)/100; streams = config.getStreamsToReplicate(); log.info("The maxDataNessageSize maxDataSize ", maxDataMsgSize, maxDataSize); }

Target:
public StreamsSnapshotReader(CorfuRuntime runtime, LogReplicationConfig config) { this.rt = runtime; this.rt.parseConfigurationString(runtime.getLayoutServers().get(0)).connect(); this.maxDataSizePerMsg = config.getMaxDataSizePerMsg(); streams = config.getStreamsToReplicate(); log.debug("The maxDataSizePerMsg ", maxDataSizePerMsg); }
Source:
public AsyncPoolImpl(String name, Lifecycle<T> lifecycle, int maxSize, long idleTimeout, long waiterTimeout, ScheduledExecutorService timeoutExecutor, int maxWaiters, Strategy strategy, int minSize, RateLimiter rateLimiter, Clock clock, LongTracker waitTimeTracker) { ArgumentUtil.notNull(lifecycle, "lifecycle"); ArgumentUtil.notNull(timeoutExecutor, "timeoutExecutor"); ArgumentUtil.notNull(strategy, "strategy"); ArgumentUtil.notNull(rateLimiter, "rateLimiter"); _poolName = name + "/" + Integer.toHexString(hashCode()); _lifecycle = lifecycle; _maxSize = maxSize; _idleTimeout = idleTimeout; _waitTimeout = waiterTimeout; _timeoutExecutor = timeoutExecutor; _maxWaiters = maxWaiters; _strategy = strategy; _minSize = minSize; _rateLimiter = rateLimiter; _clock = clock; _statsTracker = new AsyncPoolStatsTracker( () -> _lifecycle.getStats(), () -> _maxSize, () -> _minSize, () -> { synchronized (_lock) { return _poolSize; } }, () -> { synchronized (_lock) { return _checkedOut; } }, () -> { synchronized (_lock) { return _idle.size(); } }, clock, waitTimeTracker); }

Target:
public AsyncPoolImpl(String name, Lifecycle<T> lifecycle, int maxSize, long idleTimeout, long waiterTimeout, ScheduledExecutorService timeoutExecutor, int maxWaiters, Strategy strategy, int minSize, RateLimiter rateLimiter, Clock clock, LongTracker waitTimeTracker) { ArgumentUtil.notNull(lifecycle, "lifecycle"); ArgumentUtil.notNull(timeoutExecutor, "timeoutExecutor"); ArgumentUtil.notNull(strategy, "strategy"); ArgumentUtil.notNull(rateLimiter, "rateLimiter"); _poolName = name + "/" + Integer.toHexString(hashCode()); _lifecycle = lifecycle; _maxSize = maxSize; _idleTimeout = idleTimeout; _waiterTimeout = waiterTimeout; _timeoutExecutor = timeoutExecutor; _maxWaiters = maxWaiters; _strategy = strategy; _minSize = minSize; _rateLimiter = rateLimiter; _clock = clock; _statsTracker = new AsyncPoolStatsTracker( () -> _lifecycle.getStats(), () -> _maxSize, () -> _minSize, () -> { synchronized (_lock) { return _poolSize; } }, () -> { synchronized (_lock) { return _checkedOut; } }, () -> { synchronized (_lock) { return _idle.size(); } }, clock, waitTimeTracker); }
Source:
public static ResourceFilter ofType(String typeId) { return new ResourceFilter(false, null, typeId); }

Target:
public static ResourceFilter.Builder ofType(String typeId) { return new ResourceFilter.Builder(false, null, typeId); }
Source:
public void loadKeyRSA() throws IOException, GeneralSecurityException { File file = new File(this.getClass().getResource("rsa").getFile()); assertkeyPair(file, null); }

Target:
public void loadKeyRSA() throws IOException, GeneralSecurityException { File file = new File(this.getClass().getResource("rsa").getFile()); assertKeyPairNotNull(file, null); }
Source:
public void shouldDoAsyncConversionGivenConverterName() throws IOException { ConversionCacheHolder.deleteCache(); File file = FileUtils.getResourceFileFromContext("test-data/hello.doc"); Blob blob = Blobs.createBlob(file, "application/msword", null, "hello.doc"); BlobHolder bh = new SimpleBlobHolder(blob); String id = conversionService.scheduleConversion("identity", bh, null); assertNotNull(id); eventService.waitForAsyncCompletion(); BlobHolder result = conversionService.getConversionResult(id, true); assertNotNull(result); List<Blob> blobs = result.getBlobs(); assertEquals(1, blobs.size()); Blob resultBlob = blobs.get(0); assertEquals(blob.getFilename(), resultBlob.getFilename()); assertEquals(blob.getMimeType(), resultBlob.getMimeType()); }

Target:
public void shouldDoAsyncConversionGivenConverterName() throws IOException { File file = FileUtils.getResourceFileFromContext("test-data/hello.doc"); Blob blob = Blobs.createBlob(file, "application/msword", null, "hello.doc"); BlobHolder bh = new SimpleBlobHolder(blob); String id = conversionService.scheduleConversion("identity", bh, null); assertNotNull(id); eventService.waitForAsyncCompletion(); BlobHolder result = conversionService.getConversionResult(id, true); assertNotNull(result); List<Blob> blobs = result.getBlobs(); assertEquals(1, blobs.size()); Blob resultBlob = blobs.get(0); assertEquals(blob.getFilename(), resultBlob.getFilename()); assertEquals(blob.getMimeType(), resultBlob.getMimeType()); }
Source:
public boolean blobExists(String key, Subject who) throws AuthorizationException, KeyNotFoundException { who = checkAndGetSubject(who); validateKey(key); SettableBlobMeta meta = getStoredBlobMeta(key); aclHandler.hasPermissions(meta.get_acl(), READ, who, key); try { BlobStoreFile blobStoreFile = hbs.read(DATA_PREFIX + key); return blobStoreFile.exists(); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public boolean blobExists(String key, Subject who) throws AuthorizationException { try { who = checkAndGetSubject(who); validateKey(key); SettableBlobMeta meta = getStoredBlobMeta(key); aclHandler.hasPermissions(meta.get_acl(), READ, who, key); } catch (KeyNotFoundException e) { return false; } return true; }
Source:
public void setBaseClassPathForScanning(Iterable<URL> urls) { this.baseClassPathForScanning = urls; }

Target:
public void setBaseClassPathForScanning(Iterable<URL> urls) { if (baseClassPathForScanning == urls) return; if (baseClassPathForScanning != null) throw new IllegalStateException("Cannot change base class path for scanning (in "+this+")"); if (catalog != null) throw new IllegalStateException("Cannot set base class path for scanning after catalog has been loaded (in "+this+")"); this.baseClassPathForScanning = urls; }
Source:
public ProjectApi create(String name) throws RestApiException { ProjectInput projectInput = new ProjectInput(); projectInput.name = name; return this.create(projectInput); }

Target:
public ProjectApi create(String name) throws RestApiException { ProjectInput projectInput = new ProjectInput(); projectInput.name = name; return create(projectInput); }