auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean canResolve(ScopeDescriptor scopeDescription) { return scopeDescription instanceof AggregateDescriptor && ((AggregateDescriptor) scopeDescription).getType().equals(aggregateModel.type()); }

Target:
public boolean canResolve(ScopeDescriptor scopeDescription) { return scopeDescription instanceof AggregateScopeDescriptor && Objects.equals(aggregateModel.type(), ((AggregateScopeDescriptor) scopeDescription).getType()); }
Source:
protected boolean executeAnalysis(@Nullable final IProgressMonitor monitor) { IProgressMonitor mon = (monitor == null ? new NullProgressMonitor() : monitor); final ITmfStateProvider provider = createStateProvider(); String id = getId(); if (id == null) { id = "unnamed"; } try { StateSystemBackendType backend = getBackendType(); String directory; File htFile; switch (backend) { case FULL: directory = TmfTraceManager.getSupplementaryFileDir(getTrace()); htFile = new File(directory + getSsFileName()); createFullHistory(id, provider, htFile); break; case PARTIAL: directory = TmfTraceManager.getSupplementaryFileDir(getTrace()); htFile = new File(directory + getSsFileName()); createPartialHistory(id, provider, htFile); break; case INMEM: createInMemoryHistory(id, provider); break; case NULL: createNullHistory(id, provider); break; default: break; } } catch (TmfTraceException e) { return false; } return !mon.isCanceled(); }

Target:
protected boolean executeAnalysis(@Nullable final IProgressMonitor monitor) { IProgressMonitor mon = (monitor == null ? new NullProgressMonitor() : monitor); final ITmfStateProvider provider = createStateProvider(); String id = getId(); if (id == null) { id = UNDEFINED_ID; } try { StateSystemBackendType backend = getBackendType(); String directory; File htFile; switch (backend) { case FULL: directory = TmfTraceManager.getSupplementaryFileDir(getTrace()); htFile = new File(directory + getSsFileName()); createFullHistory(id, provider, htFile); break; case PARTIAL: directory = TmfTraceManager.getSupplementaryFileDir(getTrace()); htFile = new File(directory + getSsFileName()); createPartialHistory(id, provider, htFile); break; case INMEM: createInMemoryHistory(id, provider); break; case NULL: createNullHistory(id, provider); break; default: break; } } catch (TmfTraceException e) { return false; } return !mon.isCanceled(); }
Source:
public static void isRetryableExceptionWhereLeaderCannotBeFound(Throwable throwable) { assertThat(throwable) .hasMessageContaining("receiving QosException.RetryOther") .isInstanceOf(RetryableException.class); }

Target:
public static void isRetryableExceptionWhereLeaderCannotBeFound(Throwable throwable) { assertThat(throwable) .hasMessageContaining("receiving QosException.RetryOther") .isInstanceOf(RetryableException.class) .hasRootCauseInstanceOf(QosException.RetryOther.class); }
Source:
public void shouldTalkToPlugin_To_GetPipelineAnalytics() throws Exception { String responseBody = "{ \"view_path\": \"path/to/view\", \"data\": \"{}\" }"; when(pluginManager.submitTo(eq(PLUGIN_ID), requestArgumentCaptor.capture())).thenReturn(new DefaultGoPluginApiResponse(SUCCESS_RESPONSE_CODE, responseBody)); AnalyticsPluginInfo pluginInfo = mock(AnalyticsPluginInfo.class); PluginDescriptor desc = mock(PluginDescriptor.class); when(desc.id()).thenReturn(PLUGIN_ID); when(pluginInfo.getDescriptor()).thenReturn(desc); when(pluginInfo.getStaticAssetsPath()).thenReturn("/assets/root"); metadataStore.setPluginInfo(pluginInfo); AnalyticsData pipelineAnalytics = analyticsExtension.getPipelineAnalytics(PLUGIN_ID, "test_pipeline"); assertRequest(requestArgumentCaptor.getValue(), AnalyticsPluginConstants.EXTENSION_NAME, "1.0", REQUEST_GET_PIPELINE_ANALYTICS, "{\"pipeline_name\": \"test_pipeline\"}"); assertThat(pipelineAnalytics.getViewPath(), is("path/to/view")); Map<String, String> expected = new HashMap<>(); expected.put("data", "{}"); expected.put("view_path", "/assets/root/path/to/view"); assertEquals(expected, pipelineAnalytics.toMap()); }

Target:
public void shouldTalkToPlugin_To_GetPipelineAnalytics() throws Exception { String responseBody = "{ \"view_path\": \"path/to/view\", \"data\": \"{}\" }"; when(pluginManager.submitTo(eq(PLUGIN_ID), requestArgumentCaptor.capture())).thenReturn(new DefaultGoPluginApiResponse(SUCCESS_RESPONSE_CODE, responseBody)); AnalyticsPluginInfo pluginInfo = new AnalyticsPluginInfo( new GoPluginDescriptor(PLUGIN_ID, null, null, null, null, false), null, null, null); pluginInfo.setStaticAssetsPath("/assets/root"); metadataStore.setPluginInfo(pluginInfo); AnalyticsData pipelineAnalytics = analyticsExtension.getPipelineAnalytics(PLUGIN_ID, "test_pipeline"); assertRequest(requestArgumentCaptor.getValue(), AnalyticsPluginConstants.EXTENSION_NAME, "1.0", REQUEST_GET_PIPELINE_ANALYTICS, "{\"pipeline_name\": \"test_pipeline\"}"); assertThat(pipelineAnalytics.getViewPath(), is("path/to/view")); Map<String, String> expected = new HashMap<>(); expected.put("data", "{}"); expected.put("view_path", "/assets/root/path/to/view"); assertEquals(expected, pipelineAnalytics.toMap()); }
Source:
private Function<Double, Double> getTrigonometricFunction(OperatorOption o) { switch (o) { case COS: return parameter -> Math.cos(parameter.doubleValue()); case TAN: return parameter -> Math.tan(parameter.doubleValue()); case ASIN: return parameter -> Math.asin(parameter.doubleValue()); case ACOS: return parameter -> Math.acos(parameter.doubleValue()); case ATAN: return parameter -> Math.atan(parameter.doubleValue()); default: case SIN: return parameter -> Math.sin(parameter.doubleValue()); } }

Target:
private Function<Double, Double> getTrigonometricFunction(OperatorOption o) { switch (o) { case COS: return parameter -> Math.cos(parameter.doubleValue()); case TAN: return parameter -> Math.tan(parameter.doubleValue()); case ASIN: return parameter -> Math.asin(parameter.doubleValue()); case ACOS: return parameter -> Math.acos(parameter.doubleValue()); case ATAN: return parameter -> Math.atan(parameter.doubleValue()); case SIN: default: return parameter -> Math.sin(parameter.doubleValue()); } }
Source:
public void removeString() { BibtexStringViewModel toBeRemoved = selectedItemProperty.getValue(); allStrings.remove(toBeRemoved); bibDatabase.removeStringByName(fromBibtexStringViewModel(toBeRemoved)); }

Target:
public void removeString() { BibtexStringViewModel toBeRemoved = selectedItemProperty.getValue(); allStrings.remove(toBeRemoved); }
Source:
public boolean isMenuQnNumberVisible(int qnNumber) { WebElement discardChangesButton = browser.driver.findElement( By.id(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER + "-" + qnNumber)); return discardChangesButton.isDisplayed(); }

Target:
public boolean isMenuQnNumberVisible(int qnNumber) { if (qnNumber != NEW_QUESTION_NUM) { WebElement selectQuestionNumberDropdown = browser.driver.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER + "-" + qnNumber)); return selectQuestionNumberDropdown.isDisplayed(); } WebElement retrievedQnTable = browser.driver.findElement(By.id("questionTable-" + qnNumber)); return retrievedQnTable.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER)).isDisplayed(); }
Source:
public Set<String> getUnmarkedBlobs() { try { Set<String> unmarked = new HashSet<>(); Page<Blob> blobs = binaryManager.getBucket().list(BlobListOption.fields(BlobField.ID, BlobField.SIZE)); do { for (Blob blob : blobs.iterateAll()) { if (marked.contains(getDigest(blob))) { status.numBinaries++; status.sizeBinaries += blob.getSize(); } else { status.numBinariesGC++; status.sizeBinariesGC += blob.getSize(); unmarked.add(getDigest(blob)); marked.remove(getDigest(blob)); } } blobs = blobs.getNextPage(); } while (blobs != null); return unmarked; } catch (StorageException e) { throw new NuxeoException(e); } }

Target:
public Set<String> getUnmarkedBlobs() { Set<String> unmarked = new HashSet<>(); Page<Blob> blobs = binaryManager.getBucket() .list(BlobListOption.fields(BlobField.ID, BlobField.SIZE), BlobListOption.prefix(binaryManager.bucketPrefix)); do { int prefixLength = binaryManager.bucketPrefix.length(); for (Blob blob : blobs.iterateAll()) { String digest = blob.getName().substring(prefixLength); if (!isMD5(digest)) { continue; } if (marked.contains(digest)) { status.numBinaries++; status.sizeBinaries += blob.getSize(); } else { status.numBinariesGC++; status.sizeBinariesGC += blob.getSize(); unmarked.add(digest); marked.remove(digest); } } blobs = blobs.getNextPage(); } while (blobs != null); return unmarked; }
Source:
public void autoSetText(CharSequence text, int cursorPosition){ autoEdit = true; setText(text); this.setSelection(cursorPosition); autoEdit = false; }

Target:
public void autoSetText(CharSequence text, int cursorPosition){ mAutoEdit = true; setText(text); setSelection(cursorPosition); mAutoEdit = false; }
Source:
public void onMessage(ReadRowsResponse message) { resetStatusBasedBackoff(); if (rowObserver instanceof ResponseQueueReader) { ((ResponseQueueReader) rowObserver).addRequestResultMarker(); } else { call.request(1); } lastResponseMs = clock.currentTimeMillis(); timeoutRetryCount = 0; ByteString previouslyProcessedKey = rowMerger.getLastCompletedRowKey(); rowMerger.onNext(message); ByteString lastProcessedKey = rowMerger.getLastCompletedRowKey(); if (previouslyProcessedKey != lastProcessedKey) { updateLastFoundKey(lastProcessedKey); } else { updateLastFoundKey(message.getLastScannedRowKey()); } }

Target:
public void onMessage(ReadRowsResponse message) { resetStatusBasedBackoff(); lastResponseMs = clock.currentTimeMillis(); timeoutRetryCount = 0; ByteString previouslyProcessedKey = rowMerger.getLastCompletedRowKey(); rowMerger.onNext(message); ByteString lastProcessedKey = rowMerger.getLastCompletedRowKey(); if (previouslyProcessedKey != lastProcessedKey) { updateLastFoundKey(lastProcessedKey); } else { updateLastFoundKey(message.getLastScannedRowKey()); } if (adapter.autoFlowControlEnabled) { adapter.request(1); } if (resultObserver != null) { resultObserver.onNext(message); } }
Source:
double routeLeg(Person person, Leg leg, Link fromLink, Link toLink, double depTime) { double travTime = 0; Node startNode = fromLink.getToNode(); Node endNode = toLink.getFromNode(); if (toLink != fromLink) { Id<Vehicle> vehicleId = VehicleUtils.getVehicleId(person, leg.getMode(), this.scenario.getConfig()); Vehicle vehicle = scenario.getVehicles().getVehicles().get(vehicleId); Path path = this.routeAlgo.calcLeastCostPath(startNode, endNode, depTime, person, vehicle); if (path == null) throw new RuntimeException("No route found from node " + startNode.getId() + " to node " + endNode.getId() + "."); NetworkRoute route = this.populationFactory.getRouteFactories().createRoute(NetworkRoute.class, fromLink.getId(), toLink.getId()); route.setLinkIds(fromLink.getId(), NetworkUtils.getLinkIds(path.links), toLink.getId()); route.setTravelTime((int) path.travelTime); route.setTravelCost(path.travelCost); route.setDistance(RouteUtils.calcDistance(route, 1.0,1.0,this.filteredNetwork ) ); leg.setRoute(route); travTime = (int) path.travelTime; } else { NetworkRoute route = this.populationFactory.getRouteFactories().createRoute(NetworkRoute.class, fromLink.getId(), toLink.getId()); route.setTravelTime(0); route.setDistance(0.0); leg.setRoute(route); travTime = 0; } leg.setDepartureTime(depTime); leg.setTravelTime(travTime); return travTime; }

Target:
double routeLeg(Person person, Leg leg, Link fromLink, Link toLink, double depTime) { double travTime; Node startNode = fromLink.getToNode(); Node endNode = toLink.getFromNode(); if (toLink != fromLink) { Id<Vehicle> vehicleId = VehicleUtils.getVehicleId(person, leg.getMode()); Vehicle vehicle = scenario.getVehicles().getVehicles().get(vehicleId); Path path = this.routeAlgo.calcLeastCostPath(startNode, endNode, depTime, person, vehicle); if (path == null) throw new RuntimeException("No route found from node " + startNode.getId() + " to node " + endNode.getId() + "."); NetworkRoute route = this.populationFactory.getRouteFactories().createRoute(NetworkRoute.class, fromLink.getId(), toLink.getId()); route.setLinkIds(fromLink.getId(), NetworkUtils.getLinkIds(path.links), toLink.getId()); route.setTravelTime((int) path.travelTime); route.setTravelCost(path.travelCost); route.setDistance(RouteUtils.calcDistance(route, 1.0,1.0,this.filteredNetwork ) ); leg.setRoute(route); travTime = (int) path.travelTime; } else { NetworkRoute route = this.populationFactory.getRouteFactories().createRoute(NetworkRoute.class, fromLink.getId(), toLink.getId()); route.setTravelTime(0); route.setDistance(0.0); leg.setRoute(route); travTime = 0; } leg.setDepartureTime(depTime); leg.setTravelTime(travTime); return travTime; }
Source:
public static void main(final String[] args) throws Exception { Properties jobProps = HadoopSecureWrapperUtils.loadAzkabanProps(); Props initialJobprops = new Props(null, jobProps); boolean retry = false; boolean firstTry = true; if (props.containsKey(TUNING_JOB_RETRY_COUNT)) { maxJobRetry = props.getInt(TUNING_JOB_RETRY_COUNT); } while (jobTryCount <= maxJobRetry && (retry || firstTry)) { jobTryCount++; firstTry = false; props = Props.clone(initialJobprops); props.put(TuningCommonConstants.AUTO_TUNING_RETRY, retry + ""); TuningParameterUtils.updateAutoTuningParameters(props); HadoopTuningConfigurationInjector.prepareResourcesToInject(props, HadoopTuningSecurePigWrapper.getWorkingDirectory(props)); HadoopTuningConfigurationInjector.injectResources(props); pigLogFile = new File(System.getenv("PIG_LOG_FILE")); try { if (HadoopSecureWrapperUtils.shouldProxy(jobProps)) { String tokenFile = System.getenv(HADOOP_TOKEN_FILE_LOCATION); UserGroupInformation proxyUser = HadoopSecureWrapperUtils.setupProxyUser(jobProps, tokenFile, logger); proxyUser.doAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { runPigJob(args); return null; } }); } else { runPigJob(args); } } catch (Exception t) { retry = false; System.out.println("Error " + isTuningError + ", tryCount:" + jobTryCount + ", maxRetry:" + maxJobRetry); if (isTuningError && jobTryCount <= maxJobRetry) { System.out.println("Error due to auto tuning parameters "); retry = true; } else { throw t; } } } }

Target:
public static void main(final String[] args) throws Exception { int jobTryCount = 1; Properties jobProps = HadoopSecureWrapperUtils.loadAzkabanProps(); Props initialJobprops = new Props(null, jobProps); boolean retry = false; boolean firstTry = true; int maxJobRetry = 2; if (initialJobprops.containsKey(TUNING_JOB_RETRY_COUNT)) { maxJobRetry = initialJobprops.getInt(TUNING_JOB_RETRY_COUNT); } TuningParameterUtils tuningParameterUtils = new TuningParameterUtils(); while (jobTryCount <= maxJobRetry && (retry || firstTry)) { jobTryCount++; firstTry = false; props = Props.clone(initialJobprops); props.put(TuningCommonConstants.AUTO_TUNING_RETRY, String.valueOf(retry)); tuningParameterUtils.updateAutoTuningParameters(props); HadoopTuningConfigurationInjector.prepareResourcesToInject(props, HadoopTuningSecurePigWrapper.getWorkingDirectory(props)); HadoopTuningConfigurationInjector.injectResources(props); pigLogFile = new File(System.getenv("PIG_LOG_FILE")); try { if (HadoopSecureWrapperUtils.shouldProxy(jobProps)) { String tokenFile = System.getenv(HADOOP_TOKEN_FILE_LOCATION); UserGroupInformation proxyUser = HadoopSecureWrapperUtils.setupProxyUser(jobProps, tokenFile, logger); proxyUser.doAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { runPigJob(args); return null; } }); } else { runPigJob(args); } } catch (TuningException t) { retry = false; System.out.println("TryCount:" + jobTryCount + ", maxRetry:" + maxJobRetry); if (jobTryCount <= maxJobRetry) { System.out.println("Error due to auto tuning parameters "); retry = true; } else { throw t; } } catch (Exception t) { throw t; } } }
Source:
public TableViewer createTableViewerSection(Composite aParent) { Composite viewerForm = UIUtils.createsGeneralComposite(aParent, SWT.BORDER | SWT.SHADOW_ETCHED_IN); GridData gribDataViewer = new GridData(GridData.FILL_BOTH); viewerForm.setLayoutData(gribDataViewer); GridLayout layout = new GridLayout(); layout.numColumns = ReviewTableDefinition.values().length; layout.makeColumnsEqualWidth = false; layout.marginWidth = 0; layout.marginHeight = 0; viewerForm.setLayout(layout); fViewer = new TableViewer(viewerForm, TABLE_STYLE); fViewer = buildAndLayoutTable(fViewer); fViewer.setContentProvider(new ReviewTableContentProvider()); ReviewTableLabelProvider tableProvider = new ReviewTableLabelProvider(); fViewer.setLabelProvider(tableProvider); ReviewTableSorter.bind(fViewer); fViewer.setComparator(new ReviewTableSorter(7)); fViewer.getTable().addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { GerritUi.Ftracer.traceInfo("Table selection: " + e.toString()); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); fViewer.getTable().addListener(SWT.MouseDown, mouseButtonListener); return fViewer; }

Target:
public TableViewer createTableViewerSection(Composite aParent) { Composite viewerForm = UIUtils.createsGeneralComposite(aParent, SWT.BORDER | SWT.SHADOW_ETCHED_IN); GridData gribDataViewer = new GridData(GridData.FILL_BOTH); viewerForm.setLayoutData(gribDataViewer); GridLayout layout = new GridLayout(); layout.numColumns = ReviewTableDefinition.values().length; layout.makeColumnsEqualWidth = false; layout.marginWidth = 0; layout.marginHeight = 0; viewerForm.setLayout(layout); fViewer = new TableViewer(viewerForm, TABLE_STYLE); fViewer = buildAndLayoutTable(fViewer); fViewer.setContentProvider(new ReviewTableContentProvider()); ReviewTableLabelProvider tableProvider = new ReviewTableLabelProvider(); fViewer.setLabelProvider(tableProvider); ReviewTableSorter.bind(fViewer); fViewer.setComparator(new ReviewTableSorter(6)); fViewer.getTable().addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { GerritUi.Ftracer.traceInfo("Table selection: " + e.toString()); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); fViewer.getTable().addListener(SWT.MouseDown, mouseButtonListener); return fViewer; }
Source:
public String toString() { return toStringHelper().toString(); }

Target:
public final String toString() { return toStringHelper().toString(); }
Source:
public void setUserActivationKey_shouldCreateUserActivationKey() throws MessageException { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.getPerson().setGender("M"); Context.getAdministrationService().setGlobalProperty("mail.smtp_auth", "false"); Context.getAdministrationService().setGlobalProperty(OpenmrsConstants.GP_MAIL_SMTP_STARTTLS_ENABLE, "true"); Context.getAdministrationService().setGlobalProperty("mail.smtp_host", "localhost"); Context.getAdministrationService().setGlobalProperty("mail.smtp_port", "25"); User createdUser = userService.createUser(u, "Openmr5xy"); assertNull(dao.getLoginCredential(createdUser).getActivationKey()); assertEquals(createdUser, userService.setUserActivationKey(createdUser)); assertNotNull(dao.getLoginCredential(createdUser).getActivationKey()); }

Target:
public void setUserActivationKey_shouldCreateUserActivationKey() throws MessageException { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.getPerson().setGender("M"); Context.getAdministrationService().setGlobalProperty(OpenmrsConstants.GP_HOST_URL, "http://localhost:8080/openmrs/admin/users/changePassword.form/{activationKey}"); User createdUser = userService.createUser(u, "Openmr5xy"); assertNull(dao.getLoginCredential(createdUser).getActivationKey()); assertEquals(createdUser, userService.setUserActivationKey(createdUser)); assertNotNull(dao.getLoginCredential(createdUser).getActivationKey()); }
Source:
private SimpleFeatureCollection parseFeatures(FileItem zipFile, Charset cs, Set<String> validFiles, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS) throws ActionParamsException { File dir = null; FeatureCollectionParser parser = null; try { dir = makeRandomTempDirectory(); File mainFile = unZip(zipFile, cs, validFiles, dir); parser = getParser(mainFile); return parse(parser, mainFile, sourceCRS, targetCRS); } catch (ServiceException e){ UserLayerHandlerHelper.addStringToErrorJSON(e.getOptions(), "error", "parser_error"); UserLayerHandlerHelper.addStringToErrorJSON(e.getOptions(), "parser", parser == null ? null : parser.getSuffix()); throw new ActionParamsException (e.getMessage(), e.getOptions() ); } finally { if (dir != null) { deleteDir(dir); } } }

Target:
private SimpleFeatureCollection parseFeatures(FileItem zipFile, Charset cs, Set<String> validFiles, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS) throws UserLayerException, ActionParamsException { File dir = null; FeatureCollectionParser parser = null; try { dir = makeRandomTempDirectory(); File mainFile = unZip(zipFile, cs, validFiles, dir); parser = getParser(mainFile); return parser.parse(mainFile, sourceCRS, targetCRS); }catch (UserLayerException e) { if (parser != null) { e.addContent(UserLayerException.InfoType.PARSER, parser.getSuffix().toLowerCase()); } throw e; }catch (ServiceException e) { throw new ActionParamsException (e.getMessage()); } finally { if (dir != null) { deleteDir(dir); } } }
Source:
public static InetAddress getLocalInetAddress(Context context) { if (!isConnectedToLocalNetwork(context) && !isEnabledWifiHotspot(context)) { return null; } if (isConnectedToWifi(context)) { WifiManager wm = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE); int ipAddress = wm.getConnectionInfo().getIpAddress(); if (ipAddress == 0) return null; return intToInet(ipAddress); } try { Enumeration<NetworkInterface> netinterfaces = NetworkInterface.getNetworkInterfaces(); while (netinterfaces.hasMoreElements()) { NetworkInterface netinterface = netinterfaces.nextElement(); Enumeration<InetAddress> addresses = netinterface.getInetAddresses(); while (addresses.hasMoreElements()) { InetAddress address = addresses.nextElement(); if(address.getHostAddress().startsWith(WIFI_AP_ADDRESS_PREFIX) && isEnabledWifiHotspot(context)) return address; if (!address.isLoopbackAddress() && !address.isLinkLocalAddress() && !isEnabledWifiHotspot(context)) return address; } } } catch (SocketException e) { e.printStackTrace(); } return null; }

Target:
public static InetAddress getLocalInetAddress(Context context) { if (!isConnectedToLocalNetwork(context) && !isEnabledWifiHotspot(context)) { return null; } if (isConnectedToWifi(context)) { WifiManager wm = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE); int ipAddress = wm.getConnectionInfo().getIpAddress(); if (ipAddress == 0) return null; return intToInet(ipAddress); } try { Enumeration<NetworkInterface> netinterfaces = NetworkInterface.getNetworkInterfaces(); while (netinterfaces.hasMoreElements()) { NetworkInterface netinterface = netinterfaces.nextElement(); Enumeration<InetAddress> addresses = netinterface.getInetAddresses(); while (addresses.hasMoreElements()) { InetAddress address = addresses.nextElement(); if (address == null) { continue; } if(address.getHostAddress().startsWith(WIFI_AP_ADDRESS_PREFIX) && isEnabledWifiHotspot(context)) return address; if (!address.isLoopbackAddress() && !address.isLinkLocalAddress() && !isEnabledWifiHotspot(context)) return address; } } } catch (SocketException e) { e.printStackTrace(); } return null; }
Source:
protected void configure() { bind(GsonModule.DateAdapter.class).to(GsonModule.Iso8601DateAdapter.class); super.configure(); }

Target:
protected void configure() { super.configure(); bind(GsonModule.DateAdapter.class).to(GsonModule.Iso8601DateAdapter.class); }
Source:
private static void loadInternalInboundApis() { int internalInboundPort = HTTPEndpointManager.getInstance().getInternalInboundPort(); if (HTTPEndpointManager.getInstance().isAnyInternalHttpApiEnabled()) { HTTPEndpointManager.getInstance() .startListener(internalInboundPort, InboundHttpConstants.INTERNAL_INBOUND_ENDPOINT_NAME, null); } int internalInboundHttpsPort = HTTPEndpointManager.getInstance().getInternalHTTPSInboundPort(); if (HTTPEndpointManager.getInstance().isAnyInternalHttpsApiEnabled()) { HTTPEndpointManager.getInstance(). startSSLListener(internalInboundHttpsPort, InboundHttpConstants.INTERNAL_INBOUND_ENDPOINT_NAME, ConfigurationLoader.getSSLConfiguration(), null); } }

Target:
private static void loadInternalInboundApis() { HTTPEndpointManager manager = HTTPEndpointManager.getInstance(); if (manager.isAnyInternalHttpApiEnabled()) { HTTPEndpointManager.getInstance().startListener(manager.getInternalInboundHttpPort(), InboundHttpConstants.INTERNAL_HTTP_INBOUND_ENDPOINT_NAME, null); } if (manager.isAnyInternalHttpsApiEnabled()) { if (ConfigurationLoader.isSslConfiguredSuccessfully()) { manager.startSSLListener(manager.getInternalInboundHttpsPort(), InboundHttpConstants.INTERNAL_HTTPS_INBOUND_ENDPOINT_NAME, ConfigurationLoader.getSslConfiguration(), null); } else { log.error("SSL is not configured for Internal apis. Hence Internal Apis will not be available via " + "https."); } } }
Source:
public void testWithCheckConfigLocationFileDoesNotExists() { EnvironmentTestUtils.addEnvironment(this.context, "mybatis.config:foo.xml", "mybatis.check-config-location=true"); this.context.register(EmbeddedDataSourceConfiguration.class, MybatisAutoConfiguration.class); try { this.context.refresh(); fail(); } catch (BeanCreationException e) { assertEquals( "Cannot find config location: class path resource [foo.xml] (please add config file or check your Mybatis configuration)", e.getCause().getMessage()); } }

Target:
public void testWithCheckConfigLocationFileDoesNotExists() { EnvironmentTestUtils.addEnvironment(this.context, "mybatis.config:foo.xml", "mybatis.check-config-location=true"); this.context.register(EmbeddedDataSourceConfiguration.class, MybatisAutoConfiguration.class); expectedException.expect(isA(BeanCreationException.class)); expectedException .expectMessage(is("Error creating bean with name 'mybatisAutoConfiguration': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot find config location: class path resource [foo.xml] (please add config file or check your Mybatis configuration)")); this.context.refresh(); }
Source:
private int testConcurrently(int numThreads, int iterations, AccessAttempt accessAttempt) { LockPool<Integer> lockPool = new LockPool<>(); ExecutorService threadPool = Executors.newFixedThreadPool(numThreads); CountDownLatch startSignal = new CountDownLatch(1); CountDownLatch doneSignal = new CountDownLatch(numThreads); AtomicBoolean concurrencyIndicator = new AtomicBoolean(false); AtomicInteger failureCounter = new AtomicInteger(0); for (int i = 0; (i < numThreads); i++) { threadPool.execute(() -> tryAccess(iterations, startSignal, lockPool, concurrencyIndicator, failureCounter, doneSignal, accessAttempt)); } startSignal.countDown(); awaitWithoutInterrupt(doneSignal); threadPool.shutdown(); return failureCounter.get(); }

Target:
private boolean testConcurrently(int numThreads, int iterations, AccessAttempt accessAttempt) { LockPool<Integer> lockPool = new LockPool<>(); ExecutorService threadPool = Executors.newFixedThreadPool(numThreads); CountDownLatch startSignal = new CountDownLatch(1); CountDownLatch doneSignal = new CountDownLatch(numThreads); AtomicBoolean concurrencyIndicator = new AtomicBoolean(false); AtomicBoolean failureIndicator = new AtomicBoolean(false); for (int i = 0; (i < numThreads); i++) { threadPool.execute(() -> tryAccess(iterations, startSignal, lockPool, concurrencyIndicator, failureIndicator, doneSignal, accessAttempt)); } startSignal.countDown(); awaitWithoutInterrupt(doneSignal); threadPool.shutdown(); return failureIndicator.get(); }
Source:
public void preload() { if (!enabled) return; AdvancedCacheLoader preloadCl = null; for (CacheLoader l : loaders) { if (configMap.get(l).preload()) { if (!(l instanceof AdvancedCacheLoader)) { throw new PersistenceException("Cannot preload from cache loader '" + l.getClass().getName() + "' as it doesn't implement '" + AdvancedCacheLoader.class.getName() + "'"); } preloadCl = (AdvancedCacheLoader) l; if (preloadCl instanceof AdvancedAsyncCacheLoader) preloadCl = (AdvancedCacheLoader) ((AdvancedAsyncCacheLoader) preloadCl).undelegate(); break; } } if (preloadCl == null) return; long start = timeService.time(); final long maxEntries = configuration.memory().size(); final AtomicInteger loadedEntries = new AtomicInteger(0); final AdvancedCache<Object, Object> flaggedCache = getCacheForStateInsertion(); ByRef.Boolean preloaded = new ByRef.Boolean(true); preloadCl.process(null, (me, taskContext) -> { if (loadedEntries.getAndIncrement() >= maxEntries) { taskContext.stop(); preloaded.set(false); return; } Metadata metadata = me.getMetadata() != null ? ((InternalMetadataImpl) me.getMetadata()).actual() : null; preloadKey(flaggedCache, me.getKey(), me.getValue(), metadata); }, new WithinThreadExecutor(), true, true); this.preloaded = preloaded.get(); log.debugf("Preloaded %d keys in %s", loadedEntries.get(), Util.prettyPrintTime(timeService.timeDuration(start, MILLISECONDS))); }

Target:
public void preload() { if (!enabled) return; AdvancedCacheLoader preloadCl = null; for (CacheLoader l : loaders) { if (configMap.get(l).preload()) { if (!(l instanceof AdvancedCacheLoader)) { throw new PersistenceException("Cannot preload from cache loader '" + l.getClass().getName() + "' as it doesn't implement '" + AdvancedCacheLoader.class.getName() + "'"); } preloadCl = (AdvancedCacheLoader) l; if (preloadCl instanceof AdvancedAsyncCacheLoader) preloadCl = (AdvancedCacheLoader) ((AdvancedAsyncCacheLoader) preloadCl).undelegate(); break; } } if (preloadCl == null) return; long start = timeService.time(); final long maxEntries = getMaxEntries(); final AtomicInteger loadedEntries = new AtomicInteger(0); final AdvancedCache<Object, Object> flaggedCache = getCacheForStateInsertion(); ByRef.Boolean preloaded = new ByRef.Boolean(true); preloadCl.process(null, (me, taskContext) -> { if (loadedEntries.getAndIncrement() >= maxEntries) { taskContext.stop(); preloaded.set(false); return; } Metadata metadata = me.getMetadata() != null ? ((InternalMetadataImpl) me.getMetadata()).actual() : null; preloadKey(flaggedCache, me.getKey(), me.getValue(), metadata); }, new WithinThreadExecutor(), true, true); this.preloaded = preloaded.get(); log.debugf("Preloaded %d keys in %s", loadedEntries.get(), Util.prettyPrintTime(timeService.timeDuration(start, MILLISECONDS))); }
Source:
private static List<File> searchDir(String mount) { File photoDir = new File(mount + "/DCIM"); File[] goProDirs = photoDir.listFiles(); if (goProDirs == null || goProDirs.length == 0) { return null; } List<File> photoFiles = new ArrayList<>(); for (File picDir : goProDirs) { if (picDir.getName().toLowerCase().contains("gopro")) { photoFiles.addAll(Arrays.asList(picDir.listFiles())); } } return photoFiles; }

Target:
private static ArrayList<File> searchDir(String mount) { File photoDir = new File(mount + IMAGE_PATH); File[] goProDirs = photoDir.listFiles(); if (goProDirs == null || goProDirs.length == 0) { return null; } ArrayList<File> photoFiles = new ArrayList<>(); for (File picDir : goProDirs) { if (picDir.getName().toLowerCase().contains("gopro")) { photoFiles.addAll(Arrays.asList(picDir.listFiles())); } } return photoFiles; }
Source:
public void onLoadFinished(Loader<String> arg0, String page) { if (page == null) { hasLoaderError = true; } else { viewstates = Login.getViewstates(page); trackables = GCParser.parseTrackableLog(page); possibleLogTypes = GCParser.parseTypes(page); if (possibleLogTypes.isEmpty()) { hasLoaderError = true; } else { hasLoaderError = false; } } activity.onLoadFinished(); }

Target:
public void onLoadFinished(Loader<String> arg0, String page) { if (page == null) { hasLoaderError = true; } else { viewstates = Login.getViewstates(page); trackables = GCParser.parseTrackableLog(page); possibleLogTypes = GCParser.parseTypes(page); hasLoaderError = possibleLogTypes.isEmpty(); } activity.onLoadFinished(); }
Source:
protected String errorMessage(Exception e) { return "Param must be \"true\" or \"false\"."; }

Target:
protected String errorMessage(Exception e) { return "Parameter must be \"true\" or \"false\"."; }
Source:
public static Driver createDriver(DriverContext driverContext, List<Operator> operators) { Driver driver = new Driver(requireNonNull(driverContext, "driverContext is null"), requireNonNull(operators, "operators is null")); driver.initialize(); return driver; }

Target:
public static Driver createDriver(DriverContext driverContext, List<Operator> operators) { requireNonNull(driverContext, "driverContext is null"); requireNonNull(operators, "operators is null"); Driver driver = new Driver(driverContext, operators); driver.initialize(); return driver; }
Source:
public void removeDynamicMenuContributions(MenuManager menuManager, MMenu menuModel, ArrayList<MMenuElement> dump) { removeMenuContributions(menuModel, dump); for (MMenuElement mMenuElement : dump) { IContributionItem ici = getContribution(mMenuElement); if (ici == null && mMenuElement instanceof MMenu) { ici = getManager((MMenu) mMenuElement); } menuManager.remove(ici); clearModelToContribution(mMenuElement, ici); } }

Target:
public void removeDynamicMenuContributions(MenuManager menuManager, MMenu menuModel, ArrayList<MMenuElement> dump) { removeMenuContributions(menuModel, dump); for (MMenuElement mMenuElement : dump) { IContributionItem ici = getContribution(mMenuElement); if (ici == null && mMenuElement instanceof MMenu) { MMenu menuElement = (MMenu) mMenuElement; ici = getManager(menuElement); clearModelToManager(menuElement, (MenuManager) ici); } else { clearModelToContribution(menuModel, ici); } menuManager.remove(ici); } }
Source:
void getPublicKey(DataInputStream din, DataOutputStream dout) throws Exception { String username = CoreNodeUtils.deserializeString(din); Optional<PublicKeyHash> k = coreNode.getPublicKey(username).get(); dout.writeBoolean(k.isPresent()); if (!k.isPresent()) return; byte[] b = k.get().serialize(); dout.writeInt(b.length); dout.write(b); }

Target:
void getPublicKey(DataInputStream din, DataOutputStream dout) throws Exception { String username = CoreNodeUtils.deserializeString(din); Optional<PublicKeyHash> k = coreNode.getPublicKeyHash(username).get(); dout.writeBoolean(k.isPresent()); if (!k.isPresent()) return; byte[] b = k.get().serialize(); dout.writeInt(b.length); dout.write(b); }
Source:
public void testPattern() { DateTime dateTime = new DateTime().withDate(1995, 7, 4).withTime(14, 32, 12, 0); try { shouldCompileTo("{{jodaPatternHelper this \"y-MMM-d H:m:s\"}}", dateTime, "1995-Jul-4 14:32:12"); } catch (IOException e) { Assert.fail("IOException thrown"); } }

Target:
public void testPattern() throws IOException { DateTime dateTime = new DateTime().withDate(1995, 7, 4).withTime(14, 32, 12, 0); shouldCompileTo("{{jodaPatternHelper this \"y-MMM-d H:m:s\"}}", dateTime, "1995-Jul-4 14:32:12"); }
Source:
private CompositeJobParametersValidator compositeJobParametersValidator() { final List<JobParametersValidator> jobParametersValidators = Arrays.asList( new DbNameValidator(), new DbCollectionsVariantsNameValidator(), new DbCollectionsFilesNameValidator(), new InputStudyIdValidator(), new InputVcfIdValidator(), new InputVcfValidator(), new OptionalValidator(new InputVcfAggregationValidator(), JobParametersNames.INPUT_VCF_AGGREGATION), new OptionalValidator(new ConfigChunkSizeValidator(), JobParametersNames.CONFIG_CHUNK_SIZE) ); CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }

Target:
private CompositeJobParametersValidator compositeJobParametersValidator() { final List<JobParametersValidator> jobParametersValidators = Arrays.asList( new DbNameValidator(), new DbCollectionsVariantsNameValidator(), new InputStudyIdValidator(), new InputVcfIdValidator(), new InputVcfValidator(), new InputVcfAggregationValidator(), new OptionalValidator(new ConfigChunkSizeValidator(), JobParametersNames.CONFIG_CHUNK_SIZE) ); CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }
Source:
public boolean isOpen() { return closer.getState() == Closer.State.OPEN; }

Target:
public boolean isOpen() { return closer.getState() == AVAILABLE; }
Source:
private IAndroidTarget findDefaultRenderTarget() { Sdk current = Sdk.getCurrent(); if (current != null) { IAndroidTarget projectTarget = current.getTarget(mEditedFile.getProject()); int minProjectApi = Integer.MAX_VALUE; if (projectTarget != null) { if (!projectTarget.isPlatform()) { return projectTarget; } minProjectApi = projectTarget.getVersion().getApiLevel(); } IAndroidTarget best = null; int bestApiLevel = Integer.MAX_VALUE; for (IAndroidTarget target : current.getTargets()) { if (!target.isPlatform()) { continue; } int apiLevel = target.getVersion().getApiLevel(); if (apiLevel < minProjectApi) { continue; } String property = target.getProperty(PlatformPackage.PROP_LAYOUTLIB_API); if (property != null || apiLevel >= 11) { if (apiLevel < bestApiLevel) { bestApiLevel = apiLevel; best = target; } } } return best; } return null; }

Target:
private IAndroidTarget findDefaultRenderTarget() { Sdk current = Sdk.getCurrent(); if (current != null) { IAndroidTarget projectTarget = current.getTarget(mEditedFile.getProject()); int minProjectApi = Integer.MAX_VALUE; if (projectTarget != null) { if (!projectTarget.isPlatform() && projectTarget.hasRenderingLibrary()) { return projectTarget; } minProjectApi = projectTarget.getVersion().getApiLevel(); } IAndroidTarget best = null; int bestApiLevel = Integer.MAX_VALUE; for (IAndroidTarget target : current.getTargets()) { if (!target.isPlatform()) { continue; } int apiLevel = target.getVersion().getApiLevel(); if (apiLevel < minProjectApi) { continue; } String property = target.getProperty(PlatformPackage.PROP_LAYOUTLIB_API); if (property != null || apiLevel >= 11) { if (apiLevel < bestApiLevel) { bestApiLevel = apiLevel; best = target; } } } return best; } return null; }
Source:
public void testDumbLocalizer() throws Exception { File[] sources = new File[]{new File("../test-projects/src/main/java/nopol_examples/nopol_example_1/NopolExample.java")}; URL[] classpath = new URL[]{ new File("../test-projects/target/classes").toURI().toURL(), new File("../test-projects/target/test-classes").toURI().toURL() }; String testClasses = new String[] {"nopol_examples.nopol_example_1.NopolExampleTest"}; Config config = new Config(); config.setLocalizer(Config.NopolLocalizer.DUMB); DumbFaultLocalizerImpl localizer = new DumbFaultLocalizerImpl(sources, classpath, testClasses, config); Map<SourceLocation, List<TestResult>> executedSourceLocationPerTest = localizer.getTestListPerStatement(); assertEquals(8, executedSourceLocationPerTest.keySet().size()); }

Target:
public void testDumbLocalizer() throws Exception { File[] sources = new File[]{new File("../test-projects/src/main/java/nopol_examples/nopol_example_1/NopolExample.java")}; URL[] classpath = new URL[]{ new File("../test-projects/target/classes").toURI().toURL(), new File("../test-projects/target/test-classes").toURI().toURL() }; String testClasses = new String[] {"nopol_examples.nopol_example_1.NopolExampleTest"}; Config config = new Config(); DumbFaultLocalizerImpl localizer = new DumbFaultLocalizerImpl(sources, classpath, testClasses, config); Map<SourceLocation, List<TestResult>> executedSourceLocationPerTest = localizer.getTestListPerStatement(); assertEquals(8, executedSourceLocationPerTest.keySet().size()); assertTrue(executedSourceLocationPerTest.keySet().contains(new SourceLocation("nopol_examples.nopol_example_1.NopolExample", 16))); }
Source:
public boolean hasPermission(String permission, ContextReference contextReference, User user) { Permission perm = permissionDAO.findByName(permission); fi.otavanopisto.pyramus.domainmodel.users.User userEntity = getUser(user); boolean allowed = environmentUserRolePermissionDAO.hasEnvironmentPermissionAccess(userEntity.getRole(), perm); if (!allowed) { allowed = hasEveryonePermission(permission, contextReference); } PyramusPermissionCollection collection = findCollection(permission); try { PermissionFeature[] features = collection.listPermissionFeatures(permission); if (features != null) { for (PermissionFeature feature : features) { Instance<PermissionFeatureHandler> instance = featureHandlers.select(new PermissionFeatureLiteral(feature.value())); if (!instance.isUnsatisfied()) { PermissionFeatureHandler permissionFeatureHandler = instance.get(); allowed = permissionFeatureHandler.hasPermission(permission, userEntity, contextReference, allowed); } else logger.log(Level.SEVERE, String.format("Unsatisfied permission feature %s", feature.value())); } } } catch (Exception e) { e.printStackTrace(); } return allowed; }

Target:
public boolean hasPermission(String permission, ContextReference contextReference, User user) { Permission perm = permissionDAO.findByName(permission); fi.otavanopisto.pyramus.domainmodel.users.User userEntity = getUser(user); boolean allowed = environmentUserRolePermissionDAO.hasEnvironmentPermissionAccess(userEntity.getRole(), perm); if (!allowed) { allowed = hasEveryonePermission(permission, contextReference); } PyramusPermissionCollection collection = findCollection(permission); try { PermissionFeature[] features = collection.listPermissionFeatures(permission); if (features != null) { for (PermissionFeature feature : features) { Instance<PermissionFeatureHandler> instance = featureHandlers.select(new PermissionFeatureLiteral(feature.value())); if (!instance.isUnsatisfied()) { PermissionFeatureHandler permissionFeatureHandler = instance.get(); allowed = permissionFeatureHandler.hasPermission(permission, userEntity, contextReference, allowed); } else logger.log(Level.SEVERE, String.format("Unsatisfied permission feature %s", feature.value())); } } } catch (Exception e) { logger.log(Level.SEVERE, String.format("Could not list permission features for permission %s", permission), e); } return allowed; }
Source:
private void compareRegistryInfo(EndpointRegistryInfo expected, EndpointRegistryInfo actual) { org.junit.Assert.assertEquals(expected.getUuid(), actual.getUuid()); org.junit.Assert.assertEquals(expected.getName(), actual.getName()); org.junit.Assert.assertEquals(expected.getMode(), actual.getMode()); org.junit.Assert.assertEquals(expected.getType(), actual.getType()); org.junit.Assert.assertEquals(expected.getOwner(), actual.getOwner()); org.junit.Assert.assertEquals(expected.getRegistryId(), actual.getRegistryId()); }

Target:
private void compareRegistryInfo(EndpointRegistryInfo expected, EndpointRegistryInfo actual) { Assert.assertEquals(expected.getUuid(), actual.getUuid()); Assert.assertEquals(expected.getName(), actual.getName()); Assert.assertEquals(expected.getMode(), actual.getMode()); Assert.assertEquals(expected.getType(), actual.getType()); Assert.assertEquals(expected.getOwner(), actual.getOwner()); Assert.assertEquals(expected.getRegistryId(), actual.getRegistryId()); }
Source:
void onExecute(CommandSender sender, String[] args) { String searchedName = args[args.length - 1]; Entity[] entities = CommandUtils.getTargets(sender, searchedName); if (entities == null) { sender.sendMessage(pluginHeader + langEntityNotPlayer); return; } for (int i = 0; i < entities.length; i++) { if (entities[i] == null) { sender.sendMessage(pluginHeader + StringUtils.replaceOnce(langPlayerOffline, "PLAYER", searchedName)); break; } try { onExecuteForPlayer(sender, args, (Player) entities[i]); } catch (ClassCastException e) { sender.sendMessage(pluginHeader + langEntityNotPlayer); } } }

Target:
void onExecute(CommandSender sender, String[] args) { String searchedName = args[args.length - 1]; Entity[] entities = CommandUtils.getTargets(sender, searchedName); if (entities == null) { sender.sendMessage(pluginHeader + langEntityNotPlayer); return; } for (int i = 0; i < entities.length; i++) { if (entities[i] == null) { sender.sendMessage(pluginHeader + StringUtils.replaceOnce(langPlayerOffline, "PLAYER", searchedName)); break; } if (entities[i] instanceof Player) { onExecuteForPlayer(sender, args, (Player) entities[i]); } else { sender.sendMessage( pluginHeader + StringUtils.replaceOnce(langEntityNotPlayer, "ENTITY", entities[i].getType().name())); } } }
Source:
public static DateTime setEndValidTime(DateTime endValidTimeArg, DateTime issueInstant) { DateTime endValidTime = endValidTimeArg; final DateTime now = new DateTime(); if (endValidTime == null || endValidTime.isBefore(now.plusMinutes(5))) { endValidTime = now.plusMinutes(5); } if (endValidTime.isBefore(issueInstant)) { endValidTime = issueInstant.plusMinutes(5); } return endValidTime; }

Target:
private static DateTime setEndValidTime(DateTime endValidTimeArg, DateTime issueInstant) { DateTime endValidTime = endValidTimeArg; final DateTime now = new DateTime(); if (endValidTime == null || endValidTime.isBefore(now.plusMinutes(5))) { endValidTime = now.plusMinutes(5); } if (endValidTime.isBefore(issueInstant)) { endValidTime = issueInstant.plusMinutes(5); } return endValidTime; }
Source:
public LabelWithToolTip(String text, int length) { this(text); if (length > -1 && text.length() > length) { setText(text.substring(0, length - 3) + "..."); } }

Target:
public LabelWithToolTip(String text, int length) { super(text); if (length > -1 && text.length() > length) { setText(text.substring(0, length - 3) + "..."); } tooltipPanel.setWidget(tooltip); tooltipPanel.getElement().getStyle().setZIndex(1); setTitle(text); registerHandlers(); }
Source:
public static Collection testSheetParameters() { File testFile = new File(ConferenceSchedulingScoreRulesXlsxTest.class.getResource(testFileName).getFile()); try (InputStream in = new BufferedInputStream(new FileInputStream(testFile))) { XSSFWorkbook workbook = new XSSFWorkbook(in); ConferenceSolution initialSolution = new ConferenceSchedulingXlsxFileIO(false).read(testFile); TestConferenceSchedulingScoreRulesReader reader = new TestConferenceSchedulingScoreRulesReader(workbook, initialSolution); List<Object[]> parametersList = new ArrayList<>(); for (Object[] parameters = reader.nextTestSheetParameters(); parameters != null; parameters = reader.nextTestSheetParameters()) { parametersList.add(parameters); } return parametersList; } catch (IOException | RuntimeException e) { throw new IllegalStateException("Failed reading inputSolutionFile (" + testFile.getName() + ").", e); } }

Target:
public static Collection<Object[]> testSheetParameters() { File testFile = new File(ConferenceSchedulingScoreRulesXlsxTest.class.getResource(testFileName).getFile()); try (InputStream in = new BufferedInputStream(new FileInputStream(testFile))) { XSSFWorkbook workbook = new XSSFWorkbook(in); ConferenceSolution initialSolution = new ConferenceSchedulingXlsxFileIO(false).read(testFile); TestConferenceSchedulingScoreRulesReader reader = new TestConferenceSchedulingScoreRulesReader(workbook, initialSolution); List<Object[]> parametersList = new ArrayList<>(); for (Object[] parameters = reader.nextTestSheetParameters(); parameters != null; parameters = reader.nextTestSheetParameters()) { parametersList.add(parameters); } return parametersList; } catch (IOException | RuntimeException e) { throw new IllegalStateException("Failed reading inputSolutionFile (" + testFile.getName() + ").", e); } }
Source:
public Map<String, String> getSessionProperties(String sessionId) throws SqlExecutionException { return null; }

Target:
public Map<String, String> getSessionProperties(String sessionId) throws SqlExecutionException { throw new UnsupportedOperationException("Not implemented."); }