auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testMismatchedMetrics() throws IOException { IncrementalIndex index1 = IncrementalIndexTest.createIndex(new AggregatorFactory[]{ new LongSumAggregatorFactory("A", "A") }); IncrementalIndex index2 = IncrementalIndexTest.createIndex(new AggregatorFactory[]{ new LongSumAggregatorFactory("A", "A"), new LongSumAggregatorFactory("C", "C") }); IncrementalIndex index3 = IncrementalIndexTest.createIndex(new AggregatorFactory[]{ new LongSumAggregatorFactory("B", "B") }); Interval interval = new Interval(0, new DateTime().getMillis()); RoaringBitmapFactory factory = new RoaringBitmapFactory(); ArrayList<IndexableAdapter> toMerge = Lists.<IndexableAdapter>newArrayList( new IncrementalIndexAdapter(interval, index1, factory), new IncrementalIndexAdapter(interval, index2, factory), new IncrementalIndexAdapter(interval, index3, factory) ); final File tmpDirMerged = temporaryFolder.newFolder(); INDEX_MERGER.merge( toMerge, new AggregatorFactory[] { new LongSumAggregatorFactory("A", "A"), new LongSumAggregatorFactory("B", "B"), new LongSumAggregatorFactory("C", "C") }, tmpDirMerged, null, indexSpec ); }

Target:
public void testMismatchedMetrics() throws IOException { IncrementalIndex index1 = IncrementalIndexTest.createIndex(new AggregatorFactory[]{ new LongSumAggregatorFactory("A", "A") }); closer.closeLater(index1); IncrementalIndex index2 = IncrementalIndexTest.createIndex(new AggregatorFactory[]{ new LongSumAggregatorFactory("A", "A"), new LongSumAggregatorFactory("C", "C") }); closer.closeLater(index2); IncrementalIndex index3 = IncrementalIndexTest.createIndex(new AggregatorFactory[]{ new LongSumAggregatorFactory("B", "B") }); closer.closeLater(index3); IncrementalIndex index4 = IncrementalIndexTest.createIndex(new AggregatorFactory[]{ new LongSumAggregatorFactory("C", "C"), new LongSumAggregatorFactory("A", "A"), new LongSumAggregatorFactory("B", "B") }); closer.closeLater(index4); IncrementalIndex index5 = IncrementalIndexTest.createIndex(new AggregatorFactory[]{ new LongSumAggregatorFactory("C", "C"), new LongSumAggregatorFactory("B", "B") }); closer.closeLater(index5); Interval interval = new Interval(0, new DateTime().getMillis()); RoaringBitmapFactory factory = new RoaringBitmapFactory(); ArrayList<IndexableAdapter> toMerge = Lists.<IndexableAdapter>newArrayList( new IncrementalIndexAdapter(interval, index1, factory), new IncrementalIndexAdapter(interval, index2, factory), new IncrementalIndexAdapter(interval, index3, factory), new IncrementalIndexAdapter(interval, index4, factory), new IncrementalIndexAdapter(interval, index5, factory) ); final File tmpDirMerged = temporaryFolder.newFolder(); File merged = INDEX_MERGER.merge( toMerge, new AggregatorFactory[]{ new LongSumAggregatorFactory("A", "A"), new LongSumAggregatorFactory("B", "B"), new LongSumAggregatorFactory("C", "C"), new LongSumAggregatorFactory("D", "D") }, tmpDirMerged, indexSpec ); final QueryableIndexStorageAdapter adapter = new QueryableIndexStorageAdapter(closer.closeLater(INDEX_IO.loadIndex(merged))); Assert.assertEquals(ImmutableSet.of("A", "B", "C"), ImmutableSet.copyOf(adapter.getAvailableMetrics())); }
Source:
public List<Section> getSectionsUnderEvalGroup( String evalGroupID ) { List<Section> sections = new ArrayList<Section>(); if( evalGroupID == null ) { throw new IllegalArgumentException( "evalGroupId cannot be null" ); } if( !evalGroupID.startsWith( EvalConstants.GROUP_ID_SITE_PREFIX ) ) { throw new IllegalArgumentException( "cannot determine sections of groupId='" + evalGroupID + "' (must be a site)" ); } boolean isSingleSection = false; if( evalGroupID.contains( EvalConstants.GROUP_ID_SECTION_PREFIX ) ) { isSingleSection = true; } try { String siteID = evalGroupID.replace( EvalConstants.GROUP_ID_SITE_PREFIX, "" ); if( isSingleSection ) { sections.add( courseManagementService.getSection( evalGroupID.substring( evalGroupID.indexOf( EvalConstants.GROUP_ID_SECTION_PREFIX ) + 9 ) ) ); } else { String realmID = siteService.siteReference( siteID ); Set<String> sectionIDs = authzGroupService.getProviderIds( realmID ); for( String secID : sectionIDs ) { sections.add( courseManagementService.getSection( secID ) ); } } } catch( Exception ex ) return sections; }

Target:
public List<Section> getSectionsUnderEvalGroup( String evalGroupID ) { if( evalGroupID == null ) { throw new IllegalArgumentException( "evalGroupId cannot be null" ); } if( !evalGroupID.startsWith( EvalConstants.GROUP_ID_SITE_PREFIX ) ) { throw new IllegalArgumentException( "cannot determine sections of groupId='" + evalGroupID + "' (must be a site)" ); } List<Section> sections = new ArrayList<>(); boolean isSingleSection = false; if( evalGroupID.contains( EvalConstants.GROUP_ID_SECTION_PREFIX ) ) { isSingleSection = true; } try { String siteID = evalGroupID.replace( EvalConstants.GROUP_ID_SITE_PREFIX, "" ); if( isSingleSection ) { sections.add( courseManagementService.getSection( evalGroupID.substring( evalGroupID.indexOf( EvalConstants.GROUP_ID_SECTION_PREFIX ) + EvalConstants.GROUP_ID_SECTION_PREFIX.length() ) ) ); } else { String realmID = siteService.siteReference( siteID ); Set<String> sectionIDs = authzGroupService.getProviderIds( realmID ); for( String secID : sectionIDs ) { sections.add( courseManagementService.getSection( secID ) ); } } } catch( Exception ex ) return sections; }
Source:
public void testGooglePlayStoreInstallSourceIsParsedCorrectly() { final InstallSource installSource = InstallSource.fromInstallerPackageName("com.android.vending"); assertTrue(installSource instanceof GooglePlayStoreInstallSource); assertEquals("Google Play Store", installSource.toString()); }

Target:
public void testGooglePlayStoreInstallSourceIsParsedCorrectly() { final InstallSource installSource = InstallSource.fromInstallerPackageName("com.android.vending"); assertTrue( "Package name is correctly identified as belonging to the Google Play Store", installSource instanceof GooglePlayStoreInstallSource); assertEquals( "Google Play Store install source has correct description", "Google Play Store", installSource.toString()); }
Source:
private void loadBackgroundImage() { final Controller controller = Controller.getCurrentController(); final MapStyle mapStyle = controller.getModeController().getExtension(MapStyle.class); final MapModel model = controller.getMap(); final String file = mapStyle.getProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE); if (file == MapStyle.CLEAR_BACKGROUND_IMAGE) { backgroundImage = null; return; } URI uri = null; try { uri = new URI(file); } catch (final URISyntaxException e) { LogUtils.severe(e); return; } try { backgroundImage = ImageIO.read(uri.toURL()); } catch (final IOException e) { LogUtils.severe(e); return; } }

Target:
private void loadBackgroundImage() { final MapStyle mapStyle = getModeController().getExtension(MapStyle.class); final String uriString = mapStyle.getProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE); if (uriString == null) { backgroundComponent = null; return; } URI uri = assignAbsoluteURI(uriString); final ViewerController vc = getModeController().getExtension(ViewerController.class); final IViewerFactory factory = vc.getCombiFactory(); if (uri != null) { assignViewerToBackgroundComponent(factory, uri); ((ScalableComponent) backgroundComponent).setCenter(true); } repaint(); }
Source:
public void bufferWhilePredicateNull() { try { Observable.empty().bufferSplitWhen(null, false); Assert.fail("Didn't throw NullPointerException"); } catch (NullPointerException ex) { Assert.assertEquals("predicate", ex.getMessage()); } }

Target:
public void bufferWhilePredicateNull() { try { Observable.empty().bufferWhile(null); Assert.fail("Didn't throw NullPointerException"); } catch (NullPointerException ex) { Assert.assertEquals("predicate", ex.getMessage()); } }
Source:
private TableStatistics createZeroStatistics(Map<String, ColumnHandle> columns, Map<String, Type> columnTypes) { TableStatistics.Builder result = TableStatistics.builder(); result.setRowCount(Estimate.of(0)); columns.forEach((columnName, columnHandle) -> { Type columnType = requireNonNull(columnTypes.get(columnName), "columnType is null"); ColumnStatistics.Builder columnStatistics = ColumnStatistics.builder(); columnStatistics.setNullsFraction(Estimate.of(0)); columnStatistics.setDistinctValuesCount(Estimate.of(0)); if (isDataSizeRequired(columnType)) { columnStatistics.setDataSize(Estimate.of(0)); } result.setColumnStatistics(columnHandle, columnStatistics.build()); }); return result.build(); }

Target:
private TableStatistics createZeroStatistics(Map<String, ColumnHandle> columns, Map<String, Type> columnTypes) { TableStatistics.Builder result = TableStatistics.builder(); result.setRowCount(Estimate.of(0)); columns.forEach((columnName, columnHandle) -> { Type columnType = columnTypes.get(columnName); verify(columnType != null, "columnType is missing for column: %s", columnName); ColumnStatistics.Builder columnStatistics = ColumnStatistics.builder(); columnStatistics.setNullsFraction(Estimate.of(0)); columnStatistics.setDistinctValuesCount(Estimate.of(0)); if (hasDataSize(columnType)) { columnStatistics.setDataSize(Estimate.of(0)); } result.setColumnStatistics(columnHandle, columnStatistics.build()); }); return result.build(); }
Source:
public double score(InsertionData best, Job job) { Vehicle selectedVehicle = best.getSelectedVehicle(); double maxFromStart = job.getAllLocations().stream() .mapToDouble(l -> getDistance(selectedVehicle.getStartLocation(), l)) .max() .orElse(0d); double maxToEnd = job.getAllLocations().stream() .mapToDouble(l -> getDistance(selectedVehicle.getEndLocation(), l)) .max() .orElse(0d); double maxDepotDistance = Math.max(maxFromStart, maxToEnd); double minTimeToOperate = job.getOperationTimeWindows().stream() .mapToDouble(tw -> tw.getEnd() - tw.getStart()) .min() .orElse(0d); return Math.max(timeWindowParam * minTimeToOperate, minTimeWindowScore) + depotDistanceParam * maxDepotDistance; }

Target:
public double score(InsertionData best, Job job) { Vehicle selectedVehicle = best.getSelectedVehicle(); double maxFromStart = job.getAllLocations().stream() .mapToDouble(l -> getDistance(selectedVehicle.getStartLocation(), l)) .max() .orElse(0d); double maxToEnd = job.getAllLocations().stream() .mapToDouble(l -> getDistance(selectedVehicle.getEndLocation(), l)) .max() .orElse(0d); double maxDepotDistance = Math.max(maxFromStart, maxToEnd); double minTimeToOperate = job.getTimeWindows().stream() .mapToDouble(tw -> tw.getEnd() - tw.getStart()) .min() .orElse(0d); return Math.max(timeWindowParam * minTimeToOperate, minTimeWindowScore) + depotDistanceParam * maxDepotDistance; }
Source:
public void setup() throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, InterruptedException, NoSuchFieldException { Configuration conf = new Configuration(); String input_file = ClassLoader.getSystemClassLoader().getResource(filename).getFile(); conf.set("hadoopbam.vcf.trust-exts", "true"); conf.set("mapred.input.dir", "file://" + input_file); conf.setStrings("io.compression.codecs", BGZFEnhancedGzipCodec.class.getCanonicalName(), BGZFCodec.class.getCanonicalName()); conf.setInt(FileInputFormat.SPLIT_MAXSIZE, 100 * 1024); if (filename == "small_snpeff.vcf") { VCFRecordReader.setValidationStringency(conf, ValidationStringency.SILENT); } if (interval != null) { VCFInputFormat.setIntervals(conf, ImmutableList.of(interval)); } taskAttemptContext = new TaskAttemptContextImpl(conf, mock(TaskAttemptID.class)); JobContext ctx = new JobContextImpl(conf, taskAttemptContext.getJobID()); VCFInputFormat inputFormat = new VCFInputFormat(conf); List<InputSplit> splits = inputFormat.getSplits(ctx); switch (expectedSplits) { case EXACTLY_ONE: assertEquals("Should be exactly one split", 1, splits.size()); break; case MORE_THAN_ONE: assertTrue("Should be more than one split", splits.size() > 1); break; case ANY: default: break; } readers = new ArrayList<>(); for (InputSplit split : splits) { RecordReader<LongWritable, VariantContextWritable> reader = inputFormat.createRecordReader(split, taskAttemptContext); reader.initialize(split, taskAttemptContext); readers.add(reader); } }

Target:
public void setup() throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, InterruptedException, NoSuchFieldException { Configuration conf = new Configuration(); String input_file = ClassLoader.getSystemClassLoader().getResource(filename).getFile(); conf.set("hadoopbam.vcf.trust-exts", "true"); conf.set("mapred.input.dir", "file://" + input_file); conf.setStrings("io.compression.codecs", BGZFEnhancedGzipCodec.class.getCanonicalName(), BGZFCodec.class.getCanonicalName()); conf.setInt(FileInputFormat.SPLIT_MAXSIZE, 100 * 1024); if (interval != null) { VCFInputFormat.setIntervals(conf, ImmutableList.of(interval)); } taskAttemptContext = new TaskAttemptContextImpl(conf, mock(TaskAttemptID.class)); JobContext ctx = new JobContextImpl(conf, taskAttemptContext.getJobID()); VCFInputFormat inputFormat = new VCFInputFormat(conf); List<InputSplit> splits = inputFormat.getSplits(ctx); switch (expectedSplits) { case EXACTLY_ONE: assertEquals("Should be exactly one split", 1, splits.size()); break; case MORE_THAN_ONE: assertTrue("Should be more than one split", splits.size() > 1); break; case ANY: default: break; } readers = new ArrayList<>(); for (InputSplit split : splits) { RecordReader<LongWritable, VariantContextWritable> reader = inputFormat.createRecordReader(split, taskAttemptContext); reader.initialize(split, taskAttemptContext); readers.add(reader); } }
Source:
public void spotrf(byte uplo, int N, INDArray A, INDArray INFO) { int status = LAPACKE_spotrf(getColumnOrder(A), uplo, N, A.data().asNioFloat(), getLda(A) ); if( status != 0 ) { throw new Error( "Failed to execute spotrf, code:" + status ) ; } if( uplo == 'U' ) { for( int ro=1 ; ro<N ; ro++ ) { for( int c=0 ; c<ro ; c++ ) { A.putScalar( ro, c, 0 ) ; } } } else { for( int c=1 ; c<N ; c++ ) { for( int ro=0 ; ro<c ; ro++ ) { A.putScalar( ro, c, 0 ) ; } } } }

Target:
public void spotrf(byte uplo, int N, INDArray A, INDArray INFO) { int status = LAPACKE_spotrf(getColumnOrder(A), uplo, N, (FloatPointer)A.data().addressPointer(), getLda(A) ); if( status != 0 ) { throw new BlasException( "Failed to execute spotrf", status ) ; } if( uplo == 'U' ) { INDArrayIndex ix[] = new INDArrayIndex[ 2 ] ; for( int i=1 ; i<Math.min( A.rows(), A.columns() ) ; i++ ) { ix[0] = NDArrayIndex.point( i ) ; ix[1] = NDArrayIndex.interval( 0, i ) ; A.put(ix, 0) ; } } else { INDArrayIndex ix[] = new INDArrayIndex[ 2 ] ; for( int i=0 ; i<Math.min( A.rows(), A.columns()-1 ) ; i++ ) { ix[0] = NDArrayIndex.point( i ) ; ix[1] = NDArrayIndex.interval( i+1, A.columns() ) ; A.put(ix, 0) ; } } }
Source:
private void leaveErrorBreadcrumb(@NonNull Event event) { List<Error> errors = event.getErrors(); String name = ""; String msg = ""; if (errors.size() > 0) { name = errors.get(0).getErrorClass(); msg = errors.get(0).getErrorMessage(); } Map<String, Object> message = Collections.<String, Object>singletonMap("message", msg); breadcrumbState.add(new Breadcrumb(name, BreadcrumbType.ERROR, message, new Date())); }

Target:
private void leaveErrorBreadcrumb(@NonNull Event event) { List<Error> errors = event.getErrors(); if (errors.size() > 0) { String name = errors.get(0).getErrorClass(); String msg = errors.get(0).getErrorMessage(); Map<String, Object> message = Collections.<String, Object>singletonMap("message", msg); breadcrumbState.add(new Breadcrumb(name, BreadcrumbType.ERROR, message, new Date())); } }
Source:
public void badRangeHeaderTest() throws Exception { JSONObject headers = new JSONObject(); headers.put(RestUtils.Headers.RANGE, "adsfksakdfsdfkdaklf"); try { doOperation(createRestRequest(RestMethod.GET, "/", headers, null), new MockRestResponseChannel()); fail("GET operation should have failed because of an invalid range header"); } catch (RestServiceException e) { assertEquals("Unexpected error code", RestServiceErrorCode.RangeNotSatisfiable, e.getErrorCode()); } }

Target:
public void badRangeHeaderTest() throws Exception { JSONObject headers = new JSONObject(); headers.put(RestUtils.Headers.RANGE, "adsfksakdfsdfkdaklf"); try { doOperation(createRestRequest(RestMethod.GET, "/", headers, null), new MockRestResponseChannel()); fail("GET operation should have failed because of an invalid range header"); } catch (RestServiceException e) { assertEquals("Unexpected error code", RestServiceErrorCode.InvalidArgs, e.getErrorCode()); } }
Source:
public void pathWriterFailureMentionsCause() throws Exception { try { final Path outputPath = Paths.get("nope://no.txt"); createSmallBam(outputPath); Assert.assertFalse(true, "Should have thrown a RuntimeIOException"); } catch (RuntimeIOException expected) { Assert.assertTrue(expected.getCause().toString().contains("NoSuchFileException")); } }

Target:
public void pathWriterFailureMentionsCause() throws Exception { try { final Path outputPath = Paths.get("nope://no.txt"); createSmallBam(outputPath); Assert.fail("Should have thrown a RuntimeIOException"); } catch (RuntimeIOException expected) { Assert.assertTrue(expected.getCause().toString().contains("NoSuchFileException")); } }
Source:
public void before() { A = Allele.create("A"); ARef = Allele.create("A", true); T = Allele.create("T"); ATIns = Allele.create("AT"); ATCIns = Allele.create("ATC"); NoCall = Allele.create(Allele.NO_CALL_STRING); SpandDel = Allele.create(htsjdk.variant.vcf.VCFConstants.SPANNING_DELETION_ALLELE); }

Target:
public void before() { A = Allele.create("A"); ARef = Allele.create("A", true); T = Allele.create("T"); ATIns = Allele.create("AT"); ATCIns = Allele.create("ATC"); NoCall = Allele.create(Allele.NO_CALL_STRING); SpandDel = Allele.create(Allele.SPAN_DEL_STRING); }
Source:
public Response getDispoItemsById(@PathParam("fileName") String fileName) { if (!fileName.endsWith(".LIS")) { fileName = fileName.replaceAll("\\.(ada|c).*", ".LIS"); } DispoSet set = dispoApi.getDispoSetById(program, setId); String fullPath = set.getImportPath() + File.separator + "vcast" + File.separator + fileName; final File result = new File(fullPath); StreamingOutput streamingOutput = new StreamingOutput() { @Override public void write(OutputStream outputStream) throws WebApplicationException { FileInputStream inputStream = null; Writer writer = null; try { inputStream = new FileInputStream(result); writer = new OutputStreamWriter(outputStream, "UTF-8"); int c; while ((c = inputStream.read()) != -1) { writer.write(c); } outputStream.flush(); } catch (IOException ex) { throw new OseeCoreException(ex); } finally { Lib.close(inputStream); Lib.close(writer); } } }; String contentDisposition = String.format("attachment; filename=\"%s\"; creation-date=\"%s\"", fileName, new Date()); return Response.ok(streamingOutput).header("Content-Disposition", contentDisposition).type("application/text").build(); }

Target:
public Response getDispoItemsById(@PathParam("fileName") String fileName) { if (!fileName.endsWith(".LIS")) { fileName = fileName.replaceAll("\\.(ada|c)", ".LIS"); } DispoSet set = dispoApi.getDispoSetById(program, setId); String fullPath = set.getImportPath() + File.separator + "vcast" + File.separator + fileName; final File result = new File(fullPath); StreamingOutput streamingOutput = new StreamingOutput() { @Override public void write(OutputStream outputStream) throws WebApplicationException { FileInputStream inputStream = null; Writer writer = null; try { inputStream = new FileInputStream(result); writer = new OutputStreamWriter(outputStream, "UTF-8"); int c; while ((c = inputStream.read()) != -1) { writer.write(c); } outputStream.flush(); } catch (IOException ex) { throw new OseeCoreException(ex); } finally { Lib.close(inputStream); Lib.close(writer); } } }; String contentDisposition = String.format("attachment; filename=\"%s\"; creation-date=\"%s\"", fileName, new Date()); return Response.ok(streamingOutput).header("Content-Disposition", contentDisposition).type("application/text").build(); }
Source:
public ConnectionProviderUI(IConfigurationElement element) { super(element); editable = Boolean.parseBoolean(element.getAttribute(EDITABLE)); IConfigurationElement[] children = element.getChildren(); ArrayList<IConfigurationElement> wizardPageList = new ArrayList<IConfigurationElement>(); labelProviderElement = null; for( int i = 0; i < children.length; i++ ) { if( children[i].getName().equals("wizardFragment")) { if( rootFragment != null ) { } rootFragment = children[i]; } else if( children[i].getName().equals("connectionLabelProvider")) { labelProviderElement = children[i]; } } }

Target:
public ConnectionProviderUI(IConfigurationElement element) { super(element); editable = Boolean.parseBoolean(element.getAttribute(EDITABLE)); IConfigurationElement[] children = element.getChildren(); ArrayList<IConfigurationElement> wizardPageList = new ArrayList<IConfigurationElement>(); labelProviderElement = null; boolean multipleFragments = false; for( int i = 0; i < children.length; i++ ) { if( "wizardFragment".equals(children[i].getName())) { if( rootFragment != null && !multipleFragments) { String msg = "providerUI " + element.getAttribute("id") + " in contributor " + element.getContributor().getName() + " declares more than 1 wizard fragment"; JMXUIActivator.log(IStatus.WARNING, msg, null); multipleFragments = true; } rootFragment = children[i]; } else if( "connectionLabelProvider".equals(children[i].getName())) { labelProviderElement = children[i]; } } }
Source:
public URL getElasticsearchUrl() { final List<URL> urls = elasticsearchUrls.getValue(); if (urls.isEmpty()) { return null; } final int index = accessesToElasticsearchUrl.getAndIncrement() % urls.size(); URL elasticsearchURL = urls.get(index); final String defaultUsernameValue = elasticsearchDefaultUsername.getValue(); final String defaultPasswordValue = elasticsearchDefaultPassword.getValue(); if (elasticsearchURL.getUserInfo() == null && ! defaultUsernameValue.isEmpty() && ! defaultPasswordValue.isEmpty()) { try { String username = URLEncoder.encode(defaultUsernameValue, "UTF-8"); String password = URLEncoder.encode(defaultPasswordValue, "UTF-8"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder .append(elasticsearchURL.getProtocol()) .append("://") .append(username) .append(":") .append(password) .append("@") .append(elasticsearchURL.getHost()) .append(":") .append(elasticsearchURL.getPort()); return new URL(stringBuilder.toString()); } catch (Exception e) { logger.error(e.getMessage(), e); } } return elasticsearchURL; }

Target:
public URL getElasticsearchUrl() { final List<URL> urls = elasticsearchUrls.getValue(); if (urls.isEmpty()) { return null; } final int index = accessesToElasticsearchUrl.getAndIncrement() % urls.size(); URL elasticsearchURL = urls.get(index); final String defaultUsernameValue = elasticsearchDefaultUsername.getValue(); final String defaultPasswordValue = elasticsearchDefaultPassword.getValue(); if (elasticsearchURL.getUserInfo() == null && ! defaultUsernameValue.isEmpty() && ! defaultPasswordValue.isEmpty()) { try { String username = URLEncoder.encode(defaultUsernameValue, "UTF-8"); String password = URLEncoder.encode(defaultPasswordValue, "UTF-8"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder .append(elasticsearchURL.getProtocol()) .append("://") .append(username) .append(":") .append(password) .append("@") .append(elasticsearchURL.getHost()) .append(":") .append(elasticsearchURL.getPort()) .append(elasticsearchURL.getPath()); return new URL(stringBuilder.toString()); } catch (Exception e) { logger.error(e.getMessage(), e); } } return elasticsearchURL; }
Source:
private void updateDiscardAfterDelete() { if (getDataCenter().getSelectedItem() != null && getAvailableStorageTypeItems().getSelectedItem() != null) { boolean discardAfterDeleteSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted( ConfigurationValues.DiscardAfterDeleteSupported, getDataCenter().getSelectedItem().getCompatibilityVersion().toString()); boolean isBlockDomain = getAvailableStorageTypeItems().getSelectedItem().isBlockDomain(); getDiscardAfterDelete().setIsAvailable(discardAfterDeleteSupported && isBlockDomain); if (getDiscardAfterDelete().getIsAvailable()) { if (isNewStorage()) { getDiscardAfterDelete().setEntity(false); } else { getDiscardAfterDelete().setEntity(getStorage().isDiscardAfterDelete()); } } } }

Target:
private void updateDiscardAfterDelete() { if (getDataCenter().getSelectedItem() != null && getAvailableStorageTypeItems().getSelectedItem() != null) { boolean isBlockDomain = getAvailableStorageTypeItems().getSelectedItem().isBlockDomain(); if (!isBlockDomain) { getDiscardAfterDelete().setIsAvailable(false); getDiscardAfterDelete().setEntity(false); return; } boolean discardAfterDeleteSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted( ConfigurationValues.DiscardAfterDeleteSupported, getDataCenter().getSelectedItem().getCompatibilityVersion().toString()); getDiscardAfterDelete().setIsAvailable(discardAfterDeleteSupported); if (getDiscardAfterDelete().getIsAvailable()) { if (isNewStorage()) { getDiscardAfterDelete().setEntity(false); } else { getDiscardAfterDelete().setEntity(getStorage().isDiscardAfterDelete()); } } } }
Source:
public void refresh(final GlusterVolumeEntity volumeEntity) { refresh = new Timer() { @Override public void run() { refreshDetails(volumeEntity); } }; refresh.schedule(10000); }

Target:
public void refresh(final GlusterVolumeEntity volumeEntity) { refresh.schedule(10000); }
Source:
private void testSize(final int size) { CircularBuffer<Integer> instance = new CircularBuffer<Integer>(size); int i = 1; while (i < size) { i <<= 1; } assert i == instance.capacity(); instance.add(99); final int v = instance.remove(); assert 99 == v; instance = null; }

Target:
private void testSize(final int size) { final CircularBuffer<Integer> instance = new CircularBuffer<Integer>(size); int i = 1; while (i < size) { i <<= 1; } assertEquals(i, instance.capacity()); instance.add(99); final int v = instance.poll(); assertEquals(99, v); assertNull(instance.peek()); }
Source:
public void testCanStartAndStop() { log.info("test=canStartAndStop; entity="+entity+"; app="+entity.getApplication()); Entities.start(entity.getApplication(), ImmutableList.of(loc)); Asserts.succeedsEventually(MutableMap.of("timeout", 120*1000), new Runnable() { public void run() { assertTrue(entity.getAttribute(Startable.SERVICE_UP)); }}); entity.stop(); assertFalse(entity.getAttribute(Startable.SERVICE_UP)); }

Target:
public void testCanStartAndStop() { LOG.info("test=canStartAndStop; entity="+entity+"; app="+entity.getApplication()); Entities.start(entity.getApplication(), ImmutableList.of(loc)); Asserts.succeedsEventually(MutableMap.of("timeout", 120*1000), new Runnable() { public void run() { assertTrue(entity.getAttribute(Startable.SERVICE_UP)); }}); entity.stop(); assertFalse(entity.getAttribute(Startable.SERVICE_UP)); }
Source:
public void testOne() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInvalidJavaDocPositionOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(InvalidJavadocPositionCheck.class); final String[] expectedViolation = { "4:1: " + getCheckMessage(InvalidJavadocPositionCheck.class, InvalidJavadocPositionCheck.MSG_KEY, "RuntimeException"), }; final List<String> expectedXpathQueries = Collections.singletonList( "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionOne']]" + "/MODIFIERS/BLOCK_COMMENT_BEGIN" ); runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); }

Target:
public void testOne() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(InvalidJavadocPositionCheck.class); final String[] expectedViolation = { "4:1: " + getCheckMessage(InvalidJavadocPositionCheck.class, InvalidJavadocPositionCheck.MSG_KEY), }; final List<String> expectedXpathQueries = Collections.singletonList( "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionOne']]" + "/MODIFIERS/BLOCK_COMMENT_BEGIN" ); runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); }
Source:
private int sshExec(Map<String,?> props, String command) { File tempCmdFile = writeTempFile(command); tempCmdFile.setExecutable(true); File tempKeyFile = null; try { List<String> cmd = Lists.newArrayList(); cmd.add(getOptionalVal(props, PROP_SSH_EXECUTABLE, sshExecutable)); String propsFlags = getOptionalVal(props, PROP_SSH_FLAGS, sshFlags); if (propsFlags!=null && propsFlags.trim().length()>0) cmd.addAll(Arrays.asList(propsFlags.trim().split(" "))); if (privateKeyFile != null) { cmd.add("-i"); cmd.add(privateKeyFile.getAbsolutePath()); } else if (privateKeyData != null) { tempKeyFile = writeTempFile(privateKeyData); cmd.add("-i"); cmd.add(tempKeyFile.getAbsolutePath()); } if (!strictHostKeyChecking) { cmd.add("-o"); cmd.add("StrictHostKeyChecking=no"); } if (port != 22) { cmd.add("-P"); cmd.add(""+port); } if (allocatePTY) { cmd.add("-tt"); } cmd.add((Strings.isEmpty(getUsername()) ? "" : getUsername()+"@")+getHostAddress()); cmd.add(tempCmdFile.getAbsolutePath()); if (LOG.isTraceEnabled()) LOG.trace("Executing ssh with command: (with {})", command, cmd); int result = execProcess(props, cmd); if (LOG.isTraceEnabled()) LOG.trace("Executed command: {}; exit code {}", cmd, result); return result; } finally { tempCmdFile.delete(); if (tempKeyFile != null) tempKeyFile.delete(); } }

Target:
private int sshExec(Map<String,?> props, String command) { File tempKeyFile = null; try { List<String> cmd = Lists.newArrayList(); cmd.add(getOptionalVal(props, PROP_SSH_EXECUTABLE, sshExecutable)); String propsFlags = getOptionalVal(props, PROP_SSH_FLAGS, sshFlags); if (propsFlags!=null && propsFlags.trim().length()>0) cmd.addAll(Arrays.asList(propsFlags.trim().split(" "))); if (privateKeyFile != null) { cmd.add("-i"); cmd.add(privateKeyFile.getAbsolutePath()); } else if (privateKeyData != null) { tempKeyFile = writeTempFile(privateKeyData); cmd.add("-i"); cmd.add(tempKeyFile.getAbsolutePath()); } if (!strictHostKeyChecking) { cmd.add("-o"); cmd.add("StrictHostKeyChecking=no"); } if (port != 22) { cmd.add("-P"); cmd.add(""+port); } if (allocatePTY) { cmd.add("-tt"); } cmd.add((Strings.isEmpty(getUsername()) ? "" : getUsername()+"@")+getHostAddress()); cmd.add("bash -c \""+command+"\""); if (LOG.isTraceEnabled()) LOG.trace("Executing ssh with command: (with {})", command, cmd); int result = execProcess(props, cmd); if (LOG.isTraceEnabled()) LOG.trace("Executed command: {}; exit code {}", cmd, result); return result; } finally { if (tempKeyFile != null) tempKeyFile.delete(); } }
Source:
private void markOperationComplete(Long operationSequenceId) { Long heapSize = pendingOperationsWithSize.remove(operationSequenceId); if (heapSize != null) { currentWriteBufferSize -= heapSize; } else { LOG.warn("An operation completion was recieved multiple times. Your operations completed." + " Please notify Google that this occurred."); } }

Target:
private void markOperationComplete(Long operationSequenceId) { Long heapSize = pendingOperationsWithSize.remove(operationSequenceId); if (heapSize != null) { currentWriteBufferSize -= heapSize; } else { LOG.warn("An operation was reported to be complete multiple times. It's likely due to a " + "communication glitch and a retry."); } }
Source:
public static <V> Future<V> execute(FutureTask<V> command) { try { return (Future<V>) es.submit(command); } catch (RejectedExecutionException e) { log.warn("The thread pool is out of limit. A submitted task was rejected"); throw e; } }

Target:
public static <V> Future<V> execute(FutureTask<V> command) { try { return (Future<V>) es.submit(command); } catch (RejectedExecutionException e) { log.warn("The thread pool is out of limit. The submitted event was rejected"); throw e; } }
Source:
private void onSelectedHookSourceChanged() { EntityModel selectedItem = (EntityModel) getHookSources().getSelectedItem(); if (selectedItem == null) { return; } GlusterServerHook selectedServer = (GlusterServerHook) selectedItem.getEntity(); getServerHooksList().setSelectedItem(selectedServer); if (selectedServer.getStatus() == GlusterHookStatus.MISSING) { getContentModel().getContent().setEntity(null); getContentModel().getStatus().setEntity(null); getContentModel().getMd5Checksum().setEntity(null); return; } getContentModel().getStatus().setEntity(selectedServer.getStatus()); getContentModel().getMd5Checksum().setEntity(selectedServer.getChecksum()); if (selectedServer.getContentType() == GlusterHookContentType.TEXT) { startProgress(null); AsyncDataProvider.getGlusterHookContent(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { String content = (String) returnValue; getContentModel().getContent().setEntity(content); stopProgress(); } }), getGlusterHookEntiry().getId(), selectedServer.getServerId()); } }

Target:
private void onSelectedHookSourceChanged() { EntityModel selectedItem = (EntityModel) getHookSources().getSelectedItem(); if (selectedItem == null) { return; } GlusterServerHook selectedServer = (GlusterServerHook) selectedItem.getEntity(); getServerHooksList().setSelectedItem(selectedServer); if (selectedServer.getStatus() == GlusterHookStatus.MISSING) { getContentModel().getContent().setEntity(null); getContentModel().getStatus().setEntity(null); getContentModel().getMd5Checksum().setEntity(null); return; } getContentModel().getStatus().setEntity(selectedServer.getStatus()); getContentModel().getMd5Checksum().setEntity(selectedServer.getChecksum()); if (selectedServer.getContentType() == GlusterHookContentType.TEXT) { startProgress(null); AsyncDataProvider.getGlusterHookContent(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { String content = (String) returnValue; getContentModel().getContent().setEntity(content); stopProgress(); } }), getGlusterHookEntity().getId(), selectedServer.getServerId()); } }
Source:
public void openProjectOnGitHubTest() { projectExplorer.openContextMenuByPathSelectedItem(PROJECT_NAME); projectExplorer.waitContextMenu(); projectExplorer.clickOnItemInContextMenu( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.OPEN_ON_GITHUB); seleniumWebDriverHelper.switchToNextWindow(seleniumWebDriver.getWindowHandle()); Assert.assertTrue(seleniumWebDriver.getCurrentUrl().startsWith(testRepo.getHtmlUrl())); }

Target:
public void openProjectOnGitHubTest() { projectExplorer.waitAndSelectItem(PROJECT_NAME, 5); projectExplorer.openContextMenuByPathSelectedItem(PROJECT_NAME); projectExplorer.waitContextMenu(); projectExplorer.clickOnItemInContextMenu( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.OPEN_ON_GITHUB); seleniumWebDriverHelper.switchToNextWindow(seleniumWebDriver.getWindowHandle()); seleniumWebDriverHelper.waitSuccessCondition(urlToBe(testRepo.getHtmlUrl() + "/tree/master/")); }
Source:
public void testNestedRepeats() throws Exception{ List<String> subjects = createSuccessSubjects(); MockEventListener mockEventListener = new MockEventListener(MOCK_ID_1); registry.registerListener(mockEventListener,subjects); HttpPost request = new HttpPost(String.format("http://localhost:%d/odk/forms/%s/%s", TestContext.getJettyPort(), CONFIG_NAME, TITLE)); StringEntity entity = new StringEntity(getJson()); request.setEntity(entity); HttpResponse response = getHttpClient().execute(request); assertEquals(response.getStatusLine().getStatusCode(), HttpStatus.SC_OK); int count = 0; while(mockEventListener.getEvents().size() < EXPECTED_EVENTS_SUCCESS && count < WAIT_COUNT) { count++; getLogger().debug("Number of events: " + mockEventListener.getEvents().size()); if (count == WAIT_COUNT) { getLogger().error("Timeout"); fail(); } Thread.sleep(2000); } List<MotechEvent> events = mockEventListener.getEvents(); assertNotNull(events); assertEquals(events.size(), 7); }

Target:
public void testNestedRepeats() throws Exception { List<String> subjects = createSuccessSubjects(); MockEventListener mockEventListener = new MockEventListener(MOCK_ID_1); registry.registerListener(mockEventListener, subjects); HttpPost request = new HttpPost(String.format("http://localhost:%d/odk/forms/%s/%s", TestContext.getJettyPort(), CONFIG_NAME, TITLE)); StringEntity entity = new StringEntity(getJson()); request.setEntity(entity); HttpResponse response = getHttpClient().execute(request); assertEquals(response.getStatusLine().getStatusCode(), HttpStatus.SC_OK); int count = 0; while (mockEventListener.getEvents().size() < EXPECTED_EVENTS_SUCCESS && count < WAIT_COUNT) { count++; getLogger().debug("Number of events: " + mockEventListener.getEvents().size()); if (count == WAIT_COUNT) { fail(TIMEOUT); } Thread.sleep(2000); } List<MotechEvent> events = mockEventListener.getEvents(); assertNotNull(events); assertEquals(events.size(), 7); }
Source:
public void testForbiddenEnsembleChange() throws Exception { try (WriteHandle wh = result(newCreateLedgerOp() .withEnsembleSize(1) .withWriteQuorumSize(1) .withAckQuorumSize(1) .withPassword(PASSWORD) .withWriteFlags(WriteFlag.DEFERRED_SYNC) .execute())) { for (int i = 0; i < NUM_ENTRIES - 1; i++) { wh.append(DATA.retainedDuplicate()); } assertEquals(1, availableBookies.size()); killBookie(wh.getLedgerMetadata().getEnsembleAt(wh.getLastAddPushed()).get(0)); assertEquals(0, availableBookies.size()); startNewBookie(); assertEquals(1, availableBookies.size()); try { wh.append(DATA.retainedDuplicate()); fail("since ensemble change is disable we cannot be able to write any more"); } catch (BKException.BKWriteException ex) { } LedgerHandle lh = (LedgerHandle) wh; assertTrue(lh.delayedWriteFailedBookies.isEmpty()); } }

Target:
public void testForbiddenEnsembleChange() throws Exception { try (WriteHandle wh = result(newCreateLedgerOp() .withEnsembleSize(1) .withWriteQuorumSize(1) .withAckQuorumSize(1) .withPassword(PASSWORD) .withWriteFlags(WriteFlag.DEFERRED_SYNC) .execute())) { for (int i = 0; i < NUM_ENTRIES - 1; i++) { wh.append(DATA.retainedDuplicate()); } assertEquals(1, availableBookies.size()); killBookie(wh.getLedgerMetadata().getEnsembleAt(wh.getLastAddPushed()).get(0)); assertEquals(0, availableBookies.size()); startNewBookie(); assertEquals(1, availableBookies.size()); try { wh.append(DATA.retainedDuplicate()); fail("since ensemble change is disable we cannot be able to write any more"); } catch (BKException.BKWriteException ex) { } LedgerHandle lh = (LedgerHandle) wh; assertFalse(lh.hasDelayedWriteFailedBookies()); } }
Source:
public String getCompartmentName() { Stereotype stereotype = UMLUtil.getStereotype(resolveSemanticElement()); if (stereotype != null) { return (StereotypeDisplayUtils.BRACE_LEFT + stereotype.getName() + StereotypeDisplayUtils.BRACE_RIGHT); } return "Bad compartement stereotype"; }

Target:
public String getCompartmentName() { Stereotype stereotype = UMLUtil.getStereotype(resolveSemanticElement()); if (stereotype != null) { return (StereotypeDisplayUtils.BRACE_LEFT + stereotype.getName() + StereotypeDisplayUtils.BRACE_RIGHT); } return NO_STEREOTYPE_COMPARTMENT; }
Source:
protected void run() { for (;;) { try { int strategy = selectStrategy.calculateStrategy(selectNowSupplier, hasTasks()); switch (strategy) { case SelectStrategy.CONTINUE: continue; case SelectStrategy.BUSY_WAIT: strategy = epollBusyWait(); break; case SelectStrategy.SELECT: if (wakenUp == 1) { wakenUp = 0; } if (hasTasks()) { break; } strategy = epollWait(); default: } final int ioRatio = this.ioRatio; if (ioRatio == 100) { try { if (strategy > 0) { processReady(events, strategy); } } finally { runAllTasks(); } } else { final long ioStartTime = System.nanoTime(); try { if (strategy > 0) { processReady(events, strategy); } } finally { final long ioTime = System.nanoTime() - ioStartTime; runAllTasks(ioTime * (100 - ioRatio) / ioRatio); } } if (allowGrowing && strategy == events.length()) { events.increase(); } } catch (Throwable t) { handleLoopException(t); } try { if (isShuttingDown()) { closeAll(); if (confirmShutdown()) { break; } } } catch (Throwable t) { handleLoopException(t); } } }

Target:
protected void run() { for (;;) { try { int strategy = selectStrategy.calculateStrategy(selectNowSupplier, hasTasks()); switch (strategy) { case SelectStrategy.CONTINUE: continue; case SelectStrategy.BUSY_WAIT: strategy = epollBusyWait(); break; case SelectStrategy.SELECT: if (wakenUp == 1) { wakenUp = 0; } if (!hasTasks()) { strategy = epollWait(); } default: } final int ioRatio = this.ioRatio; if (ioRatio == 100) { try { if (strategy > 0) { processReady(events, strategy); } } finally { runAllTasks(); } } else { final long ioStartTime = System.nanoTime(); try { if (strategy > 0) { processReady(events, strategy); } } finally { final long ioTime = System.nanoTime() - ioStartTime; runAllTasks(ioTime * (100 - ioRatio) / ioRatio); } } if (allowGrowing && strategy == events.length()) { events.increase(); } } catch (Throwable t) { handleLoopException(t); } try { if (isShuttingDown()) { closeAll(); if (confirmShutdown()) { break; } } } catch (Throwable t) { handleLoopException(t); } } }
Source:
public void setWrapper(Wrapper wrapper) { if (tomcatContainer == null) { synchronized (lock) { if (tomcatContainer == null) { String serverInfo = ServerInfo.getServerInfo(); logger.info("Server info: " + serverInfo); for (String className : adapterClasses) { try { Object obj = Class.forName(className).newInstance(); logger.debug("Testing container adapter: " + className); if (obj instanceof TomcatContainer) { if (forceFirstAdapter || ((TomcatContainer) obj).canBoundTo(serverInfo)) { logger.info("Using " + className); tomcatContainer = (TomcatContainer) obj; tomcatContainer.setWrapper(wrapper); break; } logger.debug("Cannot bind " + className + " to " + serverInfo); } else { logger.error(className + " does not implement " + TomcatContainer.class.getName()); } } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Failed to load " + className, e); } else { logger.info("Failed to load " + className); } } } if (tomcatContainer == null) { logger.error("No suitable container adapter found!"); } } } } try { if (tomcatContainer != null && wrapper == null) { logger.info("Unregistering container adapter"); tomcatContainer.setWrapper(null); } } catch (ThreadDeath e) { throw e; } catch (Exception e) { logger.error("Could not unregister container adapter", e); } }

Target:
public void setWrapper(Wrapper wrapper) { if (tomcatContainer == null) { synchronized (lock) { if (tomcatContainer == null) { String serverInfo = ServerInfo.getServerInfo(); logger.info("Server info: " + serverInfo); for (String className : adapterClasses) { try { Object obj = Class.forName(className).newInstance(); logger.debug("Testing container adapter: " + className); if (obj instanceof TomcatContainer) { if (forceFirstAdapter || ((TomcatContainer) obj).canBoundTo(serverInfo)) { logger.info("Using " + className); tomcatContainer = (TomcatContainer) obj; tomcatContainer.setWrapper(wrapper); break; } logger.debug("Cannot bind " + className + " to " + serverInfo); } else { logger.error(className + " does not implement " + TomcatContainer.class.getName()); } } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Failed to load " + className, e); } else { logger.info("Failed to load " + className); } } } if (tomcatContainer == null) { logger.error("No suitable container adapter found!"); } } } } try { if (tomcatContainer != null && wrapper == null) { logger.info("Unregistering container adapter"); tomcatContainer.setWrapper(null); } } catch (Exception e) { logger.error("Could not unregister container adapter", e); } }
Source:
public Observable<InstanceInfo> forSnapshot(final Interest<InstanceInfo> interest) { return transportClient.connect() .flatMap(new Func1<MessageConnection, Observable<InstanceInfo>>() { @Override public Observable<InstanceInfo> call(final MessageConnection connection) { return connection .submitWithAck(new SnapshotRegistration(interest)) .cast(Object.class) .concatWith(connection.incoming()) .takeWhile(END_OF_STREAM_FILTER) .filter(INVALID_MESSAGE_FILTER) .doOnNext(new Action1<Object>() { @Override public void call(Object message) { connection.acknowledge().subscribe(); } }) .map(new Func1<Object, InstanceInfo>() { @Override public InstanceInfo call(Object message) { return ((AddInstance) message).getInstanceInfo(); } }) .doOnError(new Action1<Throwable>() { @Override public void call(Throwable error) { logger.error("Snapshot subscription error", error); } }) .doOnTerminate(new Action0() { @Override public void call() { connection.shutdown(); } }); } }); }

Target:
public Observable<InstanceInfo> forSnapshot(final Interest<InstanceInfo> interest) { return transportClient.connect() .flatMap(new Func1<MessageConnection, Observable<InstanceInfo>>() { @Override public Observable<InstanceInfo> call(final MessageConnection connection) { return connection .submitWithAck(new SnapshotRegistration(interest)) .cast(Object.class) .concatWith(connection.incoming()) .takeWhile(END_OF_STREAM_FILTER) .filter(INVALID_MESSAGE_FILTER) .doOnNext(new Action1<Object>() { @Override public void call(Object message) { connection.acknowledge().doOnError(new Action1<Throwable>() { @Override public void call(Throwable e) { logger.error("Failed to send an acknowledgment to snapshot change notification message", e); } }).subscribe(); } }) .map(new Func1<Object, InstanceInfo>() { @Override public InstanceInfo call(Object message) { return ((AddInstance) message).getInstanceInfo(); } }) .doOnError(new Action1<Throwable>() { @Override public void call(Throwable error) { logger.error("Snapshot subscription error", error); } }) .doOnTerminate(new Action0() { @Override public void call() { connection.shutdown(); } }); } }); }
Source:
public void setup(OperatorContext context) { shutdown = false; logger.debug("Operator Context = {}", context); if (!redeploy) { operator.setup(context); } }

Target:
public void setup(OperatorContext context) { shutdown = false; if (!reuseOperator) { logger.debug("Operator Context = {}", context); operator.setup(context); } }
Source:
protected void computeRequiredDifferencesToReject() { for (Diff difftoMerge : selectedDifferences) { MergeOperation mergeAction = this.mergeMode.getMergeAction(difftoMerge, this.leftEditable, this.rightEditable); if (mergeAction == MergeOperation.MERGE) { IMerger merger = mergerRegistry.getHighestRankingMerger(difftoMerge); if (merger instanceof IMerger2) { addAll(differencesToMerge, ((IMerger2)merger).getDirectResultingRejections(difftoMerge, !leftToRight)); } } } if (cascadingDifferencesFilterEnabled) { Set<Diff> setToReject = Sets.newHashSet(differencesToMerge); Iterable<Diff> cascadingDifferences = concat(transform(setToReject, ComparisonUtil .getSubDiffs(leftToRight))); addAll(differencesToMerge, cascadingDifferences); } }

Target:
protected void computeRequiredDifferencesToReject() { for (Diff difftoMerge : selectedDifferences) { MergeOperation mergeAction = this.selectedMode.getMergeAction(difftoMerge, this.leftEditable, this.rightEditable); if (mergeAction == MergeOperation.MERGE) { IMerger merger = mergerRegistry.getHighestRankingMerger(difftoMerge); if (merger instanceof IMerger2) { addAll(differencesToMerge, ((IMerger2)merger).getDirectResultingRejections(difftoMerge, !leftToRight)); } } } if (cascadingDifferencesFilterEnabled) { Set<Diff> setToReject = Sets.newHashSet(differencesToMerge); Iterable<Diff> cascadingDifferences = concat(transform(setToReject, ComparisonUtil .getSubDiffs(leftToRight))); addAll(differencesToMerge, cascadingDifferences); } }
Source:
public Object aroundInvoke(final InvocationContext invocationContext) throws Exception { log.debug("serverInterceptor aroundInvoke "); return invocationContext.proceed(); }

Target:
public Object aroundInvoke(final InvocationContext invocationContext) throws Exception { try { return invocationContext.proceed(); } finally { latch.countDown(); } }