auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_travel_guide); toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawerToggle = setupDrawerToggle(); nvDrawer = (NavigationView) findViewById(R.id.nvView); View header = LayoutInflater.from(this).inflate(R.layout.nav_header, null); nvDrawer.addHeaderView(header); setupDrawerContent(nvDrawer); ivProfile = (ImageView) header.findViewById(R.id.ivProfile); tvProfileUsername = (TextView) header.findViewById(R.id.tvProfileUsername); tvProfileEmail = (TextView) header.findViewById(R.id.tvProfileEmail); mDrawer.setDrawerListener(drawerToggle); getSupportFragmentManager().addOnBackStackChangedListener(this); FoursquareConstants.setClientIdAndSecret( getApplicationContext().getResources().getString(R.string.foursquare_client_id), getApplicationContext().getResources().getString(R.string.foursquare_client_secret)); buildSettingsDialog(); city = "Any"; group = "Any"; season = "Any"; MenuItem item = nvDrawer.getMenu().findItem(R.id.login_fragment); <START> if (Preferences.readBoolean(this, Preferences.User.LOG_IN_STATUS)) <END> item.setTitle("LOGOUT"); else item.setTitle("LOGIN"); loginStatus = Preferences.readBoolean(this, Preferences.User.LOG_IN_STATUS); setContentFragment(new TripPlanListFragment()); }</code><technical_language>I encapsulated this method sanity, places this code</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_travel_guide); toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawerToggle = setupDrawerToggle(); nvDrawer = (NavigationView) findViewById(R.id.nvView); View header = LayoutInflater.from(this).inflate(R.layout.nav_header, null); nvDrawer.addHeaderView(header); setupDrawerContent(nvDrawer); ivProfile = (ImageView) header.findViewById(R.id.ivProfile); tvProfileUsername = (TextView) header.findViewById(R.id.tvProfileUsername); tvProfileEmail = (TextView) header.findViewById(R.id.tvProfileEmail); mDrawer.setDrawerListener(drawerToggle); getSupportFragmentManager().addOnBackStackChangedListener(this); FoursquareConstants.setClientIdAndSecret( getApplicationContext().getResources().getString(R.string.foursquare_client_id), getApplicationContext().getResources().getString(R.string.foursquare_client_secret)); buildSettingsDialog(); city = "Any"; group = "Any"; season = "Any"; mLoginStatus = Preferences.readBoolean(this, Preferences.User.LOG_IN_STATUS); setMenuItemLoginTitle(); setContentFragment(new TripPlanListFragment()); }
Source:
<code>protected List<String> setupDefaultMaster(String... args) throws Exception { if (isIntegration()) { checkArgument(args.length == 0, "cannot start default master in integration test with arguments passed"); return null; } final CuratorFramework curator = zk.curator(); curator.newNamespaceAwareEnsurePath(Paths.configHosts()).ensure(curator.getZookeeperClient()); curator.newNamespaceAwareEnsurePath(Paths.configJobs()).ensure(curator.getZookeeperClient()); curator.newNamespaceAwareEnsurePath(Paths.configJobRefs()).ensure(curator.getZookeeperClient()); curator.newNamespaceAwareEnsurePath(Paths.statusHosts()).ensure(curator.getZookeeperClient()); curator.newNamespaceAwareEnsurePath(Paths.statusMasters()).ensure(curator.getZookeeperClient()); curator.newNamespaceAwareEnsurePath(Paths.historyJobs()).ensure(curator.getZookeeperClient()); List<String> argsList = Lists.newArrayList("-vvvv", "--no-log-setup", "--http", masterEndpoint(), "--admin=" + masterAdminPort(), "--name", TEST_MASTER, "--domain", "", <START> "--zk", zk.connectString()); <END> argsList.addAll(asList(args)); return argsList; }</code><technical_language>I this fault, here, please this final</technical_language>

Target:
protected List<String> setupDefaultMaster(String... args) throws Exception { if (isIntegration()) { checkArgument(args.length == 0, "cannot start default master in integration test with arguments passed"); return null; } final CuratorFramework curator = zk.curator(); curator.newNamespaceAwareEnsurePath(Paths.configHosts()).ensure(curator.getZookeeperClient()); curator.newNamespaceAwareEnsurePath(Paths.configJobs()).ensure(curator.getZookeeperClient()); curator.newNamespaceAwareEnsurePath(Paths.configJobRefs()).ensure(curator.getZookeeperClient()); curator.newNamespaceAwareEnsurePath(Paths.statusHosts()).ensure(curator.getZookeeperClient()); curator.newNamespaceAwareEnsurePath(Paths.statusMasters()).ensure(curator.getZookeeperClient()); curator.newNamespaceAwareEnsurePath(Paths.historyJobs()).ensure(curator.getZookeeperClient()); final List<String> argsList = Lists.newArrayList("-vvvv", "--no-log-setup", "--http", masterEndpoint(), "--admin=" + masterAdminPort(), "--name", TEST_MASTER, "--domain", "", "--zk", zk.connectString()); argsList.addAll(asList(args)); return argsList; }
Source:
<code>public void dispose() { log.info("vdsManager::disposing"); SchedulerUtilQuartzImpl.getInstance().deleteJob(onTimerJobId); XmlRpcUtils.shutDownConnection(_vdsProxy.getHttpClient()); <START> if (JsonRpcVdsServer.class.isInstance(_vdsProxy)) { <END> ((JsonRpcVdsServer) _vdsProxy).close(); } }</code><technical_language>ok cast is change if condition? do is outcome of shutting a vdsproxy is VdsServerWrapper instance? this code is unsafe proxy implement Closeable impl shutdown itself</technical_language>

Target:
public void dispose() { log.info("vdsManager::disposing"); SchedulerUtilQuartzImpl.getInstance().deleteJob(onTimerJobId); _vdsProxy.close(); }
Source:
<code>private void enableImmutableTables(ConnectionQueryServices queryServices, ArrayList<String> immutableList, long startWaitTime) { int retryCount = 0; long endWaitTime = System.currentTimeMillis(); long waitMore = getWaitMoreTime(endWaitTime, startWaitTime); <START> while (retryCount < 5 && !waited) { <END> LOGGER.info("waiting for more " + waitMore + " ms for client cache " + "to expire for immutable tables"); try { startWaitTime = System.currentTimeMillis(); Thread.sleep(waitMore); waited = true; } catch (InterruptedException e) { endWaitTime = System.currentTimeMillis(); waitMore = getWaitMoreTime(endWaitTime, startWaitTime); retryCount++; LOGGER.warning("Sleep before starting index rebuild is interrupted. " + "Attempting to sleep again! " + e.getMessage()); } } if (retryCount == 5) { LOGGER.info("Sleep was interrupted multiple times for immutable tables, " + "we'll still go ahead and enable the table."); } try (Admin admin = queryServices.getAdmin()) { for (String dataTableFullName: immutableList) { dataTableFullNameGlobal = dataTableFullName; HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); enableTable(admin, dataTableFullName, indexes); } } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while enabling immutable table " + dataTableFullNameGlobal); tablesAndIndexes.remove(dataTableFullNameGlobal); immutableList.remove(dataTableFullNameGlobal); throw new RuntimeException("Manually enable the table " + dataTableFullNameGlobal + " and run the index rebuild ", e); } }</code><technical_language>const for 5 .. line 445</technical_language>

Target:
private void enableImmutableTables(ConnectionQueryServices queryServices, ArrayList<String> immutableList, long startWaitTime) { long endWaitTime = EnvironmentEdgeManager.currentTimeMillis(); long waitMore = getWaitMoreTime(endWaitTime, startWaitTime); while (waitMore>0) { LOGGER.info("waiting for more " + waitMore + " ms for client cache " + "to expire for immutable tables"); try { startWaitTime = EnvironmentEdgeManager.currentTimeMillis(); Thread.sleep(waitMore); waited = true; } catch (InterruptedException e) { endWaitTime = EnvironmentEdgeManager.currentTimeMillis(); waitMore = getWaitMoreTime(endWaitTime, startWaitTime); LOGGER.warning("Sleep before starting index rebuild is interrupted. " + "Attempting to sleep again! " + e.getMessage()); } } for (String dataTableFullName: immutableList) { try (Admin admin = queryServices.getAdmin()) { HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); enableTable(admin, dataTableFullName, indexes); } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while enabling immutable table " + e); tablesAndIndexes.remove(dataTableFullName); immutableList.remove(dataTableFullName); throw new RuntimeException("Manually enable the following tables " + getSubListString(immutableList, dataTableFullName) + " and run the index rebuild ", e); } } }
Source:
<code>public MigrationURLConnection(URL url, ImportMigrationContext context) throws MalformedURLException { super(url); Validate.notNull(url, "invalid null URL"); this.context = context; <START> this.path = URL_TO_PATHS.get(url.getPath()); <END> if (this.path == null) { throw new MalformedURLException(String.format("Could not resolve URL <%s>.", url.toString())); } }</code><technical_language>a map? simply get path provided, prefix "etc/" check if file exported. If fail, if continue it. way, if is additional references, hardcoded this</technical_language>

Target:
public MigrationURLConnection(URL url, ImportMigrationContext context) throws FileNotFoundException { super(url); Validate.notNull(url, "invalid null URL"); final Path path = Paths.get("etc" + url.getPath()); this.entry = context.getEntry(path); if (this.entry == null) { throw new FileNotFoundException(); } }
Source:
<code>public LazyFuzzyMatchFnDerivs(Example ex, Callable c, FuzzyMatchFnMode mode, boolean matchAny) { this.ex = ex; if (ex.context != null && ex.context.graph != null && ex.context.graph instanceof FuzzyMatchable) this.matchable = (FuzzyMatchable) ex.context.graph; else this.matchable = null; this.c = c; this.query = (matchAny || c.getChildren().isEmpty()) ? null : c.childStringValue(0); <START> if (c.getRule().rhs.size() == 1 && "$PHRASE".equals(c.getRule().rhs.get(0))) { <END> sentence = ex.getTokens(); } else if (c.getRule().rhs.size() == 1 && "$LEMMA_PHRASE".equals(c.getRule().rhs.get(0))) { sentence = ex.getLemmaTokens(); } else { sentence = null; } this.mode = mode; this.matchAny = matchAny; if (opts.verbose >= 2) LogInfo.logs("FuzzyMatchFn[%s]%s.call: %s", this.mode, (this.matchAny ? "[matchAny]" : ""), this.query); }</code><technical_language>Replace $PHRASE Rule.phraseCat</technical_language>

Target:
public LazyFuzzyMatchFnDerivs(Example ex, Callable c, FuzzyMatchFnMode mode, boolean matchAny) { this.ex = ex; if (ex.context != null && ex.context.graph != null && ex.context.graph instanceof FuzzyMatchable) this.matchable = (FuzzyMatchable) ex.context.graph; else this.matchable = null; this.c = c; this.query = (matchAny || c.getChildren().isEmpty()) ? null : c.childStringValue(0); if (c.getRule().rhs.size() == 1 && Rule.phraseCat.equals(c.getRule().rhs.get(0))) { sentence = ex.getTokens(); } else if (c.getRule().rhs.size() == 1 && Rule.lemmaPhraseCat.equals(c.getRule().rhs.get(0))) { sentence = ex.getLemmaTokens(); } else { sentence = null; } this.mode = mode; this.matchAny = matchAny; if (opts.verbose >= 2) LogInfo.logs("FuzzyMatchFn[%s]%s.call: %s", this.mode, (this.matchAny ? "[matchAny]" : ""), this.query); }
Source:
<code>public void close() { try { proxy().close(); } catch (ConnectionClosedException | ConnectionShutdownException e) { <START> LOGGER.warn("Store was already closed, since connection was closed"); <END> } }</code><technical_language>Is this worthy of a warn? action do expect user prevent this logged</technical_language>

Target:
public void close() { try { proxy().close(); } catch (ConnectionClosedException | ConnectionShutdownException e) { LOGGER.debug("Store was already closed, since connection was closed"); } }
Source:
<code>private KalturaLiveEntry authenticate(String entryId, int partnerId, String token, KalturaEntryServerNodeType serverIndex) throws KalturaApiException, ClientConnectException, Exception { <START> long currentTime = System.currentTimeMillis(); <END> Object entryLastValidationTime = KalturaEntryDataPersistence.setProperty(entryId, Constants.KALTURA_ENTRY_VALIDATED_TIME, currentTime); KalturaLiveEntry liveEntry = null; if ((entryLastValidationTime == null) || (currentTime - (long) entryLastValidationTime > Constants.KALTURA_MIN_TIME_BETWEEN_AUTHENTICATIONS)) { liveEntry = (KalturaLiveEntry) KalturaAPI.getKalturaAPI().authenticate(entryId, partnerId, token, serverIndex); KalturaEntryDataPersistence.setProperty(entryId, Constants.CLIENT_PROPERTY_KALTURA_LIVE_ENTRY, liveEntry); logger.info("(" + entryId + ") Entry authenticated successfully!"); } else { logger.debug("(" + entryId + ") Entry did not authenticate! Last authentication: [" + (currentTime - (long) entryLastValidationTime) + "] MS ago"); } return liveEntry; }</code><technical_language>put entire lock stuff this method</technical_language>

Target:
private void authenticate(String entryId, int partnerId, String token, KalturaEntryServerNodeType serverIndex) throws KalturaApiException, ClientConnectException, Exception { Object authenticationLock = KalturaEntryDataPersistence.getLock(entryId); synchronized (authenticationLock) { try { logger.debug("(" + entryId + ") Starting authentication process"); if (Boolean.TRUE.equals(KalturaEntryDataPersistence.getPropertyByEntry(entryId, Constants.KALTURA_ENTRY_AUTHENTICATION_ERROR_FLAG))) { throw new Exception("(" + entryId + ") Authentication Error Flag is up!"); } long currentTime = System.currentTimeMillis(); Object entryLastValidationTime = KalturaEntryDataPersistence.setProperty(entryId, Constants.KALTURA_ENTRY_VALIDATED_TIME, currentTime); if ((entryLastValidationTime == null) || (currentTime - (long)entryLastValidationTime > Constants.KALTURA_MIN_TIME_BETWEEN_AUTHENTICATIONS)) { KalturaLiveEntry liveEntry = (KalturaLiveEntry) KalturaAPI.getKalturaAPI().authenticate(entryId, partnerId, token, serverIndex); KalturaEntryDataPersistence.setProperty(entryId, Constants.CLIENT_PROPERTY_KALTURA_LIVE_ENTRY, liveEntry); KalturaEntryDataPersistence.setProperty(entryId, Constants.KALTURA_ENTRY_AUTHENTICATION_ERROR_FLAG, false); logger.info("(" + entryId + ") Entry authenticated successfully!"); } else { logger.debug("(" + entryId + ") Entry did not authenticate! Last authentication: [" + (currentTime - (long)entryLastValidationTime) + "] MS ago"); } } catch (Exception e) { logger.error("(" + entryId + ") Exception was thrown during authentication process"); KalturaEntryDataPersistence.setProperty(entryId, Constants.KALTURA_ENTRY_AUTHENTICATION_ERROR_FLAG, true); KalturaEntryDataPersistence.setProperty(entryId, Constants.KALTURA_ENTRY_VALIDATED_TIME, (long)0); throw e; } } }
Source:
<code>public MenuItem configureMenuItem(Action action, Command command, MenuItem menuItem) { <START> ActionUtils.configureMenuItem(new JabRefAction(action, command, keyBindingRepository, "Menu"), menuItem); <END> setGraphic(menuItem, action); if (command instanceof SimpleCommand) { EasyBind.subscribe( ((SimpleCommand) command).statusMessageProperty(), message -> { Label label = getAssociatedNode(menuItem); if (label != null) { label.setMouseTransparent(false); if (StringUtil.isBlank(message)) { label.setTooltip(null); } else { label.setTooltip(new Tooltip(message)); } } } ); } return menuItem; }</code><technical_language>please create a new enum for Menu Button constants (I magic strings)</technical_language>

Target:
public MenuItem configureMenuItem(Action action, Command command, MenuItem menuItem) { ActionUtils.configureMenuItem(new JabRefAction(action, command, keyBindingRepository, Sources.FromMenu), menuItem); setGraphic(menuItem, action); if (command instanceof SimpleCommand) { EasyBind.subscribe( ((SimpleCommand) command).statusMessageProperty(), message -> { Label label = getAssociatedNode(menuItem); if (label != null) { label.setMouseTransparent(false); if (StringUtil.isBlank(message)) { label.setTooltip(null); } else { label.setTooltip(new Tooltip(message)); } } } ); } return menuItem; }
Source:
<code>static Assignment deserializeAssignmentV1(ByteBuffer buffer) { Struct struct = ASSIGNMENT_V1.read(buffer); ByteBuffer userData = struct.getBytes(USER_DATA_KEY_NAME); List<TopicPartition> partitions = new ArrayList<>(); for (Object structObj : struct.getArray(TOPIC_PARTITIONS_KEY_NAME)) { Struct assignment = (Struct) structObj; String topic = assignment.getString(TOPIC_KEY_NAME); for (Object partitionObj : assignment.getArray(PARTITIONS_KEY_NAME)) { partitions.add(new TopicPartition(topic, (Integer) partitionObj)); } } <START> ConsumerAssignmentData consumerData = new ConsumerAssignmentData(partitions); <END> return new Assignment(userData, consumerData); }</code><technical_language>nit: extra line below</technical_language>

Target:
static Assignment deserializeAssignmentV1(ByteBuffer buffer) { return deserializeAssignmentV0(buffer); }
Source:
<code>protected void upgradeSystemTables() throws StandardException { try { PartitionAdmin admin = SIDriver.driver().getTableFactory().getAdmin(); if (!admin.tableExists(HBaseConfiguration.MASTER_SNAPSHOTS_TABLE_NAME)) { LOG.info("Creating " + HBaseConfiguration.MASTER_SNAPSHOTS_TABLE_NAME); <START> admin.newPartition().withName(HBaseConfiguration.MASTER_SNAPSHOTS_TABLE_NAME, 100).create(); <END> } if (!admin.tableExists(HBaseConfiguration.REPLICA_REPLICATION_PROGRESS_TABLE_NAME)) { LOG.info("Creating " + HBaseConfiguration.REPLICA_REPLICATION_PROGRESS_TABLE_NAME); admin.newPartition().withName(HBaseConfiguration.REPLICA_REPLICATION_PROGRESS_TABLE_NAME, 100).create(); } } catch (IOException e) { LOG.warn("Exception while creating while creating replication tables", e); } }</code><technical_language>constant</technical_language>

Target:
protected void upgradeSystemTables() throws StandardException { try { PartitionAdmin admin = SIDriver.driver().getTableFactory().getAdmin(); if (!admin.tableExists(HBaseConfiguration.MASTER_SNAPSHOTS_TABLE_NAME)) { LOG.info("Creating " + HBaseConfiguration.MASTER_SNAPSHOTS_TABLE_NAME); admin.newPartition().withName(HBaseConfiguration.MASTER_SNAPSHOTS_TABLE_NAME, Conglomerate.Priority.HIGH).create(); } if (!admin.tableExists(HBaseConfiguration.REPLICA_REPLICATION_PROGRESS_TABLE_NAME)) { LOG.info("Creating " + HBaseConfiguration.REPLICA_REPLICATION_PROGRESS_TABLE_NAME); admin.newPartition().withName(HBaseConfiguration.REPLICA_REPLICATION_PROGRESS_TABLE_NAME, Conglomerate.Priority.HIGH).create(); } } catch (IOException e) { LOG.warn("Exception while creating while creating replication tables", e); } }
Source:
<code>protected PathFragment readSymbolicLink(Path path) throws IOException { java.nio.file.Path nioPath = getNioPath(path); try { return PathFragment.create(WindowsFileOperations.readSymlinkOrJunction(nioPath.toString())); } catch (IOException e) { <START> throw e.getMessage().endsWith("path is not a link") ? new NotASymlinkException(path) : e; <END> } }</code><technical_language>branch exception message, WindowsFileOperations.readSymlinkOrJunction throw right exception instead</technical_language>

Target:
protected PathFragment readSymbolicLink(Path path) throws IOException { java.nio.file.Path nioPath = getNioPath(path); WindowsFileOperations.ReadSymlinkOrJunctionResult result = WindowsFileOperations.readSymlinkOrJunction(nioPath.toString()); if (result.getStatus() == WindowsFileOperations.ReadSymlinkOrJunctionResult.Status.OK) { return PathFragment.create(result.getResult()); } if (result.getStatus() == WindowsFileOperations.ReadSymlinkOrJunctionResult.Status.NOT_A_LINK) { throw new NotASymlinkException(path); } throw new IOException(result.getResult()); }
Source:
<code>private static void initializeRealm(Realm realm) { boolean commitChanges = false; try { realm.beginTransaction(); long currentVersion = realm.getVersion(); boolean unversioned = currentVersion == UNVERSIONED; commitChanges = unversioned; if (unversioned) { realm.setVersion(realm.configuration.getSchemaVersion()); } final RealmProxyMediator mediator = realm.configuration.getSchemaMediator(); final Set<Class<? extends RealmModel>> modelClasses = mediator.getModelClasses(); final Map<Class<? extends RealmModel>, ColumnInfo> columnInfoMap = new HashMap<Class<? extends RealmModel>, ColumnInfo>(modelClasses.size()); for (Class<? extends RealmModel> modelClass : modelClasses) { if (unversioned) { mediator.createTable(modelClass, realm.sharedRealm); } columnInfoMap.put(modelClass, mediator.validateTable(modelClass, realm.sharedRealm, false)); } realm.schema.columnIndices = new ColumnIndices( (unversioned) ? realm.configuration.getSchemaVersion() : currentVersion, columnInfoMap); if (unversioned) { final Transaction transaction = realm.configuration.getInitialDataTransaction(); if (transaction != null) { transaction.execute(realm); } } } catch (Exception e) { commitChanges = false; <START> throw new RuntimeException(e); <END> } finally { if (commitChanges) { realm.commitTransaction(); } else { realm.cancelTransaction(); } } }</code><technical_language>I need wrap exception exceptions a subclass of RuntimeException. I prefer catching RuntimeException instead of Exception. If some methods throws non-RuntimeException, I catch separately wrap non-RuntimeExceptions</technical_language>

Target:
private static void initializeRealm(Realm realm) { boolean commitChanges = false; try { realm.beginTransaction(); long currentVersion = realm.getVersion(); boolean unversioned = currentVersion == UNVERSIONED; commitChanges = unversioned; if (unversioned) { realm.setVersion(realm.configuration.getSchemaVersion()); } final RealmProxyMediator mediator = realm.configuration.getSchemaMediator(); final Set<Class<? extends RealmModel>> modelClasses = mediator.getModelClasses(); final Map<Class<? extends RealmModel>, ColumnInfo> columnInfoMap = new HashMap<>(modelClasses.size()); if (unversioned) { for (Class<? extends RealmModel> modelClass : modelClasses) { mediator.createTable(modelClass, realm.sharedRealm); } } for (Class<? extends RealmModel> modelClass : modelClasses) { columnInfoMap.put(modelClass, mediator.validateTable(modelClass, realm.sharedRealm, false)); } realm.schema.columnIndices = new ColumnIndices( (unversioned) ? realm.configuration.getSchemaVersion() : currentVersion, columnInfoMap); if (unversioned) { final Transaction transaction = realm.configuration.getInitialDataTransaction(); if (transaction != null) { transaction.execute(realm); } } } catch (Exception e) { commitChanges = false; throw e; } finally { if (commitChanges) { realm.commitTransaction(); } else { realm.cancelTransaction(); } } }
Source:
<code>protected float getAssignmentScore(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { float doubleEstimatedMaxPartitionCount = 2 * clusterContext.getEstimatedMaxPartitionCount(); <START> return node.getAssignedReplicaCount() / doubleEstimatedMaxPartitionCount; <END> }</code><technical_language>need double estimate tanh()</technical_language>

Target:
protected float getAssignmentScore(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { return node.getAssignedReplicaCount() / (float) clusterContext.getEstimatedMaxPartitionCount(); }
Source:
<code>public void saveOrder_shouldFailIfConceptInPreviousOrderDoesNotMatchThisConcept() throws Exception { executeDataSet("org/openmrs/api/include/OrderServiceTest-globalProperties.xml"); <START> executeDataSet("org/openmrs/api/include/OrderServiceTest-discontinueReason.xml"); <END> OrderService orderService = Context.getOrderService(); Order order = new Order(); order.setAction(Order.Action.DISCONTINUE); order.setDiscontinuedReasonNonCoded("Discontinue this"); order.setPatient(Context.getPatientService().getPatient(7)); order.setConcept(Context.getConceptService().getConcept(3)); order.setCareSetting(orderService.getCareSetting(1)); order.setStartDate(new Date()); Order previousOrder = orderService.getOrder(111); order.setPreviousOrder(previousOrder); orderService.saveOrder(order); }</code><technical_language>do include this test data for reason concept? Is required for this test</technical_language>

Target:
public void saveOrder_shouldFailIfConceptInPreviousOrderDoesNotMatchThisConcept() throws Exception { executeDataSet("org/openmrs/api/include/OrderServiceTest-globalProperties.xml"); OrderService orderService = Context.getOrderService(); Order order = new Order(); order.setAction(Order.Action.DISCONTINUE); order.setDiscontinuedReasonNonCoded("Discontinue this"); order.setPatient(Context.getPatientService().getPatient(7)); order.setConcept(Context.getConceptService().getConcept(3)); order.setCareSetting(orderService.getCareSetting(1)); order.setStartDate(new Date()); Order previousOrder = orderService.getOrder(111); order.setPreviousOrder(previousOrder); orderService.saveOrder(order); }
Source:
<code><START> public boolean compare(ITmfStateValue source, ITmfStateValue dest, ConditionOperator comparisonOperator) { <END> if (source == null) { throw new IllegalArgumentException(); } switch (comparisonOperator) { case EQ: return (source.compareTo(dest) == 0); case NE: return (source.compareTo(dest) != 0); case GE: return (source.compareTo(dest) >= 0); case GT: return (source.compareTo(dest) > 0); case LE: return (source.compareTo(dest) <= 0); case LT: return (source.compareTo(dest) < 0); case NONE: default: throw new IllegalArgumentException("TmfXmlCondition: invalid comparison operator."); } }</code><technical_language>Here, source dest @NonNull, avoid null check below, throw exception if compareTo method is called null dest</technical_language>

Target:
public boolean compare(ITmfStateValue source, ITmfStateValue dest, ConditionOperator comparisonOperator) { if (source == null || dest == null) { throw new IllegalArgumentException(); } switch (comparisonOperator) { case EQ: return (source.compareTo(dest) == 0); case NE: return (source.compareTo(dest) != 0); case GE: return (source.compareTo(dest) >= 0); case GT: return (source.compareTo(dest) > 0); case LE: return (source.compareTo(dest) <= 0); case LT: return (source.compareTo(dest) < 0); case NONE: default: throw new IllegalArgumentException("TmfXmlCondition: invalid comparison operator."); } }
Source:
<code>public ReferenceSequence getSubsequenceAt(String contig, long start, long stop) { SAMSequenceRecord sequence = sequenceDictionary.getSequence(contig); int referenceIndex = sequence.getSequenceIndex(); byte[] bases; try { ReferenceCacheKey key = new ReferenceCacheKey(Thread.currentThread().getId(), referenceIndex); Reference reference = cachedReferencesByThreads.get(key); if (reference == null) { reference = run.getReference(contig); cachedReferencesByThreads.put(key, reference); <START> } <END> bases = reference.getReferenceBases(start - 1, stop - (start - 1)).getBytes(); } catch (ErrorMsg e) { throw new RuntimeException(e); } return new ReferenceSequence(contig, referenceIndex, bases); }</code><technical_language>mess thread IDs manually this? cache ThreadLocal, simpler error-prone</technical_language>

Target:
public ReferenceSequence getSubsequenceAt(String contig, long start, long stop) { SAMSequenceRecord sequence = sequenceDictionary.getSequence(contig); int referenceIndex = sequence.getSequenceIndex(); byte[] bases; try { HashMap<Integer, Reference> localRefs = cachedReferences.get(); if (localRefs == null) { localRefs = new HashMap<Integer, Reference>(); cachedReferences.set(localRefs); } Reference reference = localRefs.get(referenceIndex); if (reference == null) { reference = run.getReference(contig); localRefs.put(referenceIndex, reference); } bases = reference.getReferenceBases(start - 1, stop - (start - 1)).getBytes(); } catch (ErrorMsg e) { throw new RuntimeException(e); } return new ReferenceSequence(contig, referenceIndex, bases); }
Source:
<code>public int hashCode() { <START> return (((int)m_generation) + ((int)(m_generation >> 32))) + partitionId; <END> }</code><technical_language>include tableName part of hash code</technical_language>

Target:
public int hashCode() { return (((int)m_generation) + ((int)(m_generation >> 32))) + partitionId + tableName.hashCode(); }
Source:
<code>private Number computeActualValue(Object value) { Object transformedValue = valueTransformer.apply(value); if (isNumeric(transformedValue)) { return transformedValue instanceof Number ? (Number) transformedValue : Float.valueOf(transformedValue.toString()); } <START> return null; <END> }</code><technical_language>this class works Numbers, throw exception instead of returning null</technical_language>

Target:
private Number computeActualValue(Object value) { Object transformedValue = valueTransformer.apply(value); if (isNumeric(transformedValue)) { return transformedValue instanceof Number ? (Number) transformedValue : Float.valueOf(transformedValue.toString()); } throw new IllegalArgumentException("Only numeric values are supported, enable debug log level for more details."); }
Source:
<code>Mono<DigitalTwinsResponse<String>> getDigitalTwinWithResponse(String digitalTwinId, Context context) { return protocolLayer .getDigitalTwins() .getByIdWithResponseAsync(digitalTwinId, context) .flatMap(response -> { try { String jsonResponse = mapper.writeValueAsString(response.getValue()); DigitalTwinsResponseHeaders twinHeaders = mapper.convertValue(response.getDeserializedHeaders(), DigitalTwinsResponseHeaders.class); return Mono.justOrEmpty(new DigitalTwinsResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), jsonResponse, twinHeaders)); } catch (JsonProcessingException e) { <START> logger.error("JsonProcessingException occurred while retrieving a relationship: ", e); <END> return Mono.error(e); } }); }</code><technical_language>log statement "relationship"</technical_language>

Target:
Mono<DigitalTwinsResponse<String>> getDigitalTwinWithResponse(String digitalTwinId, Context context) { return protocolLayer .getDigitalTwins() .getByIdWithResponseAsync(digitalTwinId, context) .flatMap(response -> { try { String jsonResponse = mapper.writeValueAsString(response.getValue()); DigitalTwinsResponseHeaders twinHeaders = mapper.convertValue(response.getDeserializedHeaders(), DigitalTwinsResponseHeaders.class); return Mono.justOrEmpty(new DigitalTwinsResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), jsonResponse, twinHeaders)); } catch (JsonProcessingException e) { logger.error("JsonProcessingException occurred while serializing json object into string: ", e); return Mono.error(e); } }); }
Source:
<code>public void networkMappingsProvidedByParameters() throws Exception { <START> assertThat(validator.networkMappingsProvided("mappings"), isValid()); <END> }</code><technical_language>mapping string meaning, consider a random generated one</technical_language>

Target:
public void networkMappingsProvidedByParameters() throws Exception { assertThat(validator.networkMappingsProvided(RandomUtils.instance().nextString(10)), isValid()); }
Source:
<code>public void retirePerson(String id) throws ResourceNotFoundException, NotModifiedException { org.openmrs.Person person = Context.getPersonService().getPersonByUuid(id); if (person == null) throw new ResourceNotFoundException(String.format("Person with id '%s' not found", id)); if (person.isPersonVoided()) return; try { <START> person.setVoided(true); <END> person.setPersonVoidedBy(Context.getAuthenticatedUser()); person.setPersonVoidReason("Retired by FHIR Request"); person.setPersonDateVoided(new Date()); Context.getPersonService().voidPerson(person, "Retired by FHIR Request"); } catch (APIException apie) { throw new MethodNotAllowedException(String.format("OpenMRS has failed to retire person '%s': %s", id, apie.getMessage())); } }</code><technical_language>Setting person void reason fine. Rest underline API invocation add :)</technical_language>

Target:
public void retirePerson(String id) throws ResourceNotFoundException, NotModifiedException { org.openmrs.Person person = Context.getPersonService().getPersonByUuid(id); if (person == null) throw new ResourceNotFoundException(String.format("Person with id '%s' not found", id)); if (person.isPersonVoided()) return; try { Context.getPersonService().voidPerson(person, "Voided by FHIR Request"); } catch (APIException apie) { throw new MethodNotAllowedException(String.format("OpenMRS has failed to retire person '%s': %s", id, apie.getMessage())); } }
Source:
<code>public void updatePresentation(@NotNull NodePresentation presentation) { SpanElement spanElement = createSpanElement(styles.styles().presentableTextContainer()); spanElement.setAttribute("file-name", itemPath); spanElement.setAttribute( "occurrence", String.valueOf(searchOccurrence.getLineNumber() + 1) + ":" <START> + searchOccurrence.getLineContent()); <END> SpanElement lineNumberElement = createSpanElement(); lineNumberElement.setInnerHTML( String.valueOf(searchOccurrence.getLineNumber() + 1) + ":&nbsp;&nbsp;&nbsp;"); spanElement.appendChild(lineNumberElement); SpanElement textElement = createSpanElement(); String phrase = searchOccurrence.getPhrase(); String matchedLine = searchOccurrence.getLineContent(); if (matchedLine != null && phrase != null) { String startOfLine = matchedLine.substring(0, matchedLine.indexOf(phrase)); String endOfLine = matchedLine.substring(matchedLine.indexOf(phrase) + phrase.length()); textElement.appendChild(createTextNode(startOfLine)); SpanElement highlightElement = createSpanElement(resources.coreCss().searchMatch()); highlightElement.setInnerText(phrase); textElement.appendChild(highlightElement); textElement.appendChild(createTextNode(endOfLine)); } else { textElement.appendChild(createTextNode("Can't find sources")); } spanElement.appendChild(textElement); presentation.setPresentableIcon(resources.searchMatch()); presentation.setUserElement((Element) spanElement); }</code><technical_language>good idea put content attribute, please try find other solution</technical_language>

Target:
public void updatePresentation(@NotNull NodePresentation presentation) { SpanElement spanElement = createSpanElement(styles.styles().presentableTextContainer()); spanElement.setAttribute("debugFilePath", itemPath); SpanElement lineNumberElement = createSpanElement(); lineNumberElement.setInnerHTML( String.valueOf(searchOccurrence.getLineNumber() + 1) + ":&nbsp;&nbsp;&nbsp;"); spanElement.appendChild(lineNumberElement); SpanElement textElement = createSpanElement(); String phrase = searchOccurrence.getPhrase(); String matchedLine = searchOccurrence.getLineContent(); if (matchedLine != null && phrase != null) { String startOfLine = matchedLine.substring(0, matchedLine.indexOf(phrase)); String endOfLine = matchedLine.substring(matchedLine.indexOf(phrase) + phrase.length()); textElement.appendChild(createTextNode(startOfLine)); SpanElement highlightElement = createSpanElement(resources.coreCss().searchMatch()); highlightElement.setInnerText(phrase); textElement.appendChild(highlightElement); textElement.appendChild(createTextNode(endOfLine)); } else { textElement.appendChild(createTextNode("Can't find sources")); } spanElement.appendChild(textElement); presentation.setPresentableIcon(resources.searchMatch()); presentation.setUserElement((Element) spanElement); }
Source:
<code>public void run() { <START> if (!node.getClusterService().getClusterState().isJoinAllowed()) { <END> logger.fine("No need to fetch the latest partition table. Cluster state does not allow new members to join."); shouldFetchPartitionTables = false; return; } maxVersion = partitionStateManager.getVersion(); logger.info("Fetching most recent partition table! my version: " + maxVersion); Collection<MigrationInfo> allCompletedMigrations = new HashSet<MigrationInfo>(); Collection<MigrationInfo> allActiveMigrations = new HashSet<MigrationInfo>(); collectAndProcessResults(allCompletedMigrations, allActiveMigrations); logger.info("Most recent partition table version: " + maxVersion); processNewState(allCompletedMigrations, allActiveMigrations); syncPartitionRuntimeState(); }</code><technical_language>if join is allowed - in NO_MIGRATION state? Is ok fetch partition table repair partition table in RepairPartitionTableTask</technical_language>

Target:
public void run() { ClusterState clusterState = node.getClusterService().getClusterState(); if (!clusterState.isMigrationAllowed() && !clusterState.isPartitionPromotionAllowed()) { logger.fine("No need to fetch the latest partition table. " + "Cluster state does not allow to modify partition table."); shouldFetchPartitionTables = false; return; } maxVersion = partitionStateManager.getVersion(); logger.info("Fetching most recent partition table! my version: " + maxVersion); Collection<MigrationInfo> allCompletedMigrations = new HashSet<MigrationInfo>(); Collection<MigrationInfo> allActiveMigrations = new HashSet<MigrationInfo>(); collectAndProcessResults(allCompletedMigrations, allActiveMigrations); logger.info("Most recent partition table version: " + maxVersion); processNewState(allCompletedMigrations, allActiveMigrations); syncPartitionRuntimeState(); }
Source:
<code>public Update createStatement(String sql) { return new Update(this, statementLocator, statementRewriter, statementBuilder, sql, new ConcreteStatementContext(globalStatementAttributes, MappingRegistry.copyOf(mappingRegistry)), timingCollector, foreman, <START> containerFactoryRegistry); <END> }</code><technical_language>revert this constructor argument change for classes implement ResultBearing</technical_language>

Target:
public Update createStatement(String sql) { return new Update(this, statementLocator, statementRewriter, statementBuilder, sql, new ConcreteStatementContext(globalStatementAttributes, MappingRegistry.copyOf(mappingRegistry)), timingCollector, foreman, collectorFactoryRegistry); }
Source:
<code>public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { if (StringUtils.isNotBlank((String) config.get("refresh"))) { refreshInterval = Long.parseLong((String) config.get("refresh")); } setProperlyConfigured(true); } Set<String> configuredDevices = getConfiguredDevices(config); for(String configuredDevice : configuredDevices){ String value = (String) config.get(configuredDevice + "." + SmlReaderConstants.Configuration.CONFIGURATION_KEY_CONNECTION_TYPE); ConnectionType connectionType = ConnectionType.notConfigured; try{ connectionType = ConnectionType.valueOf(value); <START> }catch(IllegalArgumentException | NullPointerException e){ <END> logger.error("The connection type of device '" + configuredDevice + "# is invalid."); setProperlyConfigured(false); break; } if(connectionType == ConnectionType.serial){ createFromSerialConfigurationSettings(configuredDevice, config); } else if(connectionType == ConnectionType.tsap){ createFromTsapConfigurationSettings(configuredDevice, config); } else{ logger.info("There is no device configured to read SML messages from."); setProperlyConfigured(false); break; } } }</code><technical_language>in order 1.5 compatibility avoid multi catch</technical_language>

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { if (StringUtils.isNotBlank((String) config.get("refresh"))) { refreshInterval = Long.parseLong((String) config.get("refresh")); } } Enumeration<String> keys = config.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if ("service.pid".equals(key) || "refresh".equals(key)) { continue; } Matcher matcher = SmlReaderConstants.CONFIGURATION_PATTERN.matcher(key); if(!matcher.matches()) { logger.debug("given config key doesn't match a valid binding config.", key); continue; } matcher.reset(); while (matcher.find()) { String deviceId = matcher.group(1); String serialPort = (String) config.get(deviceId + "." + SmlReaderConstants.CONFIGURATION_KEY_SERIALPORT); if(serialPort == null || serialPort.isEmpty()) serialPort = SmlReaderConstants.DEFAULT_SERIAL_PORT; smlDevices.put(deviceId, SmlDevice.createInstance(deviceId, serialPort)); } } setProperlyConfigured(true); }
Source:
<code>public void propertyChange(PropertyChangeEvent event) { <START> String propertyName = event.getPropertyName(); <END> if (!(event.getSource() instanceof CandidatePair)) { return; } CandidatePair pair = (CandidatePair) event.getSource(); if (!pair.getParentComponent().equals(component)) { return; } if (IceMediaStream.PROPERTY_PAIR_STATE_CHANGED.equals(propertyName)) { CandidatePairState newState = (CandidatePairState) event.getNewValue(); if (CandidatePairState.SUCCEEDED.equals(newState)) { addAuthorizedAddress( pair.getRemoteCandidate().getTransportAddress()); } } else if (IceMediaStream.PROPERTY_PAIR_NOMINATED.equals(propertyName)) { if (initializedActive) { return; } initializedActive = true; LocalCandidate localCandidate = pair.getLocalCandidate(); LocalCandidate base = localCandidate.getBase(); if (base != null) localCandidate = base; TransportAddress remoteAddress = null; RemoteCandidate remoteCandidate = pair.getRemoteCandidate(); if (remoteCandidate != null) { remoteAddress = remoteCandidate.getTransportAddress(); } IceSocketWrapper socketWrapper = localCandidate.getCandidateIceSocketWrapper(remoteAddress); initializeActive(socketWrapper, remoteAddress); } }</code><technical_language>minor technically this (right used) allocate if gonna</technical_language>

Target:
public void propertyChange(PropertyChangeEvent event) { if (!(event.getSource() instanceof CandidatePair)) { return; } CandidatePair pair = (CandidatePair) event.getSource(); if (!pair.getParentComponent().equals(component)) { return; } String propertyName = event.getPropertyName(); if (IceMediaStream.PROPERTY_PAIR_STATE_CHANGED.equals(propertyName)) { CandidatePairState newState = (CandidatePairState) event.getNewValue(); if (CandidatePairState.SUCCEEDED.equals(newState)) { addAuthorizedAddress( pair.getRemoteCandidate().getTransportAddress()); } } else if (IceMediaStream.PROPERTY_PAIR_NOMINATED.equals(propertyName)) { synchronized (initializedActiveSyncRoot) { if (initializedActive) { return; } LocalCandidate localCandidate = pair.getLocalCandidate(); LocalCandidate base = localCandidate.getBase(); if (base != null) localCandidate = base; TransportAddress remoteAddress = null; RemoteCandidate remoteCandidate = pair.getRemoteCandidate(); if (remoteCandidate != null) { remoteAddress = remoteCandidate.getTransportAddress(); } IceSocketWrapper socketWrapper = localCandidate .getCandidateIceSocketWrapper(remoteAddress); initializeActive(socketWrapper, remoteAddress); initializedActive = true; } } }
Source:
<code>protected String[] customCommandLineValidation() { <START> final List<String> values = new ArrayList<>(); <END> checkTagValue("RGID", RGID).ifPresent(values::add); checkTagValue("RGLB", RGLB).ifPresent(values::add); checkTagValue("RGPL", RGPL).ifPresent(values::add); checkTagValue("RGPU", RGPU).ifPresent(values::add); checkTagValue("RGSM", RGSM).ifPresent(values::add); checkTagValue("RGCN", RGCN).ifPresent(values::add); checkTagValue("RGDS", RGDS).ifPresent(values::add); checkTagValue("RGKS", RGKS).ifPresent(values::add); checkTagValue("RGFO", RGFO).ifPresent(values::add); checkTagValue("RGPG", RGPG).ifPresent(values::add); checkTagValue("RGPM", RGPM).ifPresent(values::add); if (!values.isEmpty()) { return values.toArray(new String[values.size()]); } return super.customCommandLineValidation(); }</code><technical_language>rename values mismatches</technical_language>

Target:
protected String[] customCommandLineValidation() { final List<String> validationFailures = new ArrayList<>(); checkTagValue("RGID", RGID).ifPresent(validationFailures::add); checkTagValue("RGLB", RGLB).ifPresent(validationFailures::add); checkTagValue("RGPL", RGPL).ifPresent(validationFailures::add); checkTagValue("RGPU", RGPU).ifPresent(validationFailures::add); checkTagValue("RGSM", RGSM).ifPresent(validationFailures::add); checkTagValue("RGCN", RGCN).ifPresent(validationFailures::add); checkTagValue("RGDS", RGDS).ifPresent(validationFailures::add); checkTagValue("RGKS", RGKS).ifPresent(validationFailures::add); checkTagValue("RGFO", RGFO).ifPresent(validationFailures::add); checkTagValue("RGPG", RGPG).ifPresent(validationFailures::add); checkTagValue("RGPM", RGPM).ifPresent(validationFailures::add); if (!validationFailures.isEmpty()) { return validationFailures.toArray(new String[validationFailures.size()]); } return super.customCommandLineValidation(); }
Source:
<code>static List<FormTable> getPageTables(PageResult pageResultItem, List<ReadResult> readResults, Integer pageNumber) { List<FormTable> extractedTablesList = new ArrayList<>(); <START> pageResultItem.getTables().forEach(dataTable -> { <END> IterableStream<FormTableCell> tableCellList = new IterableStream<>(dataTable.getCells().stream() .map(dataTableCell -> new FormTableCell( dataTableCell.getRowIndex(), dataTableCell.getColumnIndex(), dataTableCell.getRowSpan(), dataTableCell.getColumnSpan(), dataTableCell.getText(), toBoundingBox(dataTableCell.getBoundingBox()), dataTableCell.getConfidence(), dataTableCell.isHeader() == null ? false : dataTableCell.isHeader(), dataTableCell.isFooter() == null ? false : dataTableCell.isFooter(), pageNumber, setReferenceElements(dataTableCell.getElements(), readResults, pageNumber) )) .collect(Collectors.toList())); FormTable extractedTable = new FormTable(dataTable.getRows(), dataTable.getColumns(), tableCellList); extractedTablesList.add(extractedTable); }); return extractedTablesList; }</code><technical_language>This simplified a bit a stream, logic of lambda adding list. java return pageResultItem.getTables().stream() .map(/* convert FormTable */) .collect(Collectors.toList());</technical_language>

Target:
static List<FormTable> getPageTables(PageResult pageResultItem, List<ReadResult> readResults, Integer pageNumber) { return pageResultItem.getTables().stream() .map(dataTable -> new FormTable(dataTable.getRows(), dataTable.getColumns(), new IterableStream<>(dataTable.getCells().stream() .map(dataTableCell -> new FormTableCell( dataTableCell.getRowIndex(), dataTableCell.getColumnIndex(), dataTableCell.getRowSpan(), dataTableCell.getColumnSpan(), dataTableCell.getText(), toBoundingBox(dataTableCell.getBoundingBox()), dataTableCell.getConfidence(), dataTableCell.isHeader() == null ? false : dataTableCell.isHeader(), dataTableCell.isFooter() == null ? false : dataTableCell.isFooter(), pageNumber, setReferenceElements(dataTableCell.getElements(), readResults, pageNumber))) .collect(Collectors.toList())))) .collect(Collectors.toList()); }
Source:
<code>protected void configure() { if (Boolean.valueOf(System.getenv("CHE_METRICS_ENABLED"))) { if (Boolean.valueOf(System.getenv("CHE_TRACING_ENABLED"))) { bind(ExecutorServiceWrapper.class) .to(MeteredAndTracedExecutorServiceWrapper.class) .asEagerSingleton(); } else { bind(ExecutorServiceWrapper.class) .to(MeteredExecutorServiceWrapper.class) .asEagerSingleton(); <START> ; <END> } } else { if (Boolean.valueOf(System.getenv("CHE_TRACING_ENABLED"))) { bind(ExecutorServiceWrapper.class) .to(TracedExecutorServiceWrapper.class) .asEagerSingleton(); ; } else { bind(ExecutorServiceWrapper.class).to(NoopExecutorServiceWrapper.class).asEagerSingleton(); ; } } bind(ThreadPullLauncher.class).to(ObservableThreadPullLauncher.class); }</code><technical_language>unnecessary semicolon</technical_language>

Target:
protected void configure() { if (Boolean.parseBoolean(System.getenv("CHE_METRICS_ENABLED"))) { if (Boolean.parseBoolean(System.getenv("CHE_TRACING_ENABLED"))) { bind(ExecutorServiceWrapper.class) .to(MeteredAndTracedExecutorServiceWrapper.class) .asEagerSingleton(); } else { bind(ExecutorServiceWrapper.class) .to(MeteredExecutorServiceWrapper.class) .asEagerSingleton(); } } else { if (Boolean.parseBoolean(System.getenv("CHE_TRACING_ENABLED"))) { bind(ExecutorServiceWrapper.class) .to(TracedExecutorServiceWrapper.class) .asEagerSingleton(); } else { bind(ExecutorServiceWrapper.class).to(NoopExecutorServiceWrapper.class).asEagerSingleton(); } } bind(ThreadPullLauncher.class).to(ObservableThreadPullLauncher.class); }