auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Set<Integer> getBinaryOids(Properties info) throws PSQLException { boolean binaryTransfer = PGProperty.BINARY_TRANSFER.getBoolean(info); <START> Set<Integer> binaryOids = new HashSet<Integer>(); <END> if (binaryTransfer) { binaryOids.add(Oid.BYTEA); binaryOids.add(Oid.INT2); binaryOids.add(Oid.INT4); binaryOids.add(Oid.INT8); binaryOids.add(Oid.FLOAT4); binaryOids.add(Oid.FLOAT8); binaryOids.add(Oid.TIME); binaryOids.add(Oid.DATE); binaryOids.add(Oid.TIMETZ); binaryOids.add(Oid.TIMESTAMP); binaryOids.add(Oid.TIMESTAMPTZ); binaryOids.add(Oid.INT2_ARRAY); binaryOids.add(Oid.INT4_ARRAY); binaryOids.add(Oid.INT8_ARRAY); binaryOids.add(Oid.FLOAT4_ARRAY); binaryOids.add(Oid.FLOAT8_ARRAY); binaryOids.add(Oid.VARCHAR_ARRAY); binaryOids.add(Oid.TEXT_ARRAY); binaryOids.add(Oid.POINT); binaryOids.add(Oid.BOX); binaryOids.add(Oid.UUID); } binaryOids.addAll(getOidSet(PGProperty.BINARY_TRANSFER_ENABLE.get(info))); binaryOids.removeAll(getOidSet(PGProperty.BINARY_TRANSFER_DISABLE.get(info))); return binaryOids; }</code><technical_language>consider initializing this a reasonable size limit (or eliminate) need reallocate backing array. default starting size of 16 currently guarantees (at least) 1 reallocation time this method is called</technical_language>

Target:
private static Set<Integer> getBinaryOids(Properties info) throws PSQLException { boolean binaryTransfer = PGProperty.BINARY_TRANSFER.getBoolean(info); Set<Integer> binaryOids = new HashSet<Integer>(32); if (binaryTransfer) { binaryOids.add(Oid.BYTEA); binaryOids.add(Oid.INT2); binaryOids.add(Oid.INT4); binaryOids.add(Oid.INT8); binaryOids.add(Oid.FLOAT4); binaryOids.add(Oid.FLOAT8); binaryOids.add(Oid.TIME); binaryOids.add(Oid.DATE); binaryOids.add(Oid.TIMETZ); binaryOids.add(Oid.TIMESTAMP); binaryOids.add(Oid.TIMESTAMPTZ); binaryOids.add(Oid.INT2_ARRAY); binaryOids.add(Oid.INT4_ARRAY); binaryOids.add(Oid.INT8_ARRAY); binaryOids.add(Oid.FLOAT4_ARRAY); binaryOids.add(Oid.FLOAT8_ARRAY); binaryOids.add(Oid.VARCHAR_ARRAY); binaryOids.add(Oid.TEXT_ARRAY); binaryOids.add(Oid.POINT); binaryOids.add(Oid.BOX); binaryOids.add(Oid.UUID); } binaryOids.addAll(getOidSet(PGProperty.BINARY_TRANSFER_ENABLE.get(info))); binaryOids.removeAll(getOidSet(PGProperty.BINARY_TRANSFER_DISABLE.get(info))); return binaryOids; }
Source:
<code>public String createNewGroup(final String userId, final String courseId) throws AuthenticationException { String hash; try { final String unsecuredSalt = HashManager.generateUnSecureSalt(courseId); hash = HashManager.toHex(HashManager.createHash(userId, unsecuredSalt).getBytes(StandardCharsets.UTF_8)); } catch (NoSuchAlgorithmException e) { <START> throw new AuthenticationException(e); <END> } final BasicDBObject nonStudent = new BasicDBObject(); nonStudent.append(userId, hash); final BasicDBObject groupQuery = new BasicDBObject(DatabaseStringConstants.COURSE_ID, new ObjectId(courseId)) .append(DatabaseStringConstants.USER_LIST, new BasicDBObject()) .append(DatabaseStringConstants.NON_USER_LIST, nonStudent); final DBCollection collection = database.getCollection(DatabaseStringConstants.USER_GROUP_COLLECTION); collection.insert(groupQuery); return groupQuery.get(DatabaseStringConstants.SELF_ID).toString(); }</code><technical_language>added message?</technical_language>

Target:
public String createNewGroup(final String userId, final String courseId) throws AuthenticationException { String hash; try { final String unsecuredSalt = HashManager.generateUnSecureSalt(courseId); hash = HashManager.toHex(HashManager.createHash(userId, unsecuredSalt).getBytes(StandardCharsets.UTF_8)); } catch (NoSuchAlgorithmException e) { throw new AuthenticationException("Invalid algorithm when creating a new group", e); } final BasicDBObject nonStudent = new BasicDBObject(); nonStudent.append(userId, hash); final BasicDBObject groupQuery = new BasicDBObject(DatabaseStringConstants.COURSE_ID, new ObjectId(courseId)) .append(DatabaseStringConstants.USER_LIST, new BasicDBObject()) .append(DatabaseStringConstants.NON_USER_LIST, nonStudent); final DBCollection collection = database.getCollection(DatabaseStringConstants.USER_GROUP_COLLECTION); collection.insert(groupQuery); return groupQuery.get(DatabaseStringConstants.SELF_ID).toString(); }
Source:
<code>private static void testPatternSegmentData(TmfXmlPatternSegment segment) { TestData test = new TestData(); assertEquals("getStart", test.ts, segment.getStart()); assertEquals("getEnd", test.tf, segment.getEnd()); assertEquals("getScale", test.scale, segment.getScale()); assertEquals("getName", test.name, segment.getName()); assertNotNull("getContent", segment.getContent()); assertEquals("content size", test.content.size(), segment.getContent().size()); Iterator<Map.Entry<String, Object>> it1 = segment.getContent().entrySet().iterator(); Iterator<Map.Entry<String, Object>> it2 = test.content.entrySet().iterator(); for (int i = 0; i < test.content.size(); i++) { Map.Entry<String, Object> actual = it1.next(); Map.Entry<String, Object> expected = it2.next(); <START> assertEquals("content name", expected.getKey(), actual.getKey()); <END> assertEquals("content value", expected.getValue(), actual.getValue()); } }</code><technical_language>add + i "content name" "content value". interesting element failed assert</technical_language>

Target:
private static void testPatternSegmentData(TmfXmlPatternSegment segment) { final Map<@NonNull String, @NonNull ITmfStateValue> testContent = new HashMap<>(); testContent.put("field1", TmfStateValue.newValueLong(5l)); testContent.put("field2", TmfStateValue.newValueString("test")); testContent.put("field3", TmfStateValue.newValueInt(1)); TmfXmlPatternSegment test = new TmfXmlPatternSegment(1l, 10l, ITmfTimestamp.NANOSECOND_SCALE, "seg_test2", testContent); assertEquals("getStart", test.getStart(), segment.getStart()); assertEquals("getEnd", test.getEnd(), segment.getEnd()); assertEquals("getScale", test.getScale(), segment.getScale()); assertEquals("getName", test.getName(), segment.getName()); assertNotNull("getContent", segment.getContent()); assertEquals("content size", test.getContent().size(), segment.getContent().size()); Iterator<Map.Entry<String, @NonNull ITmfStateValue>> it1 = segment.getContent().entrySet().iterator(); Iterator<Map.Entry<String, @NonNull ITmfStateValue>> it2 = test.getContent().entrySet().iterator(); for (int i = 0; i < test.getContent().size(); i++) { Map.Entry<String, @NonNull ITmfStateValue> actual = it1.next(); Map.Entry<String, @NonNull ITmfStateValue> expected = it2.next(); assertEquals("content name" + i, expected.getKey(), actual.getKey()); assertEquals("Content value comparison" + i, 0, expected.getValue().compareTo(actual.getValue())); } }
Source:
<code>public long updateAndGetCurrentMessageBackoff(SubscriptionPolicy subscriptionPolicy) { <START> currentMessageBackoff = currentMessageBackoff == -1 ? subscriptionPolicy.getMessageBackoff() : <END> Math.min(subscriptionPolicy.getBackoffMaxIntervalMillis(), (long) (currentMessageBackoff * subscriptionPolicy.getBackoffMultiplier())); return currentMessageBackoff; }</code><technical_language>recommend splitting statements, pretty tough eyes moment :)</technical_language>

Target:
public long updateAndGetCurrentMessageBackoff(SubscriptionPolicy subscriptionPolicy) { if (currentMessageBackoff == -1) { currentMessageBackoff = subscriptionPolicy.getMessageBackoff(); } else { currentMessageBackoff = Math.min(subscriptionPolicy.getBackoffMaxIntervalMillis(), (long) (currentMessageBackoff * subscriptionPolicy.getBackoffMultiplier())); } return currentMessageBackoff; }
Source:
<code>private void executeTransferPartition(List<BlockTransferInfo> transferInfos, Consumer<Exception> exceptionHandler) { for (BlockTransferInfo transferInfo : transferInfos) { try { if (mLoadTracker.loadDetected(transferInfo.getSrcLocation(), transferInfo.getDstLocation())) { LOG.warn("Skipping transfer-order: due to user activity.", transferInfo); continue; } boolean useReservedSpace = transferInfo.isSwap(); <START> synchronized (this) { <END> mBlockStore.moveBlock(Sessions.createInternalSessionId(), transferInfo.getSrcBlockId(), AllocateOptions.forTierMove(transferInfo.getDstLocation()) .setUseReservedSpace(useReservedSpace)); if (transferInfo.isSwap()) { mBlockStore.moveBlock(Sessions.createInternalSessionId(), transferInfo.getDstBlockId(), AllocateOptions.forTierMove(transferInfo.getSrcLocation()) .setUseReservedSpace(useReservedSpace)); } } } catch (Exception e) { LOG.warn("Transfer-order: failed. {}. ", transferInfo, e); if (exceptionHandler != null) { exceptionHandler.accept(e); } } } }</code><technical_language>is this lock intended guard against? BlockTransferExecutor is shared threads</technical_language>

Target:
private void executeTransferPartition(List<BlockTransferInfo> transferInfos, Consumer<Exception> exceptionHandler) { for (BlockTransferInfo transferInfo : transferInfos) { try { if (mLoadTracker.loadDetected(transferInfo.getSrcLocation(), transferInfo.getDstLocation())) { LOG.warn("Skipping transfer-order: due to user activity.", transferInfo); continue; } boolean useReservedSpace = transferInfo.isSwap(); mBlockStore.moveBlock(Sessions.createInternalSessionId(), transferInfo.getSrcBlockId(), AllocateOptions.forTierMove(transferInfo.getDstLocation()) .setUseReservedSpace(useReservedSpace)); if (transferInfo.isSwap()) { mBlockStore.moveBlock(Sessions.createInternalSessionId(), transferInfo.getDstBlockId(), AllocateOptions.forTierMove(transferInfo.getSrcLocation()) .setUseReservedSpace(useReservedSpace)); } } catch (Exception e) { LOG.warn("Transfer-order: failed. {}. ", transferInfo, e); if (exceptionHandler != null) { exceptionHandler.accept(e); } } } }
Source:
<code><START> public ImmutableOptionalValue<UUID> createValue(@Nullable UUID owner) { <END> if(owner == null) { return getEmptyValue(); } else { return createValue(Optional.of(owner)); } }</code><technical_language>Is this supposed static</technical_language>

Target:
public static ImmutableOptionalValue<UUID> createValue(@Nullable UUID owner) { if(owner == null) { return getEmptyValue(); } else { return createValue(Optional.of(owner)); } }
Source:
<code>protected Context doInBackground(Context... ctx) { listHistoryProducts = mHistoryProductDao.queryBuilder().orderDesc(HistoryProductDao.Properties.LastSeen).list(); <START> final Bitmap defaultImgUrl = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.ic_no), 200, 200, true); <END> for (HistoryProduct historyProduct : listHistoryProducts) { Bitmap imgUrl; HttpURLConnection connection = null; InputStream input = null; try { URL url = new URL(historyProduct.getUrl()); connection = (HttpURLConnection) url.openConnection(); connection.setDoInput(true); connection.connect(); input = connection.getInputStream(); imgUrl = Bitmap.createScaledBitmap(BitmapFactory.decodeStream(input), 200, 200, true); } catch (IOException e) { Log.i("HISTORY", "unable to get the history product image", e); imgUrl = defaultImgUrl; } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (connection != null) { connection.disconnect(); } } productItems.add(new HistoryItem(historyProduct.getTitle(), historyProduct.getBrands(), imgUrl, historyProduct.getBarcode())); } return ctx[0]; }</code><technical_language>I Travis CI complains this resource: ic_no</technical_language>

Target:
protected Context doInBackground(Context... ctx) { listHistoryProducts = mHistoryProductDao.queryBuilder().orderDesc(HistoryProductDao.Properties.LastSeen).list(); for (HistoryProduct historyProduct : listHistoryProducts) { Bitmap imgUrl; HttpURLConnection connection = null; InputStream input = null; try { URL url = new URL(historyProduct.getUrl()); connection = (HttpURLConnection) url.openConnection(); connection.setDoInput(true); connection.connect(); input = connection.getInputStream(); imgUrl = Bitmap.createScaledBitmap(BitmapFactory.decodeStream(input), 200, 200, true); } catch (IOException e) { Log.i("HISTORY", "unable to get the history product image", e); Drawable drawable = getResources().getDrawable(R.drawable.ic_no_red_24dp); Canvas canvas = new Canvas(); Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); canvas.setBitmap(bitmap); drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); drawable.draw(canvas); imgUrl = bitmap; } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (connection != null) { connection.disconnect(); } } productItems.add(new HistoryItem(historyProduct.getTitle(), historyProduct.getBrands(), imgUrl, historyProduct.getBarcode())); } return ctx[0]; }
Source:
<code>public boolean next(Void info) { Span currentSpan = traceAccessor.getCurrentSpan(); if (currentSpan == null) { return false; } <START> return new TraceIdToThresholdComparable(configuration.getPercentage()) <END> .compareTo(currentSpan.getTraceId()) <= 0; }</code><technical_language>inline this. ex. if configuration.getPercentage() is mutable config, a final copy. This code is simple enough inlined, reason require allocation another type do this math</technical_language>

Target:
public boolean next(Void info) { Span currentSpan = traceAccessor.getCurrentSpan(); long threshold = Math.abs(Long.MAX_VALUE * (int) (configuration.getPercentage() * 100)); if (currentSpan == null || threshold == 0L) { return false; } long traceId = currentSpan.getTraceId(); Long mod = Math.abs(traceId % 100); return mod.compareTo(threshold) <= 0; }
Source:
<code>public void after() { if (instance != null) { instance.shutdown(); } <START> System.setProperty(HAZELCAST_INTERNAL_OVERRIDE_ENTERPRISE, ""); <END> }</code><technical_language>Nit: System.clearProperty(...)</technical_language>

Target:
public void after() { if (instance != null) { instance.shutdown(); } System.clearProperty(HAZELCAST_INTERNAL_OVERRIDE_ENTERPRISE); }
Source:
<code>public ClientSecurityConfig(ClientSecurityConfig securityConfig) { if (securityConfig.identityConfig == null) { identityConfig = null; } else { Class<? extends IdentityConfig> identityType = securityConfig.identityConfig.getClass(); try { <START> identityConfig = identityType.getConstructor(identityType).newInstance(securityConfig.identityConfig); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { identityConfig = securityConfig.identityConfig; <END> } } }</code><technical_language>Minor: considered introducing a simple copy method implementing Cloneable? (But of course, code is a of beauty.)</technical_language>

Target:
public ClientSecurityConfig(ClientSecurityConfig securityConfig) { if (securityConfig.identityConfig == null) { identityConfig = null; } else { identityConfig = securityConfig.identityConfig.copy(); } }
Source:
<code>public String expandTemplate(VariableMap variables) <START> { <END> StringBuilder builder = new StringBuilder(); for (NameFragment fragment : name) { if (fragment.isVariable()) { String value = variables.getValue(fragment.getVariable()); checkArgument(value != null, "unresolved variable '%s' in resource group '%s', available: %s", fragment.getVariable(), this, variables); builder.append(value); } else { builder.append(fragment.getLiteral()); } } return builder.toString(); }</code><technical_language>Put this in a field</technical_language>

Target:
public String expandTemplate(VariableMap variables) { StringBuilder builder = new StringBuilder(); for (NameFragment fragment : fragments) { if (fragment.isVariable()) { String value = variables.getValue(fragment.getVariable()); checkArgument(value != null, "unresolved variable '%s' in resource group '%s', available: %s", fragment.getVariable(), this, variables); builder.append(value); } else { builder.append(fragment.getLiteral()); } } return builder.toString(); }
Source:
<code>public int asInt() { String result = value.replaceAll("_", ""); if (result.startsWith("0x")) { <START> return Integer.parseUnsignedInt(result.substring(2), 16); <END> } if (result.startsWith("0b")) { return Integer.parseUnsignedInt(result.substring(2), 2); } if (result.startsWith("0")) { return Integer.parseUnsignedInt(result.substring(1), 8); } return Integer.parseInt(result); }</code><technical_language>Check out <LINK_0></technical_language>

Target:
public int asInt() { String result = value.replaceAll("_", ""); if (result.startsWith("0x") || result.startsWith("0X")) { return Integer.parseUnsignedInt(result.substring(2), 16); } if (result.startsWith("0b") || result.startsWith("0B")) { return Integer.parseUnsignedInt(result.substring(2), 2); } if (result.length() > 1 && result.startsWith("0")) { return Integer.parseUnsignedInt(result.substring(1), 8); } return Integer.parseInt(result); }
Source:
<code>private static Object optimize(@Language("SQL") String expression) { assertRoundTrip(expression); Expression parsedExpression = FunctionAssertions.createExpression(expression, METADATA, SYMBOL_TYPES); Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes(TEST_SESSION, METADATA, SQL_PARSER, SYMBOL_TYPES, parsedExpression, emptyList(), WarningCollector.NOOP); ExpressionInterpreter interpreter = expressionOptimizer(parsedExpression, METADATA, TEST_SESSION, expressionTypes); Object expressionResult = interpreter.optimize(symbol -> { <START> Object value = symbolConstant(symbol); <END> if (value == null) { return symbol.toSymbolReference(); } return value; }); return expressionResult; }</code><technical_language>cc @highker removal</technical_language>

Target:
private static Object optimize(@Language("SQL") String expression) { assertRoundTrip(expression); Expression parsedExpression = FunctionAssertions.createExpression(expression, METADATA, SYMBOL_TYPES); Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes(TEST_SESSION, METADATA, SQL_PARSER, SYMBOL_TYPES, parsedExpression, emptyList(), WarningCollector.NOOP); ExpressionInterpreter interpreter = expressionOptimizer(parsedExpression, METADATA, TEST_SESSION, expressionTypes); Object expressionResult = interpreter.optimize(symbol -> { Object value = symbolConstant(symbol); if (value == null) { return symbol.toSymbolReference(); } return value; }); RowExpression rowExpression = TRANSLATOR.translate(parsedExpression, SYMBOL_TYPES); Object rowExpressionResult = new RowExpressionInterpreter(rowExpression, METADATA, TEST_SESSION.toConnectorSession(), true).optimize(symbol -> { Object value = symbolConstant(symbol); if (value == null) { return new VariableReferenceExpression(symbol.getName(), SYMBOL_TYPES.get(symbol)); } return value; }); assertExpressionAndRowExpressionEquals(expressionResult, rowExpressionResult); return expressionResult; }
Source:
<code>protected synchronized void executeRule(Rule rule, RuleEvaluationContext context) { <START> scheduler.schedule(() -> { <END> Script script = scriptEngine.newScriptFromXExpression(rule.getScript()); logger.debug("Executing rule '{}'", rule.getName()); context.setGlobalContext(RuleContextHelper.getContext(rule, injector)); try { script.execute(context); } catch (Exception e) { String msg = e.getMessage(); if (msg == null) { logger.error("Rule '{}'", rule.getName(), e.getCause()); } else { logger.error("Rule '{}': {}", rule.getName(), msg); } } }, 0, TimeUnit.SECONDS); }</code><technical_language>execute</technical_language>

Target:
protected synchronized void executeRule(Rule rule, RuleEvaluationContext context) { scheduler.execute(() -> { Script script = scriptEngine.newScriptFromXExpression(rule.getScript()); logger.debug("Executing rule '{}'", rule.getName()); context.setGlobalContext(RuleContextHelper.getContext(rule, injector)); try { script.execute(context); } catch (Exception e) { String msg = e.getMessage(); if (msg == null) { logger.error("Rule '{}'", rule.getName(), e.getCause()); } else { logger.error("Rule '{}': {}", rule.getName(), msg); } } }); }
Source:
<code>public Properties getObject() { loadBaseProperties(); props.putAll(BASE_PROPERTIES); if (secureMode) { loadPropertyList(props,SECURITY_PROPERTY_FILE_NAME_KEY); } else { loadPropertyList(props,PROPERTY_FILE_NAMES_KEY); if (testMode) { loadPropertyList(props,PROPERTY_TEST_FILE_NAMES_KEY); } } if (StringUtils.isBlank(System.getProperty(HTTP_URL_PROPERTY_NAME))) { props.put(KSB_REMOTING_URL_PROPERTY_NAME, props.getProperty(KFSConstants.APPLICATION_URL_KEY) + REMOTING_URL_SUFFIX); } else { props.put(KSB_REMOTING_URL_PROPERTY_NAME, new StringBuilder("http://").append(System.getProperty(HTTP_URL_PROPERTY_NAME)).append("/kfs-").append(props.getProperty(KFSConstants.ENVIRONMENT_KEY)).append(REMOTING_URL_SUFFIX).toString()); } if (LOG.isDebugEnabled()) { for (Iterator itr = props.keySet().iterator(); itr.hasNext(); ) { <START> String key = (String) itr.next(); <END> String value = (String) props.get(key); System.out.println(key + ": " + value); LOG.debug(key + ": " + value); } } return props; }</code><technical_language>iterator genericized? needed iterator here? yuck..</technical_language>

Target:
public Properties getObject() { loadBaseProperties(); props.putAll(BASE_PROPERTIES); if (secureMode) { loadPropertyList(props,SECURITY_PROPERTY_FILE_NAME_KEY); } else { loadPropertyList(props,PROPERTY_FILE_NAMES_KEY); if (testMode) { loadPropertyList(props,PROPERTY_TEST_FILE_NAMES_KEY); } } if (StringUtils.isBlank(System.getProperty(HTTP_URL_PROPERTY_NAME))) { props.put(KSB_REMOTING_URL_PROPERTY_NAME, props.getProperty(KFSConstants.APPLICATION_URL_KEY) + REMOTING_URL_SUFFIX); } else { props.put(KSB_REMOTING_URL_PROPERTY_NAME, new StringBuilder("http://").append(System.getProperty(HTTP_URL_PROPERTY_NAME)).append("/kfs-").append(props.getProperty(KFSConstants.ENVIRONMENT_KEY)).append(REMOTING_URL_SUFFIX).toString()); } if (LOG.isDebugEnabled()) { for (Object key: props.keySet()) { String value = (String) props.get(key); System.out.println(key + ": " + value); LOG.debug(key + ": " + value); } } return props; }
Source:
<code>public Object select(String id, Object defaultValue, ParamOption[] options) { if (defaultValue == null) { <START> defaultValue = options[0].getValue(); <END> } forms.put(id, new Select(id, defaultValue, options)); Object value = params.get(id); if (value == null) { value = defaultValue; params.put(id, value); } return value; }</code><technical_language>check if options is empty</technical_language>

Target:
public Object select(String id, Object defaultValue, ParamOption[] options) { if (defaultValue == null && options != null && options.length > 0) { defaultValue = options[0].getValue(); } forms.put(id, new Select(id, defaultValue, options)); Object value = params.get(id); if (value == null) { value = defaultValue; params.put(id, value); } return value; }
Source:
<code>private void removeNode(long address) { boolean middleNode = true; if (address == lastAddress) { if (trace) { <START> log.tracef("Removed LRU node at end 0x%016x", address); <END> } long previousLRUNode = OffHeapLruNode.getPrevious(address); if (previousLRUNode != 0) { OffHeapLruNode.setNext(previousLRUNode, 0); } lastAddress = previousLRUNode; middleNode = false; } if (address == firstAddress) { if (trace) { log.tracef("Removing LRU node at beginning 0x%016x", address); } long nextLRUNode = OffHeapLruNode.getNext(address); if (nextLRUNode != 0) { OffHeapLruNode.setPrevious(nextLRUNode, 0); } firstAddress = nextLRUNode; middleNode = false; } if (middleNode) { if (trace) { log.tracef("Removing middle LRU node at 0x%016x", address); } long previousLRUNode = OffHeapLruNode.getPrevious(address); long nextLRUNode = OffHeapLruNode.getNext(address); assert previousLRUNode != 0; assert nextLRUNode != 0; OffHeapLruNode.setNext(previousLRUNode, nextLRUNode); OffHeapLruNode.setPrevious(nextLRUNode, previousLRUNode); } }</code><technical_language>a LRU node "instance" more, I prefer talking LRU list entry, e.g. "Removed entry 0x%016x end of LRU list"</technical_language>

Target:
private void removeNode(long address) { boolean middleNode = true; if (address == lastAddress) { if (trace) { log.tracef("Removed entry 0x%016x from the end of the LRU list", address); } long previousLRUNode = OffHeapLruNode.getPrevious(address); if (previousLRUNode != 0) { OffHeapLruNode.setNext(previousLRUNode, 0); } lastAddress = previousLRUNode; middleNode = false; } if (address == firstAddress) { if (trace) { log.tracef("Removed entry 0x%016x from the beginning of the LRU list", address); } long nextLRUNode = OffHeapLruNode.getNext(address); if (nextLRUNode != 0) { OffHeapLruNode.setPrevious(nextLRUNode, 0); } firstAddress = nextLRUNode; middleNode = false; } if (middleNode) { if (trace) { log.tracef("Removed entry 0x%016x from the middle of the LRU list", address); } long previousLRUNode = OffHeapLruNode.getPrevious(address); long nextLRUNode = OffHeapLruNode.getNext(address); assert previousLRUNode != 0; assert nextLRUNode != 0; OffHeapLruNode.setNext(previousLRUNode, nextLRUNode); OffHeapLruNode.setPrevious(nextLRUNode, previousLRUNode); } }
Source:
<code>public void markAsDeleted(StoreKey id, FileSpan fileSpan) throws StoreException { verifyFileEndOffset(fileSpan); IndexValue value = findKey(id); if (value == null) { <START> throw new StoreException("id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); <END> } value.setFlag(IndexValue.Flags.Delete_Index); value.setNewOffset(fileSpan.getStartOffset()); value.setNewSize(fileSpan.getEndOffset() - fileSpan.getStartOffset()); indexes.lastEntry().getValue().addEntry(new IndexEntry(id, value), fileSpan.getEndOffset()); journal.addEntry(fileSpan.getStartOffset(), id); }</code><technical_language>id -> Id</technical_language>

Target:
public void markAsDeleted(StoreKey id, FileSpan fileSpan) throws StoreException { verifyFileEndOffset(fileSpan); IndexValue value = findKey(id); if (value == null) { throw new StoreException("Id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); } value.setFlag(IndexValue.Flags.Delete_Index); value.setNewOffset(fileSpan.getStartOffset()); value.setNewSize(fileSpan.getEndOffset() - fileSpan.getStartOffset()); indexes.lastEntry().getValue().addEntry(new IndexEntry(id, value), fileSpan.getEndOffset()); journal.addEntry(fileSpan.getStartOffset(), id); }
Source:
<code>void populateEnvContextShouldSetMaterialEnvVars() { <START> HgMaterial material = new HgMaterial("<LINK_3>", "folder"); <END> EnvironmentVariableContext ctx = new EnvironmentVariableContext(); final ArrayList<Modification> modifications = new ArrayList<>(); modifications.add(new Modification("user2", "comment2", "email2", new Date(), "24")); modifications.add(new Modification("user1", "comment1", "email1", new Date(), "23")); MaterialRevision materialRevision = new MaterialRevision(material, modifications); assertThat(ctx.getProperty(ScmMaterial.GO_MATERIAL_URL)).isNull(); assertThat(ctx.getProperty(GitMaterial.GO_MATERIAL_BRANCH)).isNull(); material.populateEnvironmentContext(ctx, materialRevision, new File(".")); String propertySuffix = material.getMaterialNameForEnvironmentVariable(); assertThat(ctx.getProperty(format("%s_%s", ScmMaterial.GO_MATERIAL_URL, propertySuffix))).isEqualTo("<LINK_1>"); assertThat(ctx.getProperty(format("%s_%s", GitMaterial.GO_MATERIAL_BRANCH, propertySuffix))).isEqualTo("default"); }</code><technical_language>modify this test a path parameter too? <LINK_4></technical_language>

Target:
void populateEnvContextShouldSetMaterialEnvVars() { HgMaterial material = new HgMaterial("<LINK_0>", "folder"); material.setBranch("branchName"); EnvironmentVariableContext ctx = new EnvironmentVariableContext(); final ArrayList<Modification> modifications = new ArrayList<>(); modifications.add(new Modification("user2", "comment2", "email2", new Date(), "24")); modifications.add(new Modification("user1", "comment1", "email1", new Date(), "23")); MaterialRevision materialRevision = new MaterialRevision(material, modifications); assertThat(ctx.getProperty(ScmMaterial.GO_MATERIAL_URL)).isNull(); assertThat(ctx.getProperty(GitMaterial.GO_MATERIAL_BRANCH)).isNull(); material.populateEnvironmentContext(ctx, materialRevision, new File(".")); String propertySuffix = material.getMaterialNameForEnvironmentVariable(); assertThat(ctx.getProperty(format("%s_%s", ScmMaterial.GO_MATERIAL_URL, propertySuffix))).isEqualTo("<LINK_2>"); assertThat(ctx.getProperty(format("%s_%s", GitMaterial.GO_MATERIAL_BRANCH, propertySuffix))).isEqualTo("branchName"); }
Source:
<code>public TwitterBuilder() { super(TwitterAuthProvider.PROVIDER_ID); try { Class c = com.twitter.sdk.android.core.TwitterCore.class; } catch (NoClassDefFoundError e) { throw new RuntimeException( "Twitter provider cannot be configured " + "without dependency. Did you forget to add " + "'com.twitter.sdk.android:twitter-core:VERSION' dependency?"); } if (getApplicationContext().getString(R.string.twitter_consumer_key) .equals(UNCONFIGURED_CONFIG_VALUE) || getApplicationContext().getString(R.string.twitter_consumer_secret) .equals(UNCONFIGURED_CONFIG_VALUE)) { <START> throw new RuntimeException("Twitter provider unconfigured. Make sure to add" + <END> " your key and secret. See the docs for more info:" + " <LINK_0>"); } }</code><technical_language>extracting hardcoded string values this strings.xml</technical_language>

Target:
public TwitterBuilder() { super(TwitterAuthProvider.PROVIDER_ID); try { Class c = com.twitter.sdk.android.core.TwitterCore.class; } catch (NoClassDefFoundError e) { throw new RuntimeException( "Twitter provider cannot be configured " + "without dependency. Did you forget to add " + "'com.twitter.sdk.android:twitter-core:VERSION' dependency?"); } Preconditions.checkConfigured(getApplicationContext(), "Twitter provider unconfigured. Make sure to add your key and secret." + " See the docs for more info:" + " <LINK_0>", R.string.twitter_consumer_key, R.string.twitter_consumer_secret); }
Source:
<code>public boolean bootstrapSchedules(Iterable<Channel> channels, Interval interval, Publisher source) { <START> if (bootstrapLock.tryLock()) { <END> bootstrapping.set(true); processed.set(0); failures.set(0); Set<ListenableFuture<UpdateProgress>> futures = Sets.newHashSet(); log.info( "Bootstrapping channels for interval from to {}", Iterables.size(channels), interval.getStart(), interval.getEnd() ); try { for (Channel channel : channels) { log.info("Bootstrapping channel {}/{}", channel.getId(), channel.getTitle()); ListenableFuture<UpdateProgress> updateFuture = executor.submit( taskFactory.create(source, channel, interval) ); Futures.addCallback(updateFuture, new FutureCallback<UpdateProgress>() { @Override public void onSuccess(UpdateProgress result) { processed.incrementAndGet(); log.info("Processed channel with updates {}", result); } @Override public void onFailure(Throwable t) { log.error("Error while processing schedules", t); failures.incrementAndGet(); lastException.set(t); } }); futures.add(updateFuture); } Futures.get(Futures.allAsList(futures), Exception.class); } catch (Exception e) { lastException.set(e); } finally { bootstrapLock.unlock(); bootstrapping.set(false); } return true; } else { return false; } }</code><technical_language>reverse this a guard? if (!boostrapLock.tryLock())</technical_language>

Target:
public boolean bootstrapSchedules(Iterable<Channel> channels, Interval interval, Publisher source) { if (!bootstrapLock.tryLock()) { return false; } bootstrapping.set(true); processed.set(0); failures.set(0); Set<ListenableFuture<UpdateProgress>> futures = Sets.newHashSet(); log.info( "Bootstrapping channels for interval from to {}", Iterables.size(channels), interval.getStart(), interval.getEnd() ); try { for (Channel channel : channels) { futures.add(bootstrapChannel(channel, interval, source)); } Futures.get(Futures.allAsList(futures), Exception.class); } catch (Exception e) { } finally { bootstrapLock.unlock(); bootstrapping.set(false); } return true; }
Source:
<code>public void handleError(HttpCommand command, HttpResponse response) { String message = parseMessage(response); Exception exception = message != null ? new HttpResponseException(command, response, message) : new HttpResponseException(command, response); try { message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()); switch (response.getStatusCode()) { case 400: if ((command.getCurrentRequest().getEndpoint().getPath().endsWith("/info")) || (message != null && message.indexOf("could not be found") != -1)) exception = new ResourceNotFoundException(message, exception); else if (message != null && message.indexOf("currently in use") != -1) exception = new IllegalStateException(message, exception); else exception = new IllegalArgumentException(message, exception); break; case 401: exception = new AuthorizationException(message, exception); break; case 402: exception = new IllegalStateException(message, exception); break; case 404: if (!command.getCurrentRequest().getMethod().equals("DELETE")) { exception = new ResourceNotFoundException(message, exception); } break; case 405: exception = new IllegalArgumentException(message, exception); break; case 409: exception = new IllegalStateException(message, exception); <START> break; <END> } } finally { closeQuietly(response.getPayload()); command.setException(exception); } }</code><technical_language>handle 500 errors instead of null fallback</technical_language>

Target:
public void handleError(HttpCommand command, HttpResponse response) { Exception exception = null; try { String message = parseMessage(response); message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()); switch (response.getStatusCode()) { case 401: exception = new AuthorizationException(message, exception); break; case 404: if (command.getCurrentRequest().getMethod().equals("GET")) { if (command.getCurrentRequest().getEndpoint().getPath().endsWith("/images/json")) { exception = new HttpResponseException("Unable to reach docker daemon", command, response); } } break; case 409: if (command.getCurrentRequest().getMethod().equals("POST")) { if (command.getCurrentRequest().getEndpoint().getPath().endsWith("/containers")) { exception = new HttpResponseException("Container already exists", command, response); } } break; case 500: if (command.getCurrentRequest().getMethod().equals("POST")) { if (command.getCurrentRequest().getEndpoint().getPath().endsWith("/engines")) { exception = new HttpResponseException("Connection refused registering docker daemon", command, response); } } break; default: exception = new HttpResponseException(message, command, response); break; } } catch (Exception e) { exception = new HttpResponseException(command, response, e); } finally { closeQuietly(response.getPayload()); command.setException(exception); } }
Source:
<code>public void testClearMetaEntryInfo() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Method clearMetaEntryInfo = DeviceTypeManagementServiceImpl.class.getDeclaredMethod("clearMetaEntryInfo", DeviceType.class); clearMetaEntryInfo.setAccessible(true); DeviceType deviceType = new DeviceType(); deviceType.setId(TEST_DEVICE_TYPE_ID); deviceType.setName(TEST_DEVICE_TYPE); DeviceTypeMetaDefinition deviceTypeMetaDefinition = new DeviceTypeMetaDefinition(); deviceTypeMetaDefinition.setClaimable(true); deviceTypeMetaDefinition.setDescription(DEVICE_TYPE_DESCRIPTION); PushNotificationConfig pushNotificationConfig = new PushNotificationConfig(TEST_DEVICE_TYPE, true, null); deviceTypeMetaDefinition.setPushNotificationConfig(pushNotificationConfig); deviceType.setDeviceTypeMetaDefinition(deviceTypeMetaDefinition); <START> <END> DeviceType returned = (DeviceType) clearMetaEntryInfo.invoke(this.deviceTypeManagementService, deviceType); Assert.assertNotNull(returned.getDeviceTypeMetaDefinition()); }</code><technical_language>Remove un-wanted extra lines</technical_language>

Target:
public void testClearMetaEntryInfo() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Method clearMetaEntryInfo = DeviceTypeManagementServiceImpl.class.getDeclaredMethod("clearMetaEntryInfo", DeviceType.class); clearMetaEntryInfo.setAccessible(true); DeviceType deviceType = DeviceMgtAPITestHelper.getDummyDeviceType(TEST_DEVICE_TYPE, TEST_DEVICE_TYPE_ID); DeviceType returned = (DeviceType) clearMetaEntryInfo.invoke(this.deviceTypeManagementService, deviceType); Assert.assertNotNull(returned.getDeviceTypeMetaDefinition(), "The response object is null."); }
Source:
<code>public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { if (node.isInterface()) { return data; } Map<MethodNameDeclaration, List<NameOccurrence>> methods = node.getScope().getEnclosingScope(ClassScope.class) .getMethodDeclarations(); for (MethodNameDeclaration mnd : findUnique(methods)) { List<NameOccurrence> occs = methods.get(mnd); if (!privateAndNotExcluded(mnd) <START> || ((Annotateable) mnd.getNode()).isAnyAnnotationPresent(getProperty(ignoredAnnotationsDescriptor))) { <END> continue; } if (occs.isEmpty()) { addViolation(data, mnd.getNode(), mnd.getImage() + mnd.getParameterDisplaySignature()); } else { if (calledFromOutsideItself(occs, mnd)) { addViolation(data, mnd.getNode(), mnd.getImage() + mnd.getParameterDisplaySignature()); } } } return data; }</code><technical_language>here, a shorthand</technical_language>

Target:
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { if (node.isInterface()) { return data; } Map<MethodNameDeclaration, List<NameOccurrence>> methods = node.getScope().getEnclosingScope(ClassScope.class) .getMethodDeclarations(); for (MethodNameDeclaration mnd : findUnique(methods)) { List<NameOccurrence> occs = methods.get(mnd); if (!privateAndNotExcluded(mnd) || hasIgnoredAnnotation((Annotatable) mnd.getNode().jjtGetParent())) { continue; } if (occs.isEmpty()) { addViolation(data, mnd.getNode(), mnd.getImage() + mnd.getParameterDisplaySignature()); } else { if (calledFromOutsideItself(occs, mnd)) { addViolation(data, mnd.getNode(), mnd.getImage() + mnd.getParameterDisplaySignature()); } } } return data; }
Source:
<code>public void testServerTemplateProps() { setServerProp(KieServerConfigurationKey.LOCATION, SERVER_LOCATION); <START> setServerProp(KieServerConfigurationKey.USER, SERVER_USER); <END> setServerProp(KieServerConfigurationKey.PASSWORD, SERVER_PASSWORD); KieServerConnectionInfo connectionInfo = kieServerConnectionInfoProvider.verifiedConnectionInfo(def); assertEquals(SERVER_LOCATION, connectionInfo.getLocation().get()); assertEquals(SERVER_USER, connectionInfo.getUser().get()); assertEquals(SERVER_PASSWORD, connectionInfo.getPassword().get()); }</code><technical_language>suggestion</technical_language>

Target:
public void testServerTemplateProps() { setServerProp(KieServerConfigurationKey.LOCATION, SERVER_LOCATION); setServerProp(KieServerConfigurationKey.USER, SERVER_USER); setServerProp(KieServerConfigurationKey.PASSWORD, SERVER_PASSWORD); KieServerConnectionInfo connectionInfo = kieServerConnectionInfoProvider.verifiedConnectionInfo(def); assertEquals(SERVER_LOCATION, connectionInfo.getLocation().get()); assertEquals(SERVER_USER, connectionInfo.getUser().get()); assertEquals(SERVER_PASSWORD, connectionInfo.getPassword().get()); assertFalse(connectionInfo.isReplaceQuery()); }
Source:
<code>static void setDefaults() { setDefault(FEATURE_POLICY_PERSISTENCE_PROPERTY, true); setDefault(FEATURE_ENRICHER_PERSISTENCE_PROPERTY, true); setDefault(FEATURE_FEED_PERSISTENCE_PROPERTY, true); setDefault(FEATURE_FEED_REGISTRATION_PROPERTY, false); setDefault(FEATURE_CATALOG_PERSISTENCE_PROPERTY, true); setDefault(FEATURE_DEFAULT_STANDBY_IS_HOT_PROPERTY, false); setDefault(FEATURE_USE_BROOKLYN_LIVE_OBJECTS_DATAGRID_STORAGE, false); setDefault(FEATURE_RENAME_THREADS, false); setDefault(FEATURE_INFER_CATALOG_ITEM_ON_REBIND, true); <START> setDefault(FEATURE_SSH_ASYNC_EXEC, true); <END> }</code><technical_language>this default false? concern is if default true, existing scripts redirect stdin/out/err fork process play nicely changes</technical_language>

Target:
static void setDefaults() { setDefault(FEATURE_POLICY_PERSISTENCE_PROPERTY, true); setDefault(FEATURE_ENRICHER_PERSISTENCE_PROPERTY, true); setDefault(FEATURE_FEED_PERSISTENCE_PROPERTY, true); setDefault(FEATURE_FEED_REGISTRATION_PROPERTY, false); setDefault(FEATURE_CATALOG_PERSISTENCE_PROPERTY, true); setDefault(FEATURE_DEFAULT_STANDBY_IS_HOT_PROPERTY, false); setDefault(FEATURE_USE_BROOKLYN_LIVE_OBJECTS_DATAGRID_STORAGE, false); setDefault(FEATURE_RENAME_THREADS, false); setDefault(FEATURE_INFER_CATALOG_ITEM_ON_REBIND, true); setDefault(FEATURE_SSH_ASYNC_EXEC, false); }
Source:
<code>public synchronized void registerCapability(RuntimeCapabilityRegistration capabilityRegistration) { CapabilityId capabilityId = capabilityRegistration.getCapabilityId(); RegistrationPoint rp = capabilityRegistration.getOldestRegistrationPoint(); RuntimeCapabilityRegistration currentRegistration = capabilities.get(capabilityId); if (currentRegistration != null) { <START> if (!safeEquals(capabilityRegistration.getCapability(), currentRegistration.getCapability()) <END> || !currentRegistration.addRegistrationPoint(rp)) { throw ControllerLogger.MGMT_OP_LOGGER.capabilityAlreadyRegisteredInContext(capabilityId.getName(), capabilityId.getContext().getName()); } } else { capabilities.put(capabilityId, capabilityRegistration); } for (String req : capabilityRegistration.getCapability().getRequirements()) { registerRequirement(new RuntimeRequirementRegistration(req, capabilityId.getName(), capabilityId.getContext(), rp)); } if (!forServer) { CapabilityContext capContext = capabilityId.getContext(); if (!satisfiedByMap.containsKey(capContext)) { Set<CapabilityContext> satisfiesUs = new HashSet<>(); satisfiedByMap.put(capContext, satisfiesUs); for (Map.Entry<CapabilityContext, Set<CapabilityContext>> entry : satisfiedByMap.entrySet()) { if (entry.getKey().canSatisfyRequirements(capContext)) { satisfiesUs.add(entry.getKey()); } if (capContext.canSatisfyRequirements(entry.getKey())) { entry.getValue().add(capContext); } } } } }</code><technical_language>Java 7 java.util.Objects.equals() need roll safeEquals. I forgetting :)</technical_language>

Target:
public synchronized void registerCapability(RuntimeCapabilityRegistration capabilityRegistration) { CapabilityId capabilityId = capabilityRegistration.getCapabilityId(); RegistrationPoint rp = capabilityRegistration.getOldestRegistrationPoint(); RuntimeCapabilityRegistration currentRegistration = capabilities.get(capabilityId); if (currentRegistration != null) { if (!Objects.equals(capabilityRegistration.getCapability(), currentRegistration.getCapability()) || !currentRegistration.addRegistrationPoint(rp)) { throw ControllerLogger.MGMT_OP_LOGGER.capabilityAlreadyRegisteredInContext(capabilityId.getName(), capabilityId.getContext().getName()); } } else { capabilities.put(capabilityId, capabilityRegistration); } for (String req : capabilityRegistration.getCapability().getRequirements()) { registerRequirement(new RuntimeRequirementRegistration(req, capabilityId.getName(), capabilityId.getContext(), rp)); } if (!forServer) { CapabilityContext capContext = capabilityId.getContext(); if (!satisfiedByMap.containsKey(capContext)) { Set<CapabilityContext> satisfiesUs = new HashSet<>(); satisfiedByMap.put(capContext, satisfiesUs); for (Map.Entry<CapabilityContext, Set<CapabilityContext>> entry : satisfiedByMap.entrySet()) { if (entry.getKey().canSatisfyRequirements(capContext)) { satisfiesUs.add(entry.getKey()); } if (capContext.canSatisfyRequirements(entry.getKey())) { entry.getValue().add(capContext); } } } } }
Source:
<code><START> public String generateSelectSql (String namespace, Requirement minimumRequirement) { <END> String fieldsString; String tableName = String.join(".", namespace, name); if (minimumRequirement.equals(EDITOR)) fieldsString = fieldsToString(editorFields(), tableName + "."); else if (minimumRequirement.equals(OPTIONAL)) fieldsString = fieldsToString(specFields(), tableName + "."); else if (minimumRequirement.equals(REQUIRED)) fieldsString = fieldsToString(requiredFields(), tableName + "."); else fieldsString = "*"; return String.format("select %s from %s", fieldsString, tableName); }</code><technical_language>Honestly I a clear order requirement types. existing methods I impression implicit ordering in mind, if better, defined sets of requirement fields for situation. In case I defined EnumSets some other abstraction instead of current approach</technical_language>

Target:
public String generateSelectSql (String namespace, Requirement minimumRequirement) { String fieldsString; String tableName = String.join(".", namespace, name); String fieldPrefix = tableName + "."; if (minimumRequirement.equals(EDITOR)) fieldsString = commaSeparatedNames(editorFields(), fieldPrefix); else if (minimumRequirement.equals(OPTIONAL)) fieldsString = commaSeparatedNames(specFields(), fieldPrefix); else if (minimumRequirement.equals(REQUIRED)) fieldsString = commaSeparatedNames(requiredFields(), fieldPrefix); else fieldsString = "*"; return String.format("select %s from %s", fieldsString, tableName); }
Source:
<code>public void stop() { if (isStarted()) { <START> log.debugf("Stopping remote cache manager %x", (Integer) System.identityHashCode(this)); <END> synchronized (cacheName2RemoteCache) { for (Map.Entry<RemoteCacheKey, RemoteCacheHolder> cache : cacheName2RemoteCache.entrySet()) { cache.getValue().remoteCache().stop(); } cacheName2RemoteCache.clear(); } listenerNotifier.stop(); counterManager.stop(); channelFactory.destroy(); } unregisterMBean(); started = false; }</code><technical_language>I understand need for this cast. invokes log.debugf(String,int) wraps int in Object[] causing boxing in Integer anyway</technical_language>

Target:
public void stop() { if (isStarted()) { log.debugf("Stopping remote cache manager %x", System.identityHashCode(this)); synchronized (cacheName2RemoteCache) { for (Map.Entry<RemoteCacheKey, RemoteCacheHolder> cache : cacheName2RemoteCache.entrySet()) { cache.getValue().remoteCache().stop(); } cacheName2RemoteCache.clear(); } listenerNotifier.stop(); counterManager.stop(); channelFactory.destroy(); } unregisterMBean(); started = false; }
Source:
<code>public static String getFactoryId() { <START> return "org.eclipse.cdt.dsf.debug.simpleMapPersistableFactory"; END> }</code><technical_language>This Id match in plugin.xml, persistence is working. update in files? org.eclipse.cdt.dsf.debug.ui.simpleMapPersistableFactory</technical_language>

Target:
public static String getFactoryId() { return "org.eclipse.cdt.dsf.ui.simpleMapPersistableFactory"; }
Source:
<code>public void testIOConsoleAvailable() throws Exception { IOConsole console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); consoleInput.available(); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); new Thread(() -> { try { Thread.sleep(100); consoleInput.close(); } catch (Exception e) { } }).start(); assertEquals("read() did not <START> signaled EOF.", <END> -1, consoleInput.read()); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.close(); consoleInput.available(); consoleInput.available(); } }</code><technical_language>remove "ed"</technical_language>

Target:
public void testIOConsoleAvailable() throws Exception { IOConsole console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); consoleInput.available(); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); new Thread(() -> { try { Thread.sleep(100); consoleInput.close(); } catch (Exception e) { } }).start(); assertEquals("read() did not signal EOF.", -1, consoleInput.read()); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.close(); consoleInput.available(); consoleInput.available(); } }
Source:
<code>public void setContents(IFileState source, int updateFlags, IProgressMonitor monitor) <START> throws CoreException { <END> }</code><technical_language>this missing implementation</technical_language>

Target:
public void setContents(IFileState source, int updateFlags, IProgressMonitor monitor) throws CoreException { delegate().setContents(source, updateFlags, monitor); }