auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testRibbonRequest() throws URISyntaxException { String urlWithEncodedJson = "<LINK_0>"; URI uri = new URI(urlWithEncodedJson); Map<String, Collection<String>> headers = new HashMap<String, Collection<String>>(); Request requestOrign = Request.create("GET", uri.toASCIIString(), headers, null, Charset.forName("utf-8")); RibbonRequest ribbonRequest = new RibbonRequest(null, requestOrign, uri); Request requestGetFormToRequest = ribbonRequest.toRequest(); assertEquals(requestOrign.method(), requestGetFormToRequest.method()); assertEquals(requestOrign.url(), requestGetFormToRequest.url()); assertEquals(urlWithEncodedJson, requestGetFormToRequest.url()); assertEquals(requestOrign.body(), requestGetFormToRequest.body()); assertEquals(requestOrign.charset(), requestGetFormToRequest.charset()); assertNotNull(requestOrign.headers()); assertEquals(0, requestOrign.headers().size()); assertNotNull(requestGetFormToRequest.headers()); Map<String, Collection<String>> headersFromNewRequest = requestGetFormToRequest.headers(); assertNotNull(headersFromNewRequest); assertEquals(1, headersFromNewRequest.size()); assertTrue(headersFromNewRequest.containsKey("Content-Length")); Collection<String> contentLengthValues = headersFromNewRequest.get("Content-Length"); assertNotNull(contentLengthValues); assertEquals(1, contentLengthValues.size()); assertEquals("0", contentLengthValues.iterator().next()); }

Target:
public void testRibbonRequest() throws URISyntaxException { String urlWithEncodedJson = "<LINK_0>"; String method = "GET"; URI uri = new URI(urlWithEncodedJson); Map<String, Collection<String>> headers = new LinkedHashMap<String, Collection<String>>(); Request requestOrigin = Request.create(method, uri.toASCIIString(), headers, null, Charset.forName("utf-8")); RibbonRequest ribbonRequest = new RibbonRequest(null, requestOrigin, uri); Request requestRecreate = ribbonRequest.toRequest(); assertThat(requestOrigin.toString()).isEqualTo(String.format("%s %s HTTP/1.1\n", method, urlWithEncodedJson)); assertThat(requestRecreate.toString()).isEqualTo(String.format("%s %s HTTP/1.1\nContent-Length: 0\n", method, urlWithEncodedJson)); }
Source:
public String toString() { StringBuilder buf = new StringBuilder(30); buf.append(getChronology().toString()) .append(' ') .append(getEra()) .append(' ') .append(getYearOfEra()); if (isLeapDay()) { buf.append("-leap-day"); } else if (isYearDay()) { buf.append("-year-day"); } else { buf.append(getMonth() < 10 ? "-0" : '-') .append(getMonth()) .append(getDayOfMonth() < 10 ? "-0" : '-') .append(getDayOfMonth()); } return buf.toString(); }

Target:
public String toString() { StringBuilder buf = new StringBuilder(30); return buf.append(getChronology().toString()) .append(' ') .append(getEra()) .append(' ') .append(getYearOfEra()) .append(this.month < 10 && this.month > 0 ? "/0" : '/') .append(this.month) .append(this.day < 10 && this.day > 0 ? "/0" : '/') .append(this.day) .toString(); }
Source:
private void updateSkipNum() { numSkipLines -= NUM_ROWS_TO_EXPAND; skipNum.setText(PatchUtil.C.patchSkipRegion(Integer .toString(numSkipLines))); checkAndUpdateArrows(); }

Target:
private void updateSkipNum() { numSkipLines -= NUM_ROWS_TO_EXPAND; skipNum.setText(PatchUtil.M.patchSkipRegion(Integer .toString(numSkipLines))); checkAndUpdateArrows(); }
Source:
public void verifyViewAndViewIndexes() throws Exception { String tableName = generateUniqueName(); String schemaName = generateUniqueName(); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); if (multiTenant) { tenantId = generateUniqueName(); props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); } try (Connection conn = DriverManager.getConnection(getUrl(), props)) { prepareForTest(conn, schemaName, tableName); String viewQuery = IndexUpgradeTool.getViewSql(tableName, schemaName); ResultSet rs = conn.createStatement().executeQuery(viewQuery); int countViews = 0; List<String> views = new ArrayList<>(); List<String> tenants = new ArrayList<>(); while (rs.next()) { views.add(rs.getString(1)); if(multiTenant) { Assert.assertNotNull(rs.getString(2)); } tenants.add(rs.getString(2)); countViews++; } Assert.assertEquals("view count in system table doesn't match", 2, countViews); for (int i = 0; i < views.size(); i++) { String viewName = SchemaUtil.getTableNameFromFullName(views.get(i)); String viewIndexQuery = IndexUpgradeTool.getViewIndexesSql(viewName, schemaName, tenants.get(i)); rs = conn.createStatement().executeQuery(viewIndexQuery); int indexes = 0; while (rs.next()) { indexes++; } Assert.assertEquals(VERIFY_COUNT_ASSERT_MESSAGE, 2-i, indexes); } } }

Target:
public void verifyViewAndViewIndexes() throws Exception { String tableName = generateUniqueName(); String schemaName = generateUniqueName(); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); if (multiTenant) { tenantId = generateUniqueName(); props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); } try (Connection conn = DriverManager.getConnection(getUrl(), props)) { prepareForTest(conn, schemaName, tableName); String viewQuery = IndexUpgradeTool.getViewSql(tableName, schemaName); ResultSet rs = conn.createStatement().executeQuery(viewQuery); List<String> views = new ArrayList<>(); List<String> tenants = new ArrayList<>(); while (rs.next()) { views.add(rs.getString(1)); if(multiTenant) { Assert.assertNotNull(rs.getString(2)); } tenants.add(rs.getString(2)); } Assert.assertEquals("view count in system table doesn't match", 2, views.size()); for (int i = 0; i < views.size(); i++) { String viewName = SchemaUtil.getTableNameFromFullName(views.get(i)); String viewIndexQuery = IndexUpgradeTool.getViewIndexesSql(viewName, schemaName, tenants.get(i)); rs = conn.createStatement().executeQuery(viewIndexQuery); int indexes = 0; while (rs.next()) { indexes++; } Assert.assertEquals(VERIFY_COUNT_ASSERT_MESSAGE, 2-i, indexes); } } }
Source:
public void saveRejectedVillageHealthSubFacility(VillageHealthSubFacilityImportRejection villageHealthSubFacilityImportRejection) { if( villageHealthSubFacilityRejectionDataService.findByUniqueCode(villageHealthSubFacilityImportRejection.getVillageCode(),villageHealthSubFacilityImportRejection.getHealthSubFacilityCode()) == null){ villageHealthSubFacilityRejectionDataService.create(villageHealthSubFacilityImportRejection); } else { villageHealthSubFacilityRejectionDataService.update(villageHealthSubFacilityImportRejection); } }

Target:
public void saveRejectedVillageHealthSubFacility(VillageHealthSubFacilityImportRejection villageHealthSubFacilityImportRejection) { VillageHealthSubFacilityImportRejection villageHealthSubFacilityImportRejection1 = villageHealthSubFacilityRejectionDataService.findByUniqueCode(villageHealthSubFacilityImportRejection.getVillageCode(),villageHealthSubFacilityImportRejection.getHealthSubFacilityCode()); if( villageHealthSubFacilityImportRejection1 == null){ villageHealthSubFacilityRejectionDataService.create(villageHealthSubFacilityImportRejection); } else { villageHealthSubFacilityRejectionDataService.update(villageHealthSubFacilityImportRejection); } }
Source:
public void dimExtractionScanAndAggregate( TopNQuery query, LongColumnSelector selector, Cursor cursor, Aggregator[][] rowSelector, Long2ObjectMap<Aggregator[]> aggregatesStore ) { long key = selector.get(); Aggregator[] theAggregators = aggregatesStore.get(key); if (theAggregators == null) { theAggregators = BaseTopNAlgorithm.makeAggregators(cursor, query.getAggregatorSpecs()); aggregatesStore.put(key, theAggregators); } for (Aggregator aggregator : theAggregators) { aggregator.aggregate(); } }

Target:
public void dimExtractionScanAndAggregate( TopNQuery query, LongColumnSelector selector, Cursor cursor, Aggregator[][] rowSelector, Long2ObjectMap<Aggregator[]> aggregatesStore ) { while (!cursor.isDone()) { long key = selector.get(); Aggregator[] theAggregators = aggregatesStore.get(key); if (theAggregators == null) { theAggregators = BaseTopNAlgorithm.makeAggregators(cursor, query.getAggregatorSpecs()); aggregatesStore.put(key, theAggregators); } for (Aggregator aggregator : theAggregators) { aggregator.aggregate(); } cursor.advance(); } }
Source:
private void rebuildIndexes(Connection conn, Configuration conf, String dataTableFullName) { if (upgrade) { prepareToRebuildIndexes(conn, dataTableFullName); if(!test) { indexingTool = new IndexTool(); } indexingTool.setConf(conf); if(rebuildMap.get(dataTableFullName).size() != 0 ) { rebuildIndexes(conn, dataTableFullName, indexingTool); } } }

Target:
private void rebuildIndexes(Connection conn, Configuration conf, String dataTableFullName) { try { HashMap<String, IndexInfo> rebuildMap = prepareToRebuildIndexes(conn, dataTableFullName); if (rebuildMap.isEmpty()) { LOGGER.info("No indexes to rebuild for table " + dataTableFullName); return; } if(!test) { indexingTool = new IndexTool(); indexingTool.setConf(conf); } startIndexRebuilds(conn, dataTableFullName, rebuildMap, indexingTool); } catch (SQLException e) { LOGGER.severe("Failed to prepare the map for index rebuilds " + e); throw new RuntimeException("Failed to prepare the map for index rebuilds"); } }
Source:
public static IVolumeSource create(ModelNode node) { if (node.has(VolumeType.EMPTY_DIR)) { return new EmptyDirVolumeSource(node); } else if (node.has(VolumeType.SECRET)) { return new SecretVolumeSource(node); } else if (node.has(VolumeType.PERSISTENT_VOLUME_CLAIM)) { return new PersistentVolumeClaimVolumeSource(node); } else { return new UnsupportedVolumeSource(node); } }

Target:
public static IVolumeSource create(ModelNode node) { if (node.has(VolumeType.EMPTY_DIR)) { return new EmptyDirVolumeSource(node); } else if (node.has(VolumeType.SECRET)) { return new SecretVolumeSource(node); } else if (node.has(VolumeType.PERSISTENT_VOLUME_CLAIM)) { return new PersistentVolumeClaimVolumeSource(node); } else { return new VolumeSource(node) {}; } }
Source:
public boolean isEntryRemovedInContext(Object key) { throw new CacheException("This context is immutable"); }

Target:
public boolean isEntryRemovedInContext(Object key) { return false; }
Source:
public void testSlice() { System.out.println( "slice" ); String[] strings = new String[]{ "1", "2", "3" }; int begin = 0; int length = 2; String[] expResult = new String[]{ "1", "2" }; String[] result = ArrayHelper.slice( strings, begin, length ); assertArrayEquals( expResult, result ); }

Target:
public void testSlice() { String[] strings = new String[]{ "1", "2", "3" }; int begin = 0; int length = 2; String[] expResult = new String[]{ "1", "2" }; String[] result = ArrayHelper.slice( strings, begin, length ); assertArrayEquals( expResult, result ); }
Source:
public String getEndpointsInfo() { final StringBuilder msg = new StringBuilder(1024); final Set<EndpointLogLine> endpointLogLines = Sets.newTreeSet(new EndpointComparator()); msg.append("The following paths were found for the configured resources:"); msg.append(NEWLINE).append(NEWLINE); final Set<Class<?>> allResources = Sets.newHashSet(); for (Class<?> clazz : allClasses()) { if (!clazz.isInterface() && Resource.from(clazz) != null) { allResources.add(clazz); } } for (Class<?> klass : allResources) { endpointLogLines.addAll(new EndpointLogger(urlPattern, klass).getEndpointLogLines()); } if (!endpointLogLines.isEmpty()) { for (EndpointLogLine line : endpointLogLines) { msg.append(line).append(NEWLINE); } } else { msg.append(" NONE").append(NEWLINE); } return msg.toString(); }

Target:
public String getEndpointsInfo() { final StringBuilder msg = new StringBuilder(1024); final List<EndpointLogLine> endpointLogLines = Lists.newArrayList(); msg.append("The following paths were found for the configured resources:"); msg.append(NEWLINE).append(NEWLINE); final Set<Class<?>> allResources = Sets.newHashSet(); for (Class<?> clazz : allClasses()) { if (!clazz.isInterface() && Resource.from(clazz) != null) { allResources.add(clazz); } } for (Class<?> klass : allResources) { new EndpointLogger(urlPattern, klass).populate(endpointLogLines); } if (!endpointLogLines.isEmpty()) { Collections.sort(endpointLogLines, new EndpointComparator()); for (EndpointLogLine line : endpointLogLines) { msg.append(line).append(NEWLINE); } } else { msg.append(" NONE").append(NEWLINE); } return msg.toString(); }
Source:
public Date startOfNextDay() { return startOfNextDay(new Date()); }

Target:
public Date startOfNextDay() { Calendar c = Calendar.getInstance(); c.setTime(new Date()); c.add(Calendar.DATE, 1); c.set(Calendar.HOUR, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); return c.getTime(); }
Source:
public void putActionResult(String key, byte[] in) throws IOException, InterruptedException { put(key, in.length, new ByteArrayInputStream(in)); }

Target:
public void putActionResult(String key, byte[] in) throws IOException, InterruptedException { diskCache.putActionResult(key, in); remoteCache.putActionResult(key, in); }
Source:
public void setZoomPercentageBy0_5_isHalfCropWidth() throws InterruptedException { Rect cropRegionMaxZoom = getSensorRect(); mZoomControl.setZoomPercentage(0f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionMinZoom = getSessionCropRegion(mControlUpdateListener); mZoomControl.setZoomPercentage(0.5f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionHalfZoom = getSessionCropRegion(mControlUpdateListener); Assert.assertEquals(cropRegionHalfZoom.width(), (cropRegionMinZoom.width() + cropRegionMaxZoom.width()) / 2.0f, 10); }

Target:
public void setZoomPercentageBy0_5_isHalfCropWidth() throws InterruptedException { mZoomControl.setZoomPercentage(1f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionMaxZoom = getSessionCropRegion(mControlUpdateListener); Rect cropRegionMinZoom = getSensorRect(); mZoomControl.setZoomPercentage(0.5f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionHalfZoom = getSessionCropRegion(mControlUpdateListener); Assert.assertEquals(cropRegionHalfZoom.width(), (cropRegionMinZoom.width() + cropRegionMaxZoom.width()) / 2.0f, 10); }
Source:
public void testInjection() throws Exception { props .put(Constants.ConfigurationKeys.AZKABAN_STORAGE_LOCAL_BASEDIR, AZKABAN_LOCAL_TEST_STORAGE); final Injector injector = Guice.createInjector( new AzkabanCommonModule(props), new AzkabanExecServerModule() ); SERVICE_PROVIDER.unsetInjector(); SERVICE_PROVIDER.setInjector(injector); assertNotNull(SERVICE_PROVIDER.getInstance(AzkabanExecutorServer.class)); }

Target:
public void testInjection() throws Exception { props .put(Constants.ConfigurationKeys.AZKABAN_STORAGE_LOCAL_BASEDIR, AZKABAN_LOCAL_TEST_STORAGE); final Injector injector = Guice.createInjector( new AzkabanCommonModule(props), new AzkabanExecServerModule() ); assertNotNull(injector.getInstance(AzkabanExecutorServer.class)); }
Source:
public static ProgramNode generateIRTree(InputStream stream, String filename) throws IOException { CharStream chars = new ANTLRInputStream(stream); Lexer lexer = new BabbleLexer(chars); TokenStream tokens = new CommonTokenStream(lexer); BabbleParser parser = new BabbleParser(tokens); ASTGenerator generator = new ASTGenerator(filename); ProgramNode irtree = (ProgramNode) generator.visitProgram(parser.program()); if (verbose) { System.out.println("Parsed: " + filename); } return irtree; }

Target:
static ProgramNode generateIRTree(InputStream stream, String filename) throws IOException { CharStream chars = new ANTLRInputStream(stream); Lexer lexer = new BabbleLexer(chars); TokenStream tokens = new CommonTokenStream(lexer); BabbleParser parser = new BabbleParser(tokens); ASTGenerator generator = new ASTGenerator(filename); ProgramNode irtree = (ProgramNode) generator.visitProgram(parser.program()); if (verbose) { System.out.println("Parsed: " + filename); } return irtree; }
Source:
protected IOReport execute(ProgressIndicator progress, IOReporter reporter) throws IOProviderConfigurationException, IOException { progress.begin("Save schema", ProgressIndicator.UNKNOWN); try (OutputStream out = getTarget().getOutput(); Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8)) { JsonStreamBuilder builder = new JsonStreamBuilder(writer, true); new SchemaToJson().schemasToJson(builder, getSchemas().getSchemas(), null); reporter.setSuccess(true); } catch (Exception e) { e.printStackTrace(); reporter.error(new IOMessageImpl(e.getMessage(), e)); reporter.setSuccess(false); } finally { progress.end(); } return reporter; }

Target:
protected IOReport execute(ProgressIndicator progress, IOReporter reporter) throws IOProviderConfigurationException, IOException { progress.begin("Save schema", ProgressIndicator.UNKNOWN); try (OutputStream out = getTarget().getOutput(); Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8)) { JsonStreamBuilder builder = new JsonStreamBuilder(writer, true); new SchemaToJson().schemasToJson(builder, getSchemas().getSchemas(), null); reporter.setSuccess(true); } catch (Exception e) { reporter.error(new IOMessageImpl(e.getMessage(), e)); reporter.setSuccess(false); } finally { progress.end(); } return reporter; }
Source:
public void traceOpened(TmfTraceOpenedSignal signal) { boolean signalIsForUs = false; for (ITmfTrace trace : TmfTraceManager.getTraceSet(signal.getTrace())) { if (trace == this) { signalIsForUs = true; break; } } if (!signalIsForUs) { return; } IStatus[] statuses = new IStatus[2]; statuses[0] = buildStatistics(); statuses[1] = buildStateSystem(); for (IStatus status : statuses) { if (!status.isOK()) { Activator.log(status); } } try { if (fResource != null) { fResource.getProject().refreshLocal(IResource.DEPTH_INFINITE, null); } } catch (CoreException e) { e.printStackTrace(); } if (signal.getTrace() == this) { if (getNbEvents() == 0) { return; } if (getStreamingInterval() > 0) { return; } final TmfTimeRange timeRange = new TmfTimeRange(getStartTime(), TmfTimestamp.BIG_CRUNCH); final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange); new Thread() { @Override public void run() { broadcast(rangeUpdatedsignal); } }.start(); return; } }

Target:
public void traceOpened(TmfTraceOpenedSignal signal) { boolean signalIsForUs = false; for (ITmfTrace trace : TmfTraceManager.getTraceSet(signal.getTrace())) { if (trace == this) { signalIsForUs = true; break; } } if (!signalIsForUs) { return; } MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null); status.add(buildStatistics()); status.add(buildStateSystem()); if (!status.isOK()) { Activator.log(status); } try { if (fResource != null) { fResource.getProject().refreshLocal(IResource.DEPTH_INFINITE, null); } } catch (CoreException e) { e.printStackTrace(); } if (signal.getTrace() == this) { if (getNbEvents() == 0) { return; } if (getStreamingInterval() > 0) { return; } final TmfTimeRange timeRange = new TmfTimeRange(getStartTime(), TmfTimestamp.BIG_CRUNCH); final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange); new Thread() { @Override public void run() { broadcast(rangeUpdatedsignal); } }.start(); return; } }
Source:
private synchronized void registerWeatherDiscoveryService(WeatherUndergroundBridgeHandler bridgeHandler) { WeatherUndergroundDiscoveryService discoveryService = new WeatherUndergroundDiscoveryService(bridgeHandler, locationProvider); bridgeHandler.getDiscoveryServiceRegs().put(bridgeHandler.getThing().getUID(), bundleContext .registerService(DiscoveryService.class.getName(), discoveryService, new Hashtable<String, Object>())); }

Target:
private synchronized void registerWeatherDiscoveryService(WeatherUndergroundBridgeHandler bridgeHandler) { WeatherUndergroundDiscoveryService discoveryService = new WeatherUndergroundDiscoveryService( bridgeHandler.getThing().getUID(), locationProvider); bridgeHandler.setDiscoveryService(bundleContext.registerService(DiscoveryService.class.getName(), discoveryService, new Hashtable<String, Object>())); }
Source:
public void spec104_mustSignalOnErrorWhenFails() throws Throwable { errorPublisherTest(new PublisherTestRun<T>() { @Override public void run(final Publisher<T> pub) throws InterruptedException { final Latch latch = new Latch(env); pub.subscribe(new TestEnvironment.TestSubscriber<T>(env) { public void onError(Throwable cause) { latch.assertOpen(String.format("Error-state Publisher %s called `onError` twice on new Subscriber", pub)); latch.close(); } }); latch.expectClose(env.defaultTimeoutMillis(), String.format("Error-state Publisher %s did not call `onError` on new Subscriber", pub)); Thread.sleep(env.defaultTimeoutMillis()); env.verifyNoAsyncErrors(); } }); }

Target:
public void spec104_mustSignalOnErrorWhenFails() throws Throwable { errorPublisherTest(new PublisherTestRun<T>() { @Override public void run(final Publisher<T> pub) throws InterruptedException { final Latch latch = new Latch(env); pub.subscribe(new TestEnvironment.TestSubscriber<T>(env) { @Override public void onError(Throwable cause) { latch.assertOpen(String.format("Error-state Publisher %s called `onError` twice on new Subscriber", pub)); latch.close(); } }); latch.expectClose(String.format("Error-state Publisher %s did not call `onError` on new Subscriber", pub)); Thread.sleep(env.defaultTimeoutMillis()); env.verifyNoAsyncErrors(); } }); }
Source:
public void onCreate() { super.onCreate(); setUpPicasso(); if (!BuildConfig.DEBUG) { FirebaseApp.initializeApp(this); setUpCrashlytics(); } Mapbox.getInstance(this, getString(R.string.access_token)); if (Mapbox.getTelemetry() != null) { Mapbox.getTelemetry().setDebugLoggingEnabled(true); } setUpTileLoadingMeasurement(); }

Target:
public void onCreate() { super.onCreate(); setUpPicasso(); if (!BuildConfig.DEBUG) { FirebaseApp.initializeApp(this); setUpCrashlytics(); } Mapbox.getInstance(this, getString(R.string.access_token)); if (BuildConfig.DEBUG) { if (Mapbox.getTelemetry() == null) { throw new RuntimeException("Mapbox.getTelemetry() == null in debug config"); } else { Mapbox.getTelemetry().setDebugLoggingEnabled(true); } } setUpTileLoadingMeasurement(); }
Source:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { throw new IOException("Throwed IOException from publisher!"); }

Target:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { throw new IOException("Threw IOException from publisher!"); }
Source:
private static boolean isWithinTryHeader(Tree syntaxNode) { Tree parent = syntaxNode; while ((parent = parent.parent()) != null) { if (parent.is(Tree.Kind.VARIABLE)) { break; } } if (parent != null && parent.is(Tree.Kind.VARIABLE)) { return isTryStatementResource((VariableTree) parent); } return false; }

Target:
private static boolean isWithinTryHeader(Tree syntaxNode) { Tree parent = syntaxNode; while (parent != null && !parent.is(Tree.Kind.VARIABLE) ) { parent = parent.parent(); } if (parent != null && parent.is(Tree.Kind.VARIABLE)) { return isTryStatementResource((VariableTree) parent); } return false; }
Source:
public boolean isOnlyHEADSelected(Set<RefFilter> filters) { for (RefFilter filter : filters) { if (filter.isSelected()) { if (!filtersForHEAD.contains(filter)) return false; } else { if (filtersForHEAD.contains(filter)) return false; } } return true; }

Target:
public boolean isOnlyHEADSelected(Set<RefFilter> filters) { for (RefFilter filter : filters) { if (filter.isSelected()) { if (!filtersForHEAD.contains(filter)) { return false; } } else { if (filtersForHEAD.contains(filter)) { return false; } } } return true; }
Source:
public InputStream fetchResource(String resourceName, ResourceUriCallback callback) { try { if (resources.containsKey(resourceName)) { final byte[] resourceByteArray = resources.get(resourceName); System.out.println("CacheResourceLoader hits: " + String.valueOf(++hits)); return toInputStreamOrNull(resourceByteArray); } InputStream resource = null; if (resourceLoader instanceof ResourceLoaderExtended) { resource = ((ResourceLoaderExtended) resourceLoader).fetchResource(resourceName, callback); } else { resource = resourceLoader.fetchResource(resourceName); } final byte[] resourceByteArray = resource == null ? null : IOUtils.toByteArray(resource); resources.put(resourceName, resourceByteArray); return toInputStreamOrNull(resourceByteArray); } catch (final IOException e) { return resourceLoader.fetchResource(resourceName); } }

Target:
public InputStream fetchResource(String resourceName, ResourceUriCallback callback) { try { if (resources.containsKey(resourceName)) { final byte[] resourceByteArray = resources.get(resourceName); return toInputStreamOrNull(resourceByteArray); } InputStream resource = null; if (resourceLoader instanceof ResourceLoaderExtended) { resource = ((ResourceLoaderExtended) resourceLoader).fetchResource(resourceName, callback); } else { resource = resourceLoader.fetchResource(resourceName); } final byte[] resourceByteArray = resource == null ? null : IOUtils.toByteArray(resource); resources.put(resourceName, resourceByteArray); return toInputStreamOrNull(resourceByteArray); } catch (final IOException e) { return resourceLoader.fetchResource(resourceName); } }
Source:
private void stressTestDeleting(MotechDataService service) { Long startTime = System.nanoTime(); for (Object object : service.retrieveAll()) { service.delete(object); } double endTime = (System.nanoTime() - startTime) / 1000000; LOGGER.info("MDS Service: Deleting " + TEST_INSTANCES + " instances took " + endTime + "ms."); logToFile(endTime); }

Target:
private void stressTestDeleting(MotechDataService service) { Long startTime = System.nanoTime(); for (Object object : service.retrieveAll()) { service.delete(object); } Long endTime = (System.nanoTime() - startTime) / 1000000; LOGGER.info("MDS Service: Deleting " + TEST_INSTANCES + " instances took " + endTime + "ms."); logToFile((double) endTime); }
Source:
private static Partition getPartition(byte[] rowKey, long conglomId) throws IOException { PartitionAdmin admin= SIDriver.driver().getTableFactory().getAdmin(); Iterable<? extends Partition> partitions = admin.allPartitions(Long.toString(conglomId)); List<Partition> partitionList = Lists.newArrayList(partitions); partitionList.sort(new Comparator<Partition>() { @Override public int compare(Partition o1, Partition o2) { byte[] k1 = o1.getStartKey(); byte[] k2 = o2.getStartKey(); if (k1 == null || k1.length == 0) { if (k2 == null || k2.length == 0) return 0; else return -1; } else { if (k2 == null || k2.length == 0) return 1; else return Bytes.compareTo(k1, k2); } } }); byte[][] startKeys = new byte[partitionList.size()][]; for (int i = 0; i < partitionList.size(); ++i) { Partition p = partitionList.get(i); byte[] k = p.getStartKey(); startKeys[i] = k; } int index = binarySearchStartKey(startKeys, rowKey); assert index != -1; Partition p = partitionList.get(index); return p; }

Target:
private static Partition getPartition(byte[] rowKey, long conglomId) throws IOException { PartitionAdmin admin= SIDriver.driver().getTableFactory().getAdmin(); Iterable<? extends Partition> partitions = admin.allPartitions(Long.toString(conglomId)); List<Partition> partitionList = Lists.newArrayList(partitions); for(Partition p : partitionList) { byte[] start = p.getStartKey(); byte[] end = p.getEndKey(); if (Bytes.compareTo(rowKey, start) >= 0 && Bytes.compareTo(rowKey, end) < 0) { return p; } } assert false; return null; }
Source:
public void onLoadFinished(Loader<AsyncTaskResult<List<EnrolledCoursesResponse>>> asyncTaskResultLoader, AsyncTaskResult<List<EnrolledCoursesResponse>> result) { progressBar.setVisibility(View.GONE); if (result == null) { logger.warn("result is found null, was expecting non-null"); return; } myCourseList.setVisibility(View.VISIBLE); if (result.getEx() != null) { if (result.getEx() instanceof AuthException) { PrefManager prefs = new PrefManager(getActivity(), PrefManager.Pref.LOGIN); prefs.clearAuth(); logger.error(result.getEx()); getActivity().finish(); } else if (result.getEx() instanceof RetroHttpException) { logger.error(result.getEx()); environment.getRouter().forceLogout( getContext(), environment.getSegment(), environment.getNotificationDelegate()); } } else if (result.getResult() != null) { invalidateSwipeFunctionality(); ArrayList<EnrolledCoursesResponse> newItems = new ArrayList<EnrolledCoursesResponse>(result.getResult()); ((MyCoursesListActivity) getActivity()).updateDatabaseAfterDownload(newItems); if (result.getResult().size() == 0) { adapter.clear(); } else { adapter.setItems(newItems); adapter.notifyDataSetChanged(); } } else { adapter.clear(); } }

Target:
public void onLoadFinished(Loader<AsyncTaskResult<List<EnrolledCoursesResponse>>> asyncTaskResultLoader, AsyncTaskResult<List<EnrolledCoursesResponse>> result) { progressBar.setVisibility(View.GONE); if (result == null) { logger.warn("result is found null, was expecting non-null"); return; } myCourseList.setVisibility(View.VISIBLE); if (result.getEx() != null) { if (result.getEx() instanceof AuthException) { PrefManager prefs = new PrefManager(getActivity(), PrefManager.Pref.LOGIN); prefs.clearAuth(); logger.error(result.getEx()); getActivity().finish(); } else if (result.getEx() instanceof RetroHttpException) { logger.error(result.getEx()); if (((RetroHttpException) result.getEx()).getStatusCode() == 401) { environment.getRouter().forceLogout( getContext(), environment.getSegment(), environment.getNotificationDelegate()); } } } else if (result.getResult() != null) { invalidateSwipeFunctionality(); ArrayList<EnrolledCoursesResponse> newItems = new ArrayList<EnrolledCoursesResponse>(result.getResult()); ((MyCoursesListActivity) getActivity()).updateDatabaseAfterDownload(newItems); if (result.getResult().size() == 0) { adapter.clear(); } else { adapter.setItems(newItems); adapter.notifyDataSetChanged(); } } else { adapter.clear(); } }
Source:
public void verifyFileSystemConfiguration() { try { getGoogleCredentials(); } catch (final IOException ioe) { logger.error("Failed to obtain application default credentials for Google Cloud Storage for OAuth scope '" + GoogleCloudStorageFileManager.GCS_OAUTH_SCOPE + "'", ioe); throw new RuntimeException("Could not obtain application default credentials for Google Cloud Storage", ioe); } final GoogleCloudStorageSinkConfiguration sinkConfiguration = configuration.configuration().getSinkConfiguration(name, GoogleCloudStorageSinkConfiguration.class); try { final URL bucketUrl = new URL(GoogleCloudStorageFileManager.GET_BUCKET_URL_PREFIX + URLEncoder.encode(sinkConfiguration.bucket, URL_ENCODING)); final GetBucketResponse response = googleGet(bucketUrl, GetBucketResponse.class); logger.info("Google Cloud Storage sink using bucket {}", name, response); URLEncoder.encode(sinkConfiguration.fileStrategy.workingDir, URL_ENCODING); URLEncoder.encode(sinkConfiguration.fileStrategy.publishDir, URL_ENCODING); } catch (final IOException ioe) { logger.error("Failed to fetch bucket information for Google Cloud Storage sink using bucket {}. Assuming destination unwritable.", name, sinkConfiguration.bucket); throw new RuntimeException(ioe); } }

Target:
public void verifyFileSystemConfiguration() { try { getGoogleCredentials(); } catch (final IOException ioe) { logger.error("Failed to obtain application default credentials for Google Cloud Storage for OAuth scope '" + GoogleCloudStorageFileManager.GCS_OAUTH_SCOPE + "'", ioe); throw new UncheckedIOException("Could not obtain application default credentials for Google Cloud Storage", ioe); } final GoogleCloudStorageSinkConfiguration sinkConfiguration = configuration.configuration().getSinkConfiguration(name, GoogleCloudStorageSinkConfiguration.class); try { final URL bucketUrl = new URL(GoogleCloudStorageFileManager.GET_BUCKET_URL_PREFIX + URLEncoder.encode(sinkConfiguration.bucket, URL_ENCODING)); final GetBucketResponse response = googleGet(bucketUrl, GetBucketResponse.class); logger.info("Google Cloud Storage sink using bucket {}", name, response); URLEncoder.encode(sinkConfiguration.fileStrategy.workingDir, URL_ENCODING); URLEncoder.encode(sinkConfiguration.fileStrategy.publishDir, URL_ENCODING); } catch (final IOException ioe) { logger.error("Failed to fetch bucket information for Google Cloud Storage sink using bucket {}. Assuming destination unwritable.", name, sinkConfiguration.bucket); throw new UncheckedIOException(ioe); } }
Source:
public void consume() { MentionsData data = null; try { data = DefaultMentionsEventExecutor.this.queue.take(); data.increaseAttempts(); if (data.isStop()) { this.halt = true; } else if (!data.isDeprecated()) { DefaultMentionsEventExecutor.this.logger .debug("[{}] - consumed. Queue size [{}]", data.getDocumentReference(), data.getVersion(), getQueueSize()); DefaultMentionsEventExecutor.this.dataConsumer.consume(data); } } catch (Exception e) { DefaultMentionsEventExecutor.this.logger .warn("Error during mention analysis of task [{}]. Cause [{}].", data, getRootCauseMessage(e)); if (data != null) { if (!data.tooManyAttempts()) { try { DefaultMentionsEventExecutor.this.queue.put(data); } catch (InterruptedException interruptedException) { DefaultMentionsEventExecutor.this.logger .error("Error when adding back a fail failed task [{}]. Cause [{}].", data, getRootCauseMessage(e)); } } else { DefaultMentionsEventExecutor.this.logger .error("[{}] abandoned because it has failed to many times.", data); } } } }

Target:
public void consume() { MentionsData data = null; try { data = DefaultMentionsEventExecutor.this.queue.take(); if (data != null) { data.increaseAttempts(); if (data.isStop()) { this.halt = true; } else if (!data.isDeprecated()) { DefaultMentionsEventExecutor.this.logger .debug("[{}] - consumed. Queue size [{}]", data.getDocumentReference(), data.getVersion(), getQueueSize()); DefaultMentionsEventExecutor.this.dataConsumer.consume(data); } } } catch (Exception e) { DefaultMentionsEventExecutor.this.logger .warn("Error during mention analysis of task [{}]. Cause [{}].", data, getRootCauseMessage(e)); if (data != null) { if (!data.tooManyAttempts()) { try { DefaultMentionsEventExecutor.this.queue.put(data); } catch (InterruptedException interruptedException) { DefaultMentionsEventExecutor.this.logger .error("Error when adding back a fail failed task [{}]. Cause [{}].", data, getRootCauseMessage(e)); } } else { DefaultMentionsEventExecutor.this.logger .error("[{}] abandoned because it has failed to many times.", data); } } } }
Source:
public static RegistrationRequest build(GridNodeConfiguration configuration, String name, String description) { RegistrationRequest pendingRequest = new RegistrationRequest(configuration, name, description); GridNodeConfiguration pendingConfiguration = pendingRequest.configuration; if (pendingConfiguration.nodeConfigFile != null) { pendingRequest.configuration = GridNodeConfiguration.loadFromJSON(pendingConfiguration.nodeConfigFile); } pendingRequest.configuration.merge(pendingConfiguration); if (pendingConfiguration.host != null) { pendingRequest.configuration.host = pendingConfiguration.host; } if (pendingConfiguration.port != null) { pendingRequest.configuration.port = pendingConfiguration.port; } if (pendingConfiguration.remoteHost != null) { pendingRequest.configuration.remoteHost = pendingConfiguration.remoteHost; } pendingRequest.configuration.fixUpHost(); pendingRequest.configuration.fixUpCapabilities(); pendingRequest.configuration.dropCapabilitiesThatDoesNotMatchCurrentPlatform(); return pendingRequest; }

Target:
public static RegistrationRequest build(GridNodeConfiguration configuration, String name, String description) { RegistrationRequest pendingRequest = new RegistrationRequest(configuration, name, description); GridNodeConfiguration pendingConfiguration = pendingRequest.configuration; if (pendingConfiguration.nodeConfigFile != null) { pendingRequest.configuration = GridNodeConfiguration.loadFromJSON(pendingConfiguration.nodeConfigFile); } pendingRequest.configuration.merge(pendingConfiguration); if (pendingConfiguration.host != null) { pendingRequest.configuration.host = pendingConfiguration.host; } if (pendingConfiguration.port != null) { pendingRequest.configuration.port = pendingConfiguration.port; } pendingRequest.configuration.fixUpHost(); pendingRequest.configuration.fixUpCapabilities(); pendingRequest.configuration.dropCapabilitiesThatDoesNotMatchCurrentPlatform(); return pendingRequest; }
Source:
private void testReadWriteAndSeek(int bufferSize) throws Exception { final AzureBlobFileSystem fs = getFileSystem(); final AbfsConfiguration abfsConfiguration = fs.getAbfsStore().getAbfsConfiguration(); abfsConfiguration.setWriteBufferSize(bufferSize); abfsConfiguration.setReadBufferSize(bufferSize); abfsConfiguration.setAlwaysReadAhead(true); final byte[] b = new byte[2 * bufferSize]; new Random().nextBytes(b); try (FSDataOutputStream stream = fs.create(TEST_PATH)) { stream.write(b); } final byte[] readBufferForReadAhead = new byte[2 * bufferSize]; int resultForReadAhead; try (FSDataInputStream inputStreamForReadAhead = fs.open(TEST_PATH)) { inputStreamForReadAhead.seek(bufferSize); resultForReadAhead = inputStreamForReadAhead.read(readBufferForReadAhead, bufferSize, bufferSize); assertNotEquals(-1, resultForReadAhead); inputStreamForReadAhead.seek(0); resultForReadAhead = inputStreamForReadAhead.read(readBufferForReadAhead, 0, bufferSize); } assertNotEquals("data read in final read()", -1, resultForReadAhead); assertArrayEquals(readBufferForReadAhead, b); }

Target:
private void testReadWriteAndSeek(int bufferSize) throws Exception { final AzureBlobFileSystem fs = getFileSystem(); final AbfsConfiguration abfsConfiguration = fs.getAbfsStore().getAbfsConfiguration(); abfsConfiguration.setWriteBufferSize(bufferSize); abfsConfiguration.setReadBufferSize(bufferSize); abfsConfiguration.setAlwaysReadAhead(true); final byte[] b = new byte[2 * bufferSize]; new Random().nextBytes(b); try (FSDataOutputStream stream = fs.create(TEST_PATH)) { stream.write(b); } final byte[] readBufferForReadAhead = new byte[2 * bufferSize]; int resultForReadAhead; try (FSDataInputStream inputStreamForReadAhead = fs.open(TEST_PATH)) { inputStreamForReadAhead.seek(bufferSize); resultForReadAhead = inputStreamForReadAhead.read(readBufferForReadAhead, bufferSize, bufferSize); assertNotEquals(-1, resultForReadAhead); assertArrayEquals(Arrays.copyOfRange(readBufferForReadAhead, bufferSize, 2 * bufferSize), Arrays.copyOfRange(b, bufferSize, 2 * bufferSize)); inputStreamForReadAhead.seek(0); resultForReadAhead = inputStreamForReadAhead.read(readBufferForReadAhead, 0, bufferSize); } assertNotEquals("data read in final read()", -1, resultForReadAhead); assertArrayEquals(readBufferForReadAhead, b); }
Source:
private String getFilter(Annotation a, Requirement annotation) { StringBuilder filter = new StringBuilder(); boolean addAnd = false; if (a.containsKey("filter")) { filter.append(annotation.filter()); addAnd = true; } boolean andAdded = false; if (a.containsKey("name")) { filter.append('(') .append(annotation.namespace()) .append('=') .append(annotation.name()) .append(')'); if (addAnd) { filter.insert(0, "(&") .append(')'); andAdded = true; } addAnd = true; } if (a.containsKey("version") && annotation.version() .indexOf('$') == -1) { Version floor; try { floor = Version.parseVersion(annotation.version()); } catch (Exception e) { floor = null; analyzer.exception(e, "The version declared by the Requirement annotation attached to type %s is invalid", current.getFQN()); } if (floor != null) { int current = filter.lastIndexOf(")"); VersionRange range = new VersionRange(floor, floor.bumpMajor()); String rangeFilter = range.toFilter(); filter.append(rangeFilter.substring(2, rangeFilter.length() - 1)); if (andAdded) { filter.deleteCharAt(current) .append(')'); } else if (addAnd) { filter.insert(0, "(&") .append(')'); } } } else if (a.containsKey("version")) { String floor = annotation.version(); int current = filter.lastIndexOf(")"); filter.append("(version>=") .append(floor) .append(")(!(version>=${version;+00;") .append(floor) .append("}))"); if (andAdded) { filter.deleteCharAt(current) .append(')'); } else if (addAnd) { filter.insert(0, "(&") .append(')'); } } return filter.toString(); }

Target:
private String getFilter(Annotation a, Requirement annotation) { StringBuilder filter = new StringBuilder(); boolean addAnd = false; if (a.containsKey("filter")) { filter.append(annotation.filter()); addAnd = true; } boolean andAdded = false; if (a.containsKey("name")) { filter.append('(') .append(annotation.namespace()) .append('=') .append(annotation.name()) .append(')'); if (addAnd) { filter.insert(0, "(&") .append(')'); andAdded = true; } addAnd = true; } if (a.containsKey("version")) { if (annotation.version() .indexOf('$') == -1) { Version floor; try { floor = Version.parseVersion(annotation.version()); } catch (Exception e) { floor = null; analyzer.exception(e, "The version declared by the Requirement annotation attached to type %s is invalid", current.getFQN()); } if (floor != null) { int current = filter.lastIndexOf(")"); VersionRange range = new VersionRange(floor, floor.bumpMajor()); String rangeFilter = range.toFilter(); filter.append(rangeFilter.substring(2, rangeFilter.length() - 1)); if (andAdded) { filter.deleteCharAt(current) .append(')'); } else if (addAnd) { filter.insert(0, "(&") .append(')'); } } } else { String floor = annotation.version(); int current = filter.lastIndexOf(")"); filter.append("(version>=") .append(floor) .append(")(!(version>=${versionmask;+00;") .append(floor) .append("}))"); if (andAdded) { filter.deleteCharAt(current) .append(')'); } else if (addAnd) { filter.insert(0, "(&") .append(')'); } } } return filter.toString(); }
Source:
public int getAvailableUnitForScsiDisk(Map<VmDevice, Integer> vmDeviceUnitMap, boolean reserveFirstTwoLuns, boolean reserveForScsiCd) { int cdPayloadUnitIndex = VmDeviceCommonUtils.getCdPayloadDeviceIndex("scsi"); int cdUnitIndex = VmDeviceCommonUtils.getCdDeviceIndex("scsi"); int unit = reserveFirstTwoLuns ? reserveForScsiCd ? Math.max(cdPayloadUnitIndex, cdUnitIndex) + 1 : 2 : 0; if (vmDeviceUnitMap == null) { return unit; } while (reserveForScsiCd && unit == cdPayloadUnitIndex || reserveForScsiCd && unit == cdUnitIndex || vmDeviceUnitMap.containsValue(unit)) { unit++; } return unit; }

Target:
public int getAvailableUnitForScsiDisk(Map<VmDevice, Integer> vmDeviceUnitMap, boolean reserveFirstTwoLuns, boolean reserveForScsiCd) { int unit = reserveFirstTwoLuns ? 2 : 0; int cdPayloadUnitIndex = VmDeviceCommonUtils.getCdPayloadDeviceIndex("scsi"); int cdUnitIndex = VmDeviceCommonUtils.getCdDeviceIndex("scsi"); while (reserveForScsiCd && unit == cdPayloadUnitIndex || reserveForScsiCd && unit == cdUnitIndex || (vmDeviceUnitMap != null && vmDeviceUnitMap.containsValue(unit))) { unit++; } return unit; }
Source:
public MicroserviceMetadata(Map<String, Object> services) { services.forEach((basePath, service) -> { for (Method method : service.getClass().getMethods()) { if (method.isAnnotationPresent(PostConstruct.class) || method.isAnnotationPresent(PreDestroy.class)) { continue; } if (Modifier.isPublic(method.getModifiers()) && isHttpMethodAvailable(method)) { String relativePath = ""; if (method.getAnnotation(Path.class) != null) { relativePath = method.getAnnotation(Path.class).value(); } String absolutePath = String.format("%s/%s", basePath, relativePath); patternRouter.add(absolutePath, new HttpResourceModel(absolutePath, method, service, false)); } else if (Modifier.isPublic(method.getModifiers()) && method.getAnnotation(Path.class) != null) { String relativePath = Utils.normalizePath(method.getAnnotation(Path.class).value()); String absolutePath = String.format("%s/%s", basePath, relativePath); patternRouter.add(absolutePath, new HttpResourceModel(absolutePath, method, service, true)); } else { log.trace("Not adding method {}({}) to path routing like. " + "HTTP calls will not be routed to this method", method.getName(), method.getParameterTypes()); } } }); }

Target:
public MicroserviceMetadata(Map<String, Object> services) { services.forEach((basePath, service) -> { for (Method method : service.getClass().getMethods()) { if (method.isAnnotationPresent(PostConstruct.class) || method.isAnnotationPresent(PreDestroy.class)) { continue; } if (Modifier.isPublic(method.getModifiers()) && isHttpMethodAvailable(method)) { String relativePath = ""; if (method.getAnnotation(Path.class) != null) { relativePath = method.getAnnotation(Path.class).value(); } String absolutePath = String.format("%s/%s", basePath, relativePath); patternRouter.add(absolutePath, new HttpResourceModel(absolutePath, method, service, false)); } else if (Modifier.isPublic(method.getModifiers()) && method.getAnnotation(Path.class) != null) { String relativePath = method.getAnnotation(Path.class).value(); String absolutePath = String.format("%s/%s", basePath, relativePath); patternRouter.add(absolutePath, new HttpResourceModel(absolutePath, method, service, true)); } else { log.trace("Not adding method {}({}) to path routing like. " + "HTTP calls will not be routed to this method", method.getName(), method.getParameterTypes()); } } }); }
Source:
private boolean isS3SelectEnabled(ConnectorSession session) { if (!hiveClientConfig.isS3SelectPushdownEnabled()) { LOG.debug("S3Select is not enabled."); return false; } if (!HiveSessionProperties.isS3SelectPushdownEnabled(session)) { LOG.debug("Session S3SelectPushdown is disabled."); return false; } LOG.info("S3Select is enabled."); return true; }

Target:
private boolean isS3SelectEnabled(ConnectorSession session) { if (!hiveClientConfig.isS3SelectPushdownEnabled()) { return false; } if (!HiveSessionProperties.isS3SelectPushdownEnabled(session)) { return false; } return true; }
Source:
private List<LocalDate> generateUnadjustedDates( LocalDate regStart, LocalDate regEnd, RollConvention rollCnv, StubConvention stubCnv, boolean explicitInitStub, LocalDate overrideStart, boolean explicitFinalStub, LocalDate end) { if (stubCnv.isCalculateBackwards()) { ArgChecker.isFalse(explicitInitStub, "Value explicitInitStub must be false"); ArgChecker.isFalse(explicitFinalStub, "Value explicitFinalStub must be false"); return generateBackwards( this, regStart, regEnd, frequency, rollCnv, stubCnv, overrideStart, end); } else { return generateForwards( this, regStart, regEnd, frequency, rollCnv, stubCnv, explicitInitStub, overrideStart, explicitFinalStub, end); } }

Target:
private List<LocalDate> generateUnadjustedDates( LocalDate regStart, LocalDate regEnd, RollConvention rollCnv, StubConvention stubCnv, boolean explicitInitStub, LocalDate overrideStart, boolean explicitFinalStub, LocalDate end) { if (stubCnv.isCalculateBackwards()) { ArgChecker.isFalse(explicitInitStub, "Value explicitInitStub must be false"); ArgChecker.isFalse(explicitFinalStub, "Value explicitFinalStub must be false"); return generateBackwards(this, regStart, regEnd, frequency, rollCnv, stubCnv, overrideStart); } else { return generateForwards( this, regStart, regEnd, frequency, rollCnv, stubCnv, explicitInitStub, overrideStart, explicitFinalStub, end); } }