auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean validateImages() { return ImagesHandler.PerformImagesChecks(getReturnValue().getCanDoActionMessages(), getVm().getStoragePoolId(), Guid.Empty, hasImages(), hasImages(), hasImages(), hasImages(), true, true, getDiskDao().getAllForVm(getVmId())); }

Target:
protected boolean validateImages() { return ImagesHandler.PerformImagesChecks(getReturnValue().getCanDoActionMessages(), getVm().getStoragePoolId(), Guid.Empty, true, true, true, true, true, true, imagesToCheck); }
Source:
private void runPatchMetadataTests(EPerson asUser, int expectedStatus) throws Exception { context.turnOffAuthorisationSystem(); Site site = SiteBuilder.createSite(context).build(); String token = getAuthToken(asUser.getEmail(), password); new MetadataPatchSuite().runWith(getClient(token), "/api/core/sites/" + site.getID(), expectedStatus); }

Target:
private void runPatchMetadataTests(EPerson asUser, int expectedStatus) throws Exception { context.turnOffAuthorisationSystem(); Site site = SiteBuilder.createSite(context).build(); context.restoreAuthSystemState(); String token = getAuthToken(asUser.getEmail(), password); new MetadataPatchSuite().runWith(getClient(token), "/api/core/sites/" + site.getID(), expectedStatus); }
Source:
public void testSuccessfulSaslAuthenticationWithCredentialStore() throws Exception { for (Provider provider : providers) { Security.insertProviderAt(provider, 1); } cleanCredentialStore(); CredentialStoreBuilder.get().setKeyStoreFile(BASE_STORE_DIRECTORY + "/mycredstore.cs") .setKeyStoreType("JCEKS") .setKeyStorePassword("StorePassword") .addPassword(USERNAME, PASSWORD) .build(); for (Provider provider : providers) { Security.removeProvider(provider.getName()); } SaslServer server = new SaslServerBuilder(PlainSaslServerFactory.class, PLAIN) .setProviderSupplier(ELYTRON_PROVIDER_SUPPLIER) .setUserName(USERNAME) .setPassword(PASSWORD.toCharArray()) .build(); AuthenticationContext context = AuthenticationContext.getContextManager().get(); AuthenticationContextConfigurationClient contextConfigurationClient = AccessController.doPrivileged(AuthenticationContextConfigurationClient.ACTION); SaslClient client = contextConfigurationClient.createSaslClient(new URI(CREDENTIAL_CONFIG_FILE), context.authRules.getConfiguration(), Arrays.asList(new String[]{PLAIN})); assertTrue(client.hasInitialResponse()); byte[] message = client.evaluateChallenge(new byte[0]); assertEquals("\0"+USERNAME+"\0"+PASSWORD,new String(message, StandardCharsets.UTF_8)); server.evaluateResponse(message); assertTrue(server.isComplete()); assertTrue(client.isComplete()); assertEquals(USERNAME, server.getAuthorizationID()); }

Target:
public void testSuccessfulSaslAuthenticationWithCredentialStore() throws Exception { SaslServer server = new SaslServerBuilder(PlainSaslServerFactory.class, PLAIN) .setProviderSupplier(() -> providers) .setUserName(USERNAME) .setPassword(PASSWORD.toCharArray()) .build(); AuthenticationContext context = AuthenticationContext.getContextManager().get(); AuthenticationContextConfigurationClient contextConfigurationClient = AccessController.doPrivileged(AuthenticationContextConfigurationClient.ACTION); SaslClient client = contextConfigurationClient.createSaslClient(new URI(CREDENTIAL_CONFIG_FILE), context.authRules.getConfiguration(), Arrays.asList(new String[]{PLAIN})); assertTrue(client.hasInitialResponse()); byte[] message = client.evaluateChallenge(new byte[0]); assertEquals("\0"+USERNAME+"\0"+PASSWORD,new String(message, StandardCharsets.UTF_8)); server.evaluateResponse(message); assertTrue(server.isComplete()); assertTrue(client.isComplete()); assertEquals(USERNAME, server.getAuthorizationID()); }
Source:
public Injector init() throws Exception { Map<String, SecureStoreData> secureStores = getAllSecureStores(); Set<String> secureStoreNames = Sets.newTreeSet(secureStores.keySet()); if (secureStoreNames.isEmpty()) { return createInjectorWithCustomSecureStore(DefaultSecureStore.class); } secureStoreNames.add(DefaultSecureStore.NAME); String currentProvider = getCurrentSecureStoreName(); String secureStoreName = ui.readString(currentProvider, secureStoreNames, "Secure store"); if (DefaultSecureStore.NAME.equals(secureStoreName)) { if (!DefaultSecureStore.NAME.equals(currentProvider)) { flags.cfg.unset("gerrit", null, "secureStore"); } return createInjectorWithCustomSecureStore(DefaultSecureStore.class); } SecureStoreData selectedPlugin = secureStores.get(secureStoreName); File installedPlugin = installPlugin(selectedPlugin, ui, site); flags.cfg.setString("gerrit", null, "secureStore", secureStoreName); Class<? extends SecureStore> storeClass = selectedPlugin.load(installedPlugin); return createInjectorWithCustomSecureStore(storeClass); }

Target:
public Injector init() throws Exception { Map<String, SecureStoreData> secureStores = getAllSecureStores(); Set<String> secureStoreNames = Sets.newTreeSet(secureStores.keySet()); if (secureStoreNames.isEmpty()) { return createInjectorWithDefaultSecureStore(); } secureStoreNames.add(DefaultSecureStore.NAME); String currentProvider = getCurrentSecureStoreName(); String secureStoreName = ui.readString(currentProvider, secureStoreNames, "Secure store"); if (DefaultSecureStore.NAME.equals(secureStoreName)) { if (!DefaultSecureStore.NAME.equals(currentProvider)) { flags.cfg.unset("gerrit", null, SECURE_STORE_CONFIG_NAME); } return createInjectorWithDefaultSecureStore(); } SecureStoreData selectedPlugin = secureStores.get(secureStoreName); File installedPlugin = installPlugin(selectedPlugin, ui, site); flags.cfg.setString("gerrit", null, SECURE_STORE_CONFIG_NAME, secureStoreName); Class<? extends SecureStore> storeClass = selectedPlugin.load(installedPlugin); return createInjectorWithCustomSecureStore(storeClass); }
Source:
private boolean executeSshPowerDown(String version) { boolean ret = false; try ( final EngineSSHClient sshClient = new EngineSSHClient(); final ByteArrayOutputStream cmdOut = new ByteArrayOutputStream(); final ByteArrayOutputStream cmdErr = new ByteArrayOutputStream() ) { try { log.info("Opening SSH power down session on host {}", getVds().getHostName()); sshClient.setVds(getVds()); sshClient.useDefaultKeyPair(); sshClient.connect(); sshClient.authenticate(); log.info("Executing SSH power down command on host {}", getVds().getHostName()); sshClient.executeCommand( Config.<String> getValue(ConfigValues.SshVdsPowerdownCommand, version), null, cmdOut, cmdErr ); ret = true; } catch (Exception ex) { log.error("SSH power down command failed on host '{}': {}\nStdout: {}\nStderr: {}", getVds().getHostName(), ex.getMessage(), cmdOut, cmdErr); log.debug("Exception", ex); } } catch(IOException e) { log.error("IOException"); log.debug("Exception", e); } return ret; }

Target:
private boolean executeSshPowerDown(String version) { boolean ret = false; try ( final EngineSSHClient sshClient = new EngineSSHClient(); final ByteArrayOutputStream cmdOut = new ByteArrayOutputStream(); final ByteArrayOutputStream cmdErr = new ByteArrayOutputStream() ) { try { log.info("Opening SSH power down session on host {}", getVds().getHostName()); sshClient.setVds(getVds()); sshClient.useDefaultKeyPair(); sshClient.connect(); sshClient.authenticate(); log.info("Executing SSH power down command on host {}", getVds().getHostName()); sshClient.executeCommand( Config.<String> getValue(ConfigValues.SshVdsPowerdownCommand, version), null, cmdOut, cmdErr ); ret = true; } catch (Exception ex) { log.error("SSH power down command failed on host '{}': {}\nStdout: {}\nStderr: {}", getVds().getHostName(), ex.getMessage(), cmdOut, cmdErr); log.debug("Exception", ex); } } catch(IOException e) { log.error("Error opening SSH connection to '{}': {}", getVds().getHostName(), e.getMessage()); log.debug("Exception", e); } return ret; }
Source:
public int getSpinnerId() { return R.id.brick_ask_spinner; }

Target:
protected int getSpinnerId() { return R.id.brick_ask_spinner; }
Source:
@Override public boolean matches(RelOptRuleCall call) { LogicalJoin logicalJoin = call.rel(0); return !F.isEmpty(logicalJoin.analyzeCondition().pairs()); }

Target:
@Override public boolean matches(RelOptRuleCall call) { LogicalJoin logicalJoin = call.rel(0); return !F.isEmpty(logicalJoin.analyzeCondition().pairs()) && logicalJoin.analyzeCondition().isEqui(); }
Source:
public int refresh(IProgressMonitor monitor) { int status = -1; List<? extends ServiceMessage> messages = null; try { HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); if (lastModified != null && lastModified.length() > 0) { try { connection.setIfModifiedSince(Long.parseLong(lastModified)); } catch (NumberFormatException e) { } } if (eTag != null && eTag.length() > 0) { connection.setRequestProperty("If-None-Match", eTag); } try { connection.connect(); status = connection.getResponseCode(); if (status == HttpURLConnection.HTTP_OK && !monitor.isCanceled()) { lastModified = connection.getHeaderField("Last-Modified"); eTag = connection.getHeaderField("ETag"); InputStream in = connection.getInputStream(); try { messages = readMessages(in, monitor); } finally { in.close(); } } else if (status == HttpURLConnection.HTTP_NOT_FOUND) { } else if (status == HttpURLConnection.HTTP_NOT_MODIFIED) { } else { logStatus(new Status(IStatus.WARNING, INotificationsFeed.ID_PLUGIN, "Http error retrieving service message: " + connection.getResponseMessage())); } } finally { connection.disconnect(); } } catch (Exception e) { logStatus(new Status(IStatus.WARNING, INotificationsFeed.ID_PLUGIN, "Http error retrieving service message.", e)); } if (messages != null && messages.size() > 0) { notifyListeners(messages); } return status; }

Target:
public int refresh(IProgressMonitor monitor) { int status = -1; List<? extends ServiceMessage> messages = null; try { HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); if (lastModified != null && lastModified.length() > 0) { try { connection.setIfModifiedSince(Long.parseLong(lastModified)); } catch (NumberFormatException e) { } } if (eTag != null && eTag.length() > 0) { connection.setRequestProperty("If-None-Match", eTag); } try { connection.connect(); status = connection.getResponseCode(); if (status == HttpURLConnection.HTTP_OK && !monitor.isCanceled()) { lastModified = connection.getHeaderField("Last-Modified"); eTag = connection.getHeaderField("ETag"); InputStream in = new BufferedInputStream(connection.getInputStream()); try { messages = readMessages(in, monitor); } finally { in.close(); } } else if (status == HttpURLConnection.HTTP_NOT_FOUND) { } else if (status == HttpURLConnection.HTTP_NOT_MODIFIED) { } else { logStatus(new Status(IStatus.WARNING, INotificationsFeed.ID_PLUGIN, "Http error retrieving service message: " + connection.getResponseMessage())); } } finally { connection.disconnect(); } } catch (Exception e) { logStatus(new Status(IStatus.WARNING, INotificationsFeed.ID_PLUGIN, "Http error retrieving service message.", e)); } if (messages != null && messages.size() > 0) { notifyListeners(messages); } return status; }
Source:
public void testSshProtoWithEmailUserPassAndPort() throws Exception { final String str = "ssh://user.name@example.com:pass@example.com:33/some/p ath"; URIish u = new URIish(str); assertEquals("ssh", u.getScheme()); assertTrue(u.isRemote()); assertEquals("/some/p ath", u.getRawPath()); assertEquals("/some/p ath", u.getPath()); assertEquals("example.com", u.getHost()); assertEquals("user.name@example.com", u.getUser()); assertEquals("pass", u.getPass()); assertEquals(33, u.getPort()); assertEquals("ssh://user.name%40example.com:pass@example.com:33/some/p ath", u.toPrivateString()); assertEquals("ssh://user.name%40example.com:pass@example.com:33/some/p%20ath", u.toPrivateASCIIString()); assertEquals(u.setPass(null).toPrivateString(), u.toString()); assertEquals(u.setPass(null).toPrivateASCIIString(), u.toASCIIString()); assertEquals(u, new URIish(str)); }

Target:
public void testSshProtoWithEmailUserPassAndPort() throws Exception { final String str = "ssh://user.name@example.com:pass@word@example.com:33/some/p ath"; URIish u = new URIish(str); assertEquals("ssh", u.getScheme()); assertTrue(u.isRemote()); assertEquals("/some/p ath", u.getRawPath()); assertEquals("/some/p ath", u.getPath()); assertEquals("example.com", u.getHost()); assertEquals("user.name@example.com", u.getUser()); assertEquals("pass@word", u.getPass()); assertEquals(33, u.getPort()); assertEquals("ssh://user.name%40example.com:pass%40word@example.com:33/some/p ath", u.toPrivateString()); assertEquals("ssh://user.name%40example.com:pass%40word@example.com:33/some/p%20ath", u.toPrivateASCIIString()); assertEquals(u.setPass(null).toPrivateString(), u.toString()); assertEquals(u.setPass(null).toPrivateASCIIString(), u.toASCIIString()); assertEquals(u, new URIish(str)); }
Source:
public <T> T trace(String component, String operation, Callable<T> callable) throws RuntimeException { try { startNewSpan(component, operation); return callable.call(); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } finally { finishSpan(); } }

Target:
public <T> T trace(String component, String operation, Callable<T> callable) { try { startNewSpan(component, operation); return callable.call(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } finally { finishSpan(); } }
Source:
public void fetchAllExternalIdsWithNonUniformPageSizes() throws Exception { final Function<List<Category>, List<String>> externalIdCallBack = categories -> categories.stream() .map(Category::getExternalId) .collect(toList()); final CompletionStage<List<List<String>>> categoryPagesStage = QueryExecutionUtils .queryAll(client(), CategoryQuery.of(), externalIdCallBack, 4); final List<List<String>> categoryPages = SphereClientUtils .blockingWait(categoryPagesStage, Duration.ofMinutes(5)); assertThat(categoryPages).hasSize(4); final List<String> externalIds = categoryPages.stream() .flatMap(List::stream) .collect(toList()); assertThat(externalIds).hasSize(15); IntStream.range(0, externalIds.size()).forEach(index -> assertThat(externalIds).contains(index + "")); }

Target:
public void fetchAllExternalIdsWithNonUniformPageSizes() throws Exception { final CompletionStage<List<String>> categoriesStage = QueryExecutionUtils .queryAll(client(), CategoryQuery.of(), Category::getExternalId, 4); final List<String> externalIds = SphereClientUtils .blockingWait(categoriesStage, Duration.ofMinutes(1)); assertThat(externalIds).hasSize(15); IntStream.range(0, externalIds.size()).forEach(index -> assertThat(externalIds).contains(index + "")); }
Source:
private <T> T getJNDIObject(String jndiName, boolean noCaching) { if (noCaching || noCaching) { return this.lookup(jndiName); } else { return (T) jndiObjectCache.get().computeIfAbsent(jndiName, this::lookup); } }

Target:
private <T> T getJNDIObject(String jndiName, boolean noCaching) { if (noCaching || this.noCaching) { return this.lookup(jndiName); } else { return (T) jndiObjectCache.get().computeIfAbsent(jndiName, this::lookup); } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_group_settings); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setTitle("Group Settings"); getSupportActionBar().setDisplayShowTitleEnabled(true); List<String> itemList = new ArrayList<>(Settings.values().length); itemList.add(Settings.NAME.ordinal(), getResources().getString(R.string.changeGroupName)); itemList.add(Settings.TYPE.ordinal(), getResources().getString(R.string.changeGroupType)); itemList.add(Settings.IMAGE.ordinal(), getResources().getString(R.string.changeGroupImage)); itemList.add(Settings.USERS.ordinal(), getResources().getString(R.string.addUsers)); ListView listView = (ListView) findViewById(R.id.listViewSettings); ListAdapterSettings arrayAdapter = new ListAdapterSettings(getApplicationContext(), R.layout.group_settings_layout, itemList); listView.setAdapter(arrayAdapter); listView.setOnItemClickListener(new CustomListener()); listView.setItemsCanFocus(true); mGroup = YieldsApplication.getGroup(); mUser = YieldsApplication.getUser(); Objects.requireNonNull(mGroup, "The group in YieldsApplication cannot be null when this activity is created"); Objects.requireNonNull(mUser, "The user in YieldsApplication cannot be null when this activity is created"); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_group_settings); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setTitle("Group Settings"); getSupportActionBar().setDisplayShowTitleEnabled(true); List<String> itemList = new ArrayList<>(Settings.values().length); itemList.add(Settings.NAME.ordinal(), getResources().getString(R.string.changeGroupName)); itemList.add(Settings.TYPE.ordinal(), getResources().getString(R.string.changeGroupType)); itemList.add(Settings.IMAGE.ordinal(), getResources().getString(R.string.changeGroupImage)); itemList.add(Settings.USERS.ordinal(), getResources().getString(R.string.addUsers)); ListView listView = (ListView) findViewById(R.id.listViewSettings); ListAdapterSettings arrayAdapter = new ListAdapterSettings(getApplicationContext(), R.layout.group_settings_layout, itemList); listView.setAdapter(arrayAdapter); listView.setOnItemClickListener(new CustomListener()); listView.setItemsCanFocus(true); mGroup = YieldsApplication.getGroup(); mUser = YieldsApplication.getUser(); assert mGroup != null : "The group in YieldsApplication cannot be null when this activity is created" ; assert mUser != null : "The user in YieldsApplication cannot be null when this activity is created" ; }
Source:
public void listen(EntriesAddedEvent entriesAddedEvent) { List<BibEntry> entries = entriesAddedEvent.getBibEntries(); for (BibEntry entry : entries) { Optional<String> citekey = entry.getCiteKeyOptional(); if (citekey.isPresent()) { addKeyToSet(citekey.get()); } } }

Target:
public void listen(EntriesAddedEvent entriesAddedEvent) { List<BibEntry> entries = entriesAddedEvent.getBibEntries(); entries.stream().map(BibEntry::getCiteKeyOptional).flatMap(Optional::stream).forEach(citeKey -> addKeyToSet(citeKey)); }
Source:
public void testTimeFieldSpecConstructor() { String incomingName = "incoming"; TimeUnit incomingTimeUnit = TimeUnit.HOURS; int incomingTimeUnitSize = 1; TimeGranularitySpec incomingTimeGranularitySpec = new TimeGranularitySpec(LONG, incomingTimeUnitSize, incomingTimeUnit, incomingName); String outgoingName = "outgoing"; TimeUnit outgoingTimeUnit = TimeUnit.DAYS; int outgoingTimeUnitSize = 1; TimeGranularitySpec outgoingTimeGranularitySpec = new TimeGranularitySpec(INT, outgoingTimeUnitSize, outgoingTimeUnit, outgoingName); int defaultNullValue = 17050; TimeFieldSpec timeFieldSpec9 = new TimeFieldSpec(incomingTimeGranularitySpec); TimeFieldSpec timeFieldSpec10 = new TimeFieldSpec(incomingTimeGranularitySpec, defaultNullValue); TimeFieldSpec timeFieldSpec11 = new TimeFieldSpec(incomingTimeGranularitySpec, outgoingTimeGranularitySpec); TimeFieldSpec timeFieldSpec12 = new TimeFieldSpec(incomingTimeGranularitySpec, outgoingTimeGranularitySpec, defaultNullValue); Assert.assertNotEquals(timeFieldSpec10, timeFieldSpec9); Assert.assertNotEquals(timeFieldSpec12, timeFieldSpec11); timeFieldSpec9.setDefaultNullValue(defaultNullValue); timeFieldSpec11.setDefaultNullValue(defaultNullValue); Assert.assertEquals(timeFieldSpec9, timeFieldSpec10); Assert.assertEquals(timeFieldSpec11, timeFieldSpec12); }

Target:
public void testTimeFieldSpecConstructor() { String incomingName = "incoming"; TimeUnit incomingTimeUnit = TimeUnit.HOURS; int incomingTimeUnitSize = 1; TimeGranularitySpec incomingTimeGranularitySpec = new TimeGranularitySpec(LONG, incomingTimeUnitSize, incomingTimeUnit, incomingName); String outgoingName = "outgoing"; TimeUnit outgoingTimeUnit = TimeUnit.DAYS; int outgoingTimeUnitSize = 1; TimeGranularitySpec outgoingTimeGranularitySpec = new TimeGranularitySpec(INT, outgoingTimeUnitSize, outgoingTimeUnit, outgoingName); TimeFieldSpec timeFieldSpec1 = new TimeFieldSpec(incomingTimeGranularitySpec); TimeFieldSpec timeFieldSpec2 = new TimeFieldSpec(incomingTimeGranularitySpec, outgoingTimeGranularitySpec); Assert.assertNotEquals(timeFieldSpec1, timeFieldSpec2); timeFieldSpec1.setOutgoingGranularitySpec(outgoingTimeGranularitySpec); Assert.assertEquals(timeFieldSpec1, timeFieldSpec2); }
Source:
public static String getSpatialPartitioningTableName(Session session) { return session.getSystemProperty(SPATIAL_PARTITIONING_TABLE_NAME, String.class); }

Target:
public static Optional<String> getSpatialPartitioningTableName(Session session) { return Optional.ofNullable(session.getSystemProperty(SPATIAL_PARTITIONING_TABLE_NAME, String.class)); }
Source:
@Override protected void onActivityResult(int requestCode, int resultCode, Intent i) { try { trace(this, "onActivityResult() :: requestCode=%s, resultCode=%s", requestCode, resultCode); if((requestCode & NON_SIMPRINTS_FLAGS) == NON_SIMPRINTS_FLAGS) { switch(requestCode) { case GRAB_PHOTO: photoGrabber.process(requestCode, resultCode, i); return; case GRAB_MRDT_PHOTO: String js = mrdt.process(requestCode, resultCode, i); trace(this, "Execing JS: %s", js); evaluateJavascript(js); return; default: trace(this, "onActivityResult() :: no handling for requestCode=%s", requestCode); } } else if(requestCode == DISCLOSURE_LOCATION_PERMISSION_REQUEST) { if (resultCode == RESULT_OK) { ActivityCompat.requestPermissions( this, LOCATION_PERMISSIONS, ACCESS_FINE_LOCATION_PERMISSION_REQUEST); } else if (resultCode == RESULT_CANCELED) { try { this.locationRequestResolved(); settings.setUserDeniedGeolocation(); } catch (SettingsException e) { error(e, "Error recording negative to access location"); } catch (Exception e) { error(e, "Unknown Error recording negative to access location"); } } } else { String js = simprints.process(requestCode, i); trace(this, "Execing JS: %s", js); evaluateJavascript(js); } } catch(Exception ex) { String action = i == null ? null : i.getAction(); warn(ex, "Problem handling intent %s (%s) with requestCode=%s & resultCode=%s", i, action, requestCode, resultCode); } }

Target:
@Override protected void onActivityResult(int requestCode, int resultCode, Intent i) { try { trace(this, "onActivityResult() :: requestCode=%s, resultCode=%s", requestCodeToString(requestCode), resultCode); if((requestCode & NON_SIMPRINTS_FLAGS) == NON_SIMPRINTS_FLAGS) { switch(requestCode) { case GRAB_PHOTO: photoGrabber.process(requestCode, resultCode, i); return; case GRAB_MRDT_PHOTO: String js = mrdt.process(requestCode, resultCode, i); trace(this, "Execing JS: %s", js); evaluateJavascript(js); return; default: trace(this, "onActivityResult() :: no handling for requestCode=%s", requestCodeToString(requestCode)); } } else if(requestCode == DISCLOSURE_LOCATION_PERMISSION_REQUEST) { if (resultCode == RESULT_OK) { ActivityCompat.requestPermissions( this, LOCATION_PERMISSIONS, ACCESS_FINE_LOCATION_PERMISSION_REQUEST); } else if (resultCode == RESULT_CANCELED) { try { this.locationRequestResolved(); settings.setUserDeniedGeolocation(); } catch (SettingsException e) { error(e, "Error recording negative to access location"); } } } else { String js = simprints.process(requestCode, i); trace(this, "Execing JS: %s", js); evaluateJavascript(js); } } catch(Exception ex) { String action = i == null ? null : i.getAction(); warn(ex, "Problem handling intent %s (%s) with requestCode=%s & resultCode=%s", i, action, requestCodeToString(requestCode), resultCode); } }
Source:
public List<SelectableData> getBagItems() { final Stream<SelectableData> defaultItemStream = Stream.of(bagItemDefaultItem()); final Stream<SelectableData> bla = IntStream.range(2, numItems).mapToObj(this::bagItemToSelectableItem); return Stream.concat(defaultItemStream, bla).collect(toList()); }

Target:
public List<SelectableData> getBagItems() { return bagItems; }
Source:
protected Long getNextBackoff() { if (exponentialRetryAlgorithm == null) { exponentialRetryAlgorithm = createRetryAlgorithm(); } if (currentBackoff == null) { currentBackoff = exponentialRetryAlgorithm.createFirstAttempt(); } else { currentBackoff = exponentialRetryAlgorithm.createNextAttempt(currentBackoff); } if (!exponentialRetryAlgorithm.shouldRetry(currentBackoff)) { return null; } else { return currentBackoff.getRetryDelay().toMillis(); } }

Target:
protected Long getNextBackoff() { if (currentBackoff == null) { currentBackoff = exponentialRetryAlgorithm.createFirstAttempt(); } currentBackoff = exponentialRetryAlgorithm.createNextAttempt(currentBackoff); if (!exponentialRetryAlgorithm.shouldRetry(currentBackoff)) { long timeLeftNs = currentBackoff.getGlobalSettings().getTotalTimeout().toNanos() - (clock.nanoTime() - currentBackoff.getFirstAttemptStartTimeNanos()); long timeLeftMs = TimeUnit.NANOSECONDS.toMillis(timeLeftNs); if (timeLeftMs > currentBackoff.getGlobalSettings().getInitialRetryDelay().toMillis()) { return timeLeftMs; } else { return null; } } else { return currentBackoff.getRetryDelay().toMillis(); } }
Source:
private Ehcache<String, String> getEhcache(final CacheLoaderWriter<String, String> cacheLoaderWriter) { ExecutorService orderedExecutor = Executors.newSingleThreadExecutor(); ExecutorService unorderedExecutor = Executors.newCachedThreadPool(); cacheEventNotificationService = new CacheEventNotificationServiceImpl<String, String>(orderedExecutor, unorderedExecutor); final Ehcache<String, String> ehcache = new Ehcache<String, String>(CACHE_CONFIGURATION, this.store, cacheLoaderWriter,cacheEventNotificationService,null, LoggerFactory.getLogger(Ehcache.class + "-" + "EhcacheBasicPutEventsTest")); ehcache.init(); assertThat("cache not initialized", ehcache.getStatus(), is(Status.AVAILABLE)); this.spiedResilienceStrategy = this.setResilienceStrategySpy(ehcache); EhcacheBasicTestUtil.registerCacheEventListener(ehcache, testCacheEventListener); return ehcache; }

Target:
private Ehcache<String, String> getEhcache(final CacheLoaderWriter<String, String> cacheLoaderWriter) { ExecutorService orderedExecutor = Executors.newSingleThreadExecutor(); ExecutorService unorderedExecutor = Executors.newCachedThreadPool(); cacheEventNotificationService = new CacheEventNotificationServiceImpl<String, String>(orderedExecutor, unorderedExecutor); final Ehcache<String, String> ehcache = new Ehcache<String, String>(CACHE_CONFIGURATION, this.store, cacheLoaderWriter,cacheEventNotificationService,null, LoggerFactory.getLogger(Ehcache.class + "-" + "EhcacheBasicPutEventsTest")); ehcache.init(); assertThat("cache not initialized", ehcache.getStatus(), is(Status.AVAILABLE)); registerCacheEventListener(ehcache, cacheEventListener); return ehcache; }
Source:
public RefUpdate.Result createEdit(Change change, PatchSet ps) throws AuthException, IOException, ResourceConflictException { if (!currentUser.get().isIdentifiedUser()) { throw new AuthException("Authentication required"); } IdentifiedUser me = (IdentifiedUser) currentUser.get(); Repository repo = gitManager.openRepository(change.getProject()); String refName = editRefName(me.getAccountId(), change.getId()); if (repo.getRefDatabase().getRef(refName) != null) { throw new ResourceConflictException("edit already exists"); } try { RevWalk rw = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter(); try { RevCommit base = rw.parseCommit(ObjectId.fromString( ps.getRevision().get())); return update(repo, me, refName, rw, base, base, ObjectId.zeroId(), createCommit(me, inserter, base, base, base.getTree())); } finally { rw.release(); inserter.release(); } } finally { repo.close(); } }

Target:
public RefUpdate.Result createEdit(Change change, PatchSet ps) throws AuthException, IOException, ResourceConflictException { if (!currentUser.get().isIdentifiedUser()) { throw new AuthException("Authentication required"); } IdentifiedUser me = (IdentifiedUser) currentUser.get(); Repository repo = gitManager.openRepository(change.getProject()); String refName = editRefName(me.getAccountId(), change.getId()); try { if (repo.getRefDatabase().getRef(refName) != null) { throw new ResourceConflictException("edit already exists"); } RevWalk rw = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter(); try { RevCommit base = rw.parseCommit(ObjectId.fromString( ps.getRevision().get())); ObjectId commit = createCommit(me, inserter, base, base, base.getTree()); inserter.flush(); return update(repo, me, refName, rw, base, ObjectId.zeroId(), commit); } finally { rw.release(); inserter.release(); } } finally { repo.close(); } }
Source:
public void login(final Credentials credentials, final IAuthenticationManager.Callback<UserAccount> callback) { if (credentials == null || credentials.isDemoCredentials()) { localLogin(credentials, callback); } else { remoteLogin(credentials, callback); } }

Target:
public void login(final Credentials credentials, final IAuthenticationManager.Callback<UserAccount> callback) { if (credentials.isDemoCredentials()) { localLogin(credentials, callback); } else { remoteLogin(credentials, callback); } }
Source:
void run() { if (fused) { return; } Observer<? super Long> actual = this.actual; long e = end; for (long i = index; i != e && get() == 0; i++) { actual.onNext((long)i); } if (get() == 0) { lazySet(1); actual.onComplete(); } }

Target:
void run() { if (fused) { return; } Observer<? super Long> actual = this.actual; long e = end; for (long i = index; i != e && get() == 0; i++) { actual.onNext(i); } if (get() == 0) { lazySet(1); actual.onComplete(); } }
Source:
public List<EngineMessage> validate(VmInit vmInit) { if (vmInit != null) { if (vmInit.getCloudInitNetworkProtocol() == null) { vmInit.setCloudInitNetworkProtocol(OPENSTACK_METADATA); } switch (vmInit.getCloudInitNetworkProtocol()) { case OPENSTACK_METADATA: return new VmInitToOpenStackMetadataAdapter().validate(vmInit); case ENI: } } return Collections.emptyList(); }

Target:
public List<EngineMessage> validate(VmInit vmInit) { if (vmInit != null) { setDefaultNetworkProtocolIfNeeded(vmInit); switch (vmInit.getCloudInitNetworkProtocol()) { case OPENSTACK_METADATA: return new VmInitToOpenStackMetadataAdapter().validate(vmInit); case ENI: } } return Collections.emptyList(); }
Source:
private void addMetaToOutputJackLib(Meta meta, OutputJackLibrary ojl) { InputVFile inputFile = meta.getVFile(); VPath path = meta.getPath(); OutputVFile outputFile = ojl.createFile(FileType.JPP, path); InputStream is = inputFile.openRead(); OutputStream os = outputFile.openWrite(); try { ByteStreamSucker sucker = new ByteStreamSucker(is, os); sucker.suck(); } finally { if (is != null) { is.close(); } if (os != null) { os.close(); } } }

Target:
private void addMetaToOutputJackLib(Meta meta, OutputJackLibrary ojl) { InputVFile inputFile = meta.getVFile(); VPath path = meta.getPath(); OutputVFile outputFile = ojl.createFile(FileType.JPP, path); InputStream is; OutputStream os; try { is = inputFile.openRead(); os = outputFile.openWrite(); ByteStreamSucker sucker = new ByteStreamSucker(is, os, true ); sucker.suck(); } finally { if (is != null) { is.close(); } } }
Source:
private ProxyProfileConfig getProxyProfileForTargetHost(String targetHost) { if (knownProxyConfigMap.containsKey(targetHost)) { return knownProxyConfigMap.get(targetHost); } if (knownDirectHosts.contains(targetHost)) { return null; } boolean defaultProfile = false; for (String key : proxyProfileMap.keySet()) { if (key.equals("*")) { log.debug("Default proxy profile found"); defaultProfile = true; continue; } if (targetHost.matches(key)) { return getProxyProfileConfig(targetHost, key); } } if (defaultProfile) { return getProxyProfileConfig(targetHost, "*"); } return null; }

Target:
private ProxyProfileConfig getProxyProfileForTargetHost(String targetHost) { if (knownProxyConfigMap.containsKey(targetHost)) { return knownProxyConfigMap.get(targetHost); } if (knownDirectHosts.contains(targetHost)) { return null; } boolean defaultProfile = false; for (String key : proxyProfileMap.keySet()) { if ("*".equals(key)) { log.debug("Default proxy profile found"); defaultProfile = true; continue; } if (targetHost.matches(key)) { return getProxyProfileConfig(targetHost, key); } } if (defaultProfile) { return getProxyProfileConfig(targetHost, "*"); } return null; }
Source:
public void controller(FragmentModel model, @FragmentParam(required = true, value = "uuid") String uuid) throws Exception { PersonAttributeType personAttributeType = Context.getPersonService().getPersonAttributeTypeByUuid(uuid); if(personAttributeType.getFormat().contentEquals(Concept.class.getCanonicalName())){ int foreignKey = personAttributeType.getForeignKey(); model.put("foreignKey", foreignKey); model.put("codedPersonAttribute", true); } else{ model.put("codedPersonAttribute", false); } }

Target:
public void controller(FragmentModel model, @FragmentParam(required = true, value = "uuid") String uuid) throws Exception { PersonAttributeType personAttributeType = Context.getPersonService().getPersonAttributeTypeByUuid(uuid); if(personAttributeType.getFormat().equals(Concept.class.getName())){ int foreignKey = personAttributeType.getForeignKey(); model.put("foreignKey", foreignKey); model.put("codedPersonAttribute", true); } else{ model.put("codedPersonAttribute", false); } }
Source:
protected double weight(IntVar v) { double w = 0.; int nbp = v.getNbProps(); for (int i = 0; i < nbp; i++) { Propagator prop = v.getPropagator(i); int pid = prop.getId(); int futVars = pid2arity.get(pid); if (futVars == -1) { futVars = prop.arity(); pid2arity.put(pid, futVars); } if (futVars > 1) { w += q.get(prop) + D; } } return w / v.getDomainSize(); }

Target:
protected double weight(IntVar v) { double w = 0.; int nbp = v.getNbProps(); for (int i = 0; i < nbp; i++) { Propagator prop = v.getPropagator(i); if (futVars(prop) > 1) { w += q.get(prop) + D; } } return w / v.getDomainSize(); }
Source:
private List<String> createList(Class[] classArray) { List<Class> fileNameList = Arrays.asList(classArray); List<String> foo = new ArrayList<>(); for (Class c : fileNameList) { if (c.getName().contains("AST")) { foo.add(c.getName()); } } for (String s1 : foo) { xPathSuggestions.add(s1.replace("AST", "").replace("net.sourceforge.pmd" + ".lang." + language + ".ast" + ".", "")); } return xPathSuggestions; }

Target:
private List<String> createList(Class[] classArray) { return Arrays.asList(classArray).stream() .filter(files -> files.getSimpleName().startsWith("AST")) .map(m -> m.getSimpleName().substring("AST".length())) .collect(Collectors.toList()); }
Source:
public Summary[] getSummaryImpl() throws DDFException { DataFrame df = (DataFrame) this.getDDF().getRepresentationHandler().get(DataFrame.class); DataFrame summaryDF = df.describe(); Row[] rows = summaryDF.collect(); Summary[] summaries = new Summary[df.columns().length]; List<Column> columns = this.getDDF().getSchema().getColumns(); int colIndex = 0; int i = 1; for(Column column: columns) { if(column.isNumeric()) { long count = Long.valueOf(rows[0].getString(i)); double mean = Double.valueOf(rows[1].getString(i)); double stddev = Double.valueOf(rows[2].getString(i)); double sqdeviation = Math.pow(stddev, 2)*(count - 1); double min = Double.valueOf(rows[3].getString(i)); double max = Double.valueOf(rows[4].getString(i)); String sqlCmd = String.format("select count(*) from %s where `%s` is null", this.getDDF().getTableName(), column.getName()); long naCount = df.sqlContext().sql(sqlCmd).collect()[0].getLong(0); Summary summary = new Summary(count, mean, sqdeviation, naCount, min, max); summaries[colIndex] = summary; i += 1; } else { summaries[colIndex] = null; } colIndex += 1; } return summaries; }

Target:
public Summary[] getSummaryImpl() throws DDFException { DataFrame df = (DataFrame) this.getDDF().getRepresentationHandler().get(DataFrame.class); DataFrame summaryDF = df.describe(); Row[] rows = summaryDF.collect(); Summary[] summaries = new Summary[df.columns().length]; List<Column> columns = this.getDDF().getSchema().getColumns(); int colIndex = 0; int i = 1; for(Column column: columns) { if(column.isNumeric()) { long count = 0L; if(rows[0].isNullAt(i)) { count = 0L; } else { count = Long.valueOf(rows[0].getString(i)); } Double mean = Double.NaN; if(!rows[1].isNullAt(i)) { mean = Double.valueOf(rows[1].getString(i)); } Double sqdeviation = Double.NaN; if(!rows[2].isNullAt(i)) { Double stddev = Double.valueOf(rows[2].getString(i)); sqdeviation = Math.pow(stddev, 2)*(count - 1); } Double min = Double.NaN; if(!rows[3].isNullAt(i)) { min = Double.valueOf(rows[3].getString(i)); } Double max = Double.NaN; if(!rows[4].isNullAt(i)) { max = Double.valueOf(rows[4].getString(i)); } String sqlCmd = String.format("select count(*) from %s where `%s` is null", this.getDDF().getTableName(), column.getName()); long naCount = df.sqlContext().sql(sqlCmd).collect()[0].getLong(0); Summary summary = new Summary(count, mean, sqdeviation, naCount, min, max); summaries[colIndex] = summary; i += 1; } else { summaries[colIndex] = null; } colIndex += 1; } return summaries; }
Source:
public void deriveAccountOne() throws Exception { long secs = 1389353062L; DeterministicKeyChain chain1 = new DeterministicKeyChain(ENTROPY, "", secs) { @Override protected ImmutableList<ChildNumber> getAccountPath() { return ImmutableList.of(ChildNumber.ONE); } }; ECKey key1 = chain1.getKey(KeyChain.KeyPurpose.RECEIVE_FUNDS); ECKey key2 = chain1.getKey(KeyChain.KeyPurpose.RECEIVE_FUNDS); final Address address = new Address(UnitTestParams.get(), "n2nHHRHs7TiZScTuVhZUkzZfTfVgGYwy6X"); assertEquals(address, key1.toAddress(UnitTestParams.get())); assertEquals("mnp2j9za5zMuz44vNxrJCXXhZsCdh89QXn", key2.toAddress(UnitTestParams.get()).toString()); assertEquals(key1, chain1.findKeyFromPubHash(address.getHash160())); assertEquals(key2, chain1.findKeyFromPubKey(key2.getPubKey())); key1.sign(Sha256Hash.ZERO_HASH); ECKey key3 = chain1.getKey(KeyChain.KeyPurpose.CHANGE); assertEquals("mpjRhk13rvV7vmnszcUQVYVQzy4HLTPTQU", key3.toAddress(UnitTestParams.get()).toString()); key3.sign(Sha256Hash.ZERO_HASH); }

Target:
public void deriveAccountOne() throws Exception { long secs = 1389353062L; DeterministicKeyChain chain1 = new AccountOneChain(ENTROPY, "", secs); ECKey key1 = chain1.getKey(KeyChain.KeyPurpose.RECEIVE_FUNDS); ECKey key2 = chain1.getKey(KeyChain.KeyPurpose.RECEIVE_FUNDS); final Address address = new Address(UnitTestParams.get(), "n2nHHRHs7TiZScTuVhZUkzZfTfVgGYwy6X"); assertEquals(address, key1.toAddress(UnitTestParams.get())); assertEquals("mnp2j9za5zMuz44vNxrJCXXhZsCdh89QXn", key2.toAddress(UnitTestParams.get()).toString()); assertEquals(key1, chain1.findKeyFromPubHash(address.getHash160())); assertEquals(key2, chain1.findKeyFromPubKey(key2.getPubKey())); key1.sign(Sha256Hash.ZERO_HASH); ECKey key3 = chain1.getKey(KeyChain.KeyPurpose.CHANGE); assertEquals("mpjRhk13rvV7vmnszcUQVYVQzy4HLTPTQU", key3.toAddress(UnitTestParams.get()).toString()); key3.sign(Sha256Hash.ZERO_HASH); }
Source:
public void testLateRegisterSuccess() throws Exception { DefaultEventLoopGroup group = new DefaultEventLoopGroup(1); try { LateRegisterHandler registerHandler = new LateRegisterHandler(); ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(group); bootstrap.handler(registerHandler); bootstrap.channel(LocalServerChannel.class); bootstrap.childHandler(new DummyHandler()); bootstrap.localAddress(new LocalAddress("1")); ChannelFuture future = bootstrap.bind(); assertFalse(future.isDone()); Thread.sleep(1000); registerHandler.registerPromise().setSuccess(); final BlockingQueue<Boolean> queue = new LinkedBlockingQueue<Boolean>(); future.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { queue.add(future.channel().eventLoop().inEventLoop(Thread.currentThread())); queue.add(future.isSuccess()); } }); assertTrue(queue.take()); assertTrue(queue.take()); } finally { group.shutdownGracefully(); group.terminationFuture().sync(); } }

Target:
public void testLateRegisterSuccess() throws Exception { DefaultEventLoopGroup group = new DefaultEventLoopGroup(1); try { LateRegisterHandler registerHandler = new LateRegisterHandler(); ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(group); bootstrap.handler(registerHandler); bootstrap.channel(LocalServerChannel.class); bootstrap.childHandler(new DummyHandler()); bootstrap.localAddress(new LocalAddress("1")); ChannelFuture future = bootstrap.bind(); assertFalse(future.isDone()); registerHandler.registerPromise().setSuccess(); final BlockingQueue<Boolean> queue = new LinkedBlockingQueue<Boolean>(); future.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { queue.add(future.channel().eventLoop().inEventLoop(Thread.currentThread())); queue.add(future.isSuccess()); } }); assertTrue(queue.take()); assertTrue(queue.take()); } finally { group.shutdownGracefully(); group.terminationFuture().sync(); } }
Source:
void updateDescriptors( Collection<DynamicRouteDescriptor> dynamicDescriptors) { mMemberRoutes.clear(); mUnselectableRoutes.clear(); mGroupableRoutes.clear(); mTransferableRoutes.clear(); boolean changed = false; for (DynamicRouteDescriptor dynamicDescriptor : dynamicDescriptors) { RouteInfo route = findRouteByDynamicRouteDescriptor(dynamicDescriptor); if (route == null) { continue; } int previousState = route.getSelectionState(); if (dynamicDescriptor.getSelectionState() != previousState) { route.mSelectionState = dynamicDescriptor.getSelectionState(); changed |= true; } if (dynamicDescriptor.isGroupable()) { mGroupableRoutes.add(route.getId()); } if (dynamicDescriptor.isTransferable()) { mTransferableRoutes.add(route.getId()); } if ((dynamicDescriptor.getSelectionState() == DynamicRouteDescriptor.SELECTING) || (dynamicDescriptor.getSelectionState() == DynamicRouteDescriptor.SELECTED)) { mMemberRoutes.add(route); if (dynamicDescriptor.isUnselectable()) { mUnselectableRoutes.add(route); } } if (changed) { sGlobal.mCallbackHandler.post( GlobalMediaRouter.CallbackHandler.MSG_ROUTE_CHANGED, route); } } sGlobal.mCallbackHandler.post( GlobalMediaRouter.CallbackHandler.MSG_ROUTE_CHANGED, this); }

Target:
void updateDescriptors( Collection<DynamicRouteDescriptor> dynamicDescriptors) { mMemberRoutes.clear(); mUnselectableRoutes.clear(); mGroupableRoutes.clear(); mTransferableRoutes.clear(); boolean changed = false; for (DynamicRouteDescriptor dynamicDescriptor : dynamicDescriptors) { RouteInfo route = findRouteByDynamicRouteDescriptor(dynamicDescriptor); if (route == null) { continue; } int previousState = route.getSelectionState(); if (dynamicDescriptor.getSelectionState() != previousState) { route.mSelectionState = dynamicDescriptor.getSelectionState(); changed |= true; } if (dynamicDescriptor.isGroupable()) { mGroupableRoutes.add(route); } if (dynamicDescriptor.isTransferable()) { mTransferableRoutes.add(route); } if ((dynamicDescriptor.getSelectionState() == DynamicRouteDescriptor.SELECTING) || (dynamicDescriptor.getSelectionState() == DynamicRouteDescriptor.SELECTED)) { mMemberRoutes.add(route); if (dynamicDescriptor.isUnselectable()) { mUnselectableRoutes.add(route); } } } sGlobal.mCallbackHandler.post( GlobalMediaRouter.CallbackHandler.MSG_ROUTE_CHANGED, this); }
Source:
public void setContentType(String contentType) { ObjectUtil.checkNotNull(contentType, "contentType"); this.contentType = contentType; }

Target:
public void setContentType(String contentType) { this.contentType = ObjectUtil.checkNotNull(contentType, "contentType"); }
Source:
public void log(Set<SubscriptionName> assigned, Set<SubscriptionName> running, Set<SubscriptionName> missing, Set<SubscriptionName> oversubscribed) { for (SubscriptionName subscriptionName : missing) { logger.warn("Missing consumer process for subscription: {}", subscriptionName); } for (SubscriptionName subscriptionName : oversubscribed) { logger.warn("Unwanted consumer process for subscription: {}", subscriptionName); } logger.info( "Subscriptions assigned: {}, existing subscriptions: {}, missing: {}, oversubscribed: {}", assigned.size(), running.size(), missing.size(), oversubscribed.size() ); }

Target:
private void log(Set<SubscriptionName> assigned, Set<SubscriptionName> running, Set<SubscriptionName> missing, Set<SubscriptionName> oversubscribed) { for (SubscriptionName subscriptionName : missing) { logger.warn("Missing consumer process for subscription: {}", subscriptionName); } for (SubscriptionName subscriptionName : oversubscribed) { logger.warn("Unwanted consumer process for subscription: {}", subscriptionName); } logger.info( "Subscriptions assigned: {}, existing subscriptions: {}, missing: {}, oversubscribed: {}", assigned.size(), running.size(), missing.size(), oversubscribed.size() ); }
Source:
public void clearMinRankOptions(int questionNumber) { WebElement minRecipientsToBeRankedInput = getMinOptionsToBeRankedInputElement(questionNumber); minRecipientsToBeRankedInput.click(); minRecipientsToBeRankedInput.clear(); }

Target:
public void clearMinRankOptions(int questionNumber) { WebElement minRecipientsToBeRankedInput = getMinOptionsToBeRankedInputElement(questionNumber); minRecipientsToBeRankedInput.clear(); }
Source:
private void processOptions(RepositoryState state) throws JGitInternalException { if (author == null) author = new PersonIdent(repo); if (name == null || !Repository.isValidRefName(Constants.R_TAGS + name)) throw new JGitInternalException(MessageFormat .format(JGitText.get().tagNameInvalid, name == null ? "<null>" : name)); if (signed == true) throw new UnsupportedOperationException(JGitText.get().signingNotSupportedOnTag); }

Target:
private void processOptions(RepositoryState state) throws JGitInternalException { if (tagger == null) tagger = new PersonIdent(repo); if (name == null || !Repository.isValidRefName(Constants.R_TAGS + name)) throw new JGitInternalException(MessageFormat.format( JGitText.get().tagNameInvalid, name == null ? "<null>" : name)); if (signed) throw new UnsupportedOperationException( JGitText.get().signingNotSupportedOnTag); }
Source:
static synchronized void updateSchemaCache(Realm realm) { final RealmCache cache = cachesMap.get(realm.getPath()); if (cache == null) { return; } final RefAndCount refAndCount = cache.refAndCountMap.get(RealmCacheType.TYPED_REALM); if (refAndCount.localRealm.get() == null) { return; } final ColumnIndices[] globalCacheArray = cache.typedColumnIndicesArray; final ColumnIndices createdCacheEntry = realm.updateSchemaCache( globalCacheArray); if (createdCacheEntry != null) { RealmCache.store(globalCacheArray, createdCacheEntry); } }

Target:
static synchronized void updateSchemaCache(Realm realm) { final RealmCache cache = cachesMap.get(realm.getPath()); if (cache == null) { return; } final RefAndCount refAndCount = cache.refAndCountMap.get(RealmCacheType.TYPED_REALM); if (refAndCount.localRealm.get() == null) { return; } final ColumnIndices[] globalCacheArray = cache.typedColumnIndicesArray; final ColumnIndices createdCacheEntry = realm.updateSchemaCache(globalCacheArray); if (createdCacheEntry != null) { RealmCache.storeColumnIndices(globalCacheArray, createdCacheEntry); } }
Source:
public InteractiveBrowserCredential build() { ValidationUtil.validate(getClass().getSimpleName(), new HashMap<String, Object>() {{ put("clientId", clientId); }}); return new InteractiveBrowserCredential(clientId, tenantId, port, redirectURL, automaticAuthentication, identityClientOptions); }

Target:
public InteractiveBrowserCredential build() { ValidationUtil.validateInteractiveBrowserRedirectUrlSetup(getClass().getSimpleName(), port, redirectUrl); ValidationUtil.validate(getClass().getSimpleName(), new HashMap<String, Object>() {{ put("clientId", clientId); }}); return new InteractiveBrowserCredential(clientId, tenantId, port, redirectUrl, automaticAuthentication, identityClientOptions); }
Source:
public static MongoInstitution getInstance(final Authenticator authenticator) { MongoInstitution result = instance; if (result == null) { synchronized (MongoInstitution.class) { if (result == null) { result = instance; instance = result = new MongoInstitution(); result.auth = authenticator; } } } return result; }

Target:
public static MongoInstitution getInstance(final Authenticator authenticator) { MongoInstitution result = instance; if (result == null) { synchronized (MongoInstitution.class) { if (result == null) { instance = result = new MongoInstitution(); result.auth = authenticator; } } } return result; }