auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<O> void updateListEditor(TakesConstrainedValueEditor<O> listEditor, ListModel<O> parentModel) { Collection<O> items = (Collection<O>) parentModel.getItems(); if (items != null) { if (items.size() > 0) { O value; if (parentModel.getSelectedItem() != null) { value = (O) parentModel.getSelectedItem(); } else { value = items.iterator().next(); parentModel.setSelectedItem(value); } if (items.contains(value)) { if (listEditor instanceof TakesConstrainedValueListEditor) { if (parentModel.getSelectedItems() != null) { ((TakesConstrainedValueListEditor<O>)listEditor).setListValue(parentModel.getSelectedItems()); } } else { listEditor.setValue(value); } } } else { if (listEditor instanceof TakesConstrainedValueListEditor) { ((TakesConstrainedValueListEditor<O>)listEditor).setListValue(null); } else { listEditor.setValue(null); } } if (listEditor instanceof TakesConstrainedValueListEditor) { ((TakesConstrainedValueListEditor<O>)listEditor).setAcceptableListValues(items); } else { listEditor.setAcceptableValues(items); } } }

Target:
<O> void updateListEditor(TakesConstrainedValueEditor<O> listEditor, ListModel<O> parentModel) { Collection<O> items = (Collection<O>) parentModel.getItems(); if (items != null) { if (items.size() > 0) { O value; if (parentModel.getSelectedItem() != null) { value = (O) parentModel.getSelectedItem(); } else { value = items.iterator().next(); parentModel.setSelectedItem(value); } if (items.contains(value)) { if (listEditor instanceof TakesConstrainedValueListEditor) { if (parentModel.getSelectedItems() != null) { ((TakesConstrainedValueListEditor<O>)listEditor).setListValue(parentModel.getSelectedItems()); } } else { listEditor.setValue(value); } } } if (listEditor instanceof TakesConstrainedValueListEditor) { ((TakesConstrainedValueListEditor<O>)listEditor).setAcceptableListValues(items); } else { listEditor.setAcceptableValues(items); } } }
Source:
default void initWireMock(Method testingMethod) { if (this.getClass().getAnnotation(WireMockRecording.class) == null) { WireMockFixture.startServerFor(this, testingMethod); } else { SdkHttpClient.apiUrl("http://localhost:8089/"); } }

Target:
default void initWireMock(Method testingMethod) { if (this.getClass().getAnnotation(WireMockRecording.class) == null) { WireMockFixture.startServerFor(this, testingMethod); } else { SdkHttpClient.apiUrl("http://localhost:8080/"); } }
Source:
public static String desanitizeIfHtmlSanitized(String string) { if (!isSanitizedHtml(string)) { return string; } return desanitizeFromHtml(string); }

Target:
public static String desanitizeIfHtmlSanitized(String string) { return isSanitizedHtml(string) ? desanitizeFromHtml(string) : string; }
Source:
public FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution) { if(jobExecution.getExitStatus().equals("UNKNOWN")) { return new FlowExecutionStatus("NOTIFY"); } else { return null; } }

Target:
public FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution) { if (shouldNotify()) { return new FlowExecutionStatus(NOTIFY); } else { return new FlowExecutionStatus(QUIET); } }
Source:
public void fastWURefreshTest() throws Exception { try { if (testwuid == null || testwuid.isEmpty()) Assert.fail("Cannot test WsWorkunits.fastWURefreshTest without target WUID - provide 'targetwuid' System property!"); WorkunitWrapper wu = new WorkunitWrapper(); wu.setWuid(testwuid); client.fastWURefresh(wu); System.out.println("wuid: " + wu.getWuid()); } catch (AxisFault e) { e.printStackTrace(); Assert.fail(); } catch (Exception e) { e.printStackTrace(); Assert.fail(); } catch (ArrayOfEspExceptionWrapper e) { e.toString(); Assert.fail(); } }

Target:
public void fastWURefreshTest() throws Exception { try { if (testwuid == null || testwuid.isEmpty()) Assert.fail("Cannot test WsWorkunits.fastWURefreshTest without target WUID - provide 'targetwuid' System property!"); WorkunitWrapper wu = new WorkunitWrapper(); wu.setWuid(testwuid); client.fastWURefresh(wu); System.out.println("wuid: " + wu.getWuid()); } catch (AxisFault e) { e.printStackTrace(); Assert.fail(); } catch (Exception e) { e.printStackTrace(); Assert.fail(); } catch (ArrayOfEspExceptionWrapper e) { Assert.fail(e.toString()); } }
Source:
private void processEntry( ZipOutputStream zipOutputStream, PluginMetadata pluginMetadata, boolean isDirectory, String name, byte[] bytes ) throws IOException { logger.trace( "Processing zip entry: ", name ); AtomicBoolean output = new AtomicBoolean( false ); boolean wasHandled = false; for ( PluginFileHandler pluginFileHandler : pluginFileHandlers ) { if ( pluginFileHandler.handles( name ) ) { wasHandled = true; logger.trace( "Plugin file handler will handle {}", pluginFileHandler.toString(), name ); try { boolean handlerSaysOutput = pluginFileHandler .handle( name, bytes, pluginMetadata ); logger.trace( "Plugin file handler handled {}", pluginFileHandler.toString(), name ); output.compareAndSet( false, handlerSaysOutput ); } catch ( PluginHandlingException e ) { logger.debug( "Plugin file handler " + pluginFileHandler.toString() + " threw exception when handling " + name, e ); throw new IOException( e ); } } } if ( !wasHandled || output.get() ) { zipOutputStream.putNextEntry( new ZipEntry( name ) ); if ( isDirectory == false ) { IOUtils.write( bytes, zipOutputStream ); } zipOutputStream.closeEntry(); } }

Target:
private void processEntry( ZipOutputStream zipOutputStream, PluginMetadata pluginMetadata, boolean isDirectory, String name, byte[] bytes ) throws IOException { logger.trace( "Processing zip entry: ", name ); AtomicBoolean output = new AtomicBoolean( false ); boolean wasHandled = false; for ( PluginFileHandler pluginFileHandler : pluginFileHandlers ) { if ( pluginFileHandler.handles( name ) ) { wasHandled = true; logger.trace( "Plugin file handler will handle {}", pluginFileHandler.toString(), name ); try { boolean handlerSaysOutput = pluginFileHandler .handle( name, bytes, pluginMetadata ); logger.trace( "Plugin file handler handled {}", pluginFileHandler.toString(), name ); output.compareAndSet( false, handlerSaysOutput ); } catch ( PluginHandlingException e ) { logger.error( "Plugin file handler " + pluginFileHandler.toString() + " threw exception when handling " + name, e ); throw new IOException( e ); } } } if ( !wasHandled || output.get() ) { zipOutputStream.putNextEntry( new ZipEntry( name ) ); if ( isDirectory == false ) { IOUtils.write( bytes, zipOutputStream ); } zipOutputStream.closeEntry(); } }
Source:
private ThreadPoolExecutor getFixedThreadPoolExecutor(int poolSize) { return new ThreadPoolExecutor(5, poolSize, 60L, TimeUnit.SECONDS, new SynchronousQueue<>(), new ThreadFactoryBuilder() .setNameFormat("workload-thread %d") .setUncaughtExceptionHandler(ExceptionLogger.INSTANCE) .build()); }

Target:
private ThreadPoolExecutor getFixedThreadPoolExecutor(int poolSize) { return new ThreadPoolExecutor(CORE_POOL_SIZE, poolSize, 60L, TimeUnit.SECONDS, new SynchronousQueue<>(), new ThreadFactoryBuilder() .setNameFormat("workload-thread %d") .setUncaughtExceptionHandler(ExceptionLogger.INSTANCE) .build()); }
Source:
public HttpMessage getBaseMsg() { return msg; }

Target:
protected HttpMessage getBaseMsg() { return msg; }
Source:
protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation) { int index = (int)(invokers.size() * Math.random()); Invoker<T> invoker = invokers.get(index); cpuUsage.computeIfAbsent(invoker.getUrl().getAddress(), value -> { CpuUsageService cpuUsageService = dubboCpuUsageFactory.createCpuUsageService(invoker.getUrl()); CpuUsageListener cpuUsageListener = new CpuUsageListenerImpl(); listeners.put(invoker.getUrl().getAddress(), cpuUsageListener); cpuUsageService.addListener("statisticsloadbalance", cpuUsageListener); return 0.0f; }); throw new IllegalStateException("Method unimplemented"); }

Target:
protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation) { int index = (int)(invokers.size() * Math.random()); Invoker<T> invoker = invokers.get(index); if (invoker.getUrl() != null) { cpuUsage.computeIfAbsent(invoker.getUrl().getAddress(), value -> { URLBuilder urlBuilder = URLBuilder.from(invoker.getUrl()); urlBuilder.setPath(CpuUsageService.class.getName()); urlBuilder.addParameter(INTERFACE_KEY, CpuUsageService.class.getName()); urlBuilder.addParameter("bean.name", CpuUsageService.class.getName()); urlBuilder.addParameter(METHODS_KEY, "addListener,removeListener"); urlBuilder.addParameters(CHECK_KEY, String.valueOf(false), REFERENCE_FILTER_KEY, ""); urlBuilder.addParameter("addListener.1.callback", true); CpuUsageService cpuUsageService = cpuUsageFactory.createCpuUsageService(invoker.getUrl()); cpuUsageService.addListener(NetUtils.getLocalHost(), new CpuUsageListenerImpl()); return 0.0f; }); } return invoker; }
Source:
S3SelectRecordCursor( Configuration configuration, Path path, RecordReader recordReader, long totalBytes, Properties splitSchema, List<HiveColumnHandle> columns, DateTimeZone hiveStorageTimeZone, TypeManager typeManager) { super(configuration, path, recordReader, totalBytes, updateSplitSchema(splitSchema, columns), columns, hiveStorageTimeZone, typeManager); }

Target:
public S3SelectRecordCursor( Configuration configuration, Path path, RecordReader recordReader, long totalBytes, Properties splitSchema, List<HiveColumnHandle> columns, DateTimeZone hiveStorageTimeZone, TypeManager typeManager) { super(configuration, path, recordReader, totalBytes, updateSplitSchema(splitSchema, columns), columns, hiveStorageTimeZone, typeManager); }
Source:
protected RowMapper<VmStatistics> createEntityRowMapper() { return new RowMapper<VmStatistics>() { @Override public VmStatistics mapRow(ResultSet rs, int rowNum) throws SQLException { VmStatistics entity = new VmStatistics(); entity.setcpu_sys(rs.getDouble("cpu_sys")); entity.setcpu_user(rs.getDouble("cpu_user")); entity.setelapsed_time(rs.getDouble("elapsed_time")); entity.setusage_cpu_percent((Integer) rs .getObject("usage_cpu_percent")); entity.setusage_mem_percent((Integer) rs .getObject("usage_mem_percent")); entity.setMigrationProgressPercent((Integer) rs .getObject("migration_progress_percent")); entity.setusage_network_percent((Integer) rs .getObject("usage_network_percent")); entity.setDisksUsage((String) rs .getObject("disks_usage")); entity.setId(getGuidDefaultEmpty(rs, "vm_guid")); return entity; } }; }

Target:
protected RowMapper<VmStatistics> createEntityRowMapper() { return new RowMapper<VmStatistics>() { @Override public VmStatistics mapRow(ResultSet rs, int rowNum) throws SQLException { VmStatistics entity = new VmStatistics(); entity.setcpu_sys(rs.getDouble("cpu_sys")); entity.setcpu_user(rs.getDouble("cpu_user")); entity.setelapsed_time(rs.getDouble("elapsed_time")); entity.setusage_cpu_percent((Integer) rs .getObject("usage_cpu_percent")); entity.setusage_mem_percent((Integer) rs .getObject("usage_mem_percent")); entity.setMigrationProgressPercent(rs .getInt("migration_progress_percent")); entity.setusage_network_percent((Integer) rs .getObject("usage_network_percent")); entity.setDisksUsage((String) rs .getObject("disks_usage")); entity.setId(getGuidDefaultEmpty(rs, "vm_guid")); return entity; } }; }
Source:
private String getMeasurementName(final String name) { if (measurementMappings == null) { return name; } for (Map.Entry<String, Pattern> entry : measurementMappings.entrySet()) { final Pattern pattern = entry.getValue(); if (pattern.matcher(name).matches()) { return entry.getKey(); } } return name; }

Target:
private String getMeasurementName(final String name) { for (Map.Entry<String, Pattern> entry : measurementMappings.entrySet()) { final Pattern pattern = entry.getValue(); if (pattern.matcher(name).matches()) { return entry.getKey(); } } return name; }
Source:
private DirectoryListing generateDirectoryListing(Path relativePath, List<Path> contentPaths, UriComponentsBuilder directoryLinkBuilder, UriComponentsBuilder fileLinkBuilder) throws IOException { DirectoryListing listing = new DirectoryListing(); listing.setLink(uriBuilder.getCurrentRequestURL()); for (Path contentPath : contentPaths) { FileContent file = new FileContent(contentPath.getFileName().toString()); Map<String, Object> fileAttributes = Files.readAttributes(contentPath, "*"); file.setStorageId((String) fileAttributes.get(RepositoryFileAttributeType.STORAGE_ID.getName())); file.setRepositoryId((String) fileAttributes.get(RepositoryFileAttributeType.REPOSITORY_ID.getName())); file.setArtifactPath((String) fileAttributes.get(RepositoryFileAttributeType.ARTIFACT_PATH.getName())); file.setLastModified(new Date(((FileTime) fileAttributes.get("lastModifiedTime")).toMillis())); file.setSize((Long) fileAttributes.get("size")); if (file.getArtifactPath() == null) { file.setArtifactPath(sanitizedPath(relativePath.toString() + "/" + file.getName())); } UriComponentsBuilder builder = null; if (Boolean.TRUE.equals(fileAttributes.get("isDirectory"))) { builder = UriComponentsBuilder.fromUriString(directoryLinkBuilder.toUriString()); listing.getDirectories().add(file); } else { if(fileLinkBuilder != null) { builder = UriComponentsBuilder.fromUriString(fileLinkBuilder.toUriString()); } listing.getFiles().add(file); } if(builder != null) { URL url = builder.path("/" + file.getArtifactPath()) .build() .toUri() .toURL(); file.setUrl(url); } } return listing; }

Target:
private DirectoryListing generateDirectoryListing(Path relativePath, List<Path> contentPaths, UriComponentsBuilder directoryLinkBuilder, UriComponentsBuilder fileLinkBuilder) throws IOException { DirectoryListing listing = new DirectoryListing(); listing.setLink(uriBuilder.getCurrentRequestUrl()); for (Path contentPath : contentPaths) { FileContent file = new FileContent(contentPath.getFileName().toString()); Map<String, Object> fileAttributes = Files.readAttributes(contentPath, "*"); file.setStorageId((String) fileAttributes.get(RepositoryFileAttributeType.STORAGE_ID.getName())); file.setRepositoryId((String) fileAttributes.get(RepositoryFileAttributeType.REPOSITORY_ID.getName())); file.setArtifactPath((String) fileAttributes.get(RepositoryFileAttributeType.ARTIFACT_PATH.getName())); file.setLastModified(new Date(((FileTime) fileAttributes.get("lastModifiedTime")).toMillis())); file.setSize((Long) fileAttributes.get("size")); if (file.getArtifactPath() == null) { file.setArtifactPath(sanitizedPath(relativePath.toString() + "/" + file.getName())); } UriComponentsBuilder builder = null; if (Boolean.TRUE.equals(fileAttributes.get("isDirectory"))) { builder = UriComponentsBuilder.fromUriString(directoryLinkBuilder.toUriString()); listing.getDirectories().add(file); } else { if (fileLinkBuilder != null) { builder = UriComponentsBuilder.fromUriString(fileLinkBuilder.toUriString()); } listing.getFiles().add(file); } if (builder != null) { URL url = builder.path("/" + file.getArtifactPath()) .build() .toUri() .toURL(); file.setUrl(url); } } return listing; }
Source:
public TransportOptions getClusterAdminTransportOptions() throws IOException { return createTransportOptions(this.clusterAdminHost); }

Target:
public TransportOptions getClusterAdminTransportOptions() throws IOException { Preconditions.checkNotNull("clusterAdminHost was not set.", clusterAdminHost); return createTransportOptions(this.clusterAdminHost); }
Source:
protected IStatus executeAnalysis() { MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null); Map<String, IAnalysisModule> modules = TmfAnalysisManager.getAnalysisModules(this); for (IAnalysisModule module : modules.values()) { if (module.isAutomatic()) { try { module.setTrace(this); } catch (TmfAnalysisException e) { } status.add(module.schedule()); } } return status; }

Target:
protected IStatus executeAnalysis() { MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null); Map<String, IAnalysisModule> modules = TmfAnalysisManager.getAnalysisModules(this); for (IAnalysisModule module : modules.values()) { if (module.isAutomatic()) { try { module.setTrace(this); status.add(module.schedule()); } catch (TmfAnalysisException e) { status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e)); } } } return status; }
Source:
public void testCacheEmptyGets() { final Set<byte[]> oneRow = ImmutableSortedSet.orderedBy(PtBytes.BYTES_COMPARATOR).add(ROW_BYTES).build(); final ColumnSelection oneColumn = ColumnSelection.create(ImmutableList.of(COL_BYTES)); final SortedMap<byte[], RowResult<byte[]>> emptyResults = ImmutableSortedMap.<byte[], RowResult<byte[]>>orderedBy(PtBytes.BYTES_COMPARATOR).build(); final Set<byte[]> noRows = ImmutableSortedSet.orderedBy(PtBytes.BYTES_COMPARATOR).build(); mockery.checking(new Expectations() { { oneOf(transaction).getRows(table, oneRow, oneColumn); will(returnValue(emptyResults)); oneOf(transaction).getRows(table, noRows, oneColumn); will(returnValue(emptyResults)); } }); Assert.assertEquals(emptyResults, cachingTransaction.getRows(table, oneRow, oneColumn)); Assert.assertEquals(emptyResults, cachingTransaction.getRows(table, oneRow, oneColumn)); mockery.assertIsSatisfied(); }

Target:
public void testCacheEmptyGets() { final Set<byte[]> oneRow = ImmutableSortedSet.orderedBy(PtBytes.BYTES_COMPARATOR).add(ROW_BYTES).build(); final ColumnSelection oneColumn = ColumnSelection.create(ImmutableList.of(COL_BYTES)); final SortedMap<byte[], RowResult<byte[]>> emptyResults = ImmutableSortedMap.<byte[], RowResult<byte[]>>orderedBy(PtBytes.BYTES_COMPARATOR).build(); final Set<byte[]> noRows = ImmutableSortedSet.orderedBy(PtBytes.BYTES_COMPARATOR).build(); mockery.checking(new Expectations() { { oneOf(transaction).getRows(table, oneRow, oneColumn); will(returnValue(emptyResults)); oneOf(transaction).getRows(table, noRows, oneColumn); will(returnValue(emptyResults)); } }); assertEquals(emptyResults, cachingTransaction.getRows(table, oneRow, oneColumn)); assertEquals(emptyResults, cachingTransaction.getRows(table, oneRow, oneColumn)); mockery.assertIsSatisfied(); }
Source:
public String toString() { return "CommandSubscribeRequest{" + "subscriptionId=" + subscriptionId + ", device=" + device + ", names=" + names + ", timestamp=" + timestamp + ", limit=" + limit + '}'; }

Target:
public String toString() { return "CommandSubscribeRequest{" + "subscriptionId='" + subscriptionId + '\'' + ", device='" + device + '\'' + ", names=" + names + ", timestamp=" + timestamp + ", limit=" + limit + '}'; }
Source:
public List<String> lines() { return getList("lines", String.class); }

Target:
public List<String> lines() { return getLines(); }
Source:
public synchronized void stop() throws IOException { this.started = false; notifyAll(); boolean interrupted = false; long WAIT_TIMEOUT = 100; boolean waited = false; while (thread != null) { if (waited) { this.thread.interrupt(); break; } try { long started = System.currentTimeMillis(); wait(WAIT_TIMEOUT); waited = System.currentTimeMillis() - started >= WAIT_TIMEOUT; } catch (InterruptedException ie) { interrupted = true; } } if (interrupted) Thread.currentThread().interrupt(); }

Target:
public synchronized void stop() throws IOException { this.started = false; notifyAll(); boolean interrupted = false; long WAIT_TIMEOUT = 100; boolean waited = false; long started = System.currentTimeMillis(); while (thread != null) { if (waited) { this.thread.interrupt(); break; } try { wait(WAIT_TIMEOUT); waited = System.currentTimeMillis() - started >= WAIT_TIMEOUT; } catch (InterruptedException ie) { interrupted = true; } } if (interrupted) Thread.currentThread().interrupt(); }
Source:
private void fillValues() { if (jvms.isEmpty()) { String message; if (Platform.OS_WIN32.equals(Platform.getOS())) { message = "BrowserSim/CordovaSim require a 32-bit JRE/JDK 6 or JDK 7 to be installed."; } else if (PlatformUtil.OS_MACOSX.equals(PlatformUtil.getOs()) && PlatformUtil.ARCH_X86.equals(PlatformUtil.getArch())) { message = "BrowserSim/CordovaSim require Java 6 to be installed."; } else { message = "BrowserSim/CordovaSim require Java 6 and above to be installed."; } setMessage(message, IMessageProvider.ERROR); automatically.setSelection(true); select.setEnabled(false); combo.setEnabled(false); } else { int selectionIndex = -1; if (IPreferenceStore.FALSE.equals(getPreferenceStore().getString(BROWSERSIM_JVM_AUTOMATICALLY))) { String selectedID = getPreferenceStore().getString(BROWSERSIM_JVM_ID); for(int i = 0; i < jvms.size(); i++) { if (selectedID.equals(jvms.get(i).getId())) { selectionIndex = i; break; } } select.setSelection(true); controlChanged(select); } else { automatically.setSelection(true); controlChanged(automatically); } automatically.setText(automatically.getText() + " (" + jvms.get(0).getName() + ")"); combo.select(selectionIndex); } }

Target:
private void fillValues() { if (jvms.isEmpty()) { String message; if (Platform.OS_WIN32.equals(Platform.getOS())) { message = "BrowserSim/CordovaSim require a 32-bit JRE/JDK 6 or JDK 7 to be installed."; } else if (PlatformUtil.OS_MACOSX.equals(PlatformUtil.getOs()) && PlatformUtil.ARCH_X86.equals(PlatformUtil.getArch())) { message = "To run BrowserSim/CordovaSim with Java 7 you must run 64-bit Eclipse or use Java 6."; } else { message = "BrowserSim/CordovaSim require Java 6 and above to be installed."; } setMessage(message, IMessageProvider.ERROR); automatically.setSelection(true); select.setEnabled(false); combo.setEnabled(false); } else { int selectionIndex = -1; if (IPreferenceStore.FALSE.equals(getPreferenceStore().getString(BROWSERSIM_JVM_AUTOMATICALLY))) { String selectedID = getPreferenceStore().getString(BROWSERSIM_JVM_ID); for(int i = 0; i < jvms.size(); i++) { if (selectedID.equals(jvms.get(i).getId())) { selectionIndex = i; break; } } select.setSelection(true); controlChanged(select); } else { automatically.setSelection(true); controlChanged(automatically); } automatically.setText(automatically.getText() + " (" + jvms.get(0).getName() + ")"); combo.select(selectionIndex); } }
Source:
public OrderPositionEto saveOrderPosition(OrderPositionEto orderPosition) { Objects.requireNonNull(orderPosition, "orderPosition"); Long orderPositionId = orderPosition.getId(); String action; if (orderPositionId == null) { action = "saved"; Long offerId = orderPosition.getOfferId(); Objects.requireNonNull(offerId, "offerId cannot be null"); OfferEto offer = this.offerManagement.findOffer(offerId); Objects.requireNonNull(offer, "Offer@" + offerId); orderPosition.setPrice(offer.getPrice()); orderPosition.setOfferName(offer.getName()); } else { OrderPositionEntity currentOrderPosition = getOrderPositionDao().find(orderPositionId); verifyUpdate(currentOrderPosition, orderPosition); action = "updated"; } OrderPositionEntity orderPositionEntity = getBeanMapper().map(orderPosition, OrderPositionEntity.class); orderPositionEntity = getOrderPositionDao().save(orderPositionEntity); LOG.debug("The order position with id has been {}.", orderPositionEntity.getId(), action); return getBeanMapper().map(orderPositionEntity, OrderPositionEto.class); }

Target:
public OrderPositionEto saveOrderPosition(OrderPositionEto orderPosition) { Objects.requireNonNull(orderPosition, "orderPosition"); Long orderPositionId = orderPosition.getId(); String action; if (orderPositionId == null) { action = "saved"; Long offerId = orderPosition.getOfferId(); Objects.requireNonNull(offerId, "offerId"); OfferEto offer = this.offerManagement.findOffer(offerId); Objects.requireNonNull(offer, "Offer@" + offerId); orderPosition.setPrice(offer.getPrice()); orderPosition.setOfferName(offer.getName()); } else { OrderPositionEntity currentOrderPosition = getOrderPositionDao().find(orderPositionId); verifyUpdate(currentOrderPosition, orderPosition); action = "updated"; } OrderPositionEntity orderPositionEntity = getBeanMapper().map(orderPosition, OrderPositionEntity.class); orderPositionEntity = getOrderPositionDao().save(orderPositionEntity); LOG.debug("The order position with id has been {}.", orderPositionEntity.getId(), action); return getBeanMapper().map(orderPositionEntity, OrderPositionEto.class); }
Source:
public boolean isQueryCacheable(Query query) { return !Sets.newHashSet(unCacheable).contains(query.getType()); }

Target:
public boolean isQueryCacheable(Query query) { return !unCacheable.contains(query.getType()); }
Source:
public ActionButton addMenuListItem(final ActionButtonDefinition<T> menuItemDef) { ActionAnchorListItem result = new ActionAnchorListItem(menuItemDef.getText()); String menuId = menuItemDef.getUniqueId(); if (menuId != null) { result.asWidget().getElement().setId( ElementIdUtils.createElementId(elementId, menuId)); } if (menuItemDef.getCommandLocation().equals(CommandLocation.ContextAndToolBar) || menuItemDef.getCommandLocation().equals(CommandLocation.OnlyFromContext)) { actionButtonList.add(menuItemDef); } result.addClickHandler(e -> { menuItemDef.onClick(getSelectedItems()); }); registerSelectionChangeHandler(menuItemDef); menuItemDef.addInitializeHandler(e -> { updateActionButton(result, menuItemDef); }); updateActionButton(result, menuItemDef); return result; }

Target:
public ActionButton addMenuListItem(final ActionButtonDefinition<T> menuItemDef) { ActionAnchorListItem result = new ActionAnchorListItem(menuItemDef.getText()); String menuItemId = menuItemDef.getUniqueId(); if (menuItemId != null) { result.asWidget().getElement().setId( ElementIdUtils.createElementId(elementId, menuItemId)); } if (menuItemDef.getCommandLocation().equals(CommandLocation.ContextAndToolBar) || menuItemDef.getCommandLocation().equals(CommandLocation.OnlyFromContext)) { actionButtonList.add(menuItemDef); } result.addClickHandler(e -> { menuItemDef.onClick(getSelectedItems()); }); registerSelectionChangeHandler(menuItemDef); menuItemDef.addInitializeHandler(e -> { updateActionButton(result, menuItemDef); }); updateActionButton(result, menuItemDef); return result; }
Source:
public void deleteMilestone() throws Exception { final Milestones milestones = milestones(); final int number = milestones.create("first milestones").number(); milestones.remove(number); MatcherAssert.assertThat( milestones.iterate(new ArrayMap<String, String>()), Matchers.notNullValue() ); }

Target:
public void deleteMilestone() throws Exception { final Milestones milestones = milestones(); final Milestone milestone = milestones.create("a milestones"); MatcherAssert.assertThat( milestones.iterate(new ArrayMap<String, String>()), Matchers.hasItem(milestone) ); milestones.remove(milestone.number()); MatcherAssert.assertThat( milestones.iterate(new ArrayMap<String, String>()), Matchers.not(Matchers.hasItem(milestone)) ); }
Source:
protected List<Measurement> doInBackground(Object... params) { Context context = (Context) params[0]; String ministryId = (String) params[1]; String mcc = (String) params[2]; String period = (String) params[3]; try { GmaApiClient apiClient = GmaApiClient.getInstance(context); JSONArray results = apiClient.searchMeasurements(ministryId, mcc, period); if(results == null) { Log.w(TAG, "No measurements found!"); return null; } return MeasurementsJsonParser.parseMeasurements(results, ministryId, mcc, period); } catch(ApiException e) { Log.e(TAG, "Failed to retrieve measurements from API", e); return null; } }

Target:
protected List<Measurement> doInBackground(Object... params) { String ministryId = (String) params[0]; String mcc = (String) params[1]; String period = (String) params[2]; try { GmaApiClient apiClient = GmaApiClient.getInstance(MeasurementsActivity.this); JSONArray results = apiClient.searchMeasurements(ministryId, mcc, period); if(results == null) { Log.w(TAG, "No measurements found!"); return null; } return MeasurementsJsonParser.parseMeasurements(results, ministryId, mcc, period); } catch(ApiException e) { Log.e(TAG, "Failed to retrieve measurements from API", e); return null; } }
Source:
private LeaderPingResult actuallyPingLeaderWithUuid( MultiplexingCompletionService<LeaderPingerContext<PingableLeader>, PingResult> multiplexingCompletionService, UUID uuid, LeaderPingerContext<PingableLeader> leader, Callable<PingResult> pingEndpoint) { try { multiplexingCompletionService.submit(leader, pingEndpoint); Future<Map.Entry<LeaderPingerContext<PingableLeader>, PingResult>> pingFuture = multiplexingCompletionService.poll(leaderPingResponseWait.toMillis(), TimeUnit.MILLISECONDS); return getLeaderPingResult(uuid, pingFuture, timeLockVersion, () -> greeningNodeShouldBecomeLeaderRateLimiter.tryAcquire()); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return LeaderPingResults.pingCallFailure(e); } catch (CheckedRejectedExecutionException e) { log.warn("Could not ping the leader, because the executor used to talk to that node is overloaded", e); return LeaderPingResults.pingCallFailure(e); } }

Target:
private LeaderPingResult actuallyPingLeaderWithUuid( MultiplexingCompletionService<LeaderPingerContext<PingableLeader>, PingResult> multiplexingCompletionService, UUID uuid, LeaderPingerContext<PingableLeader> leader, Callable<PingResult> pingEndpoint) { try { multiplexingCompletionService.submit(leader, pingEndpoint); Future<Map.Entry<LeaderPingerContext<PingableLeader>, PingResult>> pingFuture = multiplexingCompletionService.poll(leaderPingResponseWait.toMillis(), TimeUnit.MILLISECONDS); return getLeaderPingResult(uuid, pingFuture, timeLockVersion, greeningNodeShouldBecomeLeaderRateLimiter::tryAcquire); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return LeaderPingResults.pingCallFailure(e); } catch (CheckedRejectedExecutionException e) { log.warn("Could not ping the leader, because the executor used to talk to that node is overloaded", e); return LeaderPingResults.pingCallFailure(e); } }
Source:
private void sendBypassEmail(final ReceiveCommand cmd) throws EmailException { final Account.Id me = currentUser.getAccountId(); final String destBranchName = cmd.getRefName().substring(Constants.R_HEADS.length()); BranchEmail bm = branchEmailFactory.create(project, destBranchName, cmd.getType()); bm.setFrom(me); bm.send(); }

Target:
private void sendBypassEmail(final ReceiveCommand cmd) { final String destBranchName = cmd.getRefName().substring(Constants.R_HEADS.length()); BranchEmail bm = branchEmailFactory.create(project, destBranchName, cmd.getType()); bm.setFrom(currentUser.getAccountId()); try { bm.send(); } catch (EmailException e) { String error_head = ""; error_head = error_head + bm.getMessageClass() + " : "; log.error(error_head, e); } }
Source:
private void showSignOutBar() { findViewById(R.id.sign_in_bar).setVisibility(View.GONE); findViewById(R.id.sign_out_bar).setVisibility(View.VISIBLE); Player player = Games.Players.getCurrentPlayer(mGoogleApiClient); String url = player.getIconImageUrl(); TextView name = (TextView)findViewById(R.id.playerName); name.setText(player.getDisplayName()); if (url != null) { ImageView vw = (ImageView) findViewById(R.id.avatar); new DownloadImageTask(vw).execute(url); vw.setVisibility(View.VISIBLE); } String email = Plus.AccountApi.getAccountName(mGoogleApiClient); TextView emailView = (TextView)findViewById((R.id.playerEmail)); emailView.setText(email); }

Target:
private void showSignOutBar() { findViewById(R.id.sign_in_bar).setVisibility(View.GONE); findViewById(R.id.sign_out_bar).setVisibility(View.VISIBLE); Player player = Games.Players.getCurrentPlayer(mGoogleApiClient); String url = player.getIconImageUrl(); TextView name = (TextView)findViewById(R.id.playerName); name.setText(player.getDisplayName()); if (url != null) { ImageView vw = (ImageView) findViewById(R.id.avatar); new DownloadImageTask(vw).execute(url); } String email = Plus.AccountApi.getAccountName(mGoogleApiClient); TextView emailView = (TextView)findViewById((R.id.playerEmail)); emailView.setText(email); }
Source:
public Optional<String> getReturnUrl() { return Optional.ofNullable(returnUrl); }

Target:
public String getReturnUrl() { return returnUrl; }
Source:
public void testEmptySessionKeyEmptyInput() throws Exception { exception.expect(NullPointerException.class); pipe.setSessionKey(null); session.put("a", "123"); PipeRunResult res = doPipe(pipe, null, session); assertEquals(res.getResult().toString(), "[null]"); }

Target:
public void testEmptySessionKeyEmptyInput() throws Exception { exception.expect(NullPointerException.class); pipe.setSessionKey(""); session.put("a", "123"); PipeRunResult res = doPipe(pipe, null, session); assertEquals(res.getResult().toString(), "[null]"); }
Source:
public void onAvailabilityChecked(OnAvailabilityChecked event) { if (mRequestedEmail == null || !mRequestedEmail.equalsIgnoreCase(event.value)) { return; } if (isInProgress()) { endProgress(); } if (event.isError()) { AppLog.e(T.API, "OnAvailabilityChecked has error: " + event.error.type + " - " + event.error.message); ActivityUtils.hideKeyboardForced(mEmailInput); showEmailError(R.string.email_not_registered_wpcom); return; } switch (event.type) { case EMAIL: if (event.isAvailable) { showEmailError(R.string.email_not_registered_wpcom); } else if (mLoginListener != null) { EditTextUtils.hideSoftInput(mEmailInput.getEditText()); mLoginListener.gotWpcomEmail(event.value); } break; default: AppLog.e(T.API, "OnAvailabilityChecked unhandled event type: " + event.error.type); break; } }

Target:
public void onAvailabilityChecked(OnAvailabilityChecked event) { if (mRequestedEmail == null || !mRequestedEmail.equalsIgnoreCase(event.value)) { return; } if (isInProgress()) { endProgress(); } if (event.isError()) { AppLog.e(T.API, "OnAvailabilityChecked has error: " + event.error.type + " - " + event.error.message); ActivityUtils.hideKeyboardForced(mEmailInput); showEmailError(R.string.email_not_registered_wpcom); return; } switch (event.type) { case EMAIL: if (event.isAvailable) { ActivityUtils.hideKeyboardForced(mEmailInput); showEmailError(R.string.email_not_registered_wpcom); } else if (mLoginListener != null) { ActivityUtils.hideKeyboardForced(mEmailInput); mLoginListener.gotWpcomEmail(event.value); } break; default: AppLog.e(T.API, "OnAvailabilityChecked unhandled event type: " + event.error.type); break; } }
Source:
public IfLogicEndBrick(IfLogicBeginBrick ifLogicBeginBrick, IfLogicElseBrick ifElseBrick) { this.ifElseBrick = ifElseBrick; this.ifBeginBrick = ifLogicBeginBrick; }

Target:
public IfLogicEndBrick(IfLogicBeginBrick ifLogicBeginBrick, IfLogicElseBrick ifElseBrick) { this.ifBeginBrick = ifLogicBeginBrick; this.ifElseBrick = ifElseBrick; }
Source:
public static <M, K> Window<M, K, Collection<M>> keyedSessionWindow(Function<M, K> keyFn, Duration sessionGap) { BiFunction<M, Collection<M>, Collection<M>> aggregator = (m, c) -> { c.add(m); return c; }; Supplier<Collection<M>> initialValue = () -> { return new ArrayList<>(); }; return keyedSessionWindow(keyFn, sessionGap, initialValue, aggregator); }

Target:
public static <M, K> Window<M, K, Collection<M>> keyedSessionWindow(Function<M, K> keyFn, Duration sessionGap) { FoldLeftFunction<M, Collection<M>> aggregator = createAggregator(); Supplier<Collection<M>> initialValue = () -> new ArrayList<>(); return keyedSessionWindow(keyFn, sessionGap, initialValue, aggregator); }
Source:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); String user = getRequestParamValue(Const.ParamsNames.USER_ID); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, courseId); Assumption.assertPostParamNotNull(Const.ParamsNames.USER_ID, user); InstructorCourseEnrollAjaxPageData data = new InstructorCourseEnrollAjaxPageData( logic.getAccount(user), sessionToken, logic.getStudentsForCourse(courseId)); return createAjaxResult(data); }

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, courseId); gateKeeper.verifyInstructorPrivileges(account); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); CourseAttributes course = logic.getCourse(courseId); gateKeeper.verifyAccessible(instructor, course); InstructorCourseEnrollAjaxPageData data = new InstructorCourseEnrollAjaxPageData( account, sessionToken, logic.getStudentsForCourse(courseId)); return createAjaxResult(data); }
Source:
public void channelRead0(ChannelHandlerContext ctx, DiscoveryEvent event) throws Exception { try { nodeManager.handleInbound(event); } catch (Throwable t) { logger.error("Failed to process incoming message: {}", event.getMessage(), t); } }

Target:
public void channelRead0(ChannelHandlerContext ctx, DiscoveryEvent event) throws Exception { try { nodeManager.handleInbound(event); } catch (Throwable t) { logger.info("Failed to process incoming message: {}, caused by: {}", event.getMessage(), t.toString()); } }
Source:
public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(command); result = 31 * result + Objects.hashCode(notification); return result; }

Target:
public int hashCode() { return Objects.hashCode(command, notification); }
Source:
public void validate(IValidatable<String> iv) { String value = iv.getValue(); if (GeoServerApplication.get().getCatalog().getWorkspaceByName(value) != null) { iv.error(new ValidationError("NewWorkspacePanel.duplicateWorkspace")); } }

Target:
public void validate(IValidatable<String> iv) { String value = iv.getValue(); if (GeoServerApplication.get().getCatalog().getWorkspaceByName(value) != null) { iv.error(new ValidationError("NewWorkspacePanel.duplicateWorkspace") .setVariable("workspace", value)); } }
Source:
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { if (maxConnections > 0) { numConnections.decrementAndGet(); } super.channelClosed(ctx, e); }

Target:
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { if (maxConnections > 0) { if (numConnections.decrementAndGet() < 0) { log.error("BUG in ConnectionLimiter"); } } super.channelClosed(ctx, e); }
Source:
public void onFailure(Exception e) { Timber.d(e, "Alerts fetching failed."); if (getAlertsFragment()!=null){ getAlertsFragment().showError(); } }

Target:
public void onFailure(Exception e) { Timber.d(e, "Alerts fetching failed."); getAlertsFragment().showError(); }
Source:
public void destroy() { keytab = null; serverSubject = null; for (LoginContext loginContext : loginContexts) { try { loginContext.logout(); } catch (LoginException ex) { log.warn(ex.getMessage(), ex); } } loginContexts.clear(); }

Target:
public void destroy() { keytab = null; serverSubject = null; for (LoginContext loginContext : loginContexts) { try { loginContext.logout(); } catch (LoginException ex) { log.warn(ex, ex.getMessage()); } } loginContexts.clear(); }
Source:
public DeveloperProducts(String expectedSku, Map<String, Product> products) { this.sku = products.remove(expectedSku); this.provided = products; log.debug("Test?? {}", this.sku); }

Target:
public DeveloperProducts(String expectedSku, Map<String, Product> products) { this.sku = products.remove(expectedSku); this.provided = products; }
Source:
public void setAbsoluteBounds(Node<? extends View, ?> node) { Object definition = node.getContent().getDefinition(); setBounds(absoluteBounds(node)); if (definition instanceof BaseAdHocSubprocess || definition instanceof EventSubprocess || definition instanceof EmbeddedSubprocess) { shape.setIsExpanded(true); } }

Target:
public void setAbsoluteBounds(Node<? extends View, ?> node) { setBounds(absoluteBounds(node)); }
Source:
public ITestContainer addTestClass(String className) { if (fCurrentTestClass != null) { fCurrentTestClass.setEntityStatus(TestStatus.FINISHED); fCurrentTestClass = null; } if (className != null) { final ITestFile testFile = getTestFile(); final List<ITestEntity> duplicateClasses = testFile.getChildren().stream().filter(p -> p.getName().equals(className)).collect(Collectors.toList()); if (duplicateClasses.isEmpty()) { fCurrentTestClass = IRuntimeFactory.eINSTANCE.createTestClass(); fCurrentTestClass.setName(className); } else { fCurrentTestClass = (ITestClass) duplicateClasses.get(0); } fCurrentTestClass.setEntityStatus(TestStatus.RUNNING); if (getScriptEngine() instanceof IDebugEngine) fCurrentTestClass.setStackTrace(((IDebugEngine) getScriptEngine()).getStackTrace()); testFile.getChildren().add(fCurrentTestClass); } return fCurrentTestClass; }

Target:
public ITestContainer addTestClass(String className) { if (fCurrentTestClass != null) { fCurrentTestClass.setEntityStatus(TestStatus.FINISHED); fCurrentTestClass = null; } if (className != null) { final ITestFile testFile = getTestFile(); final List<ITestEntity> duplicateClasses = testFile.getChildren().stream() .filter(p -> ITestClass.class.isAssignableFrom(p.getClass()) && p.getName().equals(className)).collect(Collectors.toList()); if (duplicateClasses.isEmpty()) { fCurrentTestClass = IRuntimeFactory.eINSTANCE.createTestClass(); fCurrentTestClass.setName(className); } else { fCurrentTestClass = (ITestClass) duplicateClasses.get(0); } fCurrentTestClass.setEntityStatus(TestStatus.RUNNING); if (getScriptEngine() instanceof IDebugEngine) fCurrentTestClass.setStackTrace(((IDebugEngine) getScriptEngine()).getStackTrace()); testFile.getChildren().add(fCurrentTestClass); } return fCurrentTestClass; }
Source:
public String toCodeStringPreStatement() { StringBuilder b = new StringBuilder(); b.append(" b.append(" b.append("try {" + Globals.lineSep + " "); return b.toString(); }

Target:
public final String toCodeStringPreStatement() { StringBuilder b = new StringBuilder(); b.append(" b.append("try {" + Globals.lineSep + " "); return b.toString(); }
Source:
public SCOPE getScope(){ if (isInReplicationScope()){ if (isMetadataOnly() || isMetadataOnlyForExternalTables()){ return SCOPE.MD_ONLY; } else { return SCOPE.REPL; } } else { return SCOPE.NO_REPL; } }

Target:
public SCOPE getScope(){ if (isInReplicationScope()){ if (isMetadataOnly()){ return SCOPE.MD_ONLY; } else { return SCOPE.REPL; } } else { return SCOPE.NO_REPL; } }
Source:
public LabelPickerState setupState(String userInput, String... labelNames) { return new LabelPickerState(getHashSet(labelNames), getTestRepoLabels(), userInput); }

Target:
private LabelPickerState setupState(String userInput, String... labelNames) { return new LabelPickerState(getHashSet(labelNames), getTestRepoLabels(), userInput); }
Source:
public void testBuildName() throws Exception { final String imageName = "test-build-name"; final String dockerDirectory = Resources.getResource("dockerDirectory").getPath(); final String imageId = sut.build(Paths.get(dockerDirectory), imageName); final ImageInfo info = sut.inspectImage(imageName); final String expextedId = dockerApiVersionLessThan("1.22") ? imageId : "sha256:" + imageId; assertThat(info.id(), startsWith(expextedId)); }

Target:
public void testBuildName() throws Exception { final String imageName = "test-build-name"; final String dockerDirectory = Resources.getResource("dockerDirectory").getPath(); final String imageId = sut.build(Paths.get(dockerDirectory), imageName); final ImageInfo info = sut.inspectImage(imageName); final String expectedId = dockerApiVersionLessThan("1.22") ? imageId : "sha256:" + imageId; assertThat(info.id(), startsWith(expectedId)); }
Source:
Engine(final Executor taskExecutor, final DelayedExecutor timerExecutor, final ILoggerFactory loggerFactory, final Map<String, Object> properties, final PlanDeactivationListener planActivityListener, final PlanCompletionListener planCompletionListener) { _taskExecutor = taskExecutor; _timerExecutor = timerExecutor; _loggerFactory = loggerFactory; _properties = properties; _planDeactivationListener = planActivityListener; _planCompletionListener = planContext -> { planCompletionListener.onPlanCompleted(planContext); _taskDoneListener.onPlanCompleted(planContext); }; _allLogger = loggerFactory.getLogger(LOGGER_BASE + ":all"); _rootLogger = loggerFactory.getLogger(LOGGER_BASE + ":root"); if (_properties.containsKey(MAX_RELATIONSHIPS_PER_TRACE)) { _maxRelationshipsPerTrace = (Integer) getProperty(MAX_RELATIONSHIPS_PER_TRACE); } else { _maxRelationshipsPerTrace = DEFUALT_MAX_RELATIONSHIPS_PER_TRACE; } }

Target:
Engine(final Executor taskExecutor, final DelayedExecutor timerExecutor, final ILoggerFactory loggerFactory, final Map<String, Object> properties, final PlanDeactivationListener planActivityListener, final PlanCompletionListener planCompletionListener) { _taskExecutor = taskExecutor; _timerExecutor = timerExecutor; _loggerFactory = loggerFactory; _properties = properties; _planDeactivationListener = planActivityListener; _allLogger = loggerFactory.getLogger(LOGGER_BASE + ":all"); _rootLogger = loggerFactory.getLogger(LOGGER_BASE + ":root"); _planCompletionListener = planContext -> { try { planCompletionListener.onPlanCompleted(planContext); } catch (Throwable t) { LOG.error("Uncaught throwable from custom PlanCompletionListener.", t); } finally { _taskDoneListener.onPlanCompleted(planContext); } }; if (_properties.containsKey(MAX_RELATIONSHIPS_PER_TRACE)) { _maxRelationshipsPerTrace = (Integer) getProperty(MAX_RELATIONSHIPS_PER_TRACE); } else { _maxRelationshipsPerTrace = DEFUALT_MAX_RELATIONSHIPS_PER_TRACE; } }
Source:
public boolean waitUntilReadyToProcess(Properties jobProps) { return true; }

Target:
protected boolean waitUntilReadyToProcess(Properties jobProps) { return true; }
Source:
private boolean validRegex() { try { Pattern.compile(searchField.getText()); } catch (PatternSyntaxException e) { LOGGER.error(e.getMessage()); return false; } return true; }

Target:
private boolean validRegex() { try { Pattern.compile(searchField.getText()); } catch (PatternSyntaxException e) { LOGGER.debug(e.getMessage()); return false; } return true; }
Source:
public void testLinkInternalPageAnchorReference2() { String html = parser.parseToHtml("a [[#Some link?|alt text]] reference to an internal anchor"); TestUtil.println("HTML: \n" + html); assertTrue(html.contains("<body><p>a <a href=\"#Some_link.3F\">alt text</a> reference to an internal anchor</p></body>")); }

Target:
public void testLinkInternalPageAnchorReference2() { String html = parser.parseToHtml("a [[#Some link?|link text]] reference to an internal anchor"); TestUtil.println("HTML: \n" + html); assertTrue(html.contains("<body><p>a <a href=\"#Some_link.3F\">link text</a> reference to an internal anchor</p></body>")); }
Source:
public Dispatcher unsubscribe(Subscription subscription, int after) { if (subscription.getDispatcher() != this) { throw new IllegalStateException("Subscription is not managed by this Dispatcher"); } if (this.subscriptionsUsingDefaultHandler.get(subscription.getSubject()) != null) { throw new IllegalStateException("Subscription uses default handler and cannot call unsubscribe"); } if (!(subscription instanceof NatsSubscription)) { throw new IllegalArgumentException("This Subscription implementation is not known by Dispatcher"); } NatsSubscription ns = ((NatsSubscription) subscription); NatsSubscription sub = this.subscriptionsWithHandlers.get(ns.getSID()); if (sub != null) { this.connection.unsubscribe(sub, after); } return this; }

Target:
public Dispatcher unsubscribe(Subscription subscription, int after) { if (!this.running.get()) { throw new IllegalStateException("Dispatcher is closed"); } if (isDraining()) { return this; } if (subscription.getDispatcher() != this) { throw new IllegalStateException("Subscription is not managed by this Dispatcher"); } if (!(subscription instanceof NatsSubscription)) { throw new IllegalArgumentException("This Subscription implementation is not known by Dispatcher"); } NatsSubscription ns = ((NatsSubscription) subscription); NatsSubscription sub = this.subscriptionsWithHandlers.get(ns.getSID()); if (sub != null) { this.connection.unsubscribe(sub, after); } return this; }
Source:
public SafeHtml getValue() { if (showUnderline) { return templates.underlinedHeader(headerText); } return headerText; }

Target:
public SafeHtml getValue() { return headerText; }
Source:
public LightblueResponse data(LightblueRequest lightblueRequest) { LOGGER.debug("Calling data service with lightblueRequest: " + lightblueRequest.toString()); return callService(new LightblueHttpDataRequest(lightblueRequest) .getRestRequest(configuration.getDataServiceURI())); }

Target:
public LightblueResponse data(LightblueRequest lightblueRequest) { LOGGER.debug("Calling data service with lightblueRequest: " + lightblueRequest.toString()); try { return callService(new LightblueHttpDataRequest(lightblueRequest) .getRestRequest(configuration.getDataServiceURI())); } catch (RuntimeException e) { throw new LightblueHttpClientException("Error sending lightblue request: " + lightblueRequest.getBody(), e); } }