auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ContainerStateMachine(RaftGroupId gid, ContainerDispatcher dispatcher, ThreadPoolExecutor chunkExecutor, XceiverServerRatis ratisServer, long expiryInterval, boolean isBlockTokenEnabled, TokenVerifier tokenVerifier, Configuration conf) { this.gid = gid; this.dispatcher = dispatcher; this.chunkExecutor = chunkExecutor; this.ratisServer = ratisServer; metrics = CSMMetrics.create(gid); this.writeChunkFutureMap = new ConcurrentHashMap<>(); applyTransactionCompletionMap = new ConcurrentHashMap<>(); stateMachineDataCache = CacheBuilder.newBuilder() .expireAfterAccess(expiryInterval, TimeUnit.MILLISECONDS) .maximumSize(chunkExecutor.getCorePoolSize()).build(); this.isBlockTokenEnabled = isBlockTokenEnabled; this.tokenVerifier = tokenVerifier; this.createContainerSet = new ConcurrentSkipListSet<>(); final int numContainerOpExecutors = conf.getInt( OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_CONTAINER_OP_EXECUTORS_KEY, OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_CONTAINER_OP_EXECUTORS_DEFAULT); this.executors = new ExecutorService[numContainerOpExecutors]; <START> for (AtomicInteger i = new AtomicInteger(); <END> i.get() < numContainerOpExecutors; i.incrementAndGet()) { this.executors[i.get()] = Executors.newSingleThreadExecutor(r -> { Thread t = new Thread(r); t.setName("RatisApplyTransactionExecutor " + i.get()); return t; }); } }</code><technical_language>Is a need for AtomicInteger in place of regular int</technical_language>

Target:
public ContainerStateMachine(RaftGroupId gid, ContainerDispatcher dispatcher, ThreadPoolExecutor chunkExecutor, XceiverServerRatis ratisServer, long expiryInterval, boolean isBlockTokenEnabled, TokenVerifier tokenVerifier, Configuration conf) { this.gid = gid; this.dispatcher = dispatcher; this.chunkExecutor = chunkExecutor; this.ratisServer = ratisServer; metrics = CSMMetrics.create(gid); this.writeChunkFutureMap = new ConcurrentHashMap<>(); applyTransactionCompletionMap = new ConcurrentHashMap<>(); stateMachineDataCache = CacheBuilder.newBuilder() .expireAfterAccess(expiryInterval, TimeUnit.MILLISECONDS) .maximumSize(chunkExecutor.getCorePoolSize()).build(); this.isBlockTokenEnabled = isBlockTokenEnabled; this.tokenVerifier = tokenVerifier; this.createContainerSet = new ConcurrentSkipListSet<>(); final int numContainerOpExecutors = conf.getInt( OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_CONTAINER_OP_EXECUTORS_KEY, OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_CONTAINER_OP_EXECUTORS_DEFAULT); this.executors = new ExecutorService[numContainerOpExecutors]; for (int i = 0; i < numContainerOpExecutors; i++) { final int index = i; this.executors[index] = Executors.newSingleThreadExecutor(r -> { Thread t = new Thread(r); t.setName("RatisApplyTransactionExecutor " + index); return t; }); } }
Source:
<code>public List<String> resolve(List<String> names) { if (names == null) { <START> return new ArrayList<>(); <END> } final String defaultRack = defaultRackSupplier.get(); Preconditions.checkNotNull(defaultRack, "Default rack cannot be null"); List<String> rNames = resolver.resolve(names); if (rNames != null && rNames.size() == names.size()) { for (int i = 0; i < rNames.size(); ++i) { if (rNames.get(i) == null) { LOG.warn("Failed to resolve network location for {}, using default rack for it : {}.", rNames.get(i), defaultRack); rNames.set(i, defaultRack); } } return rNames; } LOG.warn("Failed to resolve network location for {}, using default rack for them : {}.", names, defaultRack); rNames = new ArrayList<>(names.size()); for (int i = 0; i < names.size(); ++i) { rNames.add(defaultRack); } return rNames; }</code><technical_language>Collections.emptyList() avoid constructing object here</technical_language>

Target:
public List<String> resolve(List<String> names) { if (names == null) { return Collections.emptyList(); } final String defaultRack = defaultRackSupplier.get(); Preconditions.checkNotNull(defaultRack, "Default rack cannot be null"); List<String> rNames = resolver.resolve(names); if (rNames != null && rNames.size() == names.size()) { for (int i = 0; i < rNames.size(); ++i) { if (rNames.get(i) == null) { LOG.warn("Failed to resolve network location for {}, using default rack for it : {}.", rNames.get(i), defaultRack); rNames.set(i, defaultRack); } } return rNames; } LOG.warn("Failed to resolve network location for {}, using default rack for them : {}.", names, defaultRack); rNames = new ArrayList<>(names.size()); for (int i = 0; i < names.size(); ++i) { rNames.add(defaultRack); } return rNames; }
Source:
<code>public ITmfTrace openMinimalTrace(String projectName, String traceName, Boolean isExperiment) throws FileNotFoundException { Map<String, Object> parameters = new HashMap<>(); parameters.put("name", traceName); String filePath = getFile(projectName, traceName, isExperiment).getLocation().getPath(); parameters.put("uri", filePath); QueryParameters query = new QueryParameters(parameters, Collections.emptyList()); <START> TraceManagerService traceManager = new TraceManagerService(); Response response = traceManager.putTrace(query); Object traceObject = response.getEntity(); if (traceObject instanceof ITmfTrace) { return (ITmfTrace) traceObject; } <END> throw new FileNotFoundException(); }</code><technical_language>I depend jersey rest server this point. get inspiration code implement opening, directly, is a feature installed users of Trace Compass, able this method</technical_language>

Target:
public ITmfTrace openMinimalTrace(String projectName, String traceName, Boolean isExperiment) throws FileNotFoundException { String path = getFile(projectName, traceName, isExperiment).getLocationURI().getPath(); ITmfTrace trace; try { trace = put(path, traceName, ""); if (trace != null) { return trace; } } catch (InstantiationException | IllegalAccessException | FileNotFoundException | TmfTraceException | CoreException | TmfTraceImportException e) { } throw new FileNotFoundException(); }
Source:
<code>public static void handleSpecialProperties(String contentType, MessageContext axis2MessageCtx) { axis2MessageCtx.setProperty(Constants.Configuration.MESSAGE_TYPE, contentType); axis2MessageCtx.setProperty(Constants.Configuration.CONTENT_TYPE, contentType); Map headers = (Map) axis2MessageCtx.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS); if (headers != null) { <START> headers.remove(HTTP.CONTENT_TYPE); <END> headers.put(HTTP.CONTENT_TYPE, contentType); } }</code><technical_language>put removing</technical_language>

Target:
public static void handleSpecialProperties(String contentType, MessageContext axis2MessageCtx) { axis2MessageCtx.setProperty(Constants.Configuration.MESSAGE_TYPE, contentType); axis2MessageCtx.setProperty(Constants.Configuration.CONTENT_TYPE, contentType); Map headers = (Map) axis2MessageCtx.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS); if (headers != null) { headers.put(HTTP.CONTENT_TYPE, contentType); } }
Source:
<code>public abstract SyncUser run() throws ObjectServerError; public RealmAsyncTask start() { Future<?> authenticateRequest = networkPoolExecutor.submit(new Runnable() { @Override public void run() { try { postSuccess(Request.this.run()); } catch (ObjectServerError e) { postError(e); <START> } <END> } }); return new RealmAsyncTaskImpl(authenticateRequest, networkPoolExecutor); }</code><technical_language>catch other RuntimeException log it</technical_language>

Target:
public abstract SyncUser run() throws ObjectServerError; public RealmAsyncTask start() { Future<?> authenticateRequest = networkPoolExecutor.submit(new Runnable() { @Override public void run() { try { postSuccess(Request.this.run()); } catch (ObjectServerError e) { postError(e); } catch (Throwable e) { postError(new ObjectServerError(ErrorCode.UNKNOWN, "Unexpected error", e)); } } }); return new RealmAsyncTaskImpl(authenticateRequest, networkPoolExecutor); }
Source:
<code>private TableViewer buildAndLayoutTable(final TableViewer aViewer) { final Table table = aViewer.getTable(); ITableModel[] tableInfo = ConflictWithTableModel.values(); int size = tableInfo.length; for (int index = 0; index < size; index++) { createTableViewerColumn(tableInfo[index]); } TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); table.setHeaderVisible(true); table.setLinesVisible(true); <START> table.setData("conflictsWithTable"); <END> return aViewer; }</code><technical_language>this this class, define a static in this cl;ass in other package, i.e. "FixupTableDefaultHandles. values nls</technical_language>

Target:
private TableViewer buildAndLayoutTable(final TableViewer aViewer) { final Table table = aViewer.getTable(); ITableModel[] tableInfo = ConflictWithTableModel.values(); int size = tableInfo.length; for (int index = 0; index < size; index++) { createTableViewerColumn(tableInfo[index]); } TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); table.setHeaderVisible(true); table.setLinesVisible(true); table.setData(CONFLICTS_WITH_TABLE); return aViewer; }
Source:
<code>public void testDateColumn() { IonSqlQueryBuilder queryBuilder = new IonSqlQueryBuilder(new TypeRegistry()); List<HiveColumnHandle> columns = ImmutableList.of( new HiveColumnHandle("t1", HIVE_TIMESTAMP, parseTypeSignature(TIMESTAMP), 0, REGULAR, Optional.empty()), new HiveColumnHandle("t2", HIVE_DATE, parseTypeSignature(StandardTypes.DATE), 1, REGULAR, Optional.empty())); TupleDomain<HiveColumnHandle> tupleDomain = TupleDomain.withColumnDomains(ImmutableMap.of( <START> columns.get(1), Domain.create(SortedRangeSet.copyOf(DATE, (List<Range>) ImmutableList.of(Range.equal(DATE, (long) DateTimeUtils.parseDate("2001-08-22")))), false))); <END> assertEquals("SELECT s._1, s._2 FROM S3Object s WHERE (case s._2 when '' then null else CAST(s._2 AS TIMESTAMP) end = `2001-08-22`)", queryBuilder.buildSql(columns, tupleDomain)); }</code><technical_language>This cast is unnecessary well</technical_language>

Target:
public void testDateColumn() { IonSqlQueryBuilder queryBuilder = new IonSqlQueryBuilder(new TypeRegistry()); List<HiveColumnHandle> columns = ImmutableList.of( new HiveColumnHandle("t1", HIVE_TIMESTAMP, parseTypeSignature(TIMESTAMP), 0, REGULAR, Optional.empty()), new HiveColumnHandle("t2", HIVE_DATE, parseTypeSignature(StandardTypes.DATE), 1, REGULAR, Optional.empty())); TupleDomain<HiveColumnHandle> tupleDomain = withColumnDomains(ImmutableMap.of( columns.get(1), Domain.create(SortedRangeSet.copyOf(DATE, ImmutableList.of(Range.equal(DATE, (long) DateTimeUtils.parseDate("2001-08-22")))), false))); assertEquals("SELECT s._1, s._2 FROM S3Object s WHERE (case s._2 when '' then null else CAST(s._2 AS TIMESTAMP) end = `2001-08-22`)", queryBuilder.buildSql(columns, tupleDomain)); }
Source:
<code>protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (StringUtils.isEmpty(request.getParameter(SSOUtils.POST_ACTION_URL))) { throw new RuntimeException("No post action url found in request."); } if (StringUtils.isEmpty(request.getParameter(SSOUtils.VERSION))) { throw new RuntimeException("No version found in request."); } if (!SSOUtils.versionSupported(request.getParameter(SSOUtils.VERSION))) { throw new RuntimeException(String.format("Unsupported engine version %s found in request.", request.getParameter(SSOUtils.VERSION))); } <START> if ("1".equals(request.getParameter("invalidate"))) { <END> request.getSession(true).invalidate(); } if (!request.getParameterMap().isEmpty()) { request.getSession(true).setAttribute(SSOUtils.PARAMS_MAP, new HashMap<>(request.getParameterMap())); } if (SSOUtils.isUserAuthenticated(request.getSession(true))) { request.getRequestDispatcher(SSOUtils.LOGIN_PHASE4_URI).forward(request, response); } else { SSOConfig config = (SSOConfig) request.getServletContext().getAttribute(SSOUtils.SSO_CONFIG); String externalParamValue = request.getParameter("external"); boolean disableExternal = StringUtils.isEmpty(externalParamValue) ? false : "0".equals(externalParamValue); if (config.isEnableExternalAuth() && !disableExternal) { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_EXTERNAL_URI); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } } }</code><technical_language>compare is 0 :)</technical_language>

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (StringUtils.isEmpty(request.getParameter(SSOUtils.POST_ACTION_URL))) { throw new RuntimeException("No post action url found in request."); } if (StringUtils.isEmpty(request.getParameter(SSOUtils.VERSION))) { throw new RuntimeException("No version found in request."); } if (!SSOUtils.versionSupported(request.getParameter(SSOUtils.VERSION))) { throw new RuntimeException(String.format("Unsupported engine version %s found in request.", request.getParameter(SSOUtils.VERSION))); } if (!"0".equals(request.getParameter("invalidate"))) { request.getSession(true).invalidate(); } if (!request.getParameterMap().isEmpty()) { request.getSession(true).setAttribute(SSOUtils.PARAMS_MAP, new HashMap<>(request.getParameterMap())); } if (SSOUtils.isUserAuthenticated(request.getSession(true))) { request.getRequestDispatcher(SSOUtils.LOGIN_PHASE4_URI).forward(request, response); } else { SSOConfig config = (SSOConfig) request.getServletContext().getAttribute(SSOUtils.SSO_CONFIG); String externalParamValue = request.getParameter("external"); boolean disableExternal = config.isCanBypassExternalAuth() && StringUtils.isEmpty(externalParamValue) ? false : "0".equals(externalParamValue); if (config.isEnableExternalAuth() && !disableExternal) { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_EXTERNAL_URI); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } } }
Source:
<code>private Set<InstanceMetaData> getRemainingGoodInstances(Map<String, InstanceMetaData> allInstancesByInstanceId, Map<String, InstanceMetaData> instancesToRepair, Map<String, InstanceStatus> healthMap, boolean forceRepair) { <START> return allInstancesByInstanceId.values().stream() <END> .filter(instanceMetaData -> !instancesToRepair.containsKey(instanceMetaData.getInstanceId())) .filter(instanceMetaData -> { if (forceRepair) { return !INVALID_REPAIR_STATUSES.contains(instanceMetaData.getInstanceStatus()); } else { return healthMap.containsKey(instanceMetaData.getInstanceId()) && healthMap.get(instanceMetaData.getInstanceId()).isAvailable(); } }) .collect(Collectors.toSet()); }</code><technical_language>a log for getRemainingBadInstances nice</technical_language>

Target:
private Set<InstanceMetaData> getRemainingGoodInstances(Map<String, InstanceMetaData> allInstancesByInstanceId, Map<String, InstanceMetaData> instancesToRepair, Map<String, InstanceStatus> healthMap, boolean forceRepair) { Set<InstanceMetaData> remainingGoodInstances = allInstancesByInstanceId.values().stream() .filter(instanceMetaData -> !instancesToRepair.containsKey(instanceMetaData.getInstanceId())) .filter(instanceMetaData -> { if (forceRepair) { return !INVALID_REPAIR_STATUSES.contains(instanceMetaData.getInstanceStatus()); } else { return healthMap.containsKey(instanceMetaData.getInstanceId()) && healthMap.get(instanceMetaData.getInstanceId()).isAvailable(); } }) .collect(Collectors.toSet()); LOGGER.debug("Remaining good instances [{}]", remainingGoodInstances); return remainingGoodInstances; }
Source:
<code>private MapSqlParameterSource createInterfaceParametersMapper(VdsNetworkInterface nic) { return getCustomMapSqlParameterSource() .addValue("addr", nic.getAddress()) .addValue("bond_name", nic.getBondName()) .addValue("bond_type", nic.getBondType()) .addValue("gateway", nic.getGateway()) .addValue("id", nic.getId()) .addValue("is_bond", nic.getBonded()) .addValue("bond_opts", nic.getBondOptions()) .addValue("mac_addr", nic.getMacAddress()) .addValue("name", nic.getName()) .addValue("network_name", nic.getNetworkName()) .addValue("speed", nic.getSpeed()) .addValue("subnet", nic.getSubnet()) .addValue("boot_protocol", nic.getBootProtocol()) .addValue("type", nic.getType()) .addValue("vds_id", nic.getVdsId()) .addValue("vlan_id", nic.getVlanId()) .addValue("mtu", nic.getMtu()) .addValue("bridged", nic.isBridged()) .addValue("qos_overridden", nic.isQosOverridden()) <START> .addValue("labels", SerializationFactory.getSerializer().serialize(nic.getLabels())) <END> .addValue("custom_properties", SerializationFactory.getSerializer() .serialize(nic.hasCustomProperties() ? nic.getCustomProperties() : null)); }</code><technical_language>other around: .addValue("custom_properties", nic.hasCustomProperties() ? SerializationFactory.getSerializer().serialize(nic.getCustomProperties() : null);</technical_language>

Target:
private MapSqlParameterSource createInterfaceParametersMapper(VdsNetworkInterface nic) { return getCustomMapSqlParameterSource() .addValue("addr", nic.getAddress()) .addValue("bond_name", nic.getBondName()) .addValue("bond_type", nic.getBondType()) .addValue("gateway", nic.getGateway()) .addValue("id", nic.getId()) .addValue("is_bond", nic.getBonded()) .addValue("bond_opts", nic.getBondOptions()) .addValue("mac_addr", nic.getMacAddress()) .addValue("name", nic.getName()) .addValue("network_name", nic.getNetworkName()) .addValue("speed", nic.getSpeed()) .addValue("subnet", nic.getSubnet()) .addValue("boot_protocol", nic.getBootProtocol()) .addValue("type", nic.getType()) .addValue("vds_id", nic.getVdsId()) .addValue("vlan_id", nic.getVlanId()) .addValue("mtu", nic.getMtu()) .addValue("bridged", nic.isBridged()) .addValue("qos_overridden", nic.isQosOverridden()) .addValue("labels", SerializationFactory.getSerializer().serialize(nic.getLabels())) .addValue("custom_properties", nic.hasCustomProperties() ? SerializationFactory.getSerializer().serialize(nic.getCustomProperties()) : null); }
Source:
<code>private Map<String, String> createThemeAssociations() { Map<String, String> result = new HashMap<String, String>(); IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtensionPoint extPoint = registry.getExtensionPoint("org.eclipse.e4.ui.css.swt.theme"); for (IExtension e : extPoint.getExtensions()) { for (IConfigurationElement ce : e.getConfigurationElements()) { <START> if (ce.getName().equals("themeassociation")) { END> String themeId = ce.getAttribute("themeid"); String osVersion = ce.getAttribute("os_version"); result.put(osVersion != null ? themeId + osVersion : themeId, ce.getAttribute("colorsandfonts")); } } } return result; }</code><technical_language>turned constants, in internal interface (possibly org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants) in this class itself. need updated camel case</technical_language>

Target:
private Map<String, String> createThemeAssociations() { Map<String, String> result = new HashMap<String, String>(); IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtensionPoint extPoint = registry.getExtensionPoint(E4_THEME_EXTENSION_POINT); for (IExtension e : extPoint.getExtensions()) { for (IConfigurationElement ce : e.getConfigurationElements()) { if (ce.getName().equals(ATT_THEME_ASSOCIATION)) { String themeId = ce.getAttribute(ATT_THEME_ID); String osVersion = ce.getAttribute(ATT_OS_VERSION); result.put(osVersion != null ? themeId + osVersion : themeId, ce.getAttribute(ATT_COLOR_AND_FONT_ID)); } } } return result; }
Source:
<code>public void commit(EDBCommit commit) throws EDBException { if (commit.isCommitted()) { throw new EDBException("EDBCommit was already commitet!"); } commit.finalize(); JPAHead nextHead; if (head != null) { LOGGER.debug("adding a new JPAHead"); nextHead = new JPAHead(head, commit.getTimestamp()); } else { LOGGER.debug("creating the first JPAHead"); nextHead = new JPAHead(commit.getTimestamp()); } for (String del : commit.getDeletions()) { nextHead.delete(del); } for (EDBObject update : commit.getObjects()) { String uid = update.getUID(); nextHead.replace(uid, update); } try { performUtxAction(UTXACTION.BEGIN); long timestamp = commit.getTimestamp(); commit.setCommitted(true); LOGGER.debug("persisting JPACommit and the new JPAHead"); entityManager.persist(commit); entityManager.persist(nextHead); LOGGER.debug("persisting the elements of the new JPAHead"); for (JPAObject o : nextHead.getJPAObjects()) { entityManager.persist(o); } LOGGER.debug("setting the deleted elements as deleted"); for (String id : commit.getDeletions()) { EDBObject o = new EDBObject(id, timestamp); <START> o.put("@isDeleted", new Boolean(true)); <END> JPAObject j = new JPAObject(o); entityManager.persist(j); } performUtxAction(UTXACTION.COMMIT); head = nextHead; } catch (Exception ex) { try { performUtxAction(UTXACTION.ROLLBACK); } catch (Exception e) { throw new EDBException("Failed to rollback transaction to DB", e); } throw new EDBException("Failed to commit transaction to DB", ex); } }</code><technical_language>@</technical_language>

Target:
public Long commit(EDBCommit commit) throws EDBException { if (commit.isCommitted()) { throw new EDBException("EDBCommit was already commitet!"); } long timestamp = System.currentTimeMillis(); commit.setTimestamp(timestamp); JPAHead nextHead; if (head != null) { LOGGER.debug("adding a new JPAHead"); nextHead = new JPAHead(head, timestamp); } else { LOGGER.debug("creating the first JPAHead"); nextHead = new JPAHead(timestamp); } for (String del : commit.getDeletions()) { nextHead.delete(del); } for (EDBObject update : commit.getObjects()) { String oid = update.getOID(); update.updateTimestamp(timestamp); nextHead.replace(oid, update); } try { performUtxAction(UTXACTION.BEGIN); commit.setCommitted(true); LOGGER.debug("persisting JPACommit and the new JPAHead"); entityManager.persist(commit); entityManager.persist(nextHead); LOGGER.debug("persisting the elements of the new JPAHead"); for (JPAObject o : nextHead.getJPAObjects()) { entityManager.persist(o); } LOGGER.debug("setting the deleted elements as deleted"); for (String id : commit.getDeletions()) { EDBObject o = new EDBObject(id); o.updateTimestamp(timestamp); o.put("isDeleted", new Boolean(true)); JPAObject j = new JPAObject(o); entityManager.persist(j); } performUtxAction(UTXACTION.COMMIT); head = nextHead; } catch (Exception ex) { try { performUtxAction(UTXACTION.ROLLBACK); } catch (Exception e) { throw new EDBException("Failed to rollback transaction to DB", e); } throw new EDBException("Failed to commit transaction to DB", ex); } return timestamp; }
Source:
<code>protected ContentFeatureSource createFeatureSource(ContentEntry entry, Query query) { return new MemoryFeatureStore(entry, query) { @Override protected QueryCapabilities buildQueryCapabilities() { return new QueryCapabilities() { @Override public boolean isUseProvidedFIDSupported() { return true; } }; } @Override protected FeatureWriter<SimpleFeatureType, SimpleFeature> getWriterInternal( <START> Query query, int flags) throws IOException { <END> return new MemoryFeatureWriter(getState(), query) { @Override public void write() throws IOException { if (Boolean.TRUE.equals(current.getUserData().get(Hints.USE_PROVIDED_FID))) { if (current.getUserData().containsKey(Hints.PROVIDED_FID)) { String fid = (String) current.getUserData().get(Hints.PROVIDED_FID); FeatureId id = new FeatureIdImpl(fid); current = new SimpleFeatureImpl(current.getAttributes(), current.getFeatureType(), id); } } super.write(); } }; } }; }</code><technical_language>please change MemoryFeatureStore, need for anonymous subclass MemoryDataStore is "owner" of MemoryFeatureStore</technical_language>

Target:
protected ContentFeatureSource createFeatureSource(ContentEntry entry, Query query) { return new MemoryFeatureStore(entry, query); }
Source:
<code>protected AbstractEmitter(final Builder<?> builder) { Preconditions.checkArgument(builder.threadCount > 0, "threadCount must be greater than 0"); if (builder.httpClientAdapter != null) { this.httpClientAdapter = builder.httpClientAdapter; } else { Preconditions.checkNotNull(builder.collectorUrl, "Collector url must be specified if not using a httpClientAdapter"); OkHttpClient client = new OkHttpClient.Builder() <START> .connectTimeout(5, TimeUnit.SECONDS) .readTimeout(5, TimeUnit.SECONDS) .writeTimeout(5, TimeUnit.SECONDS) <END> .build(); this.httpClientAdapter = OkHttpClientAdapter.builder() .url(builder.collectorUrl) .httpClient(client) .build(); } this.requestCallback = builder.requestCallback; this.executor = Executors.newScheduledThreadPool(builder.threadCount); }</code><technical_language>defaults in OkHttpClient is 10 seconds for of these. wondering, is reason change defaults, is 5 seconds feels right</technical_language>

Target:
protected AbstractEmitter(final Builder<?> builder) { Preconditions.checkArgument(builder.threadCount > 0, "threadCount must be greater than 0"); if (builder.httpClientAdapter != null) { this.httpClientAdapter = builder.httpClientAdapter; } else { Preconditions.checkNotNull(builder.collectorUrl, "Collector url must be specified if not using a httpClientAdapter"); this.httpClientAdapter = OkHttpClientAdapter.builder() .url(builder.collectorUrl) .httpClient( new OkHttpClient()) .build(); } this.requestCallback = builder.requestCallback; this.executor = Executors.newScheduledThreadPool(builder.threadCount); }
Source:
<code>public void performOpsAction(final Connection c, final long clientHandle, final OpsSelector selector, final ParameterSet params) throws Exception { m_es.submit(new Runnable() { @Override public void run() { try { collectStatsImpl(c, clientHandle, selector, params); } catch (Exception e) { hostLog.warn("Exception while attempting to collect stats", e); <START> if (e instanceof ConcurrentModificationException) { <END> sendErrorResponse(c, ClientResponse.GRACEFUL_FAILURE, "Statistics are unavailable, try again (" + e.getMessage() + ").", clientHandle); } else { sendErrorResponse(c, ClientResponse.OPERATIONAL_FAILURE, "Failed to get statistics (" + e.getMessage() + ").", clientHandle); } } } }); }</code><technical_language>ConcurrentModificationException for this stats thrown change in DefaultProcedureManager</technical_language>

Target:
public void performOpsAction(final Connection c, final long clientHandle, final OpsSelector selector, final ParameterSet params) throws Exception { m_es.submit(new Runnable() { @Override public void run() { try { collectStatsImpl(c, clientHandle, selector, params); } catch (Exception e) { hostLog.warn("Exception while attempting to collect stats", e); sendErrorResponse(c, ClientResponse.OPERATIONAL_FAILURE, "Failed to get statistics (" + e.getMessage() + ").", clientHandle); } } }); }
Source:
<code>public String toString() { StringBuilder result = new StringBuilder(); if (getLang() != null && !getLang().equals("und")) { result.append("Id: ").append(getId()); result.append(", Language Code: ").append(getLang()); } if (isNotBlank(getAudioTrackTitleFromMetadata())) { if (result.length() > 0) { result.append(", "); } result.append("Audio Track Title From Metadata: ").append(getAudioTrackTitleFromMetadata()); } if (result.length() > 0) { result.append(", "); } result.append("Audio Codec: ").append(getAudioCodec()); result.append(", Bitrate: ").append(getBitRate()); if (getBitsperSample() != 16) { result.append(", Bits per Sample: ").append(getBitsperSample()); } if (getAudioProperties() != null) { result.append(", ").append(getAudioProperties()); } if (isNotBlank(getArtist())) { result.append(", Artist: ").append(getArtist()); } if (isNotBlank(getAlbum())) { result.append(", Album: ").append(getAlbum()); } if (isNotBlank(getAlbumArtist())) { <START> result.append(", Album Album: ").append(getAlbumArtist()); <END> } if (isNotBlank(getSongname())) { result.append(", Track Name: ").append(getSongname()); } if (getYear() != 0) { result.append(", Year: ").append(getYear()); } if (getTrack() != 0) { result.append(", Track: ").append(getTrack()); } if (isNotBlank(getGenre())) { result.append(", Genre: ").append(getGenre()); } if (isNotBlank(getMuxingModeAudio())) { result.append(", Muxing Mode: ").append(getMuxingModeAudio()); } return result.toString(); }</code><technical_language>a typo suggestion result.append(", Album Artist: ").append(getAlbumArtist());</technical_language>

Target:
public String toString() { StringBuilder result = new StringBuilder(); if (getLang() != null && !getLang().equals("und")) { result.append("Id: ").append(getId()); result.append(", Language Code: ").append(getLang()); } if (isNotBlank(getAudioTrackTitleFromMetadata())) { if (result.length() > 0) { result.append(", "); } result.append("Audio Track Title From Metadata: ").append(getAudioTrackTitleFromMetadata()); } if (result.length() > 0) { result.append(", "); } result.append("Audio Codec: ").append(getAudioCodec()); result.append(", Bitrate: ").append(getBitRate()); if (getBitsperSample() != 16) { result.append(", Bits per Sample: ").append(getBitsperSample()); } if (getAudioProperties() != null) { result.append(", ").append(getAudioProperties()); } if (isNotBlank(getArtist())) { result.append(", Artist: ").append(getArtist()); } if (isNotBlank(getAlbum())) { result.append(", Album: ").append(getAlbum()); } if (isNotBlank(getAlbumArtist())) { result.append(", Album Artist: ").append(getAlbumArtist()); } if (isNotBlank(getSongname())) { result.append(", Track Name: ").append(getSongname()); } if (getYear() != 0) { result.append(", Year: ").append(getYear()); } if (getTrack() != 0) { result.append(", Track: ").append(getTrack()); } if (isNotBlank(getGenre())) { result.append(", Genre: ").append(getGenre()); } if (isNotBlank(getMuxingModeAudio())) { result.append(", Muxing Mode: ").append(getMuxingModeAudio()); } return result.toString(); }
Source:
<code>public MainTabBasicListItemActionButton(String tooltipText, ImageResource enabledImage, ImageResource disabledImage, String additionalStyle) { <START> super(); <END> initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this)); setTooltipText(tooltipText); setEnabledHtml(SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(enabledImage).getHTML())); setDisabledHtml(SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(disabledImage).getHTML())); stylableButtonHolder.addStyleName(additionalStyle); }</code><technical_language>implicit</technical_language>

Target:
public MainTabBasicListItemActionButton(String tooltipText, ImageResource enabledImage, ImageResource disabledImage, String additionalStyle) { initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this)); setTooltipText(tooltipText); setEnabledHtml(SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(enabledImage).getHTML())); setDisabledHtml(SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(disabledImage).getHTML())); stylableButtonHolder.addStyleName(additionalStyle); }
Source:
<code>public GraphicCanvas(Composite parent) { super(parent); m_objects = new ArrayList<IGraphicObject>(); Listener mouseListener = new Listener() { public void handleEvent(Event event) { switch (event.type) { case SWT.MouseEnter: case SWT.MouseMove: IGraphicObject obj = getGraphicObject(event.x, event.y); <START> if (obj != null && obj instanceof ITooltipProvider) { <END> String tooltip = ((ITooltipProvider) obj).getTooltip(event.x, event.y); setToolTipText(tooltip); } break; } } }; addListener(SWT.MouseMove, mouseListener); addListener(SWT.MouseEnter, mouseListener); }</code><technical_language>instanceof checks for null, remove null check</technical_language>

Target:
public GraphicCanvas(Composite parent) { super(parent); m_objects = new ArrayList<IGraphicObject>(); Listener mouseListener = new Listener() { public void handleEvent(Event event) { switch (event.type) { case SWT.MouseEnter: case SWT.MouseMove: IGraphicObject obj = getGraphicObject(event.x, event.y); if (obj instanceof ITooltipProvider) { String tooltip = ((ITooltipProvider) obj).getTooltip(event.x, event.y); setToolTipText(tooltip); } break; } } }; addListener(SWT.MouseMove, mouseListener); addListener(SWT.MouseEnter, mouseListener); }
Source:
<code>public static StarlarkInt multiply(StarlarkInt x, StarlarkInt y) { try { long xl = x.toLongFast(); long yl = y.toLongFast(); long zl = xl * yl; int leadingZeros = Long.numberOfLeadingZeros(xl) + Long.numberOfLeadingZeros(~xl) + Long.numberOfLeadingZeros(yl) + Long.numberOfLeadingZeros(~yl); if (leadingZeros > Long.SIZE + 1) { <START> return StarlarkInt.of(zl); <END> } if (leadingZeros < Long.SIZE || (xl < 0 && yl == Long.MIN_VALUE)) { throw OVERFLOW; } if (xl == 0 || zl / xl == yl) { return StarlarkInt.of(zl); } } catch (Overflow unused) { } BigInteger xbig = x.toBigInteger(); BigInteger ybig = y.toBigInteger(); BigInteger zbig = xbig.multiply(ybig); return StarlarkInt.of(zbig); }</code><technical_language>Is this faster retaining int32*int32 special case? sheer number of branches skeptical</technical_language>

Target:
public static StarlarkInt multiply(StarlarkInt x, StarlarkInt y) { if (x instanceof Int32 && y instanceof Int32) { long xl = ((Int32) x).v; long yl = ((Int32) y).v; return StarlarkInt.of(xl * yl); } try { long xl = x.toLongFast(); long yl = y.toLongFast(); long xlo = xl & 0xFFFFFFFFL; long xhi = xl >> 32; long ylo = yl & 0xFFFFFFFFL; long yhi = yl >> 32; long zlo = xlo * ylo; long t = xhi * ylo + (zlo >>> 32); long z1 = t & 0xFFFFFFFFL; long z2 = t >> 32; z1 += xlo * yhi; long z128hi = xhi * yhi + z2 + (z1 >> 32); long z128lo = xl * yl; if (z128hi == (z128lo & Long.MIN_VALUE) >> 63) { return StarlarkInt.of(z128lo); } } catch (Overflow unused) { } if (x == ZERO || y == ONE) { return x; } else if (y == ZERO || x == ONE) { return y; } else if (x == MINUS_ONE) { return StarlarkInt.uminus(y); } else if (y == MINUS_ONE) { return StarlarkInt.uminus(x); } BigInteger xbig = x.toBigInteger(); BigInteger ybig = y.toBigInteger(); BigInteger zbig = xbig.multiply(ybig); StarlarkInt z = StarlarkInt.of(zbig); if (!(z instanceof Big)) { throw new AssertionError(String.format( "bug in multiplication: %s * %s = %s, must be long multiplication", x, y, z)); } return z; }
Source:
<code>private Predicate<MethodInfo> filterMethods() { <START> return Stream.of( <END> this.filter, filterSyntheticMethods(), isGeneratedEnumMethod().negate(), isGroovyClass().negate() ).reduce(x -> true, Predicate::and); }</code><technical_language>Hmm stream method chain. a matter of taste</technical_language>

Target:
private Predicate<MethodInfo> filterMethods() { return this.filter .and(filterSyntheticMethods()) .and(isGeneratedEnumMethod().negate()) .and(isGroovyClass().negate()); }
Source:
<code>private Element getBoostrapProps () { Element retVal = null; Plugin plugin = getPlugin("io.openliberty.tools", "liberty-maven-plugin"); Xpp3Dom config = getPluginConfig(plugin, ""); <START> Xpp3Dom bootstrapPropsConfig = config.getChildren("bootstrapProperties")[0]; <END> if (bootstrapPropsConfig != null) { List<Element> elements = new ArrayList<Element>(); for (Xpp3Dom child : bootstrapPropsConfig.getChildren()) { elements.add(new Element(child.getName(), child.getValue())); } retVal = new Element("bootstrapProperties", elements.toArray(new Element[elements.size()])); } return retVal; }</code><technical_language>need check if bootstrapProperties, this Array index out of range</technical_language>

Target:
private Element getBoostrapProps () { Element retVal = null; Plugin plugin = getPlugin("io.openliberty.tools", "liberty-maven-plugin"); Xpp3Dom config = getPluginConfig(plugin, ""); if (config.getChild("bootstrapProperties") != null) { Xpp3Dom bootstrapPropsConfig = config.getChildren("bootstrapProperties")[0]; if (bootstrapPropsConfig != null) { List<Element> elements = new ArrayList<Element>(); for (Xpp3Dom child : bootstrapPropsConfig.getChildren()) { elements.add(new Element(child.getName(), child.getValue())); } retVal = new Element("bootstrapProperties", elements.toArray(new Element[elements.size()])); } } return retVal; }
Source:
<code>protected TmfXYChartViewer createChartViewer(Composite parent) { <START> return new CounterChartViewer(parent, new TmfXYChartSettings(null, null, null, 1), fXYPresentationProvider); <END> }</code><technical_language>I chart viewer responsible for presentation provider. tree viewer ask chart viewer for a series appearance directly, ITreeViewerInterface? (could renamed ICounterChartViewer)</technical_language>

Target:
protected TmfXYChartViewer createChartViewer(Composite parent) { return new CounterChartViewer(parent, new TmfXYChartSettings(null, null, null, 1)); }
Source:
<code>public boolean canBeMemberWithReason(PerunSession sess, Vo vo, User user, String loa) throws InternalErrorException, VoNotExistsException, ExtendMembershipException, PrivilegeException { Utils.checkPerunSession(sess); getPerunBl().getVosManagerBl().checkVoExists(sess, vo); <START> if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo) && !AuthzResolver.isAuthorized(sess, Role.SELF, user) && !AuthzResolver.isAuthorized(sess, Role.PERUNOBSERVER)) { throw new PrivilegeException(sess, "canBeMemberWithReason"); } return getMembersManagerBl().canBeMemberWithReason(sess, vo, user, loa); <END> }</code><technical_language>Please add VOOBSERVER</technical_language>

Target:
public boolean canBeMemberWithReason(PerunSession sess, Vo vo, User user, String loa) throws InternalErrorException, VoNotExistsException, ExtendMembershipException, PrivilegeException { Utils.checkPerunSession(sess); getPerunBl().getVosManagerBl().checkVoExists(sess, vo); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo) && !AuthzResolver.isAuthorized(sess, Role.VOOBSERVER, vo) && !AuthzResolver.isAuthorized(sess, Role.SELF, user) && !AuthzResolver.isAuthorized(sess, Role.PERUNOBSERVER)) { throw new PrivilegeException(sess, "canBeMemberWithReason"); } return getMembersManagerBl().canBeMemberWithReason(sess, vo, user, loa); }
Source:
<code>@Override public RelNode enforce( final RelNode input, final RelTraitSet required) { RelNode rel = input; if (input.getConvention() != INSTANCE) { rel = ConventionTraitDef.INSTANCE.convert( input.getCluster().getPlanner(), input, INSTANCE, true); } RelCollation collation = required.getTrait(RelCollationTraitDef.INSTANCE); <START> if (collation != null && !collation.getFieldCollations().isEmpty()) { <END> rel = EnumerableSort.create(rel, collation, null, null); } return rel; }</code><technical_language>collation null filed collations empty</technical_language>

Target:
@Override public RelNode enforce( final RelNode input, final RelTraitSet required) { RelNode rel = input; if (input.getConvention() != INSTANCE) { rel = ConventionTraitDef.INSTANCE.convert( input.getCluster().getPlanner(), input, INSTANCE, true); } RelCollation collation = required.getTrait(RelCollationTraitDef.INSTANCE); if (collation != null) { assert !collation.getFieldCollations().isEmpty(); rel = EnumerableSort.create(rel, collation, null, null); } return rel; }
Source:
<code>public Response components() throws IOException { <START> JsonArray array = new JsonArray(); <END> for (Component component : Component.getComponents()) { JsonObject obj = new JsonObject(); ToolkitComponent annotation = component.getClass().getAnnotation(ToolkitComponent.class); obj.addProperty("key", annotation.key()); obj.addProperty("name", annotation.name()); obj.addProperty("description", annotation.description()); JsonArray array2 = new JsonArray(); for (String file : annotation.editorFiles()) { JsonPrimitive element = new JsonPrimitive(file); array2.add(element); } obj.add("files", array2); array.add(obj); } return Response.ok(toJson(array)).build(); }</code><technical_language>components registered startup, this response cached</technical_language>

Target:
public Response components() throws IOException { if (cachedResponse == null) { cachedResponse = new JsonArray(); for (Component component : Component.getComponents()) { JsonObject obj = new JsonObject(); ToolkitComponent annotation = component.getClass() .getAnnotation(ToolkitComponent.class); obj.addProperty("key", annotation.key()); obj.addProperty("name", annotation.name()); obj.addProperty("description", annotation.description()); JsonArray array2 = new JsonArray(); for (String file : annotation.editorFiles()) { JsonPrimitive element = new JsonPrimitive(file); array2.add(element); } obj.add("files", array2); cachedResponse.add(obj); } } return Response.ok(toJson(cachedResponse)).build(); }
Source:
<code>public static Money of(double amount) { <START> return new Money(org.joda.money.BigMoney.of(CurrencyManager.getInstance().getDefaultCurrency(), amount)); <END> }</code><technical_language>java public static Money of(double amount) { return Money.of(amount, CurrencyManager.getInstance().getDefaultCurrency()); }</technical_language>

Target:
public static Money of(double amount) { return Money.of(amount, CurrencyManager.getInstance().getDefaultCurrency()); }
Source:
<code><START> private HiveMetaStoreClient getHive() throws IOException { <END> if (mHive != null) { return mHive; } mHive = newHiveClient(); return mHive; }</code><technical_language>I this thread safe, a lock protect changes cached client. a RW lock, read get client, write update it</technical_language>

Target:
private HiveMetaStoreClient getHive() throws IOException { if (mHive != null) { return mHive; } newHiveClient(); return mHive; }
Source:
<code>public void bucketTypeUpdate(String bucketTypeName, String bucketTypeProperties) { ScriptHelper bucketTypeStatusScript = newScript("bucket-type_update") .body.append(sudo(format("%s bucket-type update %s %s", getRiakAdminCmd(), bucketTypeName, escapeLiteralForDoubleQuotedBash(bucketTypeProperties)))) <START> .noExtraOutput() <END> .failOnNonZeroResultCode(); if (!isRiakOnPath()) { addRiakOnPath(bucketTypeStatusScript); } bucketTypeStatusScript.execute(); }</code><technical_language>need for noExtraOutput if parsing stdout</technical_language>

Target:
public void bucketTypeUpdate(String bucketTypeName, String bucketTypeProperties) { ScriptHelper bucketTypeStatusScript = newScript("bucket-type_update") .body.append(sudo(format("%s bucket-type update %s %s", getRiakAdminCmd(), bucketTypeName, escapeLiteralForDoubleQuotedBash(bucketTypeProperties)))) .failOnNonZeroResultCode(); if (!isRiakOnPath()) { addRiakOnPath(bucketTypeStatusScript); } bucketTypeStatusScript.execute(); }
Source:
<code>protected void addPermissionSubjectForAdminLevelProperties(List<PermissionSubject> permissionList) { VmStatic vmFromParams = getParameters().getVmStaticData(); if (vmFromParams != null && getVmTemplate() != null) { if (!StringUtils.isEmpty(vmFromParams.getCustomProperties())) { permissionList.add(new PermissionSubject(getVdsGroupId(), VdcObjectType.VdsGroups, ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES)); } Set<Guid> dedicatedVmForVdsFromUser = new HashSet<>(vmFromParams.getDedicatedVmForVdsList()); Set<Guid> dedicatedVmForVdsFromTemplate = new HashSet<>(getVmTemplate().getDedicatedVmForVdsList()); if <START> (dedicatedVmForVdsFromUser.size() != dedicatedVmForVdsFromTemplate.size() || !dedicatedVmForVdsFromUser.containsAll(dedicatedVmForVdsFromTemplate) <END> || !StringUtils.isEmpty(vmFromParams.getCpuPinning())) { permissionList.add(new PermissionSubject(getVdsGroupId(), VdcObjectType.VdsGroups, ActionGroup.EDIT_ADMIN_VM_PROPERTIES)); } } }</code><technical_language>shorten this equals</technical_language>

Target:
protected void addPermissionSubjectForAdminLevelProperties(List<PermissionSubject> permissionList) { VmStatic vmFromParams = getParameters().getVmStaticData(); if (vmFromParams != null && getVmTemplate() != null) { if (!StringUtils.isEmpty(vmFromParams.getCustomProperties())) { permissionList.add(new PermissionSubject(getVdsGroupId(), VdcObjectType.VdsGroups, ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES)); } Set<Guid> dedicatedVmForVdsFromUser = new HashSet<>(vmFromParams.getDedicatedVmForVdsList()); Set<Guid> dedicatedVmForVdsFromTemplate = new HashSet<>(getVmTemplate().getDedicatedVmForVdsList()); if (!dedicatedVmForVdsFromUser.equals(dedicatedVmForVdsFromTemplate) || !StringUtils.isEmpty(vmFromParams.getCpuPinning())) { permissionList.add(new PermissionSubject(getVdsGroupId(), VdcObjectType.VdsGroups, ActionGroup.EDIT_ADMIN_VM_PROPERTIES)); } } }
Source:
<code><START> public static void createStartDebugSurveyLink(JComponent parent) { <END> String programmingExperienceParam = "&entry.962486075="; try { programmingExperienceParam += URLEncoder.encode(Preferences.getInstance().getProgrammingExperience(), "UTF-8"); } catch (UnsupportedEncodingException e) { programmingExperienceParam = ""; } String surveyLink = "<LINK_0>" + Preferences.getInstance().getUserId() + programmingExperienceParam + "&entry.87074017=Java&entry.1002919343=IntelliJ&entry.2010347695&entry.2084367812"; UIUtils.createHyperLinkLabel(parent, "Share your thoughts on debugging and win an additional Amazon voucher!", surveyLink); }</code><technical_language>this in Core</technical_language>

Target:
public static void createStartDebugSurveyLink(JComponent parent) { UIUtils.createHyperLinkLabel(parent, "Share your thoughts on debugging and win an additional Amazon voucher!", WatchDogUtils.getDebugSurveyLink()); }
Source:
<code>private void notifyCallbackWithSuccess(RealmResults<PermissionOffer> permissions) { <START> callback.onSuccess(permissions); <END> activeTasks.remove(this); }</code><technical_language>Is OK call onSuccess async task thread</technical_language>

Target:
private void notifyCallbackWithSuccess(RealmResults<PermissionOffer> permissions) { try { callback.onSuccess(permissions); } finally { activeTasks.remove(this); } }
Source:
<code>Analyzer getKbIndexAnalyzer() throws Exception { if (kbIndexAnalyzer == null) { kbIndexAnalyzer = new EnglishAnalyzer(); <START> } <END> return kbIndexAnalyzer; }</code><technical_language>EnglishAnalyzer() parameters assumes a default stopword list. If okay, EnglishAnalyzer(CharArraySet.EMPTY_SET) instead</technical_language>

Target:
Analyzer getKbIndexAnalyzer() { if (kbIndexAnalyzer == null) { kbIndexAnalyzer = new EnglishAnalyzer(CharArraySet.EMPTY_SET); } return kbIndexAnalyzer; }
Source:
<code>public static boolean remove(String key) { <START> if (!isHawkInitialised()) { <END> return false; } return hawkBuilder.getStorage().remove(key); }</code><technical_language>replacing this helper method great</technical_language>

Target:
public static boolean remove(String key) { Utils.validateBuild(); return internal.getStorage().remove(key); }
Source:
<code>public LockResource lockShared() throws InterruptedException { if (mSafeMode) { <START> throw new IllegalStateException("Cannot acquire lock shared during safe-mode."); <END> } try { mSharedWaiters.add(Thread.currentThread()); mStateLock.readLock().lockInterruptibly(); } finally { mSharedWaiters.remove(Thread.currentThread()); } mSharedHolders.add(Thread.currentThread()); return new LockResource(mStateLock.readLock(), false, false, () -> { mSharedHolders.remove(Thread.currentThread()); }); }</code><technical_language>this message propagated clients? If so, this more actionable, and/or informative</technical_language>

Target:
public LockResource lockShared() throws InterruptedException { long exclusiveOnlyRemainingMs = mExclusiveOnlyDeadlineMs - System.currentTimeMillis(); if (exclusiveOnlyRemainingMs > 0) { String safeModeMsg = String.format( "Master still in exclusive-only phase (%dms remaining) for the state-lock. " + "Please see documentation for %s.", exclusiveOnlyRemainingMs, PropertyKey.Name.MASTER_BACKUP_STATE_LOCK_EXCLUSIVE_DURATION); throw new IllegalStateException(safeModeMsg); } mSharedWaitersAndHolders.add(Thread.currentThread()); mStateLock.readLock().lockInterruptibly(); return new LockResource(mStateLock.readLock(), false, false, () -> { mSharedWaitersAndHolders.remove(Thread.currentThread()); }); }