auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testMidAirCollision() throws Exception { if (BugzillaFixture.current() == BugzillaFixture.BUGS_4_4 || BugzillaFixture.current() == BugzillaFixture.BUGS_HEAD) { return; } TaskData data = BugzillaFixture.current().createTask(PrivilegeLevel.USER, null, null); assertNotNull(data); String newCommentText = "BugzillaRepositoryClientTest.testMidAirCollision(): test " + (new Date()).toString(); TaskAttribute attrNewComment = data.getRoot().getMappedAttribute(TaskAttribute.COMMENT_NEW); attrNewComment.setValue(newCommentText); Set<TaskAttribute> changed = new HashSet<TaskAttribute>(); changed.add(attrNewComment); TaskAttribute attrDeltaTs = data.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION); attrDeltaTs.setValue("2007-01-01 00:00:00"); changed.add(attrDeltaTs); try { RepositoryResponse response = BugzillaFixture.current().submitTask(data, client); assertNotNull(response); System.err.println("\n\ntestMidAirCollision >>> ResponseKind:" + response.getReposonseKind().toString() + "\n\n"); fail("Mid-air collision expected"); } catch (CoreException e) { assertTrue(e.getStatus().getMessage().indexOf("Mid-air collision occurred while submitting") != -1); return; } fail("Mid-air collision expected"); }

Target:
public void testMidAirCollision() throws Exception { TaskData data = BugzillaFixture.current().createTask(PrivilegeLevel.USER, null, null); assertNotNull(data); ITask task = generateLocalTaskAndDownload(data.getTaskId()); ITaskDataWorkingCopy workingCopy = TasksUiPlugin.getTaskDataManager().getWorkingCopy(task); TaskData taskData = workingCopy.getLocalData(); assertNotNull(taskData); String newCommentText = "BugzillaRepositoryClientTest.testMidAirCollision(): test " + (new Date()).toString(); TaskAttribute attrNewComment = data.getRoot().getMappedAttribute(TaskAttribute.COMMENT_NEW); attrNewComment.setValue(newCommentText); Set<TaskAttribute> changed = new HashSet<TaskAttribute>(); changed.add(attrNewComment); RepositoryResponse response = BugzillaFixture.current().submitTask(data, client); workingCopy = TasksUiPlugin.getTaskDataManager().getWorkingCopy(task); taskData = workingCopy.getLocalData(); assertNotNull(taskData); newCommentText = "BugzillaRepositoryClientTest.testMidAirCollision(): test #### " + (new Date()).toString(); attrNewComment = data.getRoot().getMappedAttribute(TaskAttribute.COMMENT_NEW); attrNewComment.setValue(newCommentText); changed = new HashSet<TaskAttribute>(); changed.add(attrNewComment); TaskAttribute attrDeltaTs = data.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION); attrDeltaTs.setValue("2007-01-01 00:00:00"); changed.add(attrDeltaTs); try { response = BugzillaFixture.current().submitTask(data, client); assertNotNull(response); System.err.println("\n\ntestMidAirCollision >>> ResponseKind:" + response.getReposonseKind().toString() + "\n\n"); fail("Mid-air collision expected"); } catch (CoreException e) { assertTrue(e.getStatus().getMessage().indexOf("Mid-air collision occurred while submitting") != -1); return; } fail("Mid-air collision expected"); }
Source:
public void onClick(View v) { if (v == add) { showFilterDialog(new Filter()); } else if (v == enable) { List<Filter> enabledFilters = filterEngine.getEnabledFilters(); List<Filter> allFilters = filterEngine.getAllFilters(); if(enabledFilters.isEmpty()) { for (Filter filter : allFilters) { filter.enabled = true; filterEngine.createOrUpdateFilter(filter); } ((FloatingActionButton) v).setImageResource(R.drawable.ic_clear_white_24dp); } else if (enabledFilters.size() == allFilters.size()) { for(Filter filter : allFilters) { filter.enabled = false; filterEngine.createOrUpdateFilter(filter); } ((FloatingActionButton) v).setImageResource(R.drawable.ic_done_white_24dp); } else { for(Filter filter : enabledFilters) { filter.enabled = false; filterEngine.createOrUpdateFilter(filter); } ((FloatingActionButton) v).setImageResource(R.drawable.ic_done_white_24dp); } theme().applyFabColor(enable); adapter.load(); } }

Target:
public void onClick(View v) { if (v == add) { showFilterDialog(new Filter()); } else if (v == enable) { FloatingActionButton enableButton = (FloatingActionButton) v; List<Filter> enabledFilters = filterEngine.getEnabledFilters(); List<Filter> allFilters = filterEngine.getAllFilters(); if (enabledFilters.isEmpty()) { setFilters(allFilters, true); enableButton.setImageResource(R.drawable.ic_clear_white_24dp); } else if (enabledFilters.size() == allFilters.size()) { setFilters(allFilters, false); enableButton.setImageResource(R.drawable.ic_done_white_24dp); } else { setFilters(enabledFilters, false); enableButton.setImageResource(R.drawable.ic_done_white_24dp); } theme().applyFabColor(enable); adapter.load(); } }
Source:
public boolean onOptionsItemSelected(MenuItem item) { if (getActivity() == null) { Timber.d("Returning as activity is destroyed!"); return true; } Media m = provider.getMediaAtPosition(pager.getCurrentItem()); switch (item.getItemId()) { case R.id.menu_bookmark_current_image: bookmarkDao.updateBookmark(bookmark); updateBookmarkState(item); return true; case R.id.menu_share_current_image: Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT, m.getDisplayTitle() + " \n" + m.getFilePageTitle().getCanonicalUri()); startActivity(Intent.createChooser(shareIntent, "Share image via...")); return true; case R.id.menu_browser_current_image: Intent viewIntent = new Intent(); viewIntent.setAction(ACTION_VIEW); viewIntent.setData(m.getFilePageTitle().getMobileUri()); if (viewIntent.resolveActivity(getActivity().getPackageManager()) != null){ startActivity(viewIntent); } else { Toast toast = Toast.makeText(getContext(), getString(R.string.no_web_browser), LENGTH_SHORT); toast.show(); } return true; case R.id.menu_download_current_image: if (DeviceInfoUtil.getConnectionType(getActivity()) == ConnectionType.NO_INTERNET) { ViewUtil.showShortSnackbar(getView(), R.string.no_internet); return false; } downloadMedia(m); return true; case R.id.menu_set_as_wallpaper: setWallpaper(m); return true; default: return super.onOptionsItemSelected(item); } }

Target:
public boolean onOptionsItemSelected(MenuItem item) { if (getActivity() == null) { Timber.d("Returning as activity is destroyed!"); return true; } Media m = provider.getMediaAtPosition(pager.getCurrentItem()); switch (item.getItemId()) { case R.id.menu_bookmark_current_image: bookmarkDao.updateBookmark(bookmark); updateBookmarkState(item); return true; case R.id.menu_share_current_image: Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT, m.getDisplayTitle() + " \n" + m.getFilePageTitle().getCanonicalUri()); startActivity(Intent.createChooser(shareIntent, "Share image via...")); return true; case R.id.menu_browser_current_image: Intent viewIntent = new Intent(); viewIntent.setAction(ACTION_VIEW); viewIntent.setData(m.getFilePageTitle().getMobileUri()); if (viewIntent.resolveActivity(getActivity().getPackageManager()) != null){ startActivity(viewIntent); } else { Toast toast = Toast.makeText(getContext(), getString(R.string.no_web_browser), LENGTH_SHORT); toast.show(); } return true; case R.id.menu_download_current_image: if (!NetworkUtils.isInternetConnectionEstablished(getActivity())) { ViewUtil.showShortSnackbar(getView(), R.string.no_internet); return false; } downloadMedia(m); return true; case R.id.menu_set_as_wallpaper: setWallpaper(m); return true; default: return super.onOptionsItemSelected(item); } }
Source:
public void updateUserExtSourceLastAccess(PerunSession sess, UserExtSource userExtSource) throws InternalErrorException { getPerunBl().getAuditer().log(sess, new UserExtSourceUpdated(userExtSource)); getUsersManagerImpl().updateUserExtSourceLastAccess(sess, userExtSource); }

Target:
public void updateUserExtSourceLastAccess(PerunSession sess, UserExtSource userExtSource) throws InternalErrorException { getUsersManagerImpl().updateUserExtSourceLastAccess(sess, userExtSource); getPerunBl().getAuditer().log(sess, new UserExtSourceUpdated(userExtSource)); }
Source:
public static ParquetInputSplit from(org.apache.hadoop.mapred.FileSplit split) throws IOException { return new ParquetInputSplit(split.getPath(), split.getStart(), split.getStart() + split.getLength(), split.getLength(), split.getLocations(), null); }

Target:
static ParquetInputSplit from(org.apache.hadoop.mapred.FileSplit split) throws IOException { return new ParquetInputSplit(split.getPath(), split.getStart(), split.getStart() + split.getLength(), split.getLength(), split.getLocations(), null); }
Source:
public final void testCanCreateSignedOPTIONSUriFromPath() throws IOException{ if (config.isClientEncryptionEnabled()) { throw new SkipException("Signed URLs are not decrypted by the client"); } final String name = UUID.randomUUID().toString(); final String path = testPathPrefix + name; mantaClient.put(path, TEST_DATA); mantaClient.head(path); Assert.assertEquals(mantaClient.getAsString(path), TEST_DATA); Instant expires = Instant.now().plus(1, ChronoUnit.HOURS); URI uri = mantaClient.getAsSignedURI(path, "OPTIONS", expires); HttpURLConnection connection = openHttpURLConnection(uri, mantaClient); try { connection.setReadTimeout(3000); connection.setRequestMethod("OPTIONS"); connection.connect(); if (connection.getResponseCode() != 200) { String errorText = IOUtils.toString(connection.getErrorStream(), Charset.defaultCharset()); if (config.getMantaUser().contains(SEPARATOR)) { String msg = String.format("This fails due to an outstanding bug: MANTA-2839.\n%s", errorText); throw new SkipException(msg); } Assert.fail(errorText); } String server = StringUtils.substringBefore(connection.getHeaderField("Server"), SEPARATOR); Assert.assertEquals(server, "Manta"); } finally { connection.disconnect(); } }

Target:
public final void testCanCreateSignedOPTIONSUriFromPath() throws IOException{ if (config.isClientEncryptionEnabled()) { throw new SkipException("Signed URLs are not decrypted by the client"); } final String name = UUID.randomUUID().toString(); final String path = testPathPrefix + name; mantaClient.put(path, TEST_DATA); mantaClient.head(path); Assert.assertEquals(mantaClient.getAsString(path), TEST_DATA); Instant expires = Instant.now().plus(1, ChronoUnit.HOURS); URI uri = mantaClient.getAsSignedURI(path, "OPTIONS", expires); HttpURLConnection connection = openHttpURLConnection(uri, mantaClient); try { connection.setReadTimeout(3000); connection.setRequestMethod("OPTIONS"); connection.connect(); if (connection.getResponseCode() != 200) { String errorText = IOUtils.toString(connection.getErrorStream(), Charset.defaultCharset()); if (config.getMantaUser().contains(SEPARATOR)) { String msg = String.format("This fails due to an outstanding bug: MANTA-2839.\n%s", errorText); throw new SkipException(msg); } Assert.fail(errorText); } String server = StringUtils.substringBefore(connection.getHeaderField("Server"), "/"); Assert.assertEquals(server, "Manta"); } finally { connection.disconnect(); } }
Source:
private static void elideAcceptQuery(RequestScope requestScope, User opaqueUser, Optional<MultivaluedMap<String, String>> queryParams, String path) { if (requestScope.getElideSettings() != null) { final QueryLogger ql = requestScope.getElideSettings().getQueryLogger(); if (opaqueUser == null) { ql.acceptQuery(UUID.fromString(requestScope.getRequestId()), null, requestScope.getHeaders(), requestScope.getApiVersion(), queryParams, path); } else { ql.acceptQuery(UUID.fromString(requestScope.getRequestId()), opaqueUser.getPrincipal(), requestScope.getHeaders(), requestScope.getApiVersion(), queryParams, path); } } }

Target:
private static void elideAcceptQuery(RequestScope requestScope, User opaqueUser, Optional<MultivaluedMap<String, String>> queryParams, String path) { final QueryLogger ql = requestScope.getElideSettings().getQueryLogger(); Principal user = opaqueUser == null ? null : opaqueUser.getPrincipal(); ql.acceptQuery(requestScope.getRequestId(), user, requestScope.getHeaders(), requestScope.getApiVersion(), queryParams, path); }
Source:
public void setUp() throws Exception { dbFacadeMock = mock(DbFacade.class); storagePoolDaoMock = mock(StoragePoolDAO.class); vmNicDaoMock = mock(VmNicDao.class); macPoolDaoMock = mock(MacPoolDao.class); DbFacadeLocator.setDbFacade(dbFacadeMock); when(dbFacadeMock.getStoragePoolDao()).thenReturn(storagePoolDaoMock); when(dbFacadeMock.getVmNicDao()).thenReturn(vmNicDaoMock); when(dbFacadeMock.getMacPoolDao()).thenReturn(macPoolDaoMock); macPool = createMacPool("00:1a:4a:15:c0:00", "00:1a:4a:15:c0:ff"); storagePool = createStoragePool(macPool); vmNic = createVmNic(); }

Target:
public void setUp() throws Exception { DbFacadeLocator.setDbFacade(dbFacadeMock); when(dbFacadeMock.getStoragePoolDao()).thenReturn(storagePoolDaoMock); when(dbFacadeMock.getVmNicDao()).thenReturn(vmNicDaoMock); when(dbFacadeMock.getMacPoolDao()).thenReturn(macPoolDaoMock); macFrom = "00:1a:4a:15:c0:00"; macTo = "00:1a:4a:15:c0:ff"; macPool = createMacPool(macFrom, macTo); storagePool = createStoragePool(macPool); vmNic = createVmNic(); }
Source:
public static AuthorList parse(final String authors) { Objects.requireNonNull(authors); if (!AUTHOR_CACHE.containsKey(authors)) { AuthorListParser parser = new AuthorListParser(); AuthorList authorList = parser.parse(authors); authorList.authorsUnformatted = new String(authors); AUTHOR_CACHE.put(authors, authorList); } return AUTHOR_CACHE.get(authors); }

Target:
public static AuthorList parse(final String authors) { Objects.requireNonNull(authors); AuthorList authorList = AUTHOR_CACHE.get(authors); if (authorList == null) { AuthorListParser parser = new AuthorListParser(); authorList = parser.parse(authors); AUTHOR_CACHE.put(authors, authorList); } return authorList; }
Source:
public void logout(final IProgressMonitor monitor) throws XmlRpcException { userID = -1; token = null; (new BugzillaXmlRpcOperation<Integer>(this) { @SuppressWarnings("serial") @Override public Integer execute() throws XmlRpcException { try { bugzillaClient.authenticate(null); } catch (CoreException e) { e.printStackTrace(); } Object response = call(monitor, XML_USER_LOGOUT, null); return -1; } }).execute(); return; }

Target:
public void logout(final IProgressMonitor monitor) throws XmlRpcException { userID = -1; token = null; (new BugzillaXmlRpcOperation<Integer>(this) { @SuppressWarnings("serial") @Override public Integer execute() throws XmlRpcException { try { bugzillaClient.authenticate(monitor); } catch (CoreException e) { e.printStackTrace(); } Object response = call(monitor, XML_USER_LOGOUT, null); return -1; } }).execute(); return; }
Source:
protected boolean isStorageDomainTypeCorrect(StorageDomain storageDomain) { if (storageDomain.getStorageDomainType() != StorageDomainType.ISO && storageDomain.getStorageDomainType() != StorageDomainType.ImportExport && storageDomain.isLocal() != getStoragePool().isLocal()) { addCanDoActionMessage(VdcBllMessages.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH); return false; } return true; }

Target:
protected boolean isStorageDomainTypeCorrect(StorageDomain storageDomain) { if (!isStorageDomainOfTypeIsoOrExport(storageDomain) && storageDomain.isLocal() != getStoragePool().isLocal()) { addCanDoActionMessage(VdcBllMessages.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH); return false; } return true; }
Source:
public void BotTurn() { int size = tiles.size(); int mode = (int) Math.sqrt(size); Random rand = new Random(); if (GameState.getBotMode() == BOT_ON) { int l = rand.nextInt(mode) + 0; int z = rand.nextInt(mode) + 0; while (massiveTiles[l][z].isOpen()) { l = rand.nextInt(mode) + 0; z = rand.nextInt(mode) + 0; } firstselected = massiveTiles[l][z]; firstselected.open(() -> { }); l = rand.nextInt(mode) + 0; z = rand.nextInt(mode) + 0; while (massiveTiles[l][z].isOpen() || firstselected.equals(massiveTiles[l][z])) { l = rand.nextInt(mode) + 0; z = rand.nextInt(mode) + 0; } secondselected = massiveTiles[l][z]; secondselected.openBot(() -> { }); if (!firstselected.text.getText().equals(secondselected.text.getText())) { firstselected.waitBeforeClose(); secondselected.waitBeforeClose(); } else { firstselected.setOpen(); secondselected.setOpen(); } GameState.setBotMode(BOT_OFF); firstselected = null; secondselected = null; } }

Target:
public void BotTurn() { int size = tiles.size(); int mode = (int) Math.sqrt(size); Random rand = new Random(); if (GameState.getBotMode() == BOT_ON) { int i = rand.nextInt(mode) + 0; int j = rand.nextInt(mode) + 0; while (arrayOfTiles[i][j].isOpen()) { i = rand.nextInt(mode) + 0; j = rand.nextInt(mode) + 0; } firstselected = arrayOfTiles[i][j]; firstselected.open(() -> { }); i = rand.nextInt(mode) + 0; j = rand.nextInt(mode) + 0; while (arrayOfTiles[i][j].isOpen() || firstselected.equals(arrayOfTiles[i][j])) { i = rand.nextInt(mode) + 0; j = rand.nextInt(mode) + 0; } secondselected = arrayOfTiles[i][j]; secondselected.openBot(() -> { }); if (!firstselected.text.getText().equals(secondselected.text.getText())) { firstselected.waitBeforeClose(); secondselected.waitBeforeClose(); } else { firstselected.setOpen(); secondselected.setOpen(); } GameState.setBotMode(BOT_OFF); firstselected = null; secondselected = null; } }
Source:
public void testAll() { StudentProfilePageData sppd = initializeFirstData(); testProfileEditBox(sppd.getProfileEditBox()); testUploadPhotoModal(sppd.getUploadPhotoModal()); sppd = initializeSecondData(); testProfileEditBox(sppd.getProfileEditBox()); testUploadPhotoModal(sppd.getUploadPhotoModal()); }

Target:
public void testAll() { testWithPictureKeyAndNoNullFields(); testWithNoPictureKeyAndNullFields(); }
Source:
private void setValidMongoOnlyWithIntentResult(){ jsonConfig = "{\"mongo\":{\"uri\":\"mongodb://user:pass@test.com/cgm_data\"}}"; fakeActivityResult(); }

Target:
private void setValidMongoOnlyWithIntentResult(){ jsonConfig = "{'mongo':{'uri':'mongodb://user:pass@test.com/cgm_data'}}"; fakeActivityResult(); }
Source:
public void toggleFullscreen() { if (DEBUG) Log.d(TAG, "toggleFullscreen() called"); if (simpleExoPlayer == null || getCurrentMetadata() == null) return; if (popupPlayerSelected()) { setRecovery(); service.removeViewFromParent(); Intent intent = NavigationHelper.getPlayerIntent( service, MainActivity.class, this.getPlayQueue(), this.getRepeatMode(), this.getPlaybackSpeed(), this.getPlaybackPitch(), this.getPlaybackSkipSilence(), null, true ); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra(Constants.KEY_SERVICE_ID, getCurrentMetadata().getMetadata().getServiceId()); intent.putExtra(Constants.KEY_LINK_TYPE, StreamingService.LinkType.STREAM); intent.putExtra(Constants.KEY_URL, getVideoUrl()); intent.putExtra(Constants.KEY_TITLE, getVideoTitle()); intent.putExtra(VideoDetailFragment.AUTO_PLAY, true); service.onDestroy(); context.startActivity(intent); return; } else { if (fragmentListener == null) return; isFullscreen = !isFullscreen; setControlsSize(); fragmentListener.onFullscreenStateChanged(isInFullscreen()); } if (!isInFullscreen()) { titleTextView.setVisibility(View.GONE); channelTextView.setVisibility(View.GONE); playerCloseButton.setVisibility(videoPlayerSelected() ? View.VISIBLE : View.GONE); } else { titleTextView.setVisibility(View.VISIBLE); channelTextView.setVisibility(View.VISIBLE); playerCloseButton.setVisibility(View.GONE); } setupScreenRotationButton(); }

Target:
public void toggleFullscreen() { if (DEBUG) { Log.d(TAG, "toggleFullscreen() called"); } if (simpleExoPlayer == null || getCurrentMetadata() == null) { return; } if (popupPlayerSelected()) { setRecovery(); service.removeViewFromParent(); Intent intent = NavigationHelper.getPlayerIntent( service, MainActivity.class, this.getPlayQueue(), this.getRepeatMode(), this.getPlaybackSpeed(), this.getPlaybackPitch(), this.getPlaybackSkipSilence(), null, true, !isPlaying(), isMuted() ); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra(Constants.KEY_SERVICE_ID, getCurrentMetadata().getMetadata().getServiceId()); intent.putExtra(Constants.KEY_LINK_TYPE, StreamingService.LinkType.STREAM); intent.putExtra(Constants.KEY_URL, getVideoUrl()); intent.putExtra(Constants.KEY_TITLE, getVideoTitle()); intent.putExtra(VideoDetailFragment.AUTO_PLAY, true); service.onDestroy(); context.startActivity(intent); return; } else { if (fragmentListener == null) { return; } isFullscreen = !isFullscreen; setControlsSize(); fragmentListener.onFullscreenStateChanged(isFullscreen()); } if (!isFullscreen()) { titleTextView.setVisibility(View.GONE); channelTextView.setVisibility(View.GONE); playerCloseButton.setVisibility(videoPlayerSelected() ? View.VISIBLE : View.GONE); } else { titleTextView.setVisibility(View.VISIBLE); channelTextView.setVisibility(View.VISIBLE); playerCloseButton.setVisibility(View.GONE); } setupScreenRotationButton(); }
Source:
CircuitCreationTask(TorConfig config, Directory directory, ConnectionCache connectionCache, CircuitPathChooser pathChooser, CircuitManagerImpl circuitManager, TorInitializationTracker initializationTracker) { this.config = config; this.directory = directory; this.connectionCache = connectionCache; this.circuitManager = circuitManager; this.initializationTracker = initializationTracker; this.pathChooser = pathChooser; this.executor = Executors.newCachedThreadPool(new ThreadFactory() { @Override public Thread newThread(Runnable r) { Thread t = new Thread(r); t.setName("CircuitCreationTask worker"); t.setDaemon(true); return t; } }); this.buildHandler = createCircuitBuildHandler(); this.internalBuildHandler = createInternalCircuitBuildHandler(); this.predictor = new CircuitPredictor(); this.lastNewCircuit = new AtomicLong(); }

Target:
CircuitCreationTask(TorConfig config, Directory directory, ConnectionCache connectionCache, CircuitPathChooser pathChooser, CircuitManagerImpl circuitManager, TorInitializationTracker initializationTracker) { this.config = config; this.directory = directory; this.connectionCache = connectionCache; this.circuitManager = circuitManager; this.initializationTracker = initializationTracker; this.pathChooser = pathChooser; this.executor = Threading.newPool("CircuitCreationTask worker"); this.buildHandler = createCircuitBuildHandler(); this.internalBuildHandler = createInternalCircuitBuildHandler(); this.predictor = new CircuitPredictor(); this.lastNewCircuit = new AtomicLong(); }
Source:
private void handleAuthenticationRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Map paramMap = request.getParameterMap(); SessionDTO sessionDTO = new SessionDTO(); sessionDTO.setAction(getAttribute(paramMap, PassiveRequestorConstants.ACTION)); sessionDTO.setAttributes(getAttribute(paramMap, PassiveRequestorConstants.ATTRIBUTE)); sessionDTO.setContext(getAttribute(paramMap, PassiveRequestorConstants.CONTEXT)); sessionDTO.setReplyTo(getAttribute(paramMap, PassiveRequestorConstants.REPLY_TO)); sessionDTO.setPseudo(getAttribute(paramMap, PassiveRequestorConstants.PSEUDO)); sessionDTO.setRealm(getAttribute(paramMap, PassiveRequestorConstants.REALM)); sessionDTO.setRequest(getAttribute(paramMap, PassiveRequestorConstants.REQUEST)); sessionDTO.setRequestPointer(getAttribute(paramMap, PassiveRequestorConstants.REQUEST_POINTER)); sessionDTO.setPolicy(getAttribute(paramMap, PassiveRequestorConstants.POLCY)); sessionDTO.setTenantDomain(getAttribute(paramMap, "tenantDomain")); sessionDTO.setReqQueryString(request.getQueryString()); String sessionDataKey = UUIDGenerator.generateUUID(); addSessionDataToCache(sessionDataKey, sessionDTO, IdPManagementUtil.getIdleSessionTimeOut (CarbonContext.getThreadLocalCarbonContext().getTenantDomain())); sendToAuthenticationFramework(request, response, sessionDataKey, sessionDTO); }

Target:
private void handleAuthenticationRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Map paramMap = request.getParameterMap(); SessionDTO sessionDTO = new SessionDTO(); sessionDTO.setAction(getAttribute(paramMap, PassiveRequestorConstants.ACTION)); sessionDTO.setAttributes(getAttribute(paramMap, PassiveRequestorConstants.ATTRIBUTE)); sessionDTO.setContext(getAttribute(paramMap, PassiveRequestorConstants.CONTEXT)); sessionDTO.setReplyTo(getAttribute(paramMap, PassiveRequestorConstants.REPLY_TO)); sessionDTO.setPseudo(getAttribute(paramMap, PassiveRequestorConstants.PSEUDO)); sessionDTO.setRealm(getAttribute(paramMap, PassiveRequestorConstants.REALM)); sessionDTO.setRequest(getAttribute(paramMap, PassiveRequestorConstants.REQUEST)); sessionDTO.setRequestPointer(getAttribute(paramMap, PassiveRequestorConstants.REQUEST_POINTER)); sessionDTO.setPolicy(getAttribute(paramMap, PassiveRequestorConstants.POLCY)); sessionDTO.setTenantDomain(getAttribute(paramMap, MultitenantConstants.TENANT_DOMAIN)); sessionDTO.setReqQueryString(request.getQueryString()); String sessionDataKey = UUIDGenerator.generateUUID(); addSessionDataToCache(sessionDataKey, sessionDTO, IdPManagementUtil.getIdleSessionTimeOut (CarbonContext.getThreadLocalCarbonContext().getTenantDomain())); sendToAuthenticationFramework(request, response, sessionDataKey, sessionDTO); }
Source:
protected void configure() { try { ConfigurationManager.loadCascadedPropertiesFromResources("application"); } catch (Exception ex) { } bind(AbstractConfiguration.class).toInstance(ConfigurationManager.getConfigInstance()); bind(BaseServerStartup.class).to(SampleServerStartup.class); bind(OriginManager.class).to(BasicNettyOriginManager.class); install(new ZuulFiltersModule()); bind(FilterFileManager.class).asEagerSingleton(); bind(ServerStatusManager.class); bind(SessionContextDecorator.class).to(ZuulSessionContextDecorator.class); bind(Registry.class).to(DefaultRegistry.class); bind(RequestCompleteHandler.class).to(BasicRequestCompleteHandler.class); bind(AbstractDiscoveryClientOptionalArgs.class).to(DiscoveryClient.DiscoveryClientOptionalArgs.class); bind(RequestMetricsPublisher.class).to(BasicRequestMetricsPublisher.class); bind(AccessLogPublisher.class).toInstance(new AccessLogPublisher("ACCESS", (channel, httpRequest) -> ClientRequestReceiver.getRequestFromChannel(channel).getContext().getUUID())); }

Target:
protected void configure() { try { ConfigurationManager.loadCascadedPropertiesFromResources("application"); } catch (Exception ex) { throw new RuntimeException("Error loading configuration: " + ex.getMessage(), ex); } bind(AbstractConfiguration.class).toInstance(ConfigurationManager.getConfigInstance()); bind(BaseServerStartup.class).to(SampleServerStartup.class); bind(OriginManager.class).to(BasicNettyOriginManager.class); install(new ZuulFiltersModule()); bind(FilterFileManager.class).asEagerSingleton(); bind(ServerStatusManager.class); bind(SessionContextDecorator.class).to(ZuulSessionContextDecorator.class); bind(Registry.class).to(DefaultRegistry.class); bind(RequestCompleteHandler.class).to(BasicRequestCompleteHandler.class); bind(AbstractDiscoveryClientOptionalArgs.class).to(DiscoveryClient.DiscoveryClientOptionalArgs.class); bind(RequestMetricsPublisher.class).to(BasicRequestMetricsPublisher.class); bind(AccessLogPublisher.class).toInstance(new AccessLogPublisher("ACCESS", (channel, httpRequest) -> ClientRequestReceiver.getRequestFromChannel(channel).getContext().getUUID())); }
Source:
public List<Object[]> parse(File file, HCatSchema schema, List<String> names) { try { List<String> lines = Files.readAllLines(file.toPath(), charset); if (this.header) { lines.remove(0); } List<Object[]> records = new ArrayList<>(lines.size()); for (String line : lines) { records.add(parseRow(line, names.size())); } return records; } catch (IOException e) { throw new RuntimeException("Error while reading file", e); } }

Target:
public List<Object[]> parse(File file, HCatSchema schema, List<String> names) { try { List<String> lines = Files.readAllLines(file.toPath(), charset); if (this.hasHeader) { lines = lines.subList(1, lines.size()); } List<Object[]> records = new ArrayList<>(lines.size()); for (String line : lines) { records.add(parseRow(line, names.size())); } return records; } catch (IOException e) { throw new RuntimeException("Error while reading file", e); } }
Source:
public AsyncPoolStats getStats() { AsyncPoolStats stats = null; synchronized (_lock) { stats = new AsyncPoolStats( _totalCreated, _totalDestroyed, _createErrors, _destroyErrors, _checkedOut, _timedOut, _badDestroyed, _maxSize, _poolSize, _sampleMaxCheckedOut, _sampleMaxPoolSize ); _sampleMaxCheckedOut = _checkedOut; _sampleMaxPoolSize = _poolSize; } return stats; }

Target:
public AsyncPoolStats getStats() { synchronized (_lock) { AsyncPoolStats stats = new AsyncPoolStats( _totalCreated, _totalDestroyed, _totalCreateErrors, _totalDestroyErrors, _totalBadDestroyed, _totalTimedOut, _checkedOut, _maxSize, _poolSize, _sampleMaxCheckedOut, _sampleMaxPoolSize ); _sampleMaxCheckedOut = _checkedOut; _sampleMaxPoolSize = _poolSize; return stats; } }
Source:
private DefaultTestInstances(List<Object> instances) { this.instances = instances; }

Target:
private DefaultTestInstances(List<Object> instances) { this.instances = Preconditions.notEmpty(instances, "instances must not be empty"); }
Source:
protected void checkFile(@NotNull GoFile file, @NotNull final ProblemsHolder problemsHolder) { final MultiMap<String, GoMethodDeclaration> map = new MultiMap<String, GoMethodDeclaration>(); List<GoFile> files = GoPsiImplUtil.getAllPackageFiles(file); for (GoFile goFile : files) { for (GoMethodDeclaration method : goFile.getMethods()) { if (method.getReceiver().getType() == null) continue; map.putValue(method.getName(), method); } } file.accept(new GoRecursiveVisitor() { @Override public void visitMethodDeclaration(@NotNull final GoMethodDeclaration m) { final GoType type = m.getReceiver().getType(); if (type == null) return; final String name = m.getName(); if (name == null) return; Collection<GoMethodDeclaration> byKey = map.get(name); if (byKey.size() <= 1) return; byKey = ContainerUtil.filter(byKey, new Condition<GoMethodDeclaration>() { @Override public boolean value(GoMethodDeclaration d) { return Comparing.equal(d.getReceiver().getType().getText(), type.getText()); } }); if (byKey.size() <= 1) return; PsiElement identifier = m.getNameIdentifier(); problemsHolder.registerProblem(identifier == null ? m : identifier, "Duplicate method name"); } }); }

Target:
protected void checkFile(@NotNull GoFile file, @NotNull final ProblemsHolder problemsHolder) { final PsiDirectory parent = file.getParent(); if (parent == null) return; final Project project = file.getProject(); final String packageName = file.getPackageName(); final GlobalSearchScope scope = GlobalSearchScopesCore.directoryScope(parent, false); for (GoMethodDeclaration m : file.getMethods()) { if (m.isBlank()) { continue; } GoType type = m.getReceiver().getType(); if (type == null) continue; final String methodName = m.getName(); if (methodName == null) continue; String key = packageName + "." + type.getText(); Collection<GoMethodDeclaration> declarations = GoMethodIndex.find(key, project, scope); declarations = ContainerUtil.filter(declarations, new Condition<GoMethodDeclaration>() { @Override public boolean value(GoMethodDeclaration d) { return Comparing.equal(d.getName(), methodName); } }); if (declarations.size() <= 1) continue; PsiElement identifier = m.getNameIdentifier(); problemsHolder.registerProblem(identifier == null ? m : identifier, "Duplicate method name"); } }
Source:
public void saveOrUpdateShouldSaveAProperApplicationDTO() { given(converterService.convert(applicationDTO, ApplicationEntity.class)) .willReturn(applicationEntity); given(applicationsRepository.saveAndFlush(applicationEntity)) .willReturn(this.applicationEntity); given(converterService.convert(applicationEntity, ApplicationDTO.class)) .willReturn(applicationDTO); Long result = applicationsService.saveOrUpdate(applicationDTO); assertThat(result, notNullValue()); assertThat(result, equalTo(applicationDTO.getId())); then(converterService).should().convert(applicationDTO, ApplicationEntity.class); then(applicationsRepository).should().saveAndFlush(applicationEntity); }

Target:
public void saveOrUpdateShouldSaveAProperApplicationDTO() { given(converterService.convert(applicationDTO, ApplicationEntity.class)) .willReturn(applicationEntity); given(applicationsRepository.saveAndFlush(applicationEntity)) .willReturn(this.applicationEntity); Long result = applicationsService.saveOrUpdate(applicationDTO); assertThat(result, notNullValue()); assertThat(result, equalTo(applicationDTO.getId())); then(converterService).should().convert(applicationDTO, ApplicationEntity.class); then(applicationsRepository).should().saveAndFlush(applicationEntity); }
Source:
protected ResourceSet loadResource(IEditorInput editorInput) { final URI resourceURI = EditUIUtil.getURI(getEditorInput(), null); return ResourceSetHelpers.loadResourceSetWithProxies(resourceURI, getCommandStack()); }

Target:
protected ResourceSet loadResource(IEditorInput editorInput) { final URI resourceURI = EditUIUtil.getURI(editorInput, null); return ResourceSetHelpers.loadResourceSetWithProxies(resourceURI, getCommandStack()); }
Source:
void runMetricsSenderThread() { metricsSenderThread.execute(new Runnable() { @Override public void run() { while (true) { while (!metricsRequestQueue.isEmpty()) { sendMetricsToDashboard(metricsRequestQueue.poll()); } } } }); }

Target:
private void runMetricsSenderThread() { metricsSenderExecutor.execute(new Runnable() { @Override public void run() { while (true) { try { final String request = metricsRequestQueue.take(); sendMetricsToDashboard(request); } catch (InterruptedException e) { LOG.log(Level.WARNING, "Dashboard: Interrupted while sending metrics to the dashboard server.", e); } } } }); }
Source:
public boolean equals(Object other) { return other == this || other instanceof Form && this.displayName.equals(((Form) other).displayName) && this.jrFormId.equals(((Form) other).jrFormId) && this.md5Hash.equals(((Form) other).md5Hash); }

Target:
public boolean equals(Object other) { return other == this || other instanceof Form && this.md5Hash.equals(((Form) other).md5Hash); }
Source:
public List<ExtensionEntry> getExtensionsByService(String serviceName) { return serviceEntries.get(serviceName); }

Target:
public List<ExtensionEntry> getExtensionsByService(String serviceName) { return serviceEntries.containsKey(serviceName) ? serviceEntries.get(serviceName) : Collections.<ExtensionEntry> emptyList(); }
Source:
public void visitDeclarationExpression(final DeclarationExpression exp) { if (exp.isMultipleAssignmentDeclaration()) { makeNode("sequence", new Runnable() { @Override public void run() { for (Expression e : exp.getTupleExpression().getExpressions()) { final VariableExpression v = (VariableExpression) e; makeNode("declareVariable", new Runnable() { @Override public void run() { literal(v.getType()); literal(v.getName()); } }); } if (exp.getRightExpression() instanceof ListExpression) { multipleAssignment(exp, exp.getTupleExpression(), (ListExpression)exp.getRightExpression()); } } }); } else { makeNode("declareVariable", new Runnable() { @Override public void run() { VariableExpression v = exp.getVariableExpression(); loc(exp); literal(v.getType()); literal(v.getName()); visit(exp.getRightExpression()); } }); } }

Target:
public void visitDeclarationExpression(final DeclarationExpression exp) { if (exp.isMultipleAssignmentDeclaration()) { makeNode("sequence", new Runnable() { @Override public void run() { for (Expression e : exp.getTupleExpression().getExpressions()) { final VariableExpression v = (VariableExpression) e; makeNode("declareVariable", new Runnable() { @Override public void run() { literal(v.getType()); literal(v.getName()); } }); } multipleAssignment(exp, exp.getTupleExpression(), exp.getRightExpression()); } }); } else { makeNode("declareVariable", new Runnable() { @Override public void run() { VariableExpression v = exp.getVariableExpression(); loc(exp); literal(v.getType()); literal(v.getName()); visit(exp.getRightExpression()); } }); } }
Source:
protected List<String> getChildren(String root) { LOG.debug("Preparing to call getChildren() on {}", root); final long start = System.currentTimeMillis(); int numChildren = 0; try { final List<String> children = curator.getChildren().forPath(root); numChildren = children.size(); return children; } catch (NoNodeException nne) { return Collections.emptyList(); } catch (Throwable t) { throw Throwables.propagate(t); } finally { log(OperationType.GET_CHILDREN, Optional.of(numChildren), Optional.absent(), start, root); } }

Target:
protected List<String> getChildren(String root) { LOG.trace("Preparing to call getChildren() on {}", root); final long start = System.currentTimeMillis(); int numChildren = 0; try { final List<String> children = curator.getChildren().forPath(root); numChildren = children.size(); return children; } catch (NoNodeException nne) { return Collections.emptyList(); } catch (Throwable t) { throw Throwables.propagate(t); } finally { log(OperationType.GET_CHILDREN, Optional.of(numChildren), Optional.absent(), start, root); } }
Source:
private void loadActions() { JSONArray actionList = apiConnection.execute("lists/actionmenus/", CallType.GET, new JsonArrayResultHandler(), session); for (int i = 0; i < actionList.length(); i++) { JSONObject action = actionList.getJSONObject(i).getJSONObject("ActionMenu"); JSONArray functions = action.getJSONArray("functionTypes"); JSONObject stakeholders = action.getJSONObject("activeForStakeholder"); JSONArray keys = stakeholders.names(); Map<Integer, JSONArray> functionsMap = new HashMap<Integer, JSONArray>(); for (int j = 0; j < keys.length(); j++) { if (stakeholders.getBoolean(keys.getString(j))) { functionsMap.put(Integer.parseInt(keys.getString(j)), functions); } } setFunctions(functionsMap); } }

Target:
private void loadActions() { JSONArray actionList = apiConnection.execute("lists/actionmenus/", CallType.GET, new JsonArrayResultHandler(), session); for (int i = 0; i < actionList.length(); i++) { JSONObject action = actionList.getJSONObject(i).getJSONObject("ActionMenu"); JSONArray functions = action.getJSONArray("functionTypes"); JSONObject stakeholders = action.getJSONObject("activeForStakeholder"); JSONArray keys = stakeholders.names(); Map<Integer, JSONArray> functionMap = new HashMap<Integer, JSONArray>(); for (int j = 0; j < keys.length(); j++) { if (stakeholders.getBoolean(keys.getString(j))) { functionMap.put(keys.getInt(j), functions); } } setFunctions(functionMap); } }
Source:
public static ImageDescriptor getImageDescriptor(String id) { if (id.endsWith(".gif")){ id = id.replace(".gif", ".png"); } return TeamUIPlugin.getImageDescriptor(id); }

Target:
public static ImageDescriptor getImageDescriptor(String id) { String key = null; switch (id) { case ISharedImages.IMG_DIRTY_OVR: key = TeamUIPlugin.FILE_DIRTY_OVR; break; case ISharedImages.IMG_CHECKEDIN_OVR: key = TeamUIPlugin.FILE_CHECKEDIN_OVR; break; case ISharedImages.IMG_CHECKEDOUT_OVR: key = TeamUIPlugin.FILE_CHECKEDOUT_OVR; break; case ISharedImages.IMG_CONFLICT_OVR: key = TeamUIPlugin.FILE_CONFLICT_OVR; break; case ISharedImages.IMG_ERROR_OVR: key = TeamUIPlugin.FILE_ERROR_OVR; break; case ISharedImages.IMG_WARNING_OVR: key = TeamUIPlugin.FILE_WARNING_OVR; break; case ISharedImages.IMG_HOURGLASS_OVR: key = TeamUIPlugin.FILE_HOURGLASS_OVR; break; default: key = id; } return TeamUIPlugin.getImageDescriptor(key); }
Source:
public javax.cache.CacheManager ehcache3TicketCacheManager( @Qualifier ("ehcache3CacheManagerConfiguration") final ServiceCreationConfiguration ehcache3CacheManagerConfiguration) { val ehcacheProperties = casProperties.getTicket().getRegistry().getEhcache3(); val cachingProvider = Caching.getCachingProvider(EhcacheCachingProvider.class.getName()); val ehcacheProvider = (EhcacheCachingProvider) cachingProvider; val statisticsAllEnabled = ehcacheProperties.isEnableStatistics() ? ConfigurationElementState.ENABLED : ConfigurationElementState.DISABLED; val managementAllAllEnabled = ehcacheProperties.isEnableManagement() ? ConfigurationElementState.ENABLED : ConfigurationElementState.DISABLED; val jsr107Config = new Jsr107Configuration(null, new HashMap<>(), false, managementAllAllEnabled, statisticsAllEnabled); val configuration = new DefaultConfiguration(ehcacheProvider.getDefaultClassLoader(), ehcache3CacheManagerConfiguration, jsr107Config); return ehcacheProvider.getCacheManager(ehcacheProvider.getDefaultURI(), configuration); }

Target:
public javax.cache.CacheManager ehcache3TicketCacheManager( @Qualifier ("ehcache3CacheManagerConfiguration") final ServiceCreationConfiguration ehcache3CacheManagerConfiguration) { val ehcacheProperties = casProperties.getTicket().getRegistry().getEhcache3(); val ehcacheProvider = (EhcacheCachingProvider) Caching.getCachingProvider(EhcacheCachingProvider.class.getName()); val statisticsAllEnabled = ehcacheProperties.isEnableStatistics() ? ConfigurationElementState.ENABLED : ConfigurationElementState.DISABLED; val managementAllAllEnabled = ehcacheProperties.isEnableManagement() ? ConfigurationElementState.ENABLED : ConfigurationElementState.DISABLED; val jsr107Config = new Jsr107Configuration(null, new HashMap<>(), false, managementAllAllEnabled, statisticsAllEnabled); val configuration = new DefaultConfiguration(ehcacheProvider.getDefaultClassLoader(), ehcache3CacheManagerConfiguration, jsr107Config); return ehcacheProvider.getCacheManager(ehcacheProvider.getDefaultURI(), configuration); }
Source:
if (o != null) { if (o instanceof String) { return $((String) o); } if (o instanceof SafeHtml) { return $(((SafeHtml) o).asString()); } if (o instanceof GQuery) { return (GQuery) o; } if (o instanceof Function) { return new GQuery(((Function) o).getElement()); } if (o instanceof JsonBuilder) { return new GQuery(((JsonBuilder) o).<Element>getDataImpl()); } if (o instanceof IsWidget) { return $(Arrays.asList(o)); } if (o instanceof JavaScriptObject) { JavaScriptObject jso = (JavaScriptObject) o; if (JsUtils.isFunction(jso)) { new JsUtils.JsFunction(jso).fe(); return $(); } if (!JsUtils.isWindow(jso) && !JsUtils.isElement(jso) && JsUtils.isArray(jso)) { JsArrayMixed c = jso.cast(); JsNodeArray elms = JsNodeArray.create(); for (int i = 0; i < c.length(); i++) { Object obj = c.getObject(i); if (obj instanceof Node) { elms.addNode((Node) obj); } } return new GQuery(elms); } if (JsUtils.isNodeList(jso)) { return new GQuery(jso.<NodeList<Element>> cast()); } if (JsUtils.isEvent(jso)) { jso = jso.<Event>cast().getCurrentEventTarget(); } return new GQuery(jso.<Element> cast()); } console .log("Error: GQuery.$(Object o) could not wrap the type : ", o.getClass().getName(), o); }

Target:
if (o != null) { if (o instanceof String) { return $((String) o); } if (o instanceof SafeHtml) { return $(((SafeHtml) o).asString()); } if (o instanceof GQuery) { return (GQuery) o; } if (o instanceof Function) { return new GQuery(((Function) o).getElement()); } if (o instanceof JsonBuilder) { return new GQuery(((JsonBuilder) o).<Element>getDataImpl()); } if (o instanceof IsWidget) { return $(Arrays.asList(o)); } if (o instanceof JavaScriptObject) { JavaScriptObject jso = (JavaScriptObject) o; if (JsUtils.isFunction(jso)) { new JsUtils.JsFunction(jso).fe(); return $(); } if (!JsUtils.isWindow(jso) && !JsUtils.isElement(jso) && JsUtils.isArray(jso)) { JsArrayMixed c = jso.cast(); JsNodeArray elms = JsNodeArray.create(); for (int i = 0; i < c.length(); i++) { Object obj = c.getObject(i); if (obj instanceof Node) { elms.addNode((Node) obj); } } return new GQuery(elms); } if (JsUtils.isNodeList(jso)) { return new GQuery(jso.<NodeList<Element>> cast()); } if (JsUtils.isEvent(jso)) { jso = jso.<Event>cast().getCurrentEventTarget(); } return new GQuery(jso.<Element> cast()); } throw new RuntimeException("Error: GQuery.$(Object o) could not wrap the type : " + o.getClass().getName() + " " + o); }
Source:
public static MambuAPIServiceFactory getFactory(String domain, String username, String password) { Injector injector = Guice.createInjector(new MambuAPIModule(Protocol.HTTPS, domain, username, password, "Mambu SDKv.10")); return new MambuAPIServiceFactory(injector); }

Target:
public static MambuAPIServiceFactory getFactory(String domain, String username, String password) { Injector injector = Guice.createInjector(new MambuAPIModule(Protocol.HTTPS, domain, username, password, DEFAULT_USER_AGENT_HEADER_VALUE)); return new MambuAPIServiceFactory(injector); }
Source:
public void applyTo(BlockHound.Builder builder) { allowTestsToBlock(builder); builder.allowBlockingCallsInside(CoreTestBlockHoundIntegration.class.getName(), "writeJUnitReport"); builder.blockingMethodCallback(bm -> writeJUnitReport(new AssertionError(String.format("Blocking call! %s on thread %s", bm, Thread.currentThread())), "Blocking")); Thread.setDefaultUncaughtExceptionHandler((thread, t) -> { LogFactory.getLogger("Infinispan-TEST").fatal("Throwable was not caught in thread " + thread + " - exception is: " + t); if (!(t instanceof UndeliverableException)) { writeJUnitReport(t, "Uncaught"); } }); }

Target:
public void applyTo(BlockHound.Builder builder) { allowTestsToBlock(builder); builder.allowBlockingCallsInside(CoreTestBlockHoundIntegration.class.getName(), "writeJUnitReport"); builder.blockingMethodCallback(bm -> { String testName = TestResourceTracker.getCurrentTestName(); AssertionError assertionError = new AssertionError(String.format("Blocking call! %s on thread %s", bm, Thread.currentThread())); TestSuiteProgress.fakeTestFailure(testName + ".BlockingChecker", assertionError); writeJUnitReport(testName, assertionError, "Blocking"); throw assertionError; }); Thread.setDefaultUncaughtExceptionHandler((thread, t) -> { LogFactory.getLogger("Infinispan-TEST").fatal("Throwable was not caught in thread " + thread + " - exception is: " + t); if (!(t instanceof UndeliverableException)) { writeJUnitReport(TestResourceTracker.getCurrentTestName(), t, "Uncaught"); } }); }
Source:
public ClearSiteDataServerHttpHeadersWriter(Directive... directives) { Assert.notEmpty(directives, "Directives cannot be empty or null."); this.headerWriterDelegate = StaticServerHttpHeadersWriter.builder() .header(CLEAR_SITE_DATA_HEADER, transformToHeaderValue(directives)) .build(); }

Target:
public ClearSiteDataServerHttpHeadersWriter(Directive... directives) { Assert.notEmpty(directives, "directives cannot be empty or null."); this.headerWriterDelegate = StaticServerHttpHeadersWriter.builder() .header(CLEAR_SITE_DATA_HEADER, transformToHeaderValue(directives)) .build(); }
Source:
public void setUiScale(float scale) { canvas.setUiScale(1.0f / scale); canvasRenderer.setUiScale(scale); }

Target:
public void setUiScale(float scale) { canvas.setUiScale(scale); canvasRenderer.setUiScale(1.0f / scale); }
Source:
public void onPreAdvertiseRefs(UploadPack up) throws UploadPackMayNotContinueException { for (PreUploadHook hook : hooks) { hook.onPreAdvertiseRefs(up); } }

Target:
public void onPreAdvertiseRefs(UploadPack up) throws UploadPackMayNotContinueException { for (int i = 0; i < count; i++) hooks[i].onPreAdvertiseRefs(up); }
Source:
public Widget getWidget(String itemName) { for (ItemUIProvider provider : itemUIProviders) { Widget currentWidget = provider.getWidget(itemName); if (currentWidget != null) { if (currentWidget instanceof Default) { currentWidget = resolveDefault(currentWidget, null); } return currentWidget; } } return null; }

Target:
public Widget getWidget(String itemName) { for (ItemUIProvider provider : itemUIProviders) { Widget currentWidget = provider.getWidget(itemName); if (currentWidget != null) { return resolveDefault(currentWidget); } } return null; }