auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public SiteRequestCondition(SiteSet siteSet, SiteResolver siteResolver, Set<String> includedSites, Set<String> excludedSites){ Preconditions.checkNotNull(siteResolver); Preconditions.checkNotNull(siteSet); Preconditions.checkNotNull(includedSites); this.siteSet = siteSet; this.siteResolver = siteResolver; this.includedSites = includedSites.isEmpty() ? siteSet.getSiteKeys() : ImmutableSet.copyOf(includedSites); this.excludedSites = excludedSites == null ? ImmutableSet.<String>of() : ImmutableSet.copyOf(excludedSites); }

Target:
private SiteRequestCondition(SiteSet siteSet, SiteResolver siteResolver, Set<String> includedSites, Set<String> excludedSites){ this.siteSet = Preconditions.checkNotNull(siteSet); this.siteResolver = Preconditions.checkNotNull(siteResolver); this.includedSites = ImmutableSet.copyOf(Preconditions.checkNotNull(includedSites)); this.excludedSites = ImmutableSet.copyOf(Preconditions.checkNotNull(excludedSites)); }
Source:
public boolean onCreateOptionsMenu(Menu menu) { MenuItem buttonSettings = menu.add(R.string.title_settings); buttonSettings.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); buttonSettings.setOnMenuItemClickListener(new MenuItem. OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { Intent settingsIntent = new Intent(EntryLogsActivity.this, SettingsActivity.class); settingsIntent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsFragment.class.getName()); settingsIntent.putExtra(PreferenceActivity.EXTRA_NO_HEADERS, true); EntryLogsActivity.this.startActivity(settingsIntent); return false; } }); MenuItem buttonSignout = menu.add(R.string.title_signout); buttonSignout.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); buttonSignout.setOnMenuItemClickListener(new MenuItem. OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { ApiInterface.getInstance().logOut(); Intent logOut = new Intent(EntryLogsActivity.this, LoginActivity.class); logOut.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(logOut); return false; } }); return true; }

Target:
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.items, menu); return super.onCreateOptionsMenu(menu); }
Source:
private XmlEntry processEntry(@NonNull Element entryElement, @NonNull Element displayEl, @NonNull XmlEntry parentEntry, int quark, ITmfStateSystem ss) { ITmfXmlStateAttribute display = fFactory.createStateAttribute(displayEl, parentEntry); int displayQuark = display.getAttributeQuark(quark, null); if (displayQuark == IXmlStateSystemContainer.ERROR_QUARK) { return new XmlEntry(quark, parentEntry.getTrace(), String.format("Unknown display quark for %s", ss.getAttributeName(quark)), ss); } long entryStart = ss.getStartTime(); long entryEnd = ss.getCurrentEndTime(); try { ITmfStateInterval oneInterval = ss.querySingleState(entryStart, displayQuark); while (oneInterval.getStateValue().isNull()) { long ts = oneInterval.getEndTime() + 1; if (ts > ss.getCurrentEndTime()) { break; } oneInterval = ss.querySingleState(ts, displayQuark); } entryStart = oneInterval.getStartTime(); oneInterval = ss.querySingleState(entryEnd, displayQuark); while (oneInterval.getStateValue().isNull()) { long ts = oneInterval.getStartTime() - 1; if (ts < ss.getStartTime()) { break; } oneInterval = ss.querySingleState(ts, displayQuark); } entryEnd = oneInterval.getEndTime(); } catch (StateSystemDisposedException e) { } return new XmlEntry(quark, displayQuark, parentEntry.getTrace(), ss.getAttributeName(quark), entryStart, entryEnd, EntryDisplayType.DISPLAY, ss, entryElement); }

Target:
private XmlEntry processEntry(@NonNull Element entryElement, @NonNull Element displayEl, @NonNull XmlEntry parentEntry, int quark, ITmfStateSystem ss) { ITmfXmlStateAttribute display = fFactory.createStateAttribute(displayEl, parentEntry); int displayQuark = display.getAttributeQuark(quark, null); if (displayQuark == IXmlStateSystemContainer.ERROR_QUARK) { return new XmlEntry(quark, parentEntry.getTrace(), String.format("Unknown display quark for %s", ss.getAttributeName(quark)), ss); } long entryStart = ss.getStartTime(); long entryEnd = ss.getCurrentEndTime() + 1; try { ITmfStateInterval oneInterval = ss.querySingleState(entryStart, displayQuark); while (oneInterval.getStateValue().isNull()) { long ts = oneInterval.getEndTime() + 1; if (ts > ss.getCurrentEndTime()) { break; } oneInterval = ss.querySingleState(ts, displayQuark); } entryStart = oneInterval.getStartTime(); oneInterval = ss.querySingleState(entryEnd - 1, displayQuark); while (oneInterval.getStateValue().isNull()) { long ts = oneInterval.getStartTime() - 1; if (ts < ss.getStartTime()) { break; } oneInterval = ss.querySingleState(ts, displayQuark); } entryEnd = oneInterval.getEndTime() + 1; } catch (StateSystemDisposedException e) { } return new XmlEntry(quark, displayQuark, parentEntry.getTrace(), ss.getAttributeName(quark), entryStart, entryEnd, EntryDisplayType.DISPLAY, ss, entryElement); }
Source:
public static IconvResult encode(long pointer, CharBuffer in, ByteBuffer out) { boolean isInDirect = in.isDirect(); boolean isOutDirect = out.isDirect(); int res = 0; IconvResult result = new IconvResult(); CharBuffer bufferInData = copyCharBufferData(in); ByteBuffer bufferOutData = copyByteBufferData(out); if (isInDirect && isOutDirect) { res = encodeNativeBuffer(pointer, in, out, result, in.position(), in.limit(), out.position(), out.limit()); } else if(!isInDirect && !isOutDirect) { res = encodeNativeArray(pointer, bufferInData.array(), bufferOutData.array(), result, in.position(), in.limit(), out.position(), out.limit()); } else if(isInDirect && !isOutDirect) { res = encodeHybridBufferArray(pointer, in, bufferOutData.array(), result, in.position(), in.limit(), out.position(), out.limit()); } else { res = encodeHybridArrayBuffer(pointer, bufferInData.array(), out, result, in.position(), in.limit(), out.position(), out.limit()); } ConversionResult conversionState = ConversionResult.getResult(res); result.setResultCode(conversionState); in.position(in.position() + result.getBytesReadFromSource()/2); out.position(out.position() + result.getBytesWrittenToDestination()); out.limit(out.position()); return result; }

Target:
public static IconvResult encode(long pointer, CharBuffer in, ByteBuffer out) { boolean isInDirect = in.isDirect(); boolean isOutDirect = out.isDirect(); int res = 0; IconvResult result = new IconvResult(); CharBuffer bufferInData = copyCharBufferData(in); ByteBuffer bufferOutData = copyByteBufferData(out); if (isInDirect && isOutDirect) { res = encodeNativeBuffer(pointer, in, out, result, in.position(), in.limit(), out.position(), out.limit()); } else if(!isInDirect && !isOutDirect) { res = encodeNativeArray(pointer, bufferInData.array(), bufferOutData.array(), result, bufferInData.position(), bufferInData.limit(), bufferOutData.position(), bufferOutData.limit()); } else if(isInDirect && !isOutDirect) { res = encodeHybridBufferArray(pointer, in, bufferOutData.array(), result, in.position(), in.limit(), bufferOutData.position(), bufferOutData.limit()); } else { res = encodeHybridArrayBuffer(pointer, bufferInData.array(), out, result, bufferInData.position(), bufferInData.limit(), out.position(), out.limit()); } ConversionResult conversionState = ConversionResult.getResult(res); result.setResultCode(conversionState); in.position(in.position() + result.getBytesReadFromSource()/2); if (out != bufferOutData) { bufferOutData.limit(result.getBytesWrittenToDestination()); out.put(bufferOutData); } else { out.position(out.position() + result.getBytesWrittenToDestination()); } return result; }
Source:
public View getView(int position, View convertView, ViewGroup parent) { View vwRet = convertView; if (null == vwRet) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); vwRet = inflater.inflate(R.layout.list_language_row, null); } View delBtn = vwRet.findViewById(R.id.button_delete); View dldBtn = vwRet.findViewById(R.id.button_download); View optBtn = vwRet.findViewById(R.id.button_options); delBtn.setOnClickListener(this); dldBtn.setOnClickListener(this); optBtn.setOnClickListener(this); delBtn.setVisibility(View.GONE); dldBtn.setVisibility(View.GONE); optBtn.setVisibility(View.GONE); delBtn.setTag(SUPPORTED_LANGUAGES[position]); dldBtn.setTag(SUPPORTED_LANGUAGES[position]); optBtn.setTag(SUPPORTED_LANGUAGES[position]); if (null != this.customizer) { this.customizer.customizeUI(vwRet, SUPPORTED_LANGUAGES[position]); } return vwRet; }

Target:
public View getView(int position, View convertView, ViewGroup parent) { View vwRet = convertView; if (null == vwRet) { vwRet = LayoutInflater.from(context).inflate(R.layout.list_language_row, null); } View delBtn = vwRet.findViewById(R.id.button_delete); View dldBtn = vwRet.findViewById(R.id.button_download); View optBtn = vwRet.findViewById(R.id.button_options); delBtn.setOnClickListener(this); dldBtn.setOnClickListener(this); optBtn.setOnClickListener(this); delBtn.setVisibility(View.GONE); dldBtn.setVisibility(View.GONE); optBtn.setVisibility(View.GONE); delBtn.setTag(SUPPORTED_LANGUAGES[position]); dldBtn.setTag(SUPPORTED_LANGUAGES[position]); optBtn.setTag(SUPPORTED_LANGUAGES[position]); if (null != this.customizer) { this.customizer.customizeUI(vwRet, SUPPORTED_LANGUAGES[position]); } return vwRet; }
Source:
private UnhandledErrorListener getUnhandledErrorListener(){ return new UnhandledErrorListener() { @Override public void unhandledError(String message, Throwable e) { LOG.error("unhandled exception ",e); } }; }

Target:
private UnhandledErrorListener getUnhandledErrorListener(){ return new UnhandledErrorListener() { @Override public void unhandledError(String message, Throwable e) { LOG.error("unhandled exception: "+ message,e); } }; }
Source:
public JobConfig generateJobConfig(Layout base, Layout transformed) { PartitionInfo partitionInfo; try { partitionInfo = ProtoUtils.toHiveLayout(base.toProto()); } catch (InvalidProtocolBufferException e) { return new CompactConfig(null, base.getLocation().toString(), transformed.getLocation().toString(), mLayoutType, mNumFiles); } String serdeClass = partitionInfo.getStorage().getStorageFormat().getSerde(); String inputFormat = partitionInfo.getStorage().getStorageFormat().getInputFormat(); ArrayList<SchemaField> colList = new ArrayList<>(partitionInfo.getDataColsList().size()); for (FieldSchema col : partitionInfo.getDataColsList()) { colList.add(new SchemaField(col.getId(), col.getName(), col.getType(), col.getOptional(), col.getComment())); } alluxio.job.transform.PartitionInfo transformPartInfo = new alluxio.job.transform.PartitionInfo(serdeClass, inputFormat, partitionInfo.getStorage().getSerdeParametersMap(), colList); return new CompactConfig(transformPartInfo, base.getLocation().toString(), transformed.getLocation().toString(), mLayoutType, mNumFiles); }

Target:
public JobConfig generateJobConfig(Layout base, Layout transformed) { PartitionInfo partitionInfo; try { partitionInfo = ProtoUtils.toHiveLayout(base.toProto()); } catch (InvalidProtocolBufferException e) { throw new IllegalStateException(e); } String serdeClass = partitionInfo.getStorage().getStorageFormat().getSerde(); String inputFormat = partitionInfo.getStorage().getStorageFormat().getInputFormat(); ArrayList<FieldSchema> colList = new ArrayList<>(partitionInfo.getDataColsList().size()); for (alluxio.grpc.table.FieldSchema col : partitionInfo.getDataColsList()) { colList.add(new FieldSchema(col.getId(), col.getName(), col.getType(), col.getComment())); } alluxio.job.transform.PartitionInfo transformPartInfo = new alluxio.job.transform.PartitionInfo(serdeClass, inputFormat, new HashMap<>(partitionInfo.getStorage().getStorageFormat().getSerdelibParametersMap()), colList); return new CompactConfig(transformPartInfo, base.getLocation().toString(), transformed.getLocation().toString(), mLayoutType, mNumFiles); }
Source:
public DatastreamJettyStandaloneLauncher(int port, int parseqThreadPoolSize, ResourceFactory resourceFactory, String... packages) { _port = port; _packages = packages; final RestLiConfig config = new RestLiConfig(); config.setDocumentationRequestHandler(new DefaultDocumentationRequestHandler()); config.setServerNodeUri(URI.create("/")); config.addResourcePackageNames(_packages); final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(parseqThreadPoolSize); final Engine engine = new EngineBuilder() .setTaskExecutor(scheduler) .setTimerScheduler(scheduler) .build(); final RestLiServer restServer = new RestLiServer(config, resourceFactory, engine); final TransportDispatcher dispatcher = new DelegatingTransportDispatcher(restServer, restServer); _httpJettyServer = (HttpJettyServer) new HttpServerFactory(FilterChains.empty()).createServer(0, dispatcher); }

Target:
public DatastreamJettyStandaloneLauncher(int port, int parseqThreadPoolSize, ResourceFactory resourceFactory, String... packages) { _port = port; _packages = packages; final RestLiConfig config = new RestLiConfig(); config.setDocumentationRequestHandler(new DefaultDocumentationRequestHandler()); config.setServerNodeUri(URI.create("/")); config.addResourcePackageNames(_packages); final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(parseqThreadPoolSize); final Engine engine = new EngineBuilder() .setTaskExecutor(scheduler) .setTimerScheduler(scheduler) .build(); final RestLiServer restServer = new RestLiServer(config, resourceFactory, engine); final TransportDispatcher dispatcher = new DelegatingTransportDispatcher(restServer, restServer); _httpJettyServer = (HttpJettyServer) new HttpServerFactory(FilterChains.empty()).createServer(port, dispatcher); }
Source:
public String getRelativePath() { int lastDelimiter = path.lastIndexOf(File.separatorChar); String relativePath = lastDelimiter >= 0 ? path.substring(0, lastDelimiter) : ""; return path.indexOf('*', lastDelimiter + 1) > -1 ? relativePath : path; }

Target:
public String getRelativePath() { int lastDelimiter = path.lastIndexOf(File.separatorChar); if (path.indexOf('*', lastDelimiter + 1) > -1) { return lastDelimiter >= 0 ? path.substring(0, lastDelimiter) : ""; } return path; }
Source:
public List<FeatureDto> getAllFeatures() { List<FeatureDto> features = new ArrayList<FeatureDto>(); try { for (Feature feature : featuresService.listFeatures()) { features.add(getFeatureView(feature)); } } catch (Exception ex) { logger.warn("getAllFeatures Exception: " + ex.getMessage()); } return features; }

Target:
public List<FeatureDetails> getAllFeatures() { List<FeatureDetails> features = new ArrayList<FeatureDetails>(); try { for (Feature feature : featuresService.listFeatures()) { features.add(getFeatureView(feature)); } } catch (Exception ex) { logger.warn("Could not obtain all features.", ex); } return features; }
Source:
public void testCrossCacheTxInAnotherThread() throws Exception { executeTestForAllCaches(new CI2Exc<Ignite, IgniteCache<Integer, Integer>>() { @Override public void applyx(Ignite ignite, final IgniteCache<Integer, Integer> cache) throws Exception { if (transactionConcurrency() == TransactionConcurrency.OPTIMISTIC && cache.getConfiguration(CacheConfiguration.class).getCacheMode() == LOCAL) return; for (TransactionIsolation isolation : TransactionIsolation.values()) { final IgniteCache<Integer, Integer> otherCache = ignite.getOrCreateCache( cacheConfiguration("otherCache", PARTITIONED, 0, false)); final Transaction tx = ignite.transactions().txStart(transactionConcurrency(), isolation); final AtomicInteger cntr = new AtomicInteger(0); cache.put(-1, -1); otherCache.put(-1, -1); tx.suspend(); for (int i = 0; i < 10; i++) { GridTestUtils.runAsync(new Runnable() { @Override public void run() { tx.resume(); assertEquals(ACTIVE, tx.state()); cache.put(-1, -1); otherCache.put(-1, -1); cache.put(cntr.get(), cntr.get()); otherCache.put(cntr.get(), cntr.getAndIncrement()); tx.suspend(); } }).get(FUT_TIMEOUT); } tx.resume(); cache.remove(-1); otherCache.remove(-1); tx.commit(); assertEquals(COMMITTED, tx.state()); for (int i = 0; i < cntr.get(); i++) { assertEquals(i, (int)cache.get(i)); assertEquals(i, (int)otherCache.get(i)); } assertFalse(cache.containsKey(-1)); assertFalse(otherCache.containsKey(-1)); cache.removeAll(); otherCache.removeAll(); } } }); }

Target:
public void testCrossCacheTxInAnotherThread() throws Exception { executeTestForAllCaches(new CI2Exc<Ignite, IgniteCache<Integer, Integer>>() { @Override public void applyx(Ignite ignite, final IgniteCache<Integer, Integer> cache) throws Exception { if (transactionConcurrency() == TransactionConcurrency.OPTIMISTIC && cache.getConfiguration(CacheConfiguration.class).getCacheMode() == LOCAL) return; for (TransactionIsolation isolation : TransactionIsolation.values()) { final IgniteCache<Integer, Integer> otherCache = ignite.getOrCreateCache( cacheConfiguration("otherCache", PARTITIONED, 0, false)); final Transaction tx = ignite.transactions().txStart(transactionConcurrency(), isolation); final AtomicInteger cntr = new AtomicInteger(0); cache.put(-1, -1); otherCache.put(-1, -1); tx.suspend(); for (int i = 0; i < 10; i++) { GridTestUtils.runAsync(() -> { tx.resume(); assertEquals(ACTIVE, tx.state()); cache.put(-1, -1); otherCache.put(-1, -1); cache.put(cntr.get(), cntr.get()); otherCache.put(cntr.get(), cntr.getAndIncrement()); tx.suspend(); }).get(FUT_TIMEOUT); } tx.resume(); cache.remove(-1); otherCache.remove(-1); tx.commit(); assertEquals(COMMITTED, tx.state()); for (int i = 0; i < cntr.get(); i++) { assertEquals(i, (int)cache.get(i)); assertEquals(i, (int)otherCache.get(i)); } assertFalse(cache.containsKey(-1)); assertFalse(otherCache.containsKey(-1)); cache.removeAll(); otherCache.removeAll(); } } }); }
Source:
private AddServiceRequest(OperationType operationType, ConfigRecommendationStrategy recommendationStrategy, ProvisionAction provisionAction, String stackName, String stackVersion, Set<Service> services, Set<Component> components, Configuration configuration) { this.operationType = operationType; this.recommendationStrategy = null != recommendationStrategy ? recommendationStrategy : ConfigRecommendationStrategy.NEVER_APPLY; this.provisionAction = null != provisionAction ? provisionAction : ProvisionAction.INSTALL_AND_START; this.stackName = stackName; this.stackVersion = stackVersion; this.services = null != services ? services : emptySet(); this.components = null != components ? components : emptySet(); this.configuration = null != configuration ? configuration : new Configuration(new HashMap<>(), new HashMap<>()); checkNotNull(operationType, "operationType is mandatory"); checkArgument(!this.services.isEmpty() || !this.components.isEmpty(), "Either services or components must be specified"); }

Target:
private AddServiceRequest(OperationType operationType, ConfigRecommendationStrategy recommendationStrategy, ProvisionAction provisionAction, String stackName, String stackVersion, Set<Service> services, Set<Component> components, Configuration configuration) { this.operationType = null != operationType ? operationType : OperationType.ADD_SERVICE; this.recommendationStrategy = null != recommendationStrategy ? recommendationStrategy : ConfigRecommendationStrategy.NEVER_APPLY; this.provisionAction = null != provisionAction ? provisionAction : ProvisionAction.INSTALL_AND_START; this.stackName = stackName; this.stackVersion = stackVersion; this.services = null != services ? services : emptySet(); this.components = null != components ? components : emptySet(); this.configuration = null != configuration ? configuration : new Configuration(new HashMap<>(), new HashMap<>()); checkArgument(!this.services.isEmpty() || !this.components.isEmpty(), "Either services or components must be specified"); }
Source:
private Node createFilterBox() { filterTextField = new FilterTextField("") .setOnConfirm((text) -> { Platform.runLater(() -> ui.triggerEvent(new PanelReloadingEvent())); applyStringFilter(text); Platform.runLater(() -> ui.triggerEvent(new PanelReloadedEvent())); return text; }) .setOnCancel(this::requestFocus); filterTextField.setId(guiController.getDefaultRepo() + "_col" + panelIndex + "_filterTextField"); filterTextField.setMinWidth(388); filterTextField.setMaxWidth(388); ui.registerEvent(onModelUpdate); filterTextField.setOnMouseClicked(e -> ui.triggerEvent(new PanelClickedEvent(panelIndex))); HBox layout = new HBox(); layout.getChildren().addAll(filterTextField); layout.setPadding(new Insets(0, 0, 3, 0)); setupPanelDragEvents(layout); return layout; }

Target:
private Node createFilterBox() { filterTextField = new FilterTextField("") .setOnConfirm((text) -> { Platform.runLater(() -> ui.triggerEvent(new ApplyingFilterEvent(this))); applyStringFilter(text); return text; }) .setOnCancel(this::requestFocus); filterTextField.setId(guiController.getDefaultRepo() + "_col" + panelIndex + "_filterTextField"); filterTextField.setMinWidth(388); filterTextField.setMaxWidth(388); ui.registerEvent(onModelUpdate); filterTextField.setOnMouseClicked(e -> ui.triggerEvent(new PanelClickedEvent(panelIndex))); HBox layout = new HBox(); layout.getChildren().addAll(filterTextField); layout.setPadding(new Insets(0, 0, 3, 0)); setupPanelDragEvents(layout); return layout; }
Source:
public void onError(Throwable t) { synchronized (this) { if (_sessionState != State.CLOSED || _closeStatus == null) throw new IllegalArgumentException(); if (!_closeStatus.isAbnormal()) _closeStatus = new CloseStatus(CloseStatus.SERVER_ERROR, t); if (_closeStatus.getCause() == null) _closeStatus.initCause(t); } }

Target:
public void onError(Throwable t) { synchronized (this) { if (_sessionState != State.CLOSED || _closeStatus == null) throw new IllegalArgumentException(); if (!_closeStatus.isAbnormal()) _closeStatus = new CloseStatus(CloseStatus.SERVER_ERROR, t); if (_closeStatus.getCause() == null) _closeStatus = new CloseStatus(_closeStatus.getCode(), _closeStatus.getReason(), t); } }
Source:
public void refreshView(State state) { super.refreshView(state); mState = state; final Product product = mState.getProduct(); }

Target:
public void refreshView(State state) { super.refreshView(state); mState = state; }
Source:
public static boolean parseBoolean(String str) { switch (str.toUpperCase(Locale.ENGLISH)) { case "TRUE": case "T": case "YES": case "Y": return true; case "FALSE": case "F": case "NO": case "N": return false; default: throw new IllegalArgumentException("Unknown boolean value, must 'True' or 'False' but was '" + str + "'"); } }

Target:
public static boolean parseBoolean(String str) { switch (str.toUpperCase(Locale.ENGLISH)) { case "TRUE": case "T": case "YES": case "Y": return true; case "FALSE": case "F": case "NO": case "N": return false; default: throw new IllegalArgumentException( "Unknown BuySell value, must be 'True' or 'False' but was '" + str + "'; " + "parser is case insensitive and also accepts 'T', 'Yes', 'Y', 'F', 'No' and 'N'"); } }
Source:
public void shouldUpdatePersonAddress() throws Exception { String personId = "CCC"; Person.Address preferredAddress = prepareAddress(); URI url = config.toInstancePathWithParams("/person/{personUuid}/address/{addressUuid}?v=full", personId, preferredAddress.getUuid()); personResource.updatePersonAddress(config, personId, preferredAddress); verify(restOperations).exchange(eq(url), eq(HttpMethod.POST), requestCaptor.capture(), eq(String.class)); assertThat(requestCaptor.getValue().getHeaders(), equalTo(getHeadersForPostWithoutResponse(config))); assertThat(JsonUtils.readJson(requestCaptor.getValue().getBody(), JsonObject.class), equalTo(readFromFile(UPDATE_PERSON_ADDRESS_JSON, JsonObject.class))); }

Target:
public void shouldUpdatePersonAddress() throws Exception { String personId = "CCC"; Person.Address preferredAddress = prepareAddress(); URI url = config.toInstancePathWithParams("/person/{personUuid}/address/{addressUuid}", personId, preferredAddress.getUuid()); personResource.updatePersonAddress(config, personId, preferredAddress); verify(restOperations).exchange(eq(url), eq(HttpMethod.POST), requestCaptor.capture(), eq(String.class)); assertThat(requestCaptor.getValue().getHeaders(), equalTo(getHeadersForPostWithoutResponse(config))); assertThat(JsonUtils.readJson(requestCaptor.getValue().getBody(), JsonObject.class), equalTo(readFromFile(UPDATE_PERSON_ADDRESS_JSON, JsonObject.class))); }
Source:
public NodeProvisioner.PlannedNode build() { KubernetesCloud cloud = getCloud(); PodTemplate t = getTemplate(); try { return new NodeProvisioner.PlannedNode(t.getDisplayName(), Futures.immediateFuture(KubernetesSlave .builder() .podTemplate(cloud.getUnwrappedTemplate(t)) .cloud(cloud) .build()), getNumExecutors()); } catch (IOException | Descriptor.FormException e) { throw new RuntimeException(e); } }

Target:
public NodeProvisioner.PlannedNode build() { KubernetesCloud cloud = getCloud(); PodTemplate t = getTemplate(); Future f; try { KubernetesSlave agent = KubernetesSlave .builder() .podTemplate(cloud.getUnwrappedTemplate(t)) .cloud(cloud) .build(); f = Futures.immediateFuture(agent); } catch (IOException | Descriptor.FormException e) { f = Futures.immediateFailedFuture(e); } return new NodeProvisioner.PlannedNode(t.getDisplayName(), f, getNumExecutors()); }
Source:
public Mono<EventHubManagementNode> getManagementNode() { if (isDisposed()) { return Mono.error(logger.logExceptionAsError(new IllegalStateException(String.format( "connectionId[%s]: Connection is disposed. Cannot get management instance", connectionId)))); } return getReactorConnection().then(Mono.fromCallable(() -> { if (managementChannel == null) { this.managementChannel = new ManagementChannel( createRequestResponseChannel(MANAGEMENT_SESSION_NAME, MANAGEMENT_LINK_NAME, MANAGEMENT_ADDRESS), eventHubName, tokenCredential, tokenManagerProvider, this.messageSerializer, scheduler); } return managementChannel; })); }

Target:
public Mono<EventHubManagementNode> getManagementNode() { if (isDisposed()) { return Mono.error(logger.logExceptionAsError(new IllegalStateException(String.format( "connectionId[%s]: Connection is disposed. Cannot get management instance", connectionId)))); } return getReactorConnection().then(Mono.fromCallable(this::getOrCreateManagementChannel)); }
Source:
private void unshift() { isEnteringActionName = false; Integer editorAction; try { editorAction = Integer.parseInt(actionName.toString()); } catch (Exception e) { editorAction = ACTION_CODES_MAP.get(actionName.toString().toLowerCase()); } if (editorAction == null) { Log.i(TAG, String.format("There is no known action code for '%s'", actionName.toString())); getCurrentInputConnection().commitText(actionName.toString(), 1); } else { Log.i(TAG, String.format("Matched '%s' to editor action code %s ", actionName.toString(), editorAction)); getCurrentInputConnection().performEditorAction(editorAction); } actionName = new StringBuilder(); }

Target:
private void unshift() { isEnteringActionName = false; Integer editorAction; try { editorAction = Integer.parseInt(actionName.toString()); } catch (Exception e) { editorAction = ACTION_CODES_MAP.get(actionName.toString().toLowerCase()); } if (editorAction == null) { Log.i(TAG, String.format("There is no known action code for '%s'. " + "Available action names: %s", actionName.toString(), ACTION_CODES_MAP.keySet())); getCurrentInputConnection().commitText(actionName.toString(), 1); } else { Log.i(TAG, String.format("Matched '%s' to editor action code %s", actionName.toString(), editorAction)); if (!getCurrentInputConnection().performEditorAction(editorAction)) { Log.w(TAG, String.format("Cannot perform editor action %s on the focused element", editorAction)); } } actionName = new StringBuilder(); }
Source:
public Table get(String name) throws TableManagerException { try { Table table = metadataManager.get(name); if (table == null) { throw new TableManagerException(TableManagerException.ErrorCode.TABLE_NOT_FOUND, "table_does_not_exists"); } return table; } catch (TableManagerException e) { throw e; } catch (Exception e) { throw new TableManagerException(TableManagerException.ErrorCode.INTERNAL_ERROR, e); } }

Target:
public Table get(String name) throws TableManagerException { try { Table table = metadataManager.get(name); if (table == null) { throw new TableManagerException(TableManagerException.ErrorCode.TABLE_NOT_FOUND, String.format("table does not exists table=%s", name)); } return table; } catch (TableManagerException e) { throw e; } catch (Exception e) { throw new TableManagerException(TableManagerException.ErrorCode.INTERNAL_ERROR, e); } }
Source:
private void initLocalizationEditor() { localeBox = new ListBox(); selectedLocale = new Label(); String currentLocale = LocaleInfo.getCurrentLocale().getLocaleName(); String[] localeNames = LocaleInfo.getAvailableLocaleNames(); for (String localeName : localeNames) { if(!DEFAULT.equals(localeName)) { String nativeName = LocaleInfo.getLocaleNativeDisplayName(localeName); localeBox.addItem(nativeName, localeName); if (localeName.equals(currentLocale)) { localeBox.setSelectedIndex(localeBox.getItemCount() - 1); selectedLocale.setText(localeBox.getItemText(localeBox.getSelectedIndex())); } } } if (clientAgentType.isIE8OrBelow()) { selectedLocale.getElement().getStyle().setOpacity(0); } localeBox.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { String localeName = localeBox.getValue(localeBox.getSelectedIndex()); String localeString = ""; if (!DEFAULT.equals(localeName)) { localeString = "?locale=" + localeName; } Window.open(FrontendUrlUtils.getCurrentPageURL() + localeString, "_self", ""); } }); }

Target:
private void initLocalizationEditor() { localeBox = new ListBox(); selectedLocale = new Label(); String currentLocale = LocaleInfo.getCurrentLocale().getLocaleName(); String[] localeNames = LocaleInfo.getAvailableLocaleNames(); boolean foundDefault = false; for (String localeName : localeNames) { if(!DEFAULT.equals(localeName)) { String nativeName = LocaleInfo.getLocaleNativeDisplayName(localeName); localeBox.addItem(nativeName, localeName); if (localeName.equals(currentLocale)) { foundDefault = true; localeBox.setSelectedIndex(localeBox.getItemCount() - 1); selectedLocale.setText(localeBox.getItemText(localeBox.getSelectedIndex())); } } } if(!foundDefault) { localeBox.setSelectedIndex(0); selectedLocale.setText(localeBox.getItemText(localeBox.getSelectedIndex())); } if (clientAgentType.isIE8OrBelow()) { selectedLocale.getElement().getStyle().setOpacity(0); } localeBox.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { String localeString = "?locale=" + localeBox.getValue(localeBox.getSelectedIndex()); Window.open(FrontendUrlUtils.getCurrentPageURL() + localeString, "_self", ""); } }); }
Source:
private static boolean isHtml5(final InputStream body) { final Document document; try { body.mark(Integer.MAX_VALUE); document = parseBody(body); body.reset(); } catch (final Exception ex) { return false; } final DocumentType doctype = document.getDoctype(); return doctype != null && "html".equalsIgnoreCase(doctype.getName()) && doctype.getSystemId() == null && doctype.getPublicId() == null; }

Target:
private static boolean isHtml5(final InputStream body) throws IOException { Opt<Document> document = new Opt.Empty<Document>(); boolean valid = true; try { body.mark(Integer.MAX_VALUE); document = new Opt.Single<Document>( DocumentBuilderFactory .newInstance() .newDocumentBuilder() .parse(body) ); body.reset(); } catch (final SAXException ex) { valid = false; } catch (final ParserConfigurationException ex) { throw new IOException(ex); } return valid && document.get().getDoctype() != null && "html".equalsIgnoreCase(document.get().getDoctype().getName()) && document.get().getDoctype().getSystemId() == null && document.get().getDoctype().getPublicId() == null; }
Source:
StackOpParser(KXmlParser parser) { super(parser); }

Target:
public StackOpParser(KXmlParser parser) { super(parser); }
Source:
public static boolean checkImageConfiguration(storage_domain_static storageDomain, DiskImageBase diskInfo, List<String> messages, boolean isCopyCollapse) { boolean result = true; if ((diskInfo.getvolume_type() == VolumeType.Preallocated && diskInfo.getvolume_format() == VolumeFormat.COW) || (!isCopyCollapse && isStorageBlockDevice(storageDomain) && volumeNotSupportedForBlockDevice(diskInfo)) || diskInfo.getvolume_format() == VolumeFormat.Unassigned || diskInfo.getvolume_type() == VolumeType.Unassigned) { result = false; messages.add(VdcBllMessages.ACTION_TYPE_FAILED_DISK_CONFIGURATION_NOT_SUPPORTED.toString()); } return result; }

Target:
public static boolean checkImageConfiguration(storage_domain_static storageDomain, DiskImageBase diskInfo, List<String> messages, boolean isCopyCollapse) { boolean result = true; if ((diskInfo.getvolume_type() == VolumeType.Preallocated && diskInfo.getvolume_format() == VolumeFormat.COW) || (!isCopyCollapse && isStorageBlockDevice(storageDomain) && isVolumeNotSupportedForBlockDevice(diskInfo)) || diskInfo.getvolume_format() == VolumeFormat.Unassigned || diskInfo.getvolume_type() == VolumeType.Unassigned) { result = false; messages.add(VdcBllMessages.ACTION_TYPE_FAILED_DISK_CONFIGURATION_NOT_SUPPORTED.toString()); } return result; }
Source:
protected <S extends Message> S getPart(Class<S> partStateClass) { final AggregatePartRepository<I, ?> repo = getRepository(partStateClass); final AggregatePart<I, ?, ?> aggregatePart = repo.loadOrCreate(getId()); @SuppressWarnings("unchecked") final S partState = (S) aggregatePart.getState(); return partState; }

Target:
protected <S extends Message, A extends AggregatePart<I, S, ?>> S getPart(Class<S> partStateClass) { final AggregatePartRepository<I, A> repo = getRepository(partStateClass); final AggregatePart<I, S, ?> aggregatePart = repo.loadOrCreate(getId()); final S partState = aggregatePart.getState(); return partState; }
Source:
private void init() { inflate(getContext(), R.layout.item_page_list_entry, this); ButterKnife.bind(this); setLayoutParams(new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); final int topBottomPadding = 16; setPadding(0, DimenUtil.roundedDpToPx(topBottomPadding), 0, DimenUtil.roundedDpToPx(topBottomPadding)); setBackgroundColor(ResourceUtil.getThemedColor(getContext(), R.attr.paper_color)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { setForeground(ContextCompat.getDrawable(getContext(), ResourceUtil.getThemedAttributeId(getContext(), R.attr.selectableItemBackground))); } FeedbackUtil.setToolbarButtonLongPressToast(primaryActionView); FeedbackUtil.setToolbarButtonLongPressToast(secondaryActionView); }

Target:
private void init() { inflate(getContext(), R.layout.item_page_list_entry, this); ButterKnife.bind(this); setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); final int topBottomPadding = 16; setPadding(0, DimenUtil.roundedDpToPx(topBottomPadding), 0, DimenUtil.roundedDpToPx(topBottomPadding)); setBackgroundColor(ResourceUtil.getThemedColor(getContext(), R.attr.paper_color)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { setForeground(ContextCompat.getDrawable(getContext(), ResourceUtil.getThemedAttributeId(getContext(), R.attr.selectableItemBackground))); } FeedbackUtil.setToolbarButtonLongPressToast(primaryActionView); FeedbackUtil.setToolbarButtonLongPressToast(secondaryActionView); }
Source:
protected void executeCommand() { final DiskImage newDiskImage = getParameters().getDiskImage(); if (newDiskImage != null) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { addDiskImageToDb(newDiskImage, getCompensationContext()); getReturnValue().setActionReturnValue(newDiskImage.getId()); getReturnValue().setSucceeded(true); return null; } }); } }

Target:
protected void executeCommand() { final DiskImage newDiskImage = getParameters().getDiskImage(); if (newDiskImage != null) { addDiskImageToDb(newDiskImage, getCompensationContext()); getReturnValue().setActionReturnValue(newDiskImage.getId()); getReturnValue().setSucceeded(true); } }
Source:
public void shouldLoadCsvToDirectory() throws Exception { try (Session directorySession = directoryService.open("continent")) { assertNull(directorySession.getEntry("atlantis")); Map<String, Object> params = new HashMap<>(); params.put("directoryName", "continent"); params.put("duplicateManagement", BaseDirectoryDescriptor.DataLoadingPolicy.UPDATE_DUPLICATE.toString()); OperationParameters oparams = new OperationParameters(LoadDirectoryWithCSV.ID, params); Blob blob = Blobs.createBlob(FileUtils.getResourceFileFromContext("testdirectorydata/continent_local.csv"), "text/csv", UTF_8.name(), ("testdirectorydata/continent_local.csv")); ctx.setInput(blob); OperationChain chain = new OperationChain("fakeChain"); chain.add(oparams); service.run(ctx, chain); assertNotNull(directorySession.getEntry("atlantis")); } }

Target:
public void shouldLoadCsvToDirectory() throws Exception { try (Session directorySession = directoryService.open("continent")) { assertFalse(directorySession.hasEntry("atlantis")); OperationParameters params = new OperationParameters(LoadFromCSV.ID, Map.of("directoryName", "continent", "dataLoadingPolicy", "reject_duplicate")); Blob blob = Blobs.createBlob(FileUtils.getResourceFileFromContext("testdirectorydata/continent_local.csv"), "text/csv", null, "testdirectorydata/continent_local.csv"); ctx.setInput(blob); OperationChain chain = new OperationChain("fakeChain"); chain.add(params); service.run(ctx, chain); assertTrue(directorySession.hasEntry("atlantis")); } }
Source:
public static void submit(final PatchSet.Id patchSetId, final IdentifiedUser user, final ReviewDb db, final MergeOp.Factory opFactory, final MergeQueue merger) throws OrmException { final Change.Id changeId = patchSetId.getParentKey(); final PatchSetApproval approval = createSubmitApproval(patchSetId, user, db); db.patchSetApprovals().upsert(Collections.singleton(approval)); final Change updatedChange = db.changes().atomicUpdate(changeId, new AtomicUpdate<Change>() { @Override public Change update(Change change) { if (change.getStatus() == Change.Status.NEW) { change.setStatus(Change.Status.SUBMITTED); change.setMergeable(true); ChangeUtil.updated(change); } return change; } }); if (updatedChange.getStatus() == Change.Status.SUBMITTED) { merger.merge(opFactory, updatedChange.getDest()); } }

Target:
public static void submit(final PatchSet.Id patchSetId, final IdentifiedUser user, final ReviewDb db, final MergeOp.Factory opFactory, final MergeQueue merger) throws OrmException { final Change.Id changeId = patchSetId.getParentKey(); final PatchSetApproval approval = createSubmitApproval(patchSetId, user, db); db.patchSetApprovals().upsert(Collections.singleton(approval)); final Change updatedChange = db.changes().atomicUpdate(changeId, new AtomicUpdate<Change>() { @Override public Change update(Change change) { if (change.getStatus() == Change.Status.NEW) { change.setStatus(Change.Status.SUBMITTED); ChangeUtil.updated(change); } return change; } }); if (updatedChange.getStatus() == Change.Status.SUBMITTED) { merger.merge(opFactory, updatedChange.getDest()); } }
Source:
@Test public void lenientQuotedNonFiniteDoubles() throws IOException { String json = "[\"NaN\", \"-Infinity\", \"Infinity\"]"; JsonReader reader = newReader(json); reader.setLenient(true); reader.beginArray(); assertThat(Double.isNaN(reader.nextDouble())).isTrue(); assertThat(reader.nextDouble()).isEqualTo(Double.NEGATIVE_INFINITY, Offset.offset(0d)); assertThat(reader.nextDouble()).isEqualTo(Double.POSITIVE_INFINITY, Offset.offset(0d)); reader.endArray(); }

Target:
@Test public void lenientQuotedNonFiniteDoubles() throws IOException { String json = "[\"NaN\", \"-Infinity\", \"Infinity\"]"; JsonReader reader = newReader(json); reader.setLenient(true); reader.beginArray(); assertThat(reader.nextDouble()).isNaN(); assertThat(reader.nextDouble()).isEqualTo(Double.NEGATIVE_INFINITY); assertThat(reader.nextDouble()).isEqualTo(Double.POSITIVE_INFINITY); reader.endArray(); }
Source:
public void run() { while (deletedCount.get() < putCount) { try { final String blobIdStr = deleteBlobIds.poll(50, TimeUnit.MILLISECONDS); if (blobIdStr != null) { deletedCount.incrementAndGet(); logger.trace("Deleting blob " + blobIdStr); Callback<Void> callback = new Callback<Void>() { @Override public void onCompletion(Void result, Exception exception) { logger.trace("Deletion completed for " + blobIdStr); countDownLatch.countDown(); if (exception != null) { logger.error("Deletion of " + blobIdStr + " failed with ", exception); } } }; deleteHelper.deleteBlobAndValidate(blobIdStr, deleteHelper.getErrorCodeForNoError(), callback); } } catch (InterruptedException e) { logger.error(" Interrupted Exception thrown in , exception ", e); } } try { countDownLatch.await(); } catch (InterruptedException e) { logger.error(" Interrupted Exception thrown while waiting for deletion to complete , exception ", e); } }

Target:
public void run() { while (deletedCount.get() < putCount) { try { final String blobIdStr = deleteBlobIds.poll(50, TimeUnit.MILLISECONDS); if (blobIdStr != null) { deletedCount.incrementAndGet(); logger.trace("Deleting blob " + blobIdStr); Callback<Void> callback = new Callback<Void>() { @Override public void onCompletion(Void result, Exception exception) { logger.trace("Deletion completed for " + blobIdStr); countDownLatch.countDown(); if (exception != null) { logger.error("Deletion of " + blobIdStr + " failed with ", exception); } } }; deleteHelper.deleteBlobAndValidate(blobIdStr, deleteHelper.getErrorCodeForNoError(), callback); } } catch (InterruptedException e) { logger.error("Delete operation interrupted", e); } } try { countDownLatch.await(); } catch (InterruptedException e) { logger.error("Waiting for delete operations to complete interrupted", e); } }
Source:
public String getDefaultValue() { Preconditions.checkState(defaultValueComputed); return computedDefaultValue; }

Target:
public String getDefaultValue() { Preconditions.checkState(defaultValueComputed, "precomputeDefaultValue() must be called before calling this method"); return computedDefaultValue; }
Source:
private List<String> splitConditionClause( String clause ) throws KettleSQLException { List<String> strings = new ArrayList<String>(); String[] operators = new String[] { "<>", ">=", "=>", "<=", "=<", "<", ">", "=", " REGEX ", " IN ", " IS NOT NULL", " IS NULL", " LIKE", "CONTAINS " }; int[] functions = new int[] { Condition.FUNC_NOT_EQUAL, Condition.FUNC_LARGER_EQUAL, Condition.FUNC_LARGER_EQUAL, Condition.FUNC_SMALLER_EQUAL, Condition.FUNC_SMALLER_EQUAL, Condition.FUNC_SMALLER, Condition.FUNC_LARGER, Condition.FUNC_EQUAL, Condition.FUNC_REGEXP, Condition.FUNC_IN_LIST, Condition.FUNC_NOT_NULL, Condition.FUNC_NULL, Condition.FUNC_LIKE, Condition.FUNC_CONTAINS }; int index = 0; while ( index < clause.length() ) { index = ThinUtil.skipChars( clause, index, '\'', '"' ); for ( String operator : operators ) { if ( index <= clause.length() - operator.length() ) { if ( clause.substring( index ).toUpperCase().startsWith( operator ) ) { int functionIndex = Const.indexOfString( operator, operators ); boolean negation = false; String left = Const.trim( clause.substring( 0, index ) ); String op = Condition.functions[functions[functionIndex]]; String right = Const.trim( clause.substring( index + operator.length() ) ); if ( Pattern.matches( "^NULL$", right.toUpperCase() ) ) { op = Condition.functions[Condition.FUNC_TRUE]; negation = true; right = ""; } return Arrays.<String>asList( left, op, right, String.valueOf( negation ) ); } } } index++; } return strings; }

Target:
private List<String> splitConditionClause( String clause ) throws KettleSQLException { List<String> strings = new ArrayList<String>(); String[] operators = new String[] { "<>", ">=", "=>", "<=", "=<", "<", ">", "=", " REGEX ", " IN ", " IS NOT NULL", " IS NULL", " LIKE", "CONTAINS " }; int[] functions = new int[] { Condition.FUNC_NOT_EQUAL, Condition.FUNC_LARGER_EQUAL, Condition.FUNC_LARGER_EQUAL, Condition.FUNC_SMALLER_EQUAL, Condition.FUNC_SMALLER_EQUAL, Condition.FUNC_SMALLER, Condition.FUNC_LARGER, Condition.FUNC_EQUAL, Condition.FUNC_REGEXP, Condition.FUNC_IN_LIST, Condition.FUNC_NOT_NULL, Condition.FUNC_NULL, Condition.FUNC_LIKE, Condition.FUNC_CONTAINS }; int index = 0; while ( index < clause.length() ) { index = ThinUtil.skipChars( clause, index, '\'', '"' ); for ( String operator : operators ) { if ( index <= clause.length() - operator.length() ) { if ( clause.substring( index ).toUpperCase().startsWith( operator ) ) { int functionIndex = Const.indexOfString( operator, operators ); String left = Const.trim( clause.substring( 0, index ) ); String op = Condition.functions[functions[functionIndex]]; String right = Const.trim( clause.substring( index + operator.length() ) ); return Arrays.<String>asList( left, op, right ); } } } index++; } return strings; }
Source:
public final void checkAnyPermission(@Nonnull Permission... permissions) { boolean failed = !hasAnyPermission(permissions); Authentication authentication = Jenkins.getAuthentication(); if (failed) { String permissionsDisplayName = Arrays.stream(permissions) .map(p -> p.group.title + "/" + p.name) .collect(Collectors.joining(", ")); String errorMessage; if (permissions.length == 1) { errorMessage = Messages.AccessDeniedException2_MissingPermission(authentication.getName(), permissionsDisplayName); } else { errorMessage = Messages.AccessDeniedException_MissingPermissions(authentication.getName(), permissionsDisplayName); } throw new AccessDeniedException(errorMessage); } }

Target:
public final void checkAnyPermission(@Nonnull Permission... permissions) { if (permissions.length == 0) { throw new IllegalArgumentException("At least one permission must be provided"); } boolean failed = !hasAnyPermission(permissions); Authentication authentication = Jenkins.getAuthentication(); if (failed) { String permissionsDisplayName = Arrays.stream(permissions) .map(p -> p.group.title + "/" + p.name) .collect(Collectors.joining(", ")); String errorMessage; if (permissions.length == 1) { errorMessage = Messages.AccessDeniedException2_MissingPermission(authentication.getName(), permissionsDisplayName); } else { errorMessage = Messages.AccessDeniedException_MissingPermissions(authentication.getName(), permissionsDisplayName); } throw new AccessDeniedException(errorMessage); } }
Source:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CREATE); addCustomValue(GlusterConstants.VOLUME_SNAPSHOT_NAME, getParameters().getSnapshot().getSnapshotName()); addCustomValue("ClusterName", getVdsGroupName()); }

Target:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CREATE); addCustomValue(GlusterConstants.VOLUME_SNAPSHOT_NAME, getParameters().getSnapshot().getSnapshotName()); }
Source:
public static SSLContext getTrustContext() { try { if (getAlreadyCreated()) { return sslContext; } setAlreadyCreated(); TrustManager[] trustAllCerts = new TrustManager[1]; trustAllCerts[0] = new TrustAllManager(); sslContext = SSLContext.getInstance("TLS"); sslContext.init(null, trustAllCerts, new SecureRandom()); HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier() { public boolean verify(String urlHostName, SSLSession session) { return true; } } ); } catch (NoSuchAlgorithmException e) { throw new RemoteException("Unable to find suitable algorithm while attempting to communicate with remote server.", e); } catch (KeyManagementException e) { throw new RemoteException("Key Management exception while attempting to communicate with remote server.", e); } finally { return sslContext; } }

Target:
public static SSLContext getTrustContext() throws RemoteException { try { if (getAlreadyCreated()) { return sslContext; } setAlreadyCreated(); TrustManager[] trustAllCerts = new TrustManager[1]; trustAllCerts[0] = new TrustAllManager(); sslContext = SSLContext.getInstance("TLS"); sslContext.init(null, trustAllCerts, new SecureRandom()); HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier() { public boolean verify(String urlHostName, SSLSession session) { return true; } } ); } catch (NoSuchAlgorithmException e) { throw new RemoteException("Unable to find suitable algorithm while attempting to communicate with remote server.", e); } catch (KeyManagementException e) { throw new RemoteException("Key Management exception while attempting to communicate with remote server.", e); } return sslContext; }