auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void run() { try (Git git = new Git(db)) { if (null == command) { RemoteListCommand cmd = git.remoteList(); List<RemoteConfig> remotes = cmd.call(); print(remotes); } else switch (command) { case "add": { RemoteAddCommand cmd = git.remoteAdd(); cmd.setName(name); cmd.setUri(new URIish(uri)); cmd.call(); break; } case "remove": case "rm": { RemoteRemoveCommand cmd = git.remoteRemove(); cmd.setRemoteName(name); cmd.call(); break; } case "set-url": { RemoteSetUrlCommand cmd = git.remoteSetUrl(); cmd.setRemoteName(name); cmd.setRemoteUri(new URIish(uri)); cmd.setUriType(push ? UriType.PUSH : UriType.FETCH); cmd.call(); break; } case "update": Fetch fetch = new Fetch(); fetch.init(db, gitdir); StringWriter osw = new StringWriter(); fetch.outw = new ThrowingPrintWriter(osw); StringWriter esw = new StringWriter(); fetch.errw = new ThrowingPrintWriter(esw); List<String> fetchArgs = new ArrayList<>(); if (verbose) { fetchArgs.add("--verbose"); } if (prune) { fetchArgs.add("--prune"); } if (name != null) { fetchArgs.add(name); } fetch.execute(fetchArgs.toArray(new String[0])); fetch.outw.flush(); fetch.errw.flush(); outw.println(osw.toString()); errw.println(esw.toString()); break; default: throw new JGitInternalException(MessageFormat .format(CLIText.get().unknownSubcommand, command)); } } catch (Exception e) { throw die(e.getMessage(), e); } }

Target:
protected void run() { try (Git git = new Git(db)) { if (command == null) { RemoteListCommand cmd = git.remoteList(); List<RemoteConfig> remotes = cmd.call(); print(remotes); } else { switch (command) { case "add": { RemoteAddCommand cmd = git.remoteAdd(); cmd.setName(name); cmd.setUri(new URIish(uri)); cmd.call(); break; } case "remove": case "rm": { RemoteRemoveCommand cmd = git.remoteRemove(); cmd.setRemoteName(name); cmd.call(); break; } case "set-url": { RemoteSetUrlCommand cmd = git.remoteSetUrl(); cmd.setRemoteName(name); cmd.setRemoteUri(new URIish(uri)); cmd.setUriType(push ? UriType.PUSH : UriType.FETCH); cmd.call(); break; } case "update": Fetch fetch = new Fetch(); fetch.init(db, gitdir); StringWriter osw = new StringWriter(); fetch.outw = new ThrowingPrintWriter(osw); StringWriter esw = new StringWriter(); fetch.errw = new ThrowingPrintWriter(esw); List<String> fetchArgs = new ArrayList<>(); if (verbose) { fetchArgs.add("--verbose"); } if (prune) { fetchArgs.add("--prune"); } if (name != null) { fetchArgs.add(name); } fetch.execute(fetchArgs.toArray(new String[0])); fetch.outw.flush(); fetch.errw.flush(); outw.println(osw.toString()); errw.println(esw.toString()); break; default: throw new JGitInternalException(MessageFormat .format(CLIText.get().unknownSubcommand, command)); } } } catch (Exception e) { throw die(e.getMessage(), e); } }
Source:
public void buildPolicySchema() throws SAXException { if (!"true".equalsIgnoreCase((String) configHolder.getEngineProperties().get( EntitlementExtensionBuilder.PDP_SCHEMA_VALIDATION))) { log.warn("PDP schema validation disabled."); return; } String[] schemaNSs = new String[]{PDPConstants.XACML_1_POLICY_XMLNS, PDPConstants.XACML_2_POLICY_XMLNS, PDPConstants.XACML_3_POLICY_XMLNS}; for (String schemaNS : schemaNSs) { String schemaFile; if (PDPConstants.XACML_1_POLICY_XMLNS.equals(schemaNS)) { schemaFile = PDPConstants.XACML_1_POLICY_SCHEMA_FILE; } else if (PDPConstants.XACML_2_POLICY_XMLNS.equals(schemaNS)) { schemaFile = PDPConstants.XACML_2_POLICY_SCHEMA_FILE; } else { schemaFile = PDPConstants.XACML_3_POLICY_SCHEMA_FILE; } InputStream schemaFileStream = EntitlementExtensionBuilder.class .getResourceAsStream("/" + schemaFile); SchemaFactory schemaFactory = SchemaFactory .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(new StreamSource(schemaFileStream)); configHolder.getPolicySchemaMap().put(schemaNS, schema); IdentityIOStreamUtils.closeInputStream(schemaFileStream); } }

Target:
public void buildPolicySchema() throws SAXException { if (!"true".equalsIgnoreCase((String) configHolder.getEngineProperties().get( EntitlementExtensionBuilder.PDP_SCHEMA_VALIDATION))) { log.warn("PDP schema validation disabled."); return; } String[] schemaNSs = new String[]{PDPConstants.XACML_1_POLICY_XMLNS, PDPConstants.XACML_2_POLICY_XMLNS, PDPConstants.XACML_3_POLICY_XMLNS}; for (String schemaNS : schemaNSs) { String schemaFile; if (PDPConstants.XACML_1_POLICY_XMLNS.equals(schemaNS)) { schemaFile = PDPConstants.XACML_1_POLICY_SCHEMA_FILE; } else if (PDPConstants.XACML_2_POLICY_XMLNS.equals(schemaNS)) { schemaFile = PDPConstants.XACML_2_POLICY_SCHEMA_FILE; } else { schemaFile = PDPConstants.XACML_3_POLICY_SCHEMA_FILE; } InputStream schemaFileStream = EntitlementExtensionBuilder.class.getResourceAsStream("/" + schemaFile); try{ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(new StreamSource(schemaFileStream)); configHolder.getPolicySchemaMap().put(schemaNS, schema); } finally { IdentityIOStreamUtils.closeInputStream(schemaFileStream); } } }
Source:
private Contentlet getContentlet(final UrlMapContext urlMapContext) throws DotSecurityException { Contentlet matchingContentlet = null; try { final List<Matches> matchesFound = this.findMatch(urlMapContext.getUri()); if (!matchesFound.isEmpty()) { for (Matches matches : matchesFound) { final Structure structure = CacheLocator.getContentTypeCache() .getStructureByInode(matches.getPatternChange().getStructureInode()); final Field hostField = this.findHostField(structure); matchingContentlet = this .getContentlet(matches, structure, hostField, urlMapContext); if (null != matchingContentlet) { break; } } } } catch (DotDataException e) { Logger.error(this.getClass(), String.format("Error processing URL [%s]", urlMapContext.getUri()), e); return null; } return matchingContentlet; }

Target:
private Contentlet getContentlet(final UrlMapContext urlMapContext) throws DotSecurityException { Contentlet matchingContentlet = null; try { final List<Matches> matchesFound = this.findMatch(urlMapContext.getUri()); if (!matchesFound.isEmpty()) { for (final Matches matches : matchesFound) { final Structure structure = CacheLocator.getContentTypeCache() .getStructureByInode(matches.getPatternChange().getStructureInode()); final Field hostField = this.findHostField(structure); matchingContentlet = this .getContentlet(matches, structure, hostField, urlMapContext); if (null != matchingContentlet) { break; } } } } catch (DotDataException e) { Logger.error(this.getClass(), String.format("Error processing URL [%s]", urlMapContext.getUri()), e); return null; } return matchingContentlet; }
Source:
public void withoutSSLVerification() throws InterruptedException { String username = UUID.randomUUID().toString(); String password = "password"; SyncUser user = SyncUser.login(SyncCredentials.usernamePassword(username, password, true), Constants.AUTH_URL); final SyncConfiguration configOld = configurationFactory.createSyncConfigurationBuilder(user, Constants.USER_REALM) .schema(StringOnly.class) .build(); Realm realm = Realm.getInstance(configOld); realm.beginTransaction(); realm.createObject(StringOnly.class).setChars("Foo"); realm.commitTransaction(); SystemClock.sleep(TimeUnit.SECONDS.toMillis(2)); realm.close(); user.logout(); Realm.deleteRealm(configOld); user = SyncUser.login(SyncCredentials.usernamePassword(username, password), Constants.AUTH_URL); SyncConfiguration config = new SyncConfiguration.Builder(user, Constants.USER_REALM_SECURE) .schema(StringOnly.class) .waitForInitialRemoteData() .disableSSLVerification() .build(); realm = Realm.getInstance(config); RealmResults<StringOnly> all = realm.where(StringOnly.class).findAll(); try { assertEquals(1, all.size()); assertEquals("Foo", all.get(0).getChars()); } finally { realm.close(); } }

Target:
public void withoutSSLVerification() throws InterruptedException { String username = UUID.randomUUID().toString(); String password = "password"; SyncUser user = SyncUser.login(SyncCredentials.usernamePassword(username, password, true), Constants.AUTH_URL); final SyncConfiguration configOld = configurationFactory.createSyncConfigurationBuilder(user, Constants.USER_REALM) .schema(StringOnly.class) .build(); Realm realm = Realm.getInstance(configOld); realm.beginTransaction(); realm.createObject(StringOnly.class).setChars("Foo"); realm.commitTransaction(); SystemClock.sleep(TimeUnit.SECONDS.toMillis(2)); realm.close(); user.logout(); Realm.deleteRealm(configOld); user = SyncUser.login(SyncCredentials.usernamePassword(username, password), Constants.AUTH_URL); SyncConfiguration config = configurationFactory.createSyncConfigurationBuilder(user, Constants.USER_REALM_SECURE) .schema(StringOnly.class) .waitForInitialRemoteData() .disableSSLVerification() .build(); realm = Realm.getInstance(config); RealmResults<StringOnly> all = realm.where(StringOnly.class).findAll(); try { assertEquals(1, all.size()); assertEquals("Foo", all.get(0).getChars()); } finally { realm.close(); } }
Source:
private void forceCloseContainer(final ContainerInfo container, final Set<ContainerReplica> replicas) { Preconditions.assertTrue(container.getState() == LifeCycleState.QUASI_CLOSED); final int replicationFactor = container.getReplicationFactor().getNumber(); final List<ContainerReplica> quasiClosedReplicas = replicas.stream() .filter(r -> r.getState() == State.QUASI_CLOSED) .collect(Collectors.toList()); final long uniqueQuasiClosedReplicaCount = quasiClosedReplicas .stream() .map(ContainerReplica::getOriginDatanodeId) .distinct() .count(); if (uniqueQuasiClosedReplicaCount > (replicationFactor / 2)) { final Long sequenceId = quasiClosedReplicas.stream() .map(ContainerReplica::getSequenceId) .max(Long::compare) .orElse(-1L); quasiClosedReplicas.stream() .filter(r -> sequenceId != -1L) .filter(replica -> replica.getSequenceId().equals(sequenceId)) .forEach(replica -> sendCloseCommand( container, replica.getDatanodeDetails(), true)); } }

Target:
private void forceCloseContainer(final ContainerInfo container, final Set<ContainerReplica> replicas) { Preconditions.assertTrue(container.getState() == LifeCycleState.QUASI_CLOSED); final List<ContainerReplica> quasiClosedReplicas = replicas.stream() .filter(r -> r.getState() == State.QUASI_CLOSED) .collect(Collectors.toList()); final Long sequenceId = quasiClosedReplicas.stream() .map(ContainerReplica::getSequenceId) .max(Long::compare) .orElse(-1L); LOG.info("Force closing container with BCSID {}," + " which is in QUASI_CLOSED state.", container.containerID(), sequenceId); quasiClosedReplicas.stream() .filter(r -> sequenceId != -1L) .filter(replica -> replica.getSequenceId().equals(sequenceId)) .forEach(replica -> sendCloseCommand( container, replica.getDatanodeDetails(), true)); }
Source:
public Map<String, ComponentMetrics> get() { Map<String, ComponentMetrics> result = new HashMap<>(); String[] boltComponents = topologyProvider.getBoltNames(); for (String boltComponent : boltComponents) { String[] boltInstanceNames = packingPlanProvider.getBoltInstanceNames(boltComponent); Duration duration = getDuration(BackPressureSensor.class.getSimpleName()); Map<String, InstanceMetrics> instanceMetrics = new HashMap<>(); for (String boltInstanceName : boltInstanceNames) { String metric = this.metricName + boltInstanceName; Map<String, ComponentMetrics> stmgrResult = metricsProvider.getComponentMetrics( metric, duration, COMPONENT_STMGR); HashMap<String, InstanceMetrics> streamManagerResult = stmgrResult.get(COMPONENT_STMGR).getMetrics(); InstanceMetrics stmgrInstanceResult = streamManagerResult.values().iterator().next(); double averageBp = stmgrInstanceResult.getMetricValueSum(metric) / duration.getSeconds(); averageBp = averageBp > 1000 ? 1000 : averageBp; InstanceMetrics boltInstanceMetric = new InstanceMetrics(boltInstanceName, this.metricName, averageBp); instanceMetrics.put(boltInstanceName, boltInstanceMetric); } ComponentMetrics componentMetrics = new ComponentMetrics(boltComponent, instanceMetrics); result.put(boltComponent, componentMetrics); } return result; }

Target:
public Map<String, ComponentMetrics> get() { Map<String, ComponentMetrics> result = new HashMap<>(); String[] boltComponents = topologyProvider.getBoltNames(); for (String boltComponent : boltComponents) { String[] boltInstanceNames = packingPlanProvider.getBoltInstanceNames(boltComponent); Duration duration = getDuration(); Map<String, InstanceMetrics> instanceMetrics = new HashMap<>(); for (String boltInstanceName : boltInstanceNames) { String metric = getMetricName() + boltInstanceName; Map<String, ComponentMetrics> stmgrResult = metricsProvider.getComponentMetrics( metric, duration, COMPONENT_STMGR); HashMap<String, InstanceMetrics> streamManagerResult = stmgrResult.get(COMPONENT_STMGR).getMetrics(); InstanceMetrics stmgrInstanceResult = streamManagerResult.values().iterator().next(); double averageBp = stmgrInstanceResult.getMetricValueSum(metric) / duration.getSeconds(); averageBp = averageBp > 1000 ? 1000 : averageBp; InstanceMetrics boltInstanceMetric = new InstanceMetrics(boltInstanceName, getMetricName(), averageBp); instanceMetrics.put(boltInstanceName, boltInstanceMetric); } ComponentMetrics componentMetrics = new ComponentMetrics(boltComponent, instanceMetrics); result.put(boltComponent, componentMetrics); } return result; }
Source:
private void processLocalSnapshotStartStageResult(UUID id, Map<UUID, SnapshotOperationResponse> res, Map<UUID, Exception> err) { if (cctx.kernalContext().clientNode()) return; SnapshotOperationRequest snpReq = clusterSnpReq; if (snpReq == null || !snpReq.rqId.equals(id)) { synchronized (snpOpMux) { if (clusterSnpFut != null && clusterSnpFut.rqId.equals(id)) { clusterSnpFut.onDone(new IgniteCheckedException("Snapshot operation has not been fully completed " + "[err=" + err + ", snpReq=" + snpReq + ']')); clusterSnpFut = null; } return; } } if (isLocalNodeCoordinator(cctx.discovery())) { Set<UUID> missed = new HashSet<>(snpReq.bltNodes); missed.removeAll(res.keySet()); missed.removeAll(err.keySet()); boolean cancelled = err.values().stream() .anyMatch(e -> e instanceof IgniteFutureCancelledCheckedException); if (cancelled) { snpReq.err = new IgniteFutureCancelledCheckedException("Execution of snapshot tasks " + "has been cancelled by external process [err=" + err + ", missed=" + missed + ']'); } else if (!F.isEmpty(err) || !missed.isEmpty()) { snpReq.err = new IgniteCheckedException("Execution of local snapshot tasks fails or them haven't been executed " + "due to some of nodes left the cluster. Uncompleted snapshot will be deleted " + "[err=" + err + ", missed=" + missed + ']'); } endSnpProc.start(UUID.randomUUID(), snpReq); } }

Target:
private void processLocalSnapshotStartStageResult(UUID id, Map<UUID, SnapshotOperationResponse> res, Map<UUID, Exception> err) { if (cctx.kernalContext().clientNode()) return; SnapshotOperationRequest snpReq = clusterSnpReq; boolean cancelled = err.values().stream().anyMatch(e -> e instanceof IgniteFutureCancelledCheckedException); if (snpReq == null || !snpReq.rqId.equals(id)) { synchronized (snpOpMux) { if (clusterSnpFut != null && clusterSnpFut.rqId.equals(id)) { if (cancelled) { clusterSnpFut.onDone(new IgniteFutureCancelledCheckedException("Execution of snapshot tasks " + "has been cancelled by external process [err=" + err + ", snpReq=" + snpReq + ']')); } else { clusterSnpFut.onDone(new IgniteCheckedException("Snapshot operation has not been fully completed " + "[err=" + err + ", snpReq=" + snpReq + ']')); } clusterSnpFut = null; } return; } } if (isLocalNodeCoordinator(cctx.discovery())) { Set<UUID> missed = new HashSet<>(snpReq.bltNodes); missed.removeAll(res.keySet()); missed.removeAll(err.keySet()); if (cancelled) { snpReq.err = new IgniteFutureCancelledCheckedException("Execution of snapshot tasks " + "has been cancelled by external process [err=" + err + ", missed=" + missed + ']'); } else if (!F.isEmpty(err) || !missed.isEmpty()) { snpReq.err = new IgniteCheckedException("Execution of local snapshot tasks fails or them haven't been executed " + "due to some of nodes left the cluster. Uncompleted snapshot will be deleted " + "[err=" + err + ", missed=" + missed + ']'); } endSnpProc.start(UUID.randomUUID(), snpReq); } }
Source:
public void canParseRuntimeDeprecatedConfigType() throws IOException { KeyValueServiceRuntimeConfig config = AtlasDbConfigs.OBJECT_MAPPER.readValue("type: cassandra", KeyValueServiceRuntimeConfig.class); }

Target:
public void canParseRuntimeDeprecatedConfigType() throws IOException { KeyValueServiceRuntimeConfig config = AtlasDbConfigs.OBJECT_MAPPER.readValue("type: CassandraKeyValueServiceRuntimeConfig", KeyValueServiceRuntimeConfig.class); }
Source:
private boolean showRetreatDialog( final String message, final Collection<Territory> possible, final AtomicReference<Territory> retreatTo) { final String yes = possible.size() == 1 ? "Retreat to " + possible.iterator().next().getName() : "Retreat"; final String no = "Remain"; final String cancel = "Ask Me Later"; final String[] options = {yes, no, cancel}; final int choice = JOptionPane.showOptionDialog( BattleDisplay.this, message, "Retreat?", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, no); if (choice == -1) { return false; } if (choice == JOptionPane.CANCEL_OPTION) { return false; } if (choice == JOptionPane.NO_OPTION) { return true; } if (possible.size() == 1) { retreatTo.set(possible.iterator().next()); return true; } final RetreatComponent comp = new RetreatComponent(possible); final int option = JOptionPane.showConfirmDialog( BattleDisplay.this, comp, message, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null); if (option == JOptionPane.OK_OPTION) { if (comp.getSelection() != null) { retreatTo.set(comp.getSelection()); return true; } } return false; }

Target:
private boolean showRetreatDialog( final String message, final Collection<Territory> possible, final AtomicReference<Territory> retreatTo) { final String yes = possible.size() == 1 ? "Retreat to " + possible.iterator().next().getName() : "Retreat"; final String no = "Remain"; final String cancel = "Ask Me Later"; final String[] options = {yes, no, cancel}; final int choice = JOptionPane.showOptionDialog( BattleDisplay.this, message, "Retreat?", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, no); if (choice == JOptionPane.CLOSED_OPTION || choice == JOptionPane.CANCEL_OPTION) { return false; } if (choice == JOptionPane.NO_OPTION) { return true; } if (possible.size() == 1) { retreatTo.set(possible.iterator().next()); return true; } final RetreatComponent comp = new RetreatComponent(possible); final int option = JOptionPane.showConfirmDialog( BattleDisplay.this, comp, message, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null); if (option == JOptionPane.OK_OPTION) { if (comp.getSelection() != null) { retreatTo.set(comp.getSelection()); return true; } } return false; }
Source:
protected final void computeRanges(List<? extends Input.Tok> toks) { int lineI = 0; for (Input.Tok tok : toks) { String txt = tok.getOriginalText(); int lineI0 = lineI; lineI += Newlines.count(txt); int k = tok.getIndex(); if (k >= 0) { addToRanges(range0s, lineI0, k); for (int i = lineI0; i <= lineI; i++) { addToRanges(ranges, i, k); } addToRanges(range1s, lineI, k); } } }

Target:
protected final void computeRanges(List<? extends Input.Tok> toks) { int lineI = 0; for (Input.Tok tok : toks) { String txt = tok.getOriginalText(); int lineI0 = lineI; lineI += Newlines.count(txt); int k = tok.getIndex(); if (k >= 0) { for (int i = lineI0; i <= lineI; i++) { addToRanges(ranges, i, k); } } } }
Source:
public BleScanListener() { Log.d(TAG, "Start BleScanListener()"); BluetoothAdapter bleAdaptor = BluetoothAdapter.getDefaultAdapter(); if (bleAdaptor == null) { Log.e(TAG, "BluetoothAdapter is Null"); return; } else { if (!bleAdaptor.isEnabled()) { Log.d(TAG, "BluetoothAdapter is NOT enabled, enable now"); bleAdaptor.enable(); if (!bleAdaptor.isEnabled()) { Log.e(TAG, "Can't enable Bluetooth"); return; } } } mBleScanner = bleAdaptor.getBluetoothLeScanner(); mScanFilterList = new ArrayList<ScanFilter>(); ScanFilter scanDeviceName = new ScanFilter.Builder().setDeviceName("dummy").build(); mScanFilterList.add(scanDeviceName); Log.d(TAG, "End BleScanListener()"); }

Target:
public BleScanListener() { Log.d(TAG, "Start BleScanListener()"); BluetoothAdapter bleAdaptor = BluetoothAdapter.getDefaultAdapter(); if (bleAdaptor == null) { Log.e(TAG, "BluetoothAdapter is Null"); return; } else { if (!bleAdaptor.isEnabled()) { Log.d(TAG, "BluetoothAdapter is NOT enabled, enable now"); bleAdaptor.enable(); if (!bleAdaptor.isEnabled()) { Log.e(TAG, "Can't enable Bluetooth"); return; } } } mBleScanner = bleAdaptor.getBluetoothLeScanner(); mScanFilterList = new ArrayList<ScanFilter>(); ScanFilter scanFilterDeviceName = new ScanFilter.Builder().setDeviceName("dummy").build(); mScanFilterList.add(scanFilterDeviceName); Log.d(TAG, "End BleScanListener()"); }
Source:
public static <T extends Locatable> List<T> readSegmentFile(final File segmentsFile, final String[] mandatoryColumns, final Function<DataLine, T> dataLineToSegmentFunction) { try (final TableReader<T> reader = TableUtils.reader(segmentsFile, (columns, formatExceptionFactory) -> { if (!columns.containsAll(mandatoryColumns)) { final Set<String> missingColumns = Sets.difference(new HashSet<>(Arrays.asList(mandatoryColumns)), new HashSet<>(columns.names())); throw formatExceptionFactory.apply("Bad header in file. Not all columns are present. Missing: " + StringUtils.join(missingColumns, ", ")); } return dataLineToSegmentFunction; })) { return reader.stream().collect(Collectors.toList()); } catch (final IOException | UncheckedIOException e) { throw new UserException.CouldNotReadInputFile(segmentsFile, e); } }

Target:
public static <T extends Locatable> List<T> readSegmentFile(final File segmentsFile, final String[] mandatoryColumns, final Function<DataLine, T> dataLineToSegmentFunction) { Utils.nonNull(segmentsFile); Utils.regularReadableUserFile(segmentsFile); try (final TableReader<T> reader = TableUtils.reader(segmentsFile, (columns, formatExceptionFactory) -> { if (!columns.containsAll(mandatoryColumns)) { final Set<String> missingColumns = Sets.difference(new HashSet<>(Arrays.asList(mandatoryColumns)), new HashSet<>(columns.names())); throw formatExceptionFactory.apply("Bad header in file. Not all columns are present. Missing: " + StringUtils.join(missingColumns, ", ")); } return dataLineToSegmentFunction; })) { return reader.stream().collect(Collectors.toList()); } catch (final IOException | UncheckedIOException e) { throw new UserException.CouldNotReadInputFile(segmentsFile, e); } }
Source:
public void init(HelixManager helixManager, TableConfig tableConfig) { _helixManager = helixManager; _offlineTableName = tableConfig.getTableName(); _replication = tableConfig.getValidationConfig().getReplicationNumber(); ReplicaGroupStrategyConfig replicaGroupStrategyConfig = tableConfig.getValidationConfig().getReplicaGroupStrategyConfig(); _partitionColumn = replicaGroupStrategyConfig != null ? replicaGroupStrategyConfig.getPartitionColumn() : null; if (InstanceAssignmentConfigUtils.shouldRelocateToTiers(tableConfig)) { _sortedTiers = getSortedTiersForPinotServerStorage(tableConfig.getTierConfigsList()); } if (_partitionColumn == null) { LOGGER.info("Initialized OfflineSegmentAssignment with replication: without partition column for table: ", _replication, _offlineTableName); } else { LOGGER.info("Initialized OfflineSegmentAssignment with replication: and partition column: for table: {}", _replication, _partitionColumn, _offlineTableName); } }

Target:
public void init(HelixManager helixManager, TableConfig tableConfig) { _helixManager = helixManager; _offlineTableName = tableConfig.getTableName(); _replication = tableConfig.getValidationConfig().getReplicationNumber(); ReplicaGroupStrategyConfig replicaGroupStrategyConfig = tableConfig.getValidationConfig().getReplicaGroupStrategyConfig(); _partitionColumn = replicaGroupStrategyConfig != null ? replicaGroupStrategyConfig.getPartitionColumn() : null; if (_partitionColumn == null) { LOGGER.info("Initialized OfflineSegmentAssignment with replication: without partition column for table: ", _replication, _offlineTableName); } else { LOGGER.info("Initialized OfflineSegmentAssignment with replication: and partition column: for table: {}", _replication, _partitionColumn, _offlineTableName); } }
Source:
public String joinPlayerToTeam( @RequestParam(value = "teamPassword", required = true) String enteredPassword, @PathVariable int id, HttpSession session) { Member me = (Member) session.getAttribute("member"); if (me == null) { return "redirect:/denied"; } TeamDao teamDao = new TeamDao(); Team team = teamDao.getTeamById(id, false, true, false); String teamPassword = team.getPassword(); String genPassword = StringUtils.secureString(enteredPassword); if (team == null || !genPassword.equals(teamPassword)) { return "redirect:/tournament/" + team.getTournament().getId() + "/teams"; } if (team.addPlayer(me) == 1) { teamDao.saveTeam(team); Set<Team> invitedTeams = me.getInvitedTeams(); Iterator<Team> teamIterator = invitedTeams.iterator(); while (teamIterator.hasNext()) { Team invitedTeam = teamIterator.next(); if (invitedTeam.getTournament().equals(team.getTournament())) { invitedTeam.removeInvitedPlayer(me); teamDao.saveTeam(invitedTeam); } } new MessageDao().notify(me, "You have succesfully joined " + team.getName()); } return "redirect:/team/" + teamDao.getTeamById(team.getId(), true, true, true).getId() + "/view"; }

Target:
public String joinPlayerToTeam( @RequestParam(value = "teamPassword", required = true) String enteredPassword, @PathVariable int id, HttpSession session) { Member me = (Member) session.getAttribute("member"); if (me == null) { return "redirect:/denied"; } TeamDao teamDao = new TeamDao(); Team team = teamDao.getTeamById(id, false, true, false); String teamPassword = team.getPassword(); String genPassword = StringUtils.secureString(enteredPassword); if (team == null || !genPassword.equals(teamPassword)) { return "redirect:/tournament/" + team.getTournament().getId() + "/teams"; } if (team.addPlayer(me) == 1) { teamDao.saveTeam(team); Set<Team> invitedTeams = me.getInvitedTeams(); Iterator<Team> teamIterator = invitedTeams.iterator(); while (teamIterator.hasNext()) { Team invitedTeam = teamIterator.next(); if (invitedTeam.getTournament().equals(team.getTournament())) { invitedTeam.removeInvitedPlayer(me); teamDao.saveTeam(invitedTeam); } } new MessageDao().notify(me, "You have succesfully joined " + team.getName()); new MessageDao().notify(team.getTeamLeader(), me.getName() + " has joined team " + team.getName()); } return "redirect:/team/" + teamDao.getTeamById(team.getId(), true, true, true).getId() + "/view"; }
Source:
private SymbolStatsEstimate normalizeSymbolStats(Symbol symbol, SymbolStatsEstimate symbolStats, PlanNodeStatsEstimate stats, TypeProvider types) { if (symbolStats.isUnknown()) { return SymbolStatsEstimate.unknown(); } double outputRowCount = stats.getOutputRowCount(); double distinctValuesCount = symbolStats.getDistinctValuesCount(); double nullsFraction = symbolStats.getNullsFraction(); if (!isNaN(distinctValuesCount)) { Type type = requireNonNull(types.get(symbol), () -> "type is missing for symbol: " + symbol); double maxDistinctValuesByLowHigh = maxDistinctValuesByLowHigh(symbolStats, type); if (distinctValuesCount > maxDistinctValuesByLowHigh) { distinctValuesCount = maxDistinctValuesByLowHigh; } if (distinctValuesCount > outputRowCount) { distinctValuesCount = outputRowCount; } double nonNullValues = outputRowCount * (1 - nullsFraction); if (distinctValuesCount > nonNullValues) { double difference = distinctValuesCount - nonNullValues; distinctValuesCount -= difference / 2; nonNullValues += difference / 2; nullsFraction = 1 - nonNullValues / outputRowCount; } } if (distinctValuesCount == 0.0) { return SymbolStatsEstimate.zero(); } return SymbolStatsEstimate.buildFrom(symbolStats) .setDistinctValuesCount(distinctValuesCount) .setNullsFraction(nullsFraction) .build(); }

Target:
private SymbolStatsEstimate normalizeSymbolStats(Symbol symbol, SymbolStatsEstimate symbolStats, PlanNodeStatsEstimate stats, TypeProvider types) { if (symbolStats.isUnknown()) { return SymbolStatsEstimate.unknown(); } double outputRowCount = stats.getOutputRowCount(); checkArgument(outputRowCount > 0, "outputRowCount must be greater than zero: %s", outputRowCount); double distinctValuesCount = symbolStats.getDistinctValuesCount(); double nullsFraction = symbolStats.getNullsFraction(); if (!isNaN(distinctValuesCount)) { Type type = requireNonNull(types.get(symbol), () -> "type is missing for symbol: " + symbol); double maxDistinctValuesByLowHigh = maxDistinctValuesByLowHigh(symbolStats, type); if (distinctValuesCount > maxDistinctValuesByLowHigh) { distinctValuesCount = maxDistinctValuesByLowHigh; } if (distinctValuesCount > outputRowCount) { distinctValuesCount = outputRowCount; } double nonNullValues = outputRowCount * (1 - nullsFraction); if (distinctValuesCount > nonNullValues) { double difference = distinctValuesCount - nonNullValues; distinctValuesCount -= difference / 2; nonNullValues += difference / 2; nullsFraction = 1 - nonNullValues / outputRowCount; } } if (distinctValuesCount == 0.0) { return SymbolStatsEstimate.zero(); } return SymbolStatsEstimate.buildFrom(symbolStats) .setDistinctValuesCount(distinctValuesCount) .setNullsFraction(nullsFraction) .build(); }
Source:
private void testTimeoutHelper(boolean sync) { final int taskTimeout = REPLICATION_TIMEOUT / 4; final int sleepTime = REPLICATION_TIMEOUT / 2; final String sleepOnKey = init(); MapReduceTask<String, String, String, Integer> task = createMapReduceTask(this.<String, String> cache(0)); assertEquals("Wrong task timeout.", REPLICATION_TIMEOUT, task.timeout(MILLISECONDS)); assertEquals("Wrong replication timeout.", REPLICATION_TIMEOUT, cache(0).getCacheConfiguration().clustering() .sync().replTimeout()); task.timeout(taskTimeout, MILLISECONDS); assertEquals("Wrong new task timeout.", taskTimeout, task.timeout(MILLISECONDS)); task.mappedWith(new SleepMapper(sleepTime, sleepOnKey)).reducedWith(new DummyReducer()); long start = System.nanoTime(); if (sync) { try { task.execute(); } catch (CacheException expected) { assertTrue(hasTimeoutException(expected)); } } else { try { Future<Map<String, Integer>> future = task.executeAsynchronously(); future.get(); } catch (CacheException expected) { } catch (InterruptedException e) { } catch (ExecutionException e) { assertTrue(hasTimeoutException(e)); } } long duration = System.nanoTime() - start; assertTrue(NANOSECONDS.toMillis(duration) >= taskTimeout); }

Target:
private void testTimeoutHelper(boolean sync) throws Exception { final int taskTimeout = REPLICATION_TIMEOUT / 4; final int sleepTime = REPLICATION_TIMEOUT / 2; final String sleepOnKey = init(); MapReduceTask<String, String, String, Integer> task = createMapReduceTask(this.<String, String> cache(0)); assertEquals("Wrong task timeout.", REPLICATION_TIMEOUT, task.timeout(MILLISECONDS)); assertEquals("Wrong replication timeout.", REPLICATION_TIMEOUT, cache(0).getCacheConfiguration().clustering() .sync().replTimeout()); task.timeout(taskTimeout, MILLISECONDS); assertEquals("Wrong new task timeout.", taskTimeout, task.timeout(MILLISECONDS)); task.mappedWith(new SleepMapper(sleepTime, sleepOnKey)).reducedWith(new DummyReducer()); long start = System.nanoTime(); if (sync) { try { task.execute(); fail("Should have gotten an exception for task.execute() call"); } catch (CacheException expected) { assertTrue(hasTimeoutException(expected)); } } else { try { Future<Map<String, Integer>> future = task.executeAsynchronously(); future.get(); fail("Should have gotten an exception for future.get() call"); } catch (ExecutionException e) { assertTrue(hasTimeoutException(e)); } } long duration = System.nanoTime() - start; assertTrue(NANOSECONDS.toMillis(duration) >= taskTimeout); }
Source:
public void idTokenWithAudience_correct() throws IOException { final String accessToken1 = "1/MkSJoj1xsli0AccessToken_NKPY2"; MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); MockTokenServerTransport transport = transportFactory.transport; ServiceAccountCredentials credentials = ServiceAccountCredentials.fromPkcs8( SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID, SCOPES, transportFactory, null); transport.addServiceAccount(SA_CLIENT_EMAIL, accessToken1); TestUtils.assertContainsBearerToken(credentials.getRequestMetadata(CALL_URI), accessToken1); String targetAudience = "<LINK_0>"; IdTokenCredentials tokenCredential = IdTokenCredentials.create(credentials, targetAudience); tokenCredential.refresh(); assertEquals(defaultIDToken, tokenCredential.getAccessToken().getTokenValue()); assertEquals(defaultIDToken, tokenCredential.getIdToken().getTokenValue()); assertEquals( targetAudience, (String) tokenCredential.getIdToken().getJsonWebSignature().getPayload().getAudience()); }

Target:
public void idTokenWithAudience_correct() throws IOException { String accessToken1 = "1/MkSJoj1xsli0AccessToken_NKPY2"; MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); MockTokenServerTransport transport = transportFactory.transport; ServiceAccountCredentials credentials = ServiceAccountCredentials.fromPkcs8( SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID, SCOPES, transportFactory, null); transport.addServiceAccount(SA_CLIENT_EMAIL, accessToken1); TestUtils.assertContainsBearerToken(credentials.getRequestMetadata(CALL_URI), accessToken1); String targetAudience = "<LINK_0>"; IdTokenCredentials tokenCredential = IdTokenCredentials.newBuilder() .setIdTokenProvider(credentials) .setTargetAudience(targetAudience) .build(); tokenCredential.refresh(); assertEquals(DEFAULT_ID_TOKEN, tokenCredential.getAccessToken().getTokenValue()); assertEquals(DEFAULT_ID_TOKEN, tokenCredential.getIdToken().getTokenValue()); assertEquals( targetAudience, (String) tokenCredential.getIdToken().getJsonWebSignature().getPayload().getAudience()); }
Source:
private static <T> Map<String, T> safeGetMap(Map map, String key, Class<T> valueType) { Map<?, ?> unchecked = safeGet(map, key, Map.class); if (unchecked == null) { return null; } try { return unchecked .entrySet() .stream() .map(e -> new SimpleEntry<>(String.class.cast(e.getKey()), e.getValue())) .map(e -> new SimpleEntry<>(e.getKey(), valueType.cast(e.getValue()))) .collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue)); } catch (ClassCastException e) { LOGGER.warn( "Form configuration field was malformed, expected a querySettings Map containing type {}", key, valueType.getName()); } return null; }

Target:
private static <T> Map<String, T> safeGetMap(Map map, String key, Class<T> valueType) { Map<?, ?> unchecked = safeGet(map, key, Map.class); if (unchecked == null) { return null; } try { return unchecked .entrySet() .stream() .map(e -> new SimpleEntry<>(String.class.cast(e.getKey()), e.getValue())) .map(e -> new SimpleEntry<>(e.getKey(), valueType.cast(e.getValue()))) .collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue)); } catch (ClassCastException e) { LOGGER.debug(EXCEPTION_OCCURRED_PARSING, e); LOGGER.warn( "Form configuration field was malformed, expected a querySettings Map containing type {}", key, valueType.getName()); } return null; }
Source:
public void reset() { m_syncedSinceLastEdit = false; for (SegmentReader reader : m_readCursors.values()) { reader.m_objectReadIndex = 0; reader.m_bytesRead = 0; reader.m_readOffset = SEGMENT_HEADER_BYTES; reader.m_discardCount = 0; } if (m_tmpHeaderBuf != null) { m_tmpHeaderBuf.discard(); m_tmpHeaderBuf = null; } }

Target:
public void reset() { m_syncedSinceLastEdit = false; for (SegmentReader reader : m_readCursors.values()) { reader.resetReader(); } if (m_tmpHeaderBuf != null) { m_tmpHeaderBuf.discard(); m_tmpHeaderBuf = null; } }
Source:
protected void buttonPressed(int buttonId) { if (buttonId == Window.OK) { try { int result = deleteBranch(selectedRefs, false); if (result == DeleteBranchOperation.REJECTED_UNMERGED) { List<RefNode> nodes = extractSelectedRefNodes(); @SuppressWarnings("unchecked") MessageDialog messageDialog = new UnmergedBranchDialog( getShell(), nodes); if (messageDialog.open() == Window.OK) deleteBranch(selectedRefs, true); else return; } else if (result == DeleteBranchOperation.REJECTED_CURRENT) Activator .handleError( UIText.DeleteBranchCommand_CannotDeleteCheckedOutBranch, null, true); } catch (CoreException e) { Activator.handleError(e.getMessage(), e, true); } } super.buttonPressed(buttonId); }

Target:
protected void buttonPressed(int buttonId) { if (buttonId == Window.OK) { try { int result = deleteBranch(selectedRefs, false); if (result == DeleteBranchOperation.REJECTED_UNMERGED) { List<RefNode> nodes = extractSelectedRefNodes(); MessageDialog messageDialog = new UnmergedBranchDialog<RefNode>( getShell(), nodes); if (messageDialog.open() == Window.OK) deleteBranch(selectedRefs, true); else return; } else if (result == DeleteBranchOperation.REJECTED_CURRENT) Activator .handleError( UIText.DeleteBranchCommand_CannotDeleteCheckedOutBranch, null, true); } catch (CoreException e) { Activator.handleError(e.getMessage(), e, true); } } super.buttonPressed(buttonId); }
Source:
private static String computeEntryName(Type type, int id) { if (type == Type.SOFT_IRQ) { return type.toString() + ' ' + id + ' ' + SoftIrqLabelProvider.getSoftIrq(id); } return type.toString() + ' ' + id; }

Target:
private static @NonNull String computeEntryName(Type type, int id) { if (type == Type.SOFT_IRQ) { return type.toString() + ' ' + id + ' ' + SoftIrqLabelProvider.getSoftIrq(id); } return type.toString() + ' ' + id; }
Source:
private static boolean isSubdirectory(String path) { final int slashIndex = path.indexOf("/"); return slashIndex >= 0 && slashIndex < path.length() - 1; }

Target:
private static boolean isSubdirectory(String path) { final int slashIndex = path.indexOf('/'); return slashIndex >= 0 && slashIndex < path.length() - 1; }
Source:
public int getTextLength() { final StackElement stackElement = tokenStack.peek(); try { setXmlText(stackElement, jsonParser); return stackElement.value.length; } catch (IOException e) { throw new IllegalStateException(e); } }

Target:
public int getTextLength() { final StackElement stackElement = tokenStack.peek(); try { assert stackElement != null; setXmlText(stackElement, jsonParser); return stackElement.value.length; } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
private void testSearch() throws Exception { ______TS("content: default help page"); helpPage.verifyHtmlMainContent("/instructorHelpPageDefault.html"); ______TS("search for empty keyword"); helpPage.clearSearchBox(); helpPage.clickSearchButton(); helpPage.verifyHtmlMainContent("/instructorHelpPageDefault.html"); ______TS("search for single keyword"); String searchContent = "course"; helpPage.inputSearchQuery(searchContent); helpPage.clickSearchButton(); helpPage.verifyHtmlMainContent("/instructorHelpPageSearchSingleKeyword.html"); ______TS("search for multiple keywords"); searchContent = "enroll students"; helpPage.clearSearchBox(); helpPage.inputSearchQuery(searchContent); helpPage.clickSearchButton(); String searchResultsMultipleKeywords = helpPage.getSearchResults(); helpPage.verifyHtmlMainContent("/instructorHelpPageSearchMultipleKeywords.html"); ______TS("check case insensitivity of query"); searchContent = "eNroLL STUDENTs"; helpPage.clearSearchBox(); helpPage.inputSearchQuery(searchContent); helpPage.clickSearchButton(); assertEquals(searchResultsMultipleKeywords, helpPage.getSearchResults()); ______TS("reset search"); helpPage.clickResetButton(); helpPage.verifyHtmlMainContent("/instructorHelpPageDefault.html"); ______TS("search for non existing keyword"); searchContent = "non existing keyword"; helpPage.clearSearchBox(); helpPage.inputSearchQuery(searchContent); helpPage.clickSearchButton(); assertEquals("", helpPage.getSearchResults()); }

Target:
private void testSearch() throws Exception { ______TS("content: default help page"); helpPage.verifyHtmlMainContent("/instructorHelpPageDefault.html"); ______TS("search for empty keyword"); helpPage.clearSearchBox(); helpPage.clickSearchButton(); helpPage.verifyHtmlMainContent("/instructorHelpPageDefault.html"); ______TS("search for single keyword"); String searchContent = "course"; helpPage.inputSearchQuery(searchContent); helpPage.clickSearchButton(); helpPage.verifyHtmlPart(SEARCH_RESULTS, "/instructorHelpPageSearchSingleKeyword.html"); ______TS("search for multiple keywords"); searchContent = "enroll students"; helpPage.clearSearchBox(); helpPage.inputSearchQuery(searchContent); helpPage.clickSearchButton(); helpPage.verifyHtmlPart(SEARCH_RESULTS, "/instructorHelpPageSearchMultipleKeywords.html"); ______TS("check case insensitivity of query"); searchContent = "eNroLL STUDENTs"; helpPage.clearSearchBox(); helpPage.inputSearchQuery(searchContent); helpPage.clickSearchButton(); helpPage.verifyHtmlPart(SEARCH_RESULTS, "/instructorHelpPageSearchMultipleKeywords.html"); ______TS("reset search"); helpPage.clickResetButton(); helpPage.verifyHtmlMainContent("/instructorHelpPageDefault.html"); ______TS("search for non existing keyword"); searchContent = "non existing keyword"; helpPage.clearSearchBox(); helpPage.inputSearchQuery(searchContent); helpPage.clickSearchButton(); assertEquals("", helpPage.getSearchResults()); }
Source:
public void setAccelerator (int accelerator) { checkWidget(); if (this.accelerator == accelerator) return; long accelGroup = getAccelGroup (); if (accelGroup != 0) removeAccelerator (accelGroup); this.accelerator = accelerator; if (accelGroup != 0) { addAccelerator (accelGroup); } }

Target:
public void setAccelerator (int accelerator) { checkWidget(); if (this.accelerator == accelerator) return; long accelGroup = getAccelGroup (); if (accelGroup != 0) removeAccelerator (accelGroup); this.accelerator = accelerator; if (accelGroup != 0) addAccelerator (accelGroup); }
Source:
public void testEncryptionGcm() throws Exception { Configuration conf = new Configuration(); conf.set(SchemaCryptoPropertiesFactory.CONF_ENCRYPTION_ALGORITHM, "AES_GCM_CTR_V1"); runTest(conf); }

Target:
public void testEncryptionGcm() throws Exception { Configuration conf = new Configuration(); conf.set(SchemaCryptoPropertiesFactory.CONF_ENCRYPTION_ALGORITHM, ParquetCipher.AES_GCM_V1.toString()); runTest(conf); }
Source:
protected void ExecuteVdsBrokerCommand() { status = getBroker().glusterValidateSshConnection(getParameters().getRemoteServer(), getParameters().getFingerprint(), getParameters().getUserName()); ProceedProxyReturnValue(); setReturnValue(getReturnValue()); }

Target:
protected void ExecuteVdsBrokerCommand() { status = getBroker().glusterValidateSshConnection(getParameters().getRemoteServer(), getParameters().getFingerprint(), getParameters().getUserName()); ProceedProxyReturnValue(); setReturnValue(true); }
Source:
public Response listWorkflows(Long pageSize, String pageToken, String keyValueSearch, ConsonanceUser user) throws NotFoundException { Long optionalPageSize = pageSize; String optionalPageToken = pageToken; String optionalKeyFilter = keyValueSearch; Ga4ghWesWorkflowListResponse list = new Ga4ghWesWorkflowListResponse(); List<Job> allJobs = orderResource.listWorkflowRuns(user); Map <Integer, JobState> serialize = new TreeMap<Integer, JobState>(); allJobs.stream().forEach((Job j) -> serialize.put(j.getJobId(), j.getState())); for (Integer key: serialize.keySet()){ Ga4ghWesWorkflowDesc descriptor = new Ga4ghWesWorkflowDesc(); descriptor.setWorkflowId(String.valueOf(key)); descriptor.setState(mapState(serialize.get(key))); list.addWorkflowsItem(descriptor); } return Response.ok().entity(list).build(); }

Target:
public Response listWorkflows(Long pageSize, String pageToken, String keyValueSearch, ConsonanceUser user) throws NotFoundException { Long optionalPageSize = pageSize; String optionalPageToken = pageToken; String optionalKeyFilter = keyValueSearch; Ga4ghWesWorkflowListResponse list = new Ga4ghWesWorkflowListResponse(); List<Job> allJobs = orderResource.listWorkflowRuns(user); Map <Integer, JobState> serialized = new TreeMap<Integer, JobState>(); allJobs.stream().forEach((Job j) -> serialized.put(j.getJobId(), j.getState())); for (Integer key: serialized.keySet()){ Ga4ghWesWorkflowDesc descriptor = new Ga4ghWesWorkflowDesc(); descriptor.setWorkflowId(String.valueOf(key)); descriptor.setState(mapState(serialized.get(key))); list.addWorkflowsItem(descriptor); } return Response.ok().entity(list).build(); }
Source:
private void removeManagedBlockStorageDisk() { Future<ActionReturnValue> future = commandCoordinatorUtil.executeAsyncCommand( ActionType.RemoveManagedBlockStorageDisk, getParameters(), cloneContextAndDetachFromParent()); try { setReturnValue(future.get()); setSucceeded(getReturnValue().getSucceeded()); } catch (InterruptedException | ExecutionException e) { log.error("Error removing Cinder disk '{}': {}", getDiskImage().getDiskAlias(), e.getMessage()); log.debug("Exception", e); } }

Target:
private void removeManagedBlockStorageDisk() { Future<ActionReturnValue> future = commandCoordinatorUtil.executeAsyncCommand( ActionType.RemoveManagedBlockStorageDisk, getParameters(), cloneContextAndDetachFromParent()); try { setReturnValue(future.get()); setSucceeded(getReturnValue().getSucceeded()); } catch (InterruptedException | ExecutionException e) { log.error("Error removing managed block storage disk '{}': {}", getDiskImage().getDiskAlias(), e.getMessage()); log.debug("Exception", e); } }
Source:
public final Session session( AccessMode mode ) { assertOpen(); Session session = newSessionWithMode( mode ); if( closed.get() ) { closeResources(); throw new IllegalStateException( "This driver instance has already been closed" ); } return session; }

Target:
public final Session session( AccessMode mode ) { assertOpen(); Session session = newSessionWithMode( mode ); if( closed.get() ) { closeResources(); throw driverCloseException(); } return session; }
Source:
public void should_insert_json_using_prepare_statement() { try (CqlSession session = sessionWithCustomCodec()) { User user = new User(2, "bob", 35); PreparedStatement pst = session.prepare(insertInto("json_jackson_row").json(bindMarker("user")).build()); session.execute(pst.bind().set("user", user, User.class)); List<Row> rows = session.execute(selectFrom("json_jackson_row").json().all().build()).all(); Assertions.assertThat(rows.get(0).get(0, User.class)).isEqualTo(user); } }

Target:
public void should_insert_json_using_prepare_statement() { try (CqlSession session = sessionWithCustomCodec()) { User user = new User(2, "bob", 35); PreparedStatement pst = session.prepare(insertInto("json_jackson_row").json(bindMarker("user")).build()); session.execute(pst.bind().set("user", user, User.class)); List<Row> rows = session.execute(selectFrom("json_jackson_row").json().all().build()).all(); assertThat(rows.get(0).get(0, User.class)).isEqualTo(user); } }
Source:
public CTFStream getStream(Long id) { if( id == null){ return fStreams.get(Long.valueOf(0)); } return fStreams.get(id); }

Target:
public CTFStream getStream(Long id) { if (id == null) { return fStreams.get(0L); } return fStreams.get(id); }
Source:
public boolean isModified(DirCacheEntry entry, boolean forceContentCheck) { return isModified(entry, false, null); }

Target:
public boolean isModified(DirCacheEntry entry, boolean forceContentCheck) { return isModified(entry, forceContentCheck, null); }
Source:
protected boolean checkAltitudeName(String name) { if (AltitudeSweCoordinateName.isAltitudeSweCoordinateName(name)) { return true; } return CoordinateHelper.getInstance().hasAltitudeName(name); }

Target:
protected boolean checkAltitudeName(String name) { return AltitudeSweCoordinateName.isAltitudeSweCoordinateName(name) || CoordinateHelper.getInstance().hasAltitudeName(name); }