auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public synchronized boolean unregister(String headerName) { if (mRegistry.remove(headerName) == null) { return false; } return true; }

Target:
public synchronized boolean unregister(String headerName) { return mRegistry.remove(headerName) != null; }
Source:
public Borrowal(Account account, DocumentCopy<?> copy, BorrowalType type) { this.account = account; this.copy = copy; this.type = type; account.getBorrowals().add( this ); copy.getBorrowals().add( this ); }

Target:
public Borrowal(Account account, DocumentCopy<?> copy, BorrowalType type) { this.account = account; this.copy = copy; this.type = type; }
Source:
private static int determineNumberOfEigenSamples(final OptionalInt requestedNumberOfEigenSamples, final int numberOfCountColumns, final SingularValueDecomposition logNormalsSVD, final Logger logger) { final int numberOfEigenSamples; if (requestedNumberOfEigenSamples.isPresent()) { if (requestedNumberOfEigenSamples.getAsInt() > numberOfCountColumns) { logger.warn(String.format("The number of requested eigen samples (%d) is larger than the available number of read count columns after filtering (%d), thus we will have to use the latter.", requestedNumberOfEigenSamples.getAsInt(), numberOfCountColumns)); } numberOfEigenSamples = Math.min(requestedNumberOfEigenSamples.getAsInt(), numberOfCountColumns); } else { final double[] singularValues = logNormalsSVD.getSingularValues(); final double mean = MathUtils.mean(singularValues, 0, singularValues.length); final double eigenValueCutoff = mean * JOLLIFES_RULE_MEAN_FACTOR; numberOfEigenSamples = (int) DoubleStream.of(singularValues).filter(v -> v > eigenValueCutoff).count(); logger.info(String.format("Jollife's rule produced %d eigen samples out of %d possibles for the reduced PoN", numberOfEigenSamples, numberOfCountColumns)); } return numberOfEigenSamples; }

Target:
static int determineNumberOfEigenSamples(final OptionalInt requestedNumberOfEigenSamples, final int numberOfCountColumns, final SingularValueDecomposition logNormalsSVD, final Logger logger) { final int numberOfEigenSamples; if (requestedNumberOfEigenSamples.isPresent()) { if (requestedNumberOfEigenSamples.getAsInt() > numberOfCountColumns) { logger.warn(String.format("The number of requested eigen samples (%d) is larger than the available number of read count columns after filtering (%d), thus we will have to use the latter.", requestedNumberOfEigenSamples.getAsInt(), numberOfCountColumns)); } numberOfEigenSamples = Math.min(requestedNumberOfEigenSamples.getAsInt(), numberOfCountColumns); } else { final double[] singularValues = logNormalsSVD.getSingularValues(); final double mean = MathUtils.mean(singularValues, 0, singularValues.length); final double eigenValueCutoff = mean * JOLLIFES_RULE_MEAN_FACTOR; numberOfEigenSamples = (int) DoubleStream.of(singularValues).filter(v -> v > eigenValueCutoff).count(); logger.info(String.format("Jollife's rule produced %d eigen samples out of %d possibles for the reduced PoN", numberOfEigenSamples, numberOfCountColumns)); } return numberOfEigenSamples; }
Source:
DependencyQueueTaskDispatcher(GerritHandler gerritHandler) { this.currentlyTriggeringEvents = new HashSet<GerritTriggeredEvent>(); gerritHandler.addListener(this); logger.info("Registered to gerrit events"); }

Target:
DependencyQueueTaskDispatcher(GerritHandler gerritHandler) { this.currentlyTriggeringEvents = Collections.newSetFromMap( new ConcurrentHashMap<GerritTriggeredEvent, Boolean>()); if (gerritHandler == null) { logger.error("Gerrit Handler was not available to construct DependencyQueueTaskDispatcher"); } else { gerritHandler.addListener(this); } logger.info("Registered to gerrit events"); }
Source:
public void showAuthenticationErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getAuthenticationErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(context, account, incoming); String title = context.getString(R.string.notification_authentication_error_title); String text = context.getString(R.string.notification_authentication_error_text, account.getDescription()); NotificationCompat.Builder builder = controller.createNotificationBuilder() .setSmallIcon(R.drawable.notification_icon_warning) .setWhen(System.currentTimeMillis()) .setAutoCancel(true) .setTicker(title) .setContentTitle(title) .setContentText(text) .setContentIntent(editServerSettingsPendingIntent) .setStyle(new BigTextStyle().bigText(text)) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC); if (Build.VERSION.SDK_INT >= 21) { builder.setCategory(Notification.CATEGORY_ERROR); } controller.configureNotification(builder, null, null, NOTIFICATION_LED_FAILURE_COLOR, NOTIFICATION_LED_BLINK_FAST, true); getNotificationManager().notify(notificationId, builder.build()); }

Target:
public void showAuthenticationErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getAuthenticationErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(context, account, incoming); String title = context.getString(R.string.notification_authentication_error_title); String text = context.getString(R.string.notification_authentication_error_text, account.getDescription()); NotificationCompat.Builder builder = controller.createNotificationBuilder() .setSmallIcon(R.drawable.notification_icon_warning) .setWhen(System.currentTimeMillis()) .setAutoCancel(true) .setTicker(title) .setContentTitle(title) .setContentText(text) .setContentIntent(editServerSettingsPendingIntent) .setStyle(new BigTextStyle().bigText(text)) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setCategory(NotificationCompat.CATEGORY_ERROR); controller.configureNotification(builder, null, null, NOTIFICATION_LED_FAILURE_COLOR, NOTIFICATION_LED_BLINK_FAST, true); getNotificationManager().notify(notificationId, builder.build()); }
Source:
private void commitTransaction(Connection dbConnection) { try { if (dbConnection != null && !dbConnection.getAutoCommit()) { dbConnection.commit(); } } catch (SQLException e) { rollbackTransaction(dbConnection); log.error("An error occurred while commit transactions. ", e); } }

Target:
private void commitTransaction(Connection dbConnection) { try { if (dbConnection != null && !dbConnection.getAutoCommit()) { dbConnection.commit(); } } catch (SQLException e) { log.error("An error occurred while transaction commit. ", e); rollbackTransaction(dbConnection); } }
Source:
public void testLoadAccountMRUObjectsFromServer() throws Exception { final List<SalesforceObject> mruObjects_before = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); Map<String, String> idToNames = new HashMap<String, String>(); int numberOfRecords = 1; idToNames = createRecordsOnServer(numberOfRecords, Constants.ACCOUNT); String[] names = idToNames.values().toArray(new String[numberOfRecords]);; String[] ids = idToNames.keySet().toArray(new String[numberOfRecords]); try { Thread.sleep(2000); final List<SalesforceObject> mruObjects = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); assertNotNull("MRU list should not be null", mruObjects); assertEquals("MRU list size should not be changed", mruObjects_before.size()+numberOfRecords, mruObjects.size()); assertEquals("Recently viewed object name is incorrect", names[0], mruObjects.get(0).getName()); } finally { deleteRecordsOnServer(ids, Constants.ACCOUNT); } }

Target:
public void testLoadAccountMRUObjectsFromServer() throws Exception { final List<SalesforceObject> mruObjects_before = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); int numberOfRecords = 1; Map<String, String> idToNames = createRecordsOnServer(numberOfRecords, Constants.ACCOUNT); Collection<String> names = idToNames.values(); Set<String> ids = idToNames.keySet(); try { Thread.sleep(2000); final List<SalesforceObject> mruObjects = metadataManager.loadMRUObjects(Constants.ACCOUNT, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); assertNotNull("MRU list should not be null", mruObjects); assertEquals("MRU list size should not be changed", mruObjects_before.size()+numberOfRecords, mruObjects.size()); assertEquals("Recently viewed object name is incorrect", names.toArray()[0], mruObjects.get(0).getName()); } finally { deleteRecordsOnServer(ids, Constants.ACCOUNT); } }
Source:
public String generate(TreeLogger treeLogger, GeneratorContext generatorContext, String typeName) throws UnableToCompleteException { setTypeOracle(generatorContext.getTypeOracle()); setPropertyOracle(generatorContext.getPropertyOracle()); setTreeLogger(treeLogger); setTypeClass(getType(typeName)); checkLatestVersion(); PrintWriter printWriter = tryCreatePrintWriter(generatorContext, SUFFIX); if (printWriter == null) { return typeName + SUFFIX; } JClassType preBootstrapper = getPreBootstrapper(); ClassSourceFileComposerFactory composer = initComposer(preBootstrapper); SourceWriter sw = composer.createSourceWriter(generatorContext, printWriter); JClassType bootstrapper = getBootstrapper(); String ginjectorName = new GinjectorGenerator(bootstrapper).generate(getTreeLogger(), generatorContext, GinjectorGenerator.DEFAULT_FQ_NAME); writeInit(sw, ginjectorName, preBootstrapper, bootstrapper); closeDefinition(sw); return getPackageName() + "." + getClassName(); }

Target:
public String generate(TreeLogger treeLogger, GeneratorContext generatorContext, String typeName) throws UnableToCompleteException { setTypeOracle(generatorContext.getTypeOracle()); setPropertyOracle(generatorContext.getPropertyOracle()); setTreeLogger(treeLogger); setTypeClass(getType(typeName)); PrintWriter printWriter = tryCreatePrintWriter(generatorContext, SUFFIX); if (printWriter == null) { return typeName + SUFFIX; } JClassType preBootstrapper = getPreBootstrapper(); ClassSourceFileComposerFactory composer = initComposer(preBootstrapper); SourceWriter sw = composer.createSourceWriter(generatorContext, printWriter); JClassType bootstrapper = getBootstrapper(); String ginjectorName = new GinjectorGenerator(bootstrapper).generate(getTreeLogger(), generatorContext, GinjectorGenerator.DEFAULT_FQ_NAME); writeInit(sw, ginjectorName, preBootstrapper, bootstrapper); closeDefinition(sw); return getPackageName() + "." + getClassName(); }
Source:
public String getSimpleName() { int index = getActualName().lastIndexOf(File.separator); if (index != -1){ return actualName; } else { return getActualName().substring(index + 1); } }

Target:
public String getSimpleName() { int index = getActualName().lastIndexOf("/"); if (index != -1){ return actualName; } else { return getActualName().substring(index + 1); } }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SyncDomainAnswer that = (SyncDomainAnswer) o; if (_success != that._success) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SyncDomainAnswer)) return false; if (!super.equals(o)) return false; SyncDomainAnswer that = (SyncDomainAnswer) o; if (_success != that._success) return false; return true; }
Source:
public HelixParticipantTest(String stateModelDef) { List<ZkInfo> zkInfoList = new ArrayList<>(); zkInfoList.add(new ZkInfo(null, "DC0", (byte) 0, 2199, false)); zkJson = constructZkLayoutJSON(zkInfoList); props = new Properties(); props.setProperty("clustermap.host.name", "localhost"); props.setProperty("clustermap.port", "2200"); props.setProperty("clustermap.cluster.name", clusterName); props.setProperty("clustermap.datacenter.name", "DC0"); props.setProperty("clustermap.dcs.zk.connect.strings", zkJson.toString(2)); props.setProperty("clustermap.state.model.definition", stateModelDef); this.stateModelDef = stateModelDef; helixManagerFactory = new MockHelixManagerFactory(); accountService = Mockito.mock(AccountService.class); }

Target:
public HelixParticipantTest(String stateModelDef) { List<ZkInfo> zkInfoList = new ArrayList<>(); zkInfoList.add(new ZkInfo(null, "DC0", (byte) 0, 2199, false)); zkJson = constructZkLayoutJSON(zkInfoList); props = new Properties(); props.setProperty("clustermap.host.name", "localhost"); props.setProperty("clustermap.port", "2200"); props.setProperty("clustermap.cluster.name", clusterName); props.setProperty("clustermap.datacenter.name", "DC0"); props.setProperty("clustermap.dcs.zk.connect.strings", zkJson.toString(2)); props.setProperty("clustermap.state.model.definition", stateModelDef); this.stateModelDef = stateModelDef; helixManagerFactory = new MockHelixManagerFactory(); }
Source:
private void setUpTriggersForced() { if( getArguments().getString("state").compareTo("From Favourite") == 0) { setUpFavTriggers(); } else { BackendClient.of(this).getTriggers(new TriggersCallback()); } }

Target:
private void setUpTriggersForced() { if( getArguments().getString("state").equalsIgnoreCase("From Favourite")) { setUpFavTriggers(); } else { BackendClient.of(this).getTriggers(new TriggersCallback()); } }
Source:
private void refreshProject(IProgressMonitor monitor) throws CoreException { if (_projectMetatData.getNewProjectHandle() != null) { _projectMetatData.getNewProjectHandle().refreshLocal(IProject.DEPTH_INFINITE, monitor); Job updateJob = new UpdateMavenProjectJob(new IProject[] {_projectMetatData.getNewProjectHandle() }); updateJob.schedule(); } }

Target:
private void refreshProject(IProgressMonitor monitor) throws CoreException { IProject project = _projectMetatData.getNewProjectHandle(); if (project != null) { Job updateJob = new UpdateMavenProjectJob(new IProject[] {project}); updateJob.schedule(); } }
Source:
private Pair<String, String> readUntilMatch(Iterator<String> lineIterator, Pattern pattern) { while (lineIterator.hasNext()) { String line = lineIterator.next(); Matcher matcher = pattern.matcher(line); if (matcher.matches()) { return Pair.of(line, matcher.group(1)); } } throw new BugInRandoopException("Error: JUnit output doesn't contain: " + pattern.pattern()); }

Target:
private Match readUntilMatch(Iterator<String> lineIterator, Pattern pattern) { while (lineIterator.hasNext()) { String line = lineIterator.next(); Matcher matcher = pattern.matcher(line); if (matcher.matches()) { return new Match(line, matcher.group(1)); } } throw new BugInRandoopException("Error: JUnit output doesn't contain: " + pattern.pattern()); }
Source:
public void testSubmitTopologyDryRun() throws Exception { SchedulerStateManagerAdaptor adaptor = mock(SchedulerStateManagerAdaptor.class); PowerMockito.whenNew(SchedulerStateManagerAdaptor.class).withAnyArguments(). thenReturn(adaptor); SubmitterMain submitterMain = spy(new SubmitterMain(config, topology)); PowerMockito.mockStatic(Context.class); PowerMockito.when(Context.dryRun(config)).thenReturn(true); doThrow(new SubmitDryRunResponse(topology, config, mock(PackingPlan.class))). when(submitterMain).callLauncherRunner(Mockito.any(Config.class)); try { submitterMain.submitTopology(); } finally { verify(uploader, never()).uploadPackage(); verify(adaptor, never()).isTopologyRunning(anyString()); } }

Target:
public void testSubmitTopologyDryRun() throws Exception { SchedulerStateManagerAdaptor adaptor = mock(SchedulerStateManagerAdaptor.class); PowerMockito.whenNew(SchedulerStateManagerAdaptor.class).withAnyArguments(). thenReturn(adaptor); SubmitterMain submitterMain = spy(new SubmitterMain(config, topology)); when(config.getBooleanValue(ConfigKeys.get("DRY_RUN"), false)).thenReturn(true); try { submitterMain.submitTopology(); } finally { verify(uploader, never()).uploadPackage(); verify(adaptor, never()).isTopologyRunning(anyString()); } }
Source:
public void actionPerformed(java.awt.event.ActionEvent evt) { PersonaDetailsDialog createPersonaDialog = new PersonaDetailsDialog(ContactArtifactViewer.this, PersonaDetailsMode.CREATE, null, new PersonaCreateCallbackImpl(personaUIComponents), false); PersonaDetailsPanel personaPanel = createPersonaDialog.getDetailsPanel(); if (contactName != null) { personaPanel.setPersonaName(contactName); } for (CentralRepoAccount account : contactUniqueAccountsList) { personaPanel.addAccount(account, "Account found in Contact artifact.", Persona.Confidence.UNKNOWN); } createPersonaDialog.display(); }

Target:
public void actionPerformed(java.awt.event.ActionEvent evt) { PersonaDetailsDialog createPersonaDialog = new PersonaDetailsDialog(ContactArtifactViewer.this, PersonaDetailsMode.CREATE, null, new PersonaCreateCallbackImpl(personaUIComponents), false); PersonaDetailsPanel personaPanel = createPersonaDialog.getDetailsPanel(); if (contactName != null) { personaPanel.setPersonaName(contactName); } for (CentralRepoAccount account : contactUniqueAccountsList) { personaPanel.addAccount(account, Bundle.ContactArtifactViewer_persona_account_justification() , Persona.Confidence.HIGH); } createPersonaDialog.display(); }
Source:
private void offer(Mutation mutation) throws IOException { try { Runnable operation = null; if (options.useBulkApi() && (mutation instanceof Put || mutation instanceof Delete)) { MutateRowRequest request = adapt(mutation); ListenableFuture<Empty> future = bulkMutation.add(request); addExceptionCallback(future, mutation); } else { initializeAsyncMutators(); long operationId = rpcThrottler.registerOperationWithHeapSize(mutation.heapSize()); operation = new MutationOperation(mutation, operationId); if (executorService != null && options.getAsyncMutatorCount() > 0) { asyncOperationsQueue.add(operation); } else { operation.run(); } } } catch (InterruptedException e) { throw new IOException("Interrupted in buffered mutator while mutating row : '" + Bytes.toString(mutation.getRow()), e); } }

Target:
private void offer(Mutation mutation) throws IOException { try { Runnable operation = null; if (options.useBulkApi() && (mutation instanceof Put || mutation instanceof Delete)) { MutateRowRequest request = adapt(mutation); ListenableFuture<Empty> future = bulkMutation.add(request); addExceptionCallback(future, mutation); } else { long operationId = rpcThrottler.registerOperationWithHeapSize(mutation.heapSize()); operation = new MutationOperation(mutation, operationId); if (executorService != null && options.getAsyncMutatorCount() > 0) { initializeAsyncMutators(); asyncOperationsQueue.add(operation); } else { operation.run(); } } } catch (InterruptedException e) { throw new IOException("Interrupted in buffered mutator while mutating row : '" + Bytes.toString(mutation.getRow()), e); } }
Source:
public InputStream call(CallContext callContext, InputStream[] input) { checkAllowedArgs(callContext.getEndpointState(), callContext.getSessionState(), callContext.getWorkUnit()); return getCaller().arrayCall(getClient(), callContext.getEndpointState(), callContext.getSessionState(), callContext.getWorkUnit(), input); }

Target:
public void call(CallContext callContext, InputStream[] input) { checkAllowedArgs(callContext.getEndpointState(), callContext.getSessionState(), callContext.getWorkUnit()); callContext.withEndpointState(getCaller().arrayCall(getClient(), callContext.getEndpointState(), callContext.getSessionState(), callContext.getWorkUnit(), input)); }
Source:
public void testTwoUniqueIndexes() { SessionFactoryBuilder config = SessionFactoryBuilder.entities( TwoUniqueIndexesEntity.class ); TwoUniqueIndexesEntity entity = new TwoUniqueIndexesEntity(); entity.name = "Fabio Massimo"; entity.email = "fabiomassimo@myemailprovider.eu"; entity.address = "11bis Rue Roquepine Paris"; try ( SessionFactory sessionFactory = config.build() ) { inTransaction( sessionFactory, session -> { session.persist( entity ); } ); inTransaction( sessionFactory, session -> { TwoUniqueIndexesEntity stored = session.load( TwoUniqueIndexesEntity.class, entity.name ); assertThat( entity.email ).isEqualTo( stored.getEmail() ); assertThat( entity.address ).isEqualTo( stored.getAddress() ); } ); inTransaction( sessionFactory, session -> { session.delete( entity ); } ); } }

Target:
public void testTwoUniqueIndexes() { config = SessionFactoryBuilder.entities( TwoUniqueIndexesEntity.class ); TwoUniqueIndexesEntity entity = new TwoUniqueIndexesEntity(); entity.name = "Fabio Massimo"; entity.email = "fabiomassimo@myemailprovider.eu"; entity.address = "11bis Rue Roquepine Paris"; this.entity = entity; try ( SessionFactory sessionFactory = config.build() ) { inTransaction( sessionFactory, session -> { session.persist( entity ); } ); inTransaction( sessionFactory, session -> { TwoUniqueIndexesEntity stored = session.load( TwoUniqueIndexesEntity.class, entity.name ); assertThat( entity.email ).isEqualTo( stored.getEmail() ); assertThat( entity.address ).isEqualTo( stored.getAddress() ); } ); } }
Source:
public Experiment getExperiment(String experimentAccession, String accessKey) { try { return getExperimentFromCache(experimentAccession, experimentTypes.get(Pair.of(experimentAccession, accessKey))); } catch (ExecutionException e) { throw new RuntimeException(e); } }

Target:
public Experiment getExperiment(String experimentAccession, String accessKey) { return getExperimentFromCache(experimentAccession, getExperimentType(experimentAccession, accessKey)); }
Source:
public void run() throws Exception { WebResource webResource = getClient().resource(endpoint + "/v1/catalog/entities"); ClientResponse clientResponse = webResource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class); String jsonResponse = clientResponse.getEntity(String.class); List<String> entities = getJsonParser().readValue(jsonResponse,new TypeReference<List<String>>(){}); for (String entity : entities) { getOut().println(entity); } }

Target:
public void run() throws Exception { WebResource webResource = getClient().resource(endpoint + "/v1/catalog/entities"); ClientResponse clientResponse = webResource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class); if (clientResponse.getStatus() != Response.Status.OK.getStatusCode()) { String err = getErrorMessage(clientResponse); throw new CommandExecutionException(err); } String jsonResponse = clientResponse.getEntity(String.class); List<String> entities = getJsonParser().readValue(jsonResponse,new TypeReference<List<String>>(){}); for (String entity : entities) { getOut().println(entity); } }
Source:
public void testCommandServiceSetup() { List<String> extensionsWithoutCommandSupport = asList( PrometheusKieServerExtension.EXTENSION_NAME, ScenarioSimulationKieServerExtension.EXTENSION_NAME); for (KieServerExtension extension : ((KieServerImpl) kieServer).getServerExtensions()) { KieContainerCommandService<?> tmp = extension.getAppComponents(KieContainerCommandService.class); if (extensionsWithoutCommandSupport.contains(extension.getExtensionName())) { assertNull(tmp); } else { assertNotNull(tmp); } } }

Target:
public void testCommandServiceSetup() { List<String> extensionsWithoutCommandSupport = asList( PrometheusKieServerExtension.EXTENSION_NAME, ScenarioSimulationKieServerExtension.EXTENSION_NAME); for (KieServerExtension extension : ((KieServerImpl) kieServer).getServerExtensions()) { KieContainerCommandService<?> kieContainerCommandService = extension.getAppComponents(KieContainerCommandService.class); String extensionName = extension.getExtensionName(); Objects.requireNonNull(extensionName, "extension.getExtensionName() should not be null"); if (extensionsWithoutCommandSupport.contains(extensionName)) { assertNull(kieContainerCommandService); } else { assertNotNull(kieContainerCommandService); } } }
Source:
protected Control createDialogArea(Composite parent) { final Composite composite = (Composite) super.createDialogArea(parent); composite.setLayout(new GridLayout(2, false)); getShell().setText( changeCredentials ? UIText.LoginDialog_changeCredentials : UIText.LoginDialog_login); Label uriLabel = new Label(composite, SWT.NONE); uriLabel.setText(UIText.LoginDialog_repository); Text uriText = new Text(composite, SWT.READ_ONLY); uriText.setText(uri.toString()); Label userLabel = new Label(composite, SWT.NONE); userLabel.setText(UIText.LoginDialog_user); if (isUserSet) { user = new Text(composite, SWT.BORDER | SWT.READ_ONLY); user.setText(uri.getUser()); } else user = new Text(composite, SWT.BORDER); GridDataFactory.fillDefaults().grab(true, false).applyTo(user); Label passwordLabel = new Label(composite, SWT.NONE); passwordLabel.setText(UIText.LoginDialog_password); password = new Text(composite, SWT.PASSWORD | SWT.BORDER); GridDataFactory.fillDefaults().grab(true, false).applyTo(password); Label storeLabel = new Label(composite, SWT.NONE); storeLabel.setText(UIText.LoginDialog_storeInSecureStore); storeCheckbox = new Button(composite, SWT.CHECK); storeCheckbox.setSelection(true); if (changeCredentials) storeCheckbox.setEnabled(false); if (isUserSet) password.setFocus(); else user.setFocus(); return composite; }

Target:
protected Control createDialogArea(Composite parent) { final Composite composite = (Composite) super.createDialogArea(parent); composite.setLayout(new GridLayout(2, false)); getShell().setText( changeCredentials ? UIText.LoginDialog_changeCredentials : UIText.LoginDialog_login); Label uriLabel = new Label(composite, SWT.NONE); uriLabel.setText(UIText.LoginDialog_repository); Text uriText = new Text(composite, SWT.READ_ONLY); uriText.setText(uri.toString()); Label userLabel = new Label(composite, SWT.NONE); userLabel.setText(UIText.LoginDialog_user); if (isUserSet) { user = new Text(composite, SWT.BORDER | SWT.READ_ONLY); user.setText(uri.getUser()); } else user = new Text(composite, SWT.BORDER); GridDataFactory.fillDefaults().grab(true, false).applyTo(user); Label passwordLabel = new Label(composite, SWT.NONE); passwordLabel.setText(UIText.LoginDialog_password); password = new Text(composite, SWT.PASSWORD | SWT.BORDER); GridDataFactory.fillDefaults().grab(true, false).applyTo(password); if(!changeCredentials) { Label storeLabel = new Label(composite, SWT.NONE); storeLabel.setText(UIText.LoginDialog_storeInSecureStore); storeCheckbox = new Button(composite, SWT.CHECK); storeCheckbox.setSelection(true); } if (isUserSet) password.setFocus(); else user.setFocus(); return composite; }
Source:
public ServerECDSASignatureSignerContext(KeycloakSession session, String algorithm) throws SignatureException { super(getKey(session, algorithm)); }

Target:
public ServerECDSASignatureSignerContext(KeycloakSession session, String algorithm) throws SignatureException { super(ServerAsymmetricSignatureSignerContext.getKey(session, algorithm)); }
Source:
public DeadAgentReaper(final MasterModel masterModel, final long timeoutHours) { this(masterModel, timeoutHours, SYSTEM_CLOCK, PERMITS_PER_SECOND, ThreadLocalRandom.current().nextInt(DELAY)); }

Target:
public DeadAgentReaper(final MasterModel masterModel, final long timeoutHours) { this(masterModel, timeoutHours, SYSTEM_CLOCK, PERMITS_PER_SECOND, new Random().nextInt(DELAY)); }
Source:
private void scrobbleBroadcast() { Song song = mCurrentSong; if (song == null) return; if (!mStockBroadcast && !mScrobble) return; long[] androidIds = MediaUtils.getAndroidMediaIds(getApplicationContext(), song); if (mStockBroadcast) { Intent intent = new Intent("com.android.music.playstatechanged"); intent.putExtra("playing", (mState & FLAG_PLAYING) != 0); intent.putExtra("track", song.title); intent.putExtra("album", song.album); intent.putExtra("artist", song.artist); if (song.mbid != null) intent.putExtra("mbid", song.mbid); sendBroadcast(intent); } if (mScrobble) { Intent intent = new Intent("net.jjc1138.android.scrobbler.action.MUSIC_STATUS"); intent.putExtra("playing", (mState & FLAG_PLAYING) != 0); intent.putExtra("secs", (int)song.duration / 1000); intent.putExtra("clashWithScrobbleDroid", "1"); intent.putExtra("track", song.title); intent.putExtra("album", song.album); intent.putExtra("artist", song.artist); if (song.mbid != null) intent.putExtra("mb-trackid", song.mbid); sendBroadcast(intent); } }

Target:
private void scrobbleBroadcast() { Song song = mCurrentSong; if (song == null) return; if (!mStockBroadcast && !mScrobble) return; long[] androidIds = MediaUtils.getAndroidMediaIds(getApplicationContext(), song); if (mStockBroadcast) { Intent intent = new Intent("com.android.music.playstatechanged"); intent.putExtra("playing", (mState & FLAG_PLAYING) != 0); intent.putExtra("track", song.title); intent.putExtra("album", song.album); intent.putExtra("artist", song.artist); if (song.mbid != null) intent.putExtra("mbid", song.mbid); sendBroadcast(intent); } if (mScrobble) { Intent intent = new Intent("net.jjc1138.android.scrobbler.action.MUSIC_STATUS"); intent.putExtra("playing", (mState & FLAG_PLAYING) != 0); intent.putExtra("secs", (int)song.duration / 1000); intent.putExtra("track", song.title); intent.putExtra("album", song.album); intent.putExtra("artist", song.artist); if (song.mbid != null) intent.putExtra("mb-trackid", song.mbid); sendBroadcast(intent); } }
Source:
private static TempFile createSingleColumnFileWithNullValues(int rows) throws IOException, ReflectiveOperationException, SerDeException { @SuppressWarnings("deprecation") Serializer serde = new OrcSerde(); TempFile tempFile = new TempFile(); FileSinkOperator.RecordWriter writer = createOrcRecordWriter(tempFile.getFile(), ORC_12, CompressionKind.NONE, BIGINT); SettableStructObjectInspector objectInspector = createSettableStructObjectInspector("test", BIGINT); Object row = objectInspector.create(); StructField field = objectInspector.getAllStructFieldRefs().get(0); for (int i = 0; i < rows; i++) { if (i % 10 == 0) { objectInspector.setStructFieldData(row, field, null); } else { objectInspector.setStructFieldData(row, field, (long) i); } Writable record = serde.serialize(row, objectInspector); writer.write(record); } writer.close(false); return tempFile; }

Target:
private static TempFile createSingleColumnFileWithNullValues(int rows) throws IOException, ReflectiveOperationException, SerDeException { Serializer serde = new OrcSerde(); TempFile tempFile = new TempFile(); FileSinkOperator.RecordWriter writer = createOrcRecordWriter(tempFile.getFile(), ORC_12, CompressionKind.NONE, BIGINT); SettableStructObjectInspector objectInspector = createSettableStructObjectInspector("test", BIGINT); Object row = objectInspector.create(); StructField field = objectInspector.getAllStructFieldRefs().get(0); for (int i = 0; i < rows; i++) { if (i % 10 == 0) { objectInspector.setStructFieldData(row, field, null); } else { objectInspector.setStructFieldData(row, field, (long) i); } Writable record = serde.serialize(row, objectInspector); writer.write(record); } writer.close(false); return tempFile; }
Source:
private List<MetricDto> searchMetrics(DbSession dbSession, ComponentTreeWsRequest request) { List<String> metricKeys = requireNonNull(request.getMetricKeys()); List<MetricDto> metrics = dbClient.metricDao().selectByKeys(dbSession, metricKeys); if (metrics.size() < metricKeys.size()) { List<String> foundMetricKeys = Lists.transform(metrics, MetricDto::getKey); Set<String> missingMetricKeys = Sets.difference( new LinkedHashSet<>(metricKeys), new LinkedHashSet<>(foundMetricKeys)); throw new NotFoundException(format("The following metric keys are not found: %s", COMA_JOINER.join(missingMetricKeys))); } Set<String> forbiddenMetrics = new TreeSet<>(metrics.stream() .filter(metric -> ComponentTreeAction.FORBIDDEN_METRIC_TYPES.contains(metric.getValueType())) .map(MetricDto::getKey) .collect(Collectors.toSet())); checkArgument(forbiddenMetrics.isEmpty(), "Metric types '%s' and '%s' are not allowed : %s", DATA.name(), DISTRIB.name(), COMA_JOINER.join(forbiddenMetrics)); return metrics; }

Target:
private List<MetricDto> searchMetrics(DbSession dbSession, ComponentTreeWsRequest request) { List<String> metricKeys = requireNonNull(request.getMetricKeys()); List<MetricDto> metrics = dbClient.metricDao().selectByKeys(dbSession, metricKeys); if (metrics.size() < metricKeys.size()) { List<String> foundMetricKeys = Lists.transform(metrics, MetricDto::getKey); Set<String> missingMetricKeys = Sets.difference( new LinkedHashSet<>(metricKeys), new LinkedHashSet<>(foundMetricKeys)); throw new NotFoundException(format("The following metric keys are not found: %s", COMA_JOINER.join(missingMetricKeys))); } String forbiddenMetrics = metrics.stream() .filter(metric -> ComponentTreeAction.FORBIDDEN_METRIC_TYPES.contains(metric.getValueType())) .map(MetricDto::getKey) .sorted() .collect(Collectors.join(COMA_JOINER)); checkArgument(forbiddenMetrics.isEmpty(), "Metrics %s can't be requested in this web service. Please use api/measures/component", forbiddenMetrics); return metrics; }
Source:
private Champ overwriteChildLink(final int bitpos, final Pair<Champ, Multihash> node) { final int setIndex = this.contents.length - 1 - index(nodeMap, bitpos); final HashPrefixPayload[] src = this.contents; final HashPrefixPayload[] dst = new HashPrefixPayload[src.length]; System.arraycopy(src, 0, dst, 0, src.length); dst[setIndex] = new HashPrefixPayload(null, MaybeMultihash.of(node.right)); return new Champ(dataMap, nodeMap, dst); }

Target:
private Champ overwriteChildLink(final int bitpos, final Pair<Champ, Multihash> node) { final int setIndex = this.contents.length - 1 - getIndex(nodeMap, bitpos); final HashPrefixPayload[] src = this.contents; final HashPrefixPayload[] dst = Arrays.copyOf(src, src.length); dst[setIndex] = new HashPrefixPayload(MaybeMultihash.of(node.right)); return new Champ(dataMap, nodeMap, dst); }
Source:
private void updateTaskStatuses( Map<Guid, Map<Guid, AsyncTaskStatus>> poolsAllTasksMap) { for (SPMTask task : _tasks.values()) { if (task.getShouldPoll()) { Map<Guid, AsyncTaskStatus> asyncTasksForPoolMap = poolsAllTasksMap .get(task.getStoragePoolID()); if (asyncTasksForPoolMap != null) { AsyncTask asyncTask = task.getParameters().getDbAsyncTask(); CommandEntity rootCmdEntity = coco.getCommandEntity(asyncTask.getRootCommandId()); if (rootCmdEntity != null && !rootCmdEntity.isExecuted()) { task.setPartiallyCompletedCommandTask(true); } AsyncTaskStatus cachedAsyncTaskStatus = asyncTasksForPoolMap .get(task.getVdsmTaskId()); task.updateTask(cachedAsyncTaskStatus); } } } }

Target:
private void updateTaskStatuses( Map<Guid, Map<Guid, AsyncTaskStatus>> poolsAllTasksMap) { for (SPMTask task : _tasks.values()) { if (task.getShouldPoll()) { Map<Guid, AsyncTaskStatus> asyncTasksForPoolMap = poolsAllTasksMap .get(task.getStoragePoolID()); if (asyncTasksForPoolMap != null) { AsyncTaskStatus cachedAsyncTaskStatus = asyncTasksForPoolMap .get(task.getVdsmTaskId()); task.updateTask(cachedAsyncTaskStatus); } } } }
Source:
public synchronized List<IMarkerEvent> getMarkerList(String category, long startTime, long endTime, long resolution, IProgressMonitor monitor) { if (!category.equals(LOST_EVENTS)) { return Collections.emptyList(); } int lostEventsQuark = getLostEventsQuark(); if (lostEventsQuark == -1) { return Collections.emptyList(); } long[] request = new long[] { startTime, endTime, resolution, fStateSystem.getCurrentEndTime() }; if (Arrays.equals(request, fLastRequest)) { return fLastMarkers; } List<IMarkerEvent> markers = new ArrayList<>(); try { final long start = Math.max(startTime, fStateSystem.getStartTime()); final long end = Math.min(endTime, fStateSystem.getCurrentEndTime()); if (start <= end) { List<ITmfStateInterval> intervals = StateSystemUtils.queryHistoryRange(checkNotNull(fStateSystem), lostEventsQuark, start, end, resolution, monitor); for (ITmfStateInterval interval : intervals) { if (interval.getStateValue().isNull()) { continue; } long time = interval.getStartTime(); long duration = interval.getStateValue().unboxLong() - time; IMarkerEvent marker = new MarkerEvent(null, time, duration, LOST_EVENTS, COLOR, null, false); markers.add(marker); } } } catch (AttributeNotFoundException | StateSystemDisposedException e) { } fLastRequest = request; fLastMarkers = Collections.unmodifiableList(markers); return fLastMarkers; }

Target:
public synchronized List<IMarkerEvent> getMarkerList(String category, long startTime, long endTime, long resolution, IProgressMonitor monitor) { if (!category.equals(LOST_EVENTS)) { return Collections.emptyList(); } ITmfStateSystem ss = getStateSystem(); if (ss == null) { return Collections.emptyList(); } int lostEventsQuark = getLostEventsQuark(ss); if (lostEventsQuark == -1) { return Collections.emptyList(); } long[] request = new long[] { startTime, endTime, resolution, ss.getCurrentEndTime() }; if (Arrays.equals(request, fLastRequest)) { return fLastMarkers; } List<IMarkerEvent> markers = new ArrayList<>(); try { final long start = Math.max(startTime, ss.getStartTime()); final long end = Math.min(endTime, ss.getCurrentEndTime()); if (start <= end) { List<ITmfStateInterval> intervals = StateSystemUtils.queryHistoryRange(ss, lostEventsQuark, start, end, resolution, monitor); for (ITmfStateInterval interval : intervals) { if (interval.getStateValue().isNull()) { continue; } long time = interval.getStartTime(); long duration = interval.getStateValue().unboxLong() - time; IMarkerEvent marker = new MarkerEvent(null, time, duration, LOST_EVENTS, COLOR, null, false); markers.add(marker); } } } catch (AttributeNotFoundException | StateSystemDisposedException e) { } fLastRequest = request; fLastMarkers = Collections.unmodifiableList(markers); return fLastMarkers; }
Source:
public Group nextRow() throws TranslatorException, DataNotAvailableException { while(true){ try { Group row = nextRowInternal(); if (row == null) { return null; } return row; } catch (IOException e) { throw new TranslatorException(e); } } }

Target:
public Group nextRow() throws TranslatorException, DataNotAvailableException { try { Group row = nextRowInternal(); if (row == null) { return null; } return row; } catch (IOException e) { throw new TranslatorException(e); } }
Source:
public Worker create(WorkerKey key) throws Exception { int workerId = pidCounter.getAndIncrement(); Path logFile = workerBaseDir.getRelative("worker-" + workerId + "-" + key.getMnemonic() + ".log"); Worker worker; boolean sandboxed = workerOptions.workerSandboxing || key.mustBeSandboxed(); boolean proxyed = key.proxyed(); if (sandboxed) { Path workDir = getSandboxedWorkerPath(key, workerId); worker = new SandboxedWorker(key, workerId, workDir, logFile); } else if (proxyed) { worker = new WorkerProxy(key, workerId, key.getExecRoot(), logFile); } else { worker = new Worker(key, workerId, key.getExecRoot(), logFile); } if (workerOptions.workerVerbose) { reporter.handle( Event.info( String.format( "Created new %s %s worker (id %d), logging to %s", sandboxed ? "sandboxed" : "non-sandboxed", key.getMnemonic(), workerId, logFile))); } return worker; }

Target:
public Worker create(WorkerKey key) throws Exception { int workerId = pidCounter.getAndIncrement(); Path logFile = workerBaseDir.getRelative("worker-" + workerId + "-" + key.getMnemonic() + ".log"); Worker worker; boolean sandboxed = workerOptions.workerSandboxing || key.mustBeSandboxed(); if (sandboxed) { Path workDir = getSandboxedWorkerPath(key, workerId); worker = new SandboxedWorker(key, workerId, workDir, logFile); } else if (key.getProxied()) { worker = new WorkerProxy(key, workerId, key.getExecRoot(), logFile, WorkerMultiplexerManager.getInstance(key.hashCode())); } else { worker = new Worker(key, workerId, key.getExecRoot(), logFile); } if (workerOptions.workerVerbose) { reporter.handle( Event.info( String.format( "Created new %s %s worker (id %d), logging to %s", sandboxed ? "sandboxed" : "non-sandboxed", key.getMnemonic(), workerId, logFile))); } return worker; }
Source:
public static boolean dimensionMatchesType(WorldProvider provider, String type) { Set<String> dimTypes = getDimensionTypes(provider); Queue<String> curTypes = new ArrayDeque<String>(); curTypes.add(type); String curType; while ((curType = curTypes.poll()) != null) { if (dimTypes.contains(curType)) return true; Type curT = types.get(curType); if (curT != null) curTypes.addAll(curT.subtypes); } return false; }

Target:
public static boolean dimensionMatchesType(WorldProvider provider, String type) { Set<String> dimTypes = getDimensionTypes(provider); Queue<String> curTypes = new ArrayDeque<String>(); do { if (dimTypes.contains(type)) return true; Type curT = types.get(type); if (curT != null) curTypes.addAll(curT.subtypes); } while ((type = curTypes.poll()) != null); return false; }
Source:
private void displayParents(final List<PatchSetInfo.ParentInfo> parents) { if (parents.size() == 0) { infoTable.setWidget(R_PARENTS, 1, new InlineLabel(Util.C.initialCommit())); return; } final Grid parentsTable = new Grid(parents.size(), 2); parentsTable.setStyleName(Gerrit.RESOURCES.css().parentsTable()); parentsTable.addStyleName(Gerrit.RESOURCES.css().noborder()); final CellFormatter ptfmt = parentsTable.getCellFormatter(); int row = 0; for (PatchSetInfo.ParentInfo parent : parents) { parentsTable.setWidget(row, 0, new InlineLabel(parent.id.get())); ptfmt.addStyleName(row, 0, Gerrit.RESOURCES.css().noborder()); ptfmt.addStyleName(row, 0, Gerrit.RESOURCES.css().monospace()); String parentMsg = parent.shortMessage; if (parentMsg.length() > 80) { parentMsg = parentMsg.substring(0, 77) + "..."; } parentsTable.setWidget(row, 1, new InlineLabel(parentMsg)); ptfmt.addStyleName(row, 1, Gerrit.RESOURCES.css().noborder()); row++; } infoTable.setWidget(R_PARENTS, 1, parentsTable); }

Target:
private void displayParents(final List<PatchSetInfo.ParentInfo> parents) { if (parents.size() == 0) { infoTable.setWidget(R_PARENTS, 1, new InlineLabel(Util.C.initialCommit())); return; } final Grid parentsTable = new Grid(parents.size(), 2); parentsTable.setStyleName(Gerrit.RESOURCES.css().parentsTable()); parentsTable.addStyleName(Gerrit.RESOURCES.css().noborder()); final CellFormatter ptfmt = parentsTable.getCellFormatter(); int row = 0; for (PatchSetInfo.ParentInfo parent : parents) { parentsTable.setWidget(row, 0, new InlineLabel(parent.id.get())); ptfmt.addStyleName(row, 0, Gerrit.RESOURCES.css().noborder()); ptfmt.addStyleName(row, 0, Gerrit.RESOURCES.css().monospace()); parentsTable.setWidget(row, 1, new InlineLabel(Util.cropSubject(parent.shortMessage))); ptfmt.addStyleName(row, 1, Gerrit.RESOURCES.css().noborder()); row++; } infoTable.setWidget(R_PARENTS, 1, parentsTable); }
Source:
private <T, R> R calculateConfirmedVolume(GlusterVolumeEntity volume, Function<BrickProperties, T> field, Function<List<Stream<T>>, R> reduce) { List<BrickProperties> bricks = volume.getBricks().stream() .map(GlusterBrickEntity::getId) .map(b -> brickDao.getById(b)) .filter(Objects::nonNull) .map(GlusterBrickEntity::getBrickProperties) .collect(Collectors.toList()); if (bricks.stream().map(field).anyMatch(Objects::isNull)) { log.info("Volume have non-thin bricks, skipping confirmed free size calculation", volume.getName()); return null; } List<Stream<T>> replicaSets = new ArrayList<>(); switch (volume.getVolumeType()) { case REPLICATE: case DISTRIBUTED_REPLICATE: int replicaSize = bricks.size()/volume.getReplicaCount(); while (!bricks.isEmpty()) { int replicaCounter = 0; List<BrickProperties> set = new ArrayList<>(); while(replicaCounter < replicaSize) { set.add(bricks.get(0)); bricks.remove(0); replicaCounter++; } replicaSets.add(set.stream().map(field)); } break; default: replicaSets = Collections.singletonList(bricks.stream().map(field)); break; } return reduce.apply(replicaSets); }

Target:
private <T, R> R calculateConfirmedVolume(GlusterVolumeEntity volume, Function<BrickProperties, T> field, Function<List<Stream<T>>, R> reduce) { List<BrickProperties> bricks = volume.getBricks().stream() .map(GlusterBrickEntity::getId) .map(b -> brickDao.getById(b)) .filter(Objects::nonNull) .map(GlusterBrickEntity::getBrickProperties) .collect(Collectors.toList()); if (bricks.stream().map(field).anyMatch(Objects::isNull)) { log.info("Volume have non-thin bricks, skipping confirmed free size calculation", volume.getName()); return null; } List<Stream<T>> replicaSets = new ArrayList<>(); switch (volume.getVolumeType()) { case REPLICATE: case DISTRIBUTED_REPLICATE: while (!bricks.isEmpty()) { int replicaCounter = 0; List<BrickProperties> set = new ArrayList<>(); while(replicaCounter < volume.getReplicaCount() && !bricks.isEmpty()) { set.add(bricks.get(0)); bricks.remove(0); replicaCounter++; } replicaSets.add(set.stream().map(field)); } break; default: replicaSets = Collections.singletonList(bricks.stream().map(field)); break; } return reduce.apply(replicaSets); }
Source:
public String unpackString() throws IOException { int strLen = unpackRawStringHeader(); if(strLen > 0) { if(strLen > config.getMaxUnpackStringSize()) { throw new MessageSizeException(String.format("cannot unpack a String of size larger than %,d: %,d", config.getMaxUnpackStringSize(), strLen), strLen); } prepareDecoder(); assert(decoder != null); decoder.reset(); try { int cursor = 0; decodeBuffer.clear(); StringBuilder sb = new StringBuilder(); while(cursor < strLen) { if(!ensureBuffer()) throw new EOFException(); int readLen = Math.min(buffer.size() - position, strLen-cursor); ByteBuffer bb = buffer.toByteBuffer(position, readLen); while(bb.hasRemaining()) { boolean endOfInput = (cursor + readLen) >= strLen; CoderResult cr = decoder.decode(bb, decodeBuffer, endOfInput); if(endOfInput && cr.isUnderflow()) cr = decoder.flush(decodeBuffer); if(cr.isOverflow()) { readLen = bb.position() - bb.remaining(); } if(cr.isError()) { if(cr.isMalformed() && config.getActionOnMalFormedInput() == CodingErrorAction.REPORT) { cr.throwException(); } else if(cr.isUnmappable() && config.getActionOnUnmappableCharacter() == CodingErrorAction.REPORT) { cr.throwException(); } } decodeBuffer.flip(); sb.append(decodeBuffer); decodeBuffer.clear(); cursor += readLen; consume(readLen); } } return sb.toString(); } catch(CharacterCodingException e) { throw new MessageStringCodingException(e); } } else return EMPTY_STRING; }

Target:
public String unpackString() throws IOException { int strLen = unpackRawStringHeader(); if(strLen > 0) { if(strLen > config.getMaxUnpackStringSize()) { throw new MessageSizeException(String.format("cannot unpack a String of size larger than %,d: %,d", config.getMaxUnpackStringSize(), strLen), strLen); } prepareDecoder(); assert(decoder != null); decoder.reset(); try { int cursor = 0; decodeBuffer.clear(); StringBuilder sb = new StringBuilder(); while(cursor < strLen) { if(!ensureBuffer()) throw new EOFException(); int readLen = Math.min(buffer.size() - position, strLen-cursor); ByteBuffer bb = buffer.toByteBuffer(position, readLen); while(bb.hasRemaining()) { boolean endOfInput = (cursor + readLen) >= strLen; CoderResult cr = decoder.decode(bb, decodeBuffer, endOfInput); if(endOfInput && cr.isUnderflow()) cr = decoder.flush(decodeBuffer); if(cr.isOverflow()) { readLen = bb.limit() - bb.remaining(); decoder.reset(); } if(cr.isError()) { if((cr.isMalformed() && config.getActionOnMalFormedInput() == CodingErrorAction.REPORT) || (cr.isUnmappable() && config.getActionOnUnmappableCharacter() == CodingErrorAction.REPORT)) { cr.throwException(); } } decodeBuffer.flip(); sb.append(decodeBuffer); decodeBuffer.clear(); cursor += readLen; consume(readLen); } } return sb.toString(); } catch(CharacterCodingException e) { throw new MessageStringCodingException(e); } } else return EMPTY_STRING; }
Source:
private void checkInputSize(byte[] bytes) { if (bytes.length > runtimeOptions.getUploadSize()) { logger.debug("Total size is greater than the allowed size {}", bytes.length, runtimeOptions.getUploadSize()); throw new WebApplicationException("Upload size is greater than the allowed size.", Response.Status.BAD_REQUEST); } }

Target:
private void checkInputSize(byte[] bytes) { if (bytes.length > runtimeOptions.getUploadSize()) { logger.debug("Total size is greater than the allowed size {}", bytes.length, runtimeOptions.getUploadSize()); throw new WebApplicationException("Upload size is greater than the allowed size: " + runtimeOptions.getUploadSize(), Response.Status.BAD_REQUEST); } }
Source:
GdkRGBA gdk_color_to_rgba (GdkColor color) { GdkRGBA rgba = null; if (color != null) { rgba = new GdkRGBA (); rgba = display.toGdkRGBA (color); } return rgba; }

Target:
GdkRGBA gdk_color_to_rgba (GdkColor color) { GdkRGBA rgba = null; if (color != null) { rgba = display.toGdkRGBA (color); } return rgba; }