auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ServiceAccountWithToken createService(HttpServletRequest request, HttpServletResponse response) throws IOException, NotFoundException, UnauthorizedException { final Session session = getSessionsService().get(request); PermissionDefinition permissionDefinition = getPermissionsService().userPermissions(session.getEmail(), session); if (BooleanUtils.isTrue(permissionDefinition.admin)) { final ServiceStore serviceStoreImpl = getServiceStore(); final String token = randomIdGenerator.get(); <START> ServiceAccount service = serviceStoreImpl.store(token, request.getInputStream()); <END> logInfo("new service account created").addParameter("id", service.getId()).log(); response.setStatus(HttpServletResponse.SC_CREATED); return new ServiceAccountWithToken(token, service.getId()); } response.setStatus(HttpServletResponse.SC_FORBIDDEN); return null; }</code><technical_language>rule i follow is, creates resources responsibly clean up. restolina creates request, i expect handle closing stream</technical_language>

Target:
public void createService(HttpServletRequest request, HttpServletResponse response) throws IOException, NotFoundException, UnauthorizedException { final Session session = getSessionsService().get(request); if (session != null && getPermissionsService().isAdministrator(session)) { final ServiceStore serviceStoreImpl = getServiceStore(); final String token = randomIdGenerator.get(); ServiceAccount service = serviceStoreImpl.store(token, request.getInputStream()); logInfo("new service account created").addParameter("id", service.getId()).log(); writeResponse(response, new ServiceAccountWithToken(token, service.getId()), SC_CREATED); return; } response.setStatus(HttpServletResponse.SC_FORBIDDEN); }
Source:
<code>@Override public void drive() { PLANNING: for (VolcanoPlannerPhase phase : VolcanoPlannerPhase.values()) { while (true) { LOGGER.debug("PLANNER = {}; PHASE = {}; COST = {}", this, phase.toString(), planner.root.bestCost); VolcanoRuleMatch match = ruleQueue.popMatch(phase); if (match == null) { break; } assert match.getRule().matches(match); try { match.onMatch(); } catch (VolcanoTimeoutException e) { planner.canonize(); ruleQueue.phaseCompleted(phase); break PLANNING; <START> } <END> planner.canonize(); } ruleQueue.phaseCompleted(phase); } }</code><technical_language>call drive recursively yield semantic</technical_language>

Target:
@Override public void drive() { PLANNING: for (VolcanoPlannerPhase phase : VolcanoPlannerPhase.values()) { while (true) { LOGGER.debug("PLANNER = {}; PHASE = {}; COST = {}", this, phase.toString(), planner.root.bestCost); VolcanoRuleMatch match = ruleQueue.popMatch(phase); if (match == null) { break; } assert match.getRule().matches(match); try { match.onMatch(); } catch (VolcanoTimeoutException e) { LOGGER.warn("Volcano planning times out, cancels the subsequent optimization."); planner.canonize(); ruleQueue.phaseCompleted(phase); break PLANNING; } planner.canonize(); } ruleQueue.phaseCompleted(phase); } }
Source:
<code><START> static Brave registerTracers(Environment environment, Configuration config, String tracerName) { <END> Brave brave = createBraveTracer(config, tracerName); environment.jersey().register(new BraveContainerRequestFilter( new ServerRequestInterceptor(brave.serverTracer()), new DefaultSpanNameProvider() )); environment.jersey().register(new BraveContainerResponseFilter( new ServerResponseInterceptor(brave.serverTracer()) )); environment.servlets() .addFilter(TraceIdLoggingFilter.class.getSimpleName(), TraceIdLoggingFilter.INSTANCE) .addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*"); return brave; }</code><technical_language>do need return Brave</technical_language>

Target:
static void registerTracers(Environment environment, Configuration config, String tracerName) { ServerTracer serverTracer = getServerTracer(extractIp(config), extractPort(config), tracerName); environment.jersey().register(new BraveContainerRequestFilter( new ServerRequestInterceptor(serverTracer), new DefaultSpanNameProvider() )); environment.jersey().register(new BraveContainerResponseFilter( new ServerResponseInterceptor(serverTracer) )); environment.servlets() .addFilter(TraceIdLoggingFilter.class.getSimpleName(), TraceIdLoggingFilter.INSTANCE) .addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*"); }
Source:
<code>public void setEnvironment(final Environment environment) { if (environment instanceof ConfigurableEnvironment) { ConfigurableEnvironment configurableEnvironment = (ConfigurableEnvironment) environment; Map<String, Object> map = new HashMap<>(); <START> MapPropertySource fakeValues = new MapPropertySource("Implicit expressions", map); <END> for (Map.Entry<String, ConfigurationMetadataProperty> entry : allProperties.entrySet()) { String raw = environment.getProperty(entry.getKey()); if (raw != null) { String type = entry.getValue().getType(); map.put(entry.getKey() + "-expression", literalExpression(raw, type)); } } configurableEnvironment.getPropertySources().addLast(fakeValues); } }</code><technical_language>is intended meaning of "fakeValues"</technical_language>

Target:
public void setEnvironment(final Environment environment) { if (environment instanceof ConfigurableEnvironment) { ConfigurableEnvironment configurableEnvironment = (ConfigurableEnvironment) environment; Map<String, Object> map = new HashMap<>(); for (Map.Entry<String, ConfigurationMetadataProperty> entry : allProperties.entrySet()) { String raw = environment.getProperty(entry.getKey()); if (raw != null) { String type = entry.getValue().getType(); map.put(entry.getKey() + "-expression", literalExpression(raw, type)); } } configurableEnvironment.getPropertySources().addLast(new MapPropertySource("Implicit expressions", map)); } }
Source:
<code>public String commitMessage(GitRepositoryManager repoManager, Provider<ReviewDb> db) { if (commitMessage == null) { PatchSet.Id psId = null; String sha1 = null; Project.NameKey name = null; Repository repo = null; try { psId = change(db).currentPatchSetId(); sha1 = db.get().patchSets().get(psId).getRevision().get(); name = change.getProject(); repo = repoManager.openRepository(name); RevWalk walk = new RevWalk(repo); try { RevCommit c = walk.parseCommit(ObjectId.fromString(sha1)); commitMessage = c.getFullMessage(); } finally { walk.release(); } } catch (RepositoryNotFoundException e) { log.error("Repository not found: " + name.toString(), e); } catch (IOException e) { if(repo == null) { log.error("Problem opening repository: " + name.toString(), e); } else { log.error("Problem parsing commit: " + sha1, e); } } catch (OrmException e) { if (psId != null) { log.error("Problem requesting sha1 from database for patchSetId: " + psId.toString(), e); } else { log.error("Problem requesting change from database for change: " + legacyId.toString(), e); } } finally { <START> if(repo != null) { <END> repo.close(); } } } return commitMessage; }</code><technical_language>Yeah, sounds great</technical_language>

Target:
public String commitMessage(GitRepositoryManager repoManager, Provider<ReviewDb> db) throws IOException, OrmException { if (commitMessage == null) { PatchSet.Id psId = null; String sha1 = null; Project.NameKey name = null; Repository repo = null; psId = change(db).currentPatchSetId(); sha1 = db.get().patchSets().get(psId).getRevision().get(); name = change.getProject(); repo = repoManager.openRepository(name); RevWalk walk = new RevWalk(repo); try { RevCommit c = walk.parseCommit(ObjectId.fromString(sha1)); commitMessage = c.getFullMessage(); } finally { walk.release(); repo.close(); } } return commitMessage; }
Source:
<code><START> public void update(IncomingMessageEnvelope envelope, TaskCoordinator coordinator) { <END> EndOfStreamState state = eosStates.get(envelope.getSystemStreamPartition()); EndOfStreamMessage message = (EndOfStreamMessage) envelope.getMessage(); state.update(message.getTaskName(), message.getTaskCount()); log.info("Received end-of-stream from task " + message.getTaskName() + " in " + envelope.getSystemStreamPartition()); SystemStream systemStream = envelope.getSystemStreamPartition().getSystemStream(); if (isEndOfStream(systemStream)) { log.info("End-of-stream of input " + systemStream + " for " + systemStream); ioGraph.getNodesOfInput(systemStream).forEach(node -> { if (node.isOutputIntermediate()) { boolean inputsEndOfStream = node.getInputs().stream().allMatch(spec -> isEndOfStream(spec.toSystemStream())); if (inputsEndOfStream) { SystemStream outputStream = node.getOutput().toSystemStream(); sendEndOfStream(outputStream, upstreamTaskCounts.get(outputStream)); } } }); boolean allEndOfStream = eosStates.values().stream().allMatch(EndOfStreamState::isEndOfStream); if (allEndOfStream) { log.info("All input streams have reached the end for task " + taskName); coordinator.shutdown(TaskCoordinator.RequestScope.CURRENT_TASK); } } }</code><technical_language>minor: define typed input argument this update() method? e.g. update(IncomingControlMessage<EndOfStreamMessage> envelope, TaskCoordinator coordinator)? need type cast anymore</technical_language>

Target:
public void update(IncomingMessageEnvelope envelope, TaskCoordinator coordinator) { EndOfStreamState state = eosStates.get(envelope.getSystemStreamPartition()); EndOfStreamMessage message = (EndOfStreamMessage) envelope.getMessage(); state.update(message.getTaskName(), message.getTaskCount()); log.info("Received end-of-stream from task " + message.getTaskName() + " in " + envelope.getSystemStreamPartition()); SystemStream systemStream = envelope.getSystemStreamPartition().getSystemStream(); if (isEndOfStream(systemStream)) { log.info("End-of-stream of input " + systemStream + " for " + systemStream); listener.getIOGraph().getNodesOfInput(systemStream).forEach(node -> { if (node.isOutputIntermediate()) { boolean inputsEndOfStream = node.getInputs().stream().allMatch(spec -> isEndOfStream(spec.toSystemStream())); if (inputsEndOfStream) { SystemStream outputStream = node.getOutput().toSystemStream(); sendEndOfStream(outputStream, upstreamTaskCounts.get(outputStream)); } } }); boolean allEndOfStream = eosStates.values().stream().allMatch(EndOfStreamState::isEndOfStream); if (allEndOfStream) { log.info("All input streams have reached the end for task " + taskName); coordinator.shutdown(TaskCoordinator.RequestScope.CURRENT_TASK); } } }
Source:
<code>private boolean filterImage() throws IOException, DataFilterException { final int imageLeft = readShort(); final int imageTop = readShort(); final int imageWidth = readShort(); final int imageHeight = readShort(); final int imageFlags = readByte(); final boolean hasLocalColorMap = (imageFlags & 0x80) == 0x80; final byte[] localColorMap; if (hasLocalColorMap) { final int bitsPerPixel = (imageFlags & 0x07) + 1; final int imageColors = 1 << bitsPerPixel; localColorMap = readBytes(3 * imageColors); } else { localColorMap = new byte[0]; } final int lzwCodeSize = readByte(); if (imageLeft + imageWidth > screenWidth || imageTop + imageHeight > screenHeight || lzwCodeSize < 2 || lzwCodeSize >= 12 || !validateImageFlags(imageFlags)) { foundImageData(false); skipSubBlocks(); return false; } else { foundImageData(true); <START> writeByte(0x2c); <END> writeShort(imageLeft); writeShort(imageTop); writeShort(imageWidth); writeShort(imageHeight); writeByte(imageFlags); writeBytes(localColorMap); writeByte(lzwCodeSize); copySubBlocks(); return true; } }</code><technical_language>function of this 0x2c here? A constant a descriptive name is preferrable</technical_language>

Target:
private boolean filterImage() throws IOException, DataFilterException { final int imageLeft = readShort(); final int imageTop = readShort(); final int imageWidth = readShort(); final int imageHeight = readShort(); final int imageFlags = readByte(); final boolean hasLocalColorMap = (imageFlags & 0x80) == 0x80; final byte[] localColorMap; if (hasLocalColorMap) { final int bitsPerPixel = (imageFlags & 0x07) + 1; final int imageColors = 1 << bitsPerPixel; localColorMap = readBytes(3 * imageColors); } else { localColorMap = new byte[0]; } final int lzwCodeSize = readByte(); if (imageLeft + imageWidth > screenWidth || imageTop + imageHeight > screenHeight || lzwCodeSize < 2 || lzwCodeSize >= 12 || !validateImageFlags(imageFlags)) { foundImageData(false); skipSubBlocks(); return false; } else { foundImageData(true); writeByte(IMAGE_SEPARATOR); writeShort(imageLeft); writeShort(imageTop); writeShort(imageWidth); writeShort(imageHeight); writeByte(imageFlags); writeBytes(localColorMap); writeByte(lzwCodeSize); copySubBlocks(); return true; } }
Source:
<code>private RexNode simplifyArithmetic(RexCall e) { if (e.getType().getSqlTypeName().getFamily() != SqlTypeFamily.NUMERIC || e.getOperands().stream() .anyMatch(o -> e.getType().getSqlTypeName().getFamily() != SqlTypeFamily.NUMERIC)) { return simplifyGenericNode(e); } assert e.getOperands().size() == 2; if (RexUtil.isNullLiteral(e.operands.get(0), true) || RexUtil.isNullLiteral(e.operands.get(1), true)) { return rexBuilder.makeNullLiteral(e.type); <START> } <END> switch (e.getKind()) { case PLUS: return simplifyPlus(e); case MINUS: return simplifyMinus(e); case TIMES: return simplifyMultiply(e); case DIVIDE: return simplifyDivide(e); default: throw new IllegalArgumentException("Unsupported arithmeitc operation " + e.getKind()); } }</code><technical_language>true. users want throw exception</technical_language>

Target:
private RexNode simplifyArithmetic(RexCall e) { if (e.getType().getSqlTypeName().getFamily() != SqlTypeFamily.NUMERIC || e.getOperands().stream().anyMatch( o -> e.getType().getSqlTypeName().getFamily() != SqlTypeFamily.NUMERIC)) { return simplifyGenericNode(e); } assert e.getOperands().size() == 2; switch (e.getKind()) { case PLUS: return simplifyPlus(e); case MINUS: return simplifyMinus(e); case TIMES: return simplifyMultiply(e); case DIVIDE: return simplifyDivide(e); default: throw new IllegalArgumentException("Unsupported arithmeitc operation " + e.getKind()); } }
Source:
<code>public void resetAfterClearHistory() { while (getTopFragment() != null) { <START> getSupportFragmentManager().popBackStackImmediate(); <END> } Prefs.clearTabs(); displayMainPageIfNoTabs(); }</code><technical_language>call safer do a popBackStack() call executePendingTransactions end</technical_language>

Target:
public void resetAfterClearHistory() { getSupportFragmentManager().popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE); Prefs.clearTabs(); displayMainPageIfNoTabs(); }
Source:
<code>public void closesStream() throws IOException { final InputStream stream = Mockito.mock(InputStream.class); final CapInputStream wrapper = new CapInputStream( stream, <START> 0L <END> ); wrapper.close(); Mockito.verify(stream, Mockito.times(1)).close(); }</code><technical_language>@original-brownbear minor: join lines</technical_language>

Target:
public void closesStream() throws Exception { final InputStream stream = Mockito.mock(InputStream.class); final CapInputStream wrapper = new CapInputStream(stream, 0L); wrapper.close(); Mockito.verify(stream, Mockito.times(1)).close(); }
Source:
<code>public void validateParameter(final String parameterName, final ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined()) { <START> ModelNode clonedValue = null; <END> StringBuilder allowed = new StringBuilder(); if (value.getType() == ModelType.OBJECT) { clonedValue = value.clone(); } for (AttributeDefinition ad : allowedValues.values()) { String key = ad.getName(); allowed.append(key).append(' '); ModelNode toTest = value.has(key) ? value.get(key) : new ModelNode(); ad.getValidator().validateParameter(key, toTest); if (clonedValue != null && clonedValue.has(key)) { clonedValue.remove(key); } } if (clonedValue != null && !clonedValue.asList().isEmpty()) { Iterator<ModelNode> it = clonedValue.asList().iterator(); StringBuilder sb = new StringBuilder(); while(it.hasNext()) { sb.append(it.next().asString()); if (it.hasNext()) sb.append(' '); } ControllerLogger.ROOT_LOGGER.unknownAttribute(sb, allowed); } } }</code><technical_language>This a Set<String></technical_language>

Target:
public void validateParameter(final String parameterName, final ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined()) { Set<String> keys = value.getType() == ModelType.OBJECT ? new HashSet<>(value.keys()): Collections.emptySet(); for (AttributeDefinition ad : allowedValues.values()) { String key = ad.getName(); ModelNode toTest = value.has(key) ? value.get(key) : new ModelNode(); ad.getValidator().validateParameter(key, toTest); if (keys.contains(key)) { keys.remove(key); } } if (!keys.isEmpty()) { Iterator<String> it = keys.iterator(); StringBuilder sb = new StringBuilder(); while (it.hasNext()) { sb.append(it.next()); if (it.hasNext()) sb.append(' '); } StringBuilder allowed = new StringBuilder(); for (AttributeDefinition ad : allowedValues.values()) { allowed.append(ad.getName()).append(' '); } ControllerLogger.ROOT_LOGGER.unknownAttribute(sb, allowed); } } }
Source:
<code>public CaffeineDnsCache(int minTtl, int maxTtl, int negativeTtl, long maxSize) { this.minTtl = Math.min(MAX_SUPPORTED_TTL_SECS, checkPositiveOrZero(minTtl, "minTtl")); this.maxTtl = Math.min(MAX_SUPPORTED_TTL_SECS, checkPositiveOrZero(maxTtl, "maxTtl")); <START> if (minTtl > maxTtl) { <END> throw new IllegalArgumentException( "minTtl: " + minTtl + ", maxTtl: " + maxTtl + " (expected: 0 <= minTtl <= maxTtl)"); } this.negativeTtl = checkPositiveOrZero(negativeTtl, "negativeTtl"); this.maxSize = checkPositiveOrZero(maxSize, "maxSize"); resolveCache = new CaffeineCache<ExtendedDnsCacheEntry>(maxSize) { @Override protected boolean shouldReplaceAll(ExtendedDnsCacheEntry entry) { return entry.cause() != null; } }; }</code><technical_language>This simplified guavas Precondition.checkArgument</technical_language>

Target:
public CaffeineDnsCache(int minTtl, int maxTtl, int negativeTtl, long maxSize) { this.minTtl = Math.min(MAX_SUPPORTED_TTL_SECS, checkPositiveOrZero(minTtl, "minTtl")); this.maxTtl = Math.min(MAX_SUPPORTED_TTL_SECS, checkPositiveOrZero(maxTtl, "maxTtl")); Preconditions.checkArgument(minTtl <= maxTtl, "minTtl: " + minTtl + ", maxTtl: " + maxTtl + " (expected: 0 <= minTtl <= maxTtl)"); this.negativeTtl = checkPositiveOrZero(negativeTtl, "negativeTtl"); this.maxSize = checkPositiveOrZero(maxSize, "maxSize"); resolveCache = new CaffeineCache<ExtendedDnsCacheEntry>(maxSize) { @Override protected boolean shouldReplaceAll(ExtendedDnsCacheEntry entry) { return entry.cause() != null; } }; }
Source:
<code>public static Iterable<Object[]> data() { return Arrays.asList( <START> new Object[][] { <END> {"'"}, {"\\\""}, {"\\\\"}, {">"}, {"<"}, {"&"}, {"{"}, {"}"}, {"["}, {"]"}, {":"}, {";"}, {","}, {"."}, {"?"}, {"/"}, {"|"}, {"-"}, {"_"}, {"+"}, {"="}, {"*"}, {"^"}, {"%"}, {"$"}, {"#"}, {"@"}, {"!"}, {"~"}, {"`"}, {"("}, {")"} }); }</code><technical_language>question: array element, is reason return array a double array? <LINK_0></technical_language>

Target:
public static Iterable<?> data() { return Arrays.asList( "'", "\\\"", "\\\\", ">", "<", "&", "{", "}", "[", "]", ":", ";", ",", ".", "?", "/", "|", "-", "_", "+", "=", "*", "^", "%", "$", "#", "@", "!", "~", "`", "(", ")"); }
Source:
<code>public void selectionChanged(final SelectionChangedEvent event) { this.selection = event.getSelection(); Object[] listeners = getListeners(); for (Object <START> listener2 : <END> listeners) { final ISelectionChangedListener listener = (ISelectionChangedListener) listener2; SafeRunner.run(new SafeRunnable() { @Override public void run() { listener.selectionChanged(event); } }); } }</code><technical_language>rename listener listener->selectionChangedListener</technical_language>

Target:
public void selectionChanged(final SelectionChangedEvent event) { this.selection = event.getSelection(); for (Object listener : getListeners()) { final ISelectionChangedListener selectionChangedListener = (ISelectionChangedListener) listener; SafeRunner.run(new SafeRunnable() { @Override public void run() { selectionChangedListener.selectionChanged(event); } }); } }
Source:
<code>public String getGroupName(byte[] groupId) { <START> return getGroup(groupId).name; <END> }</code><technical_language>group null, please check this (like in getContactName)</technical_language>

Target:
public String getGroupName(byte[] groupId) { GroupInfo group = getGroup(groupId); if (group == null) { return ""; } else { return group.name; } }
Source:
<code>public void process(Exchange exchange) { @SuppressWarnings("unchecked") final CamelRpcRequest<RpcRequest,RpcResponse> wrapper = exchange.getIn().getBody(CamelRpcRequest.class); final JmsQueueNameFactory queueNameFactory = new JmsQueueNameFactory(CamelRpcConstants.JMS_QUEUE_PREFIX, wrapper.getModule().getId(), wrapper.getRequest().getLocation()); exchange.getIn().setHeader(CamelRpcConstants.JMS_QUEUE_NAME_HEADER, queueNameFactory.getName()); <START> exchange.getIn().setHeader(CamelRpcConstants.CAMEL_JMS_REQUEST_TIMEOUT_HEADER, CAMEL_JMS_REQUEST_TIMEOUT == 0 ? wrapper.getRequest().getTimeToLiveMs() : CAMEL_JMS_REQUEST_TIMEOUT); <END> final String request = wrapper.getModule().marshalRequest((RpcRequest)wrapper.getRequest()); exchange.getIn().setBody(request); }</code><technical_language>If request specifies a timeout (i.e. getTimeToLiveMs() != null) is instead of of org.opennms.jms.timeout property</technical_language>

Target:
public void process(Exchange exchange) { @SuppressWarnings("unchecked") final CamelRpcRequest<RpcRequest,RpcResponse> wrapper = exchange.getIn().getBody(CamelRpcRequest.class); final JmsQueueNameFactory queueNameFactory = new JmsQueueNameFactory(CamelRpcConstants.JMS_QUEUE_PREFIX, wrapper.getModule().getId(), wrapper.getRequest().getLocation()); exchange.getIn().setHeader(CamelRpcConstants.JMS_QUEUE_NAME_HEADER, queueNameFactory.getName()); exchange.getIn().setHeader(CamelRpcConstants.CAMEL_JMS_REQUEST_TIMEOUT_HEADER, wrapper.getRequest().getTimeToLiveMs() != null ? wrapper.getRequest().getTimeToLiveMs() : CAMEL_JMS_REQUEST_TIMEOUT); final String request = wrapper.getModule().marshalRequest((RpcRequest)wrapper.getRequest()); exchange.getIn().setBody(request); }
Source:
<code>public List<Interval> takeSome(final Interval interval, final long idealSplitWeight, final long currentSize, final double projectSizeOfRemaining) { final long amount = idealSplitWeight - currentSize; if (amount > 0) { <START> return CollectionUtil.makeList(interval, null); <END> } else { return CollectionUtil.makeList(null, interval); } }</code><technical_language>Arrays.asList() here? result of this method is modified</technical_language>

Target:
public List<Interval> takeSome(final Interval interval, final long idealSplitWeight, final long currentSize, final double projectSizeOfRemaining) { final long amount = idealSplitWeight - currentSize; if (amount > 0) { return Arrays.asList(interval, null); } else { return Arrays.asList(null, interval); } }
Source:
<code>public static <A> ImmutableList<A> from(@Nonnull Iterable<A> list) { ImmutableList<A> l = empty(); <START> for (Iterator<A> iterator = list.iterator(); iterator.hasNext();) { <END> A item = iterator.next(); l = cons(item, l); } return l.reverse(); }</code><technical_language>for (A item : list) {</technical_language>

Target:
public static <A> ImmutableList<A> from(@Nonnull Iterable<A> list) { if (list instanceof ArrayList) { return from((ArrayList<A>) list); } else if (list instanceof LinkedList) { return from((LinkedList<A>) list); } ArrayList<A> arrayList = new ArrayList<>(); list.forEach(arrayList::add); return from(arrayList); }
Source:
<code>public boolean putValue(String key, String value) throws OseeCoreException { boolean wasUpdated = false; if (ResourceConstants.BINARY_DATA_PATH.equals(key)) { throw new OseeStateException( "Unsupported modification - attempt to modify binary data path. Sets are startup through -D%s=<PATH>", ResourceConstants.BINARY_DATA_PATH); } else if (SqlProvider.SQL_DATABASE_HINTS_SUPPORTED_KEY.equals(key)) { throw new OseeStateException( "Unsupported modification - attempt to modify database hints supported. This is an unmodifiable database specific setting.", SqlProvider.SQL_DATABASE_HINTS_SUPPORTED_KEY); } else if (SqlProvider.SQL_RECURSIVE_WITH_KEY.equals(key)) { throw new OseeStateException( <START> "Unsupported modification - attempt to modify database hints supported. This is an unmodifiable database specific setting.", <END> SqlProvider.SQL_RECURSIVE_WITH_KEY); } else if (SqlProvider.SQL_REG_EXP_PATTERN_KEY.equals(key)) { throw new OseeStateException( "Unsupported modification - attempt to modify database hints supported. This is an unmodifiable database specific setting.", SqlProvider.SQL_REG_EXP_PATTERN_KEY); } else if (DataStoreConstants.DATASTORE_INDEX_ON_START_UP.equals(key)) { throw new OseeStateException( "Unsupported modification - attempt to modify index start-up flag. This is an launch time setting.", DataStoreConstants.DATASTORE_INDEX_ON_START_UP); } else { dbService.runPreparedUpdate(DELETE_KEY_SQL, key); int updated = dbService.runPreparedUpdate(INSERT_KEY_VALUE_SQL, key, value); wasUpdated = updated == 1; } return wasUpdated; }</code><technical_language>this exception message above</technical_language>

Target:
public boolean putValue(String key, String value) throws OseeCoreException { boolean wasUpdated = false; if (ResourceConstants.BINARY_DATA_PATH.equals(key)) { throw new OseeStateException(BINARY_DATA_ERROR_MSG, ResourceConstants.BINARY_DATA_PATH, ResourceConstants.BINARY_DATA_PATH); } else if (SqlProvider.SQL_DATABASE_HINTS_SUPPORTED_KEY.equals(key)) { throw new OseeStateException(DB_KEY_ERROR_MSG, SqlProvider.SQL_DATABASE_HINTS_SUPPORTED_KEY); } else if (SqlProvider.SQL_RECURSIVE_WITH_KEY.equals(key)) { throw new OseeStateException(DB_KEY_ERROR_MSG, SqlProvider.SQL_RECURSIVE_WITH_KEY); } else if (SqlProvider.SQL_REG_EXP_PATTERN_KEY.equals(key)) { throw new OseeStateException(DB_KEY_ERROR_MSG, SqlProvider.SQL_REG_EXP_PATTERN_KEY); } else if (DataStoreConstants.DATASTORE_INDEX_ON_START_UP.equals(key)) { throw new OseeStateException(INDEX_STARTUP_ERROR_MSG, DataStoreConstants.DATASTORE_INDEX_ON_START_UP); } else { dbService.runPreparedUpdate(DELETE_KEY_SQL, key); int updated = dbService.runPreparedUpdate(INSERT_KEY_VALUE_SQL, key, value); wasUpdated = updated == 1; } return wasUpdated; }
Source:
<code>private static Expression boundAsExpression(Bound<?> bound) { Comparable<?> value = bound.getValue(); Expression valueExpr = null; if (value == Interval.NEG_INF) { valueExpr = JavaParser.parseExpression("Interval.NEG_INF"); } else if (value == Interval.POS_INF) { valueExpr = JavaParser.parseExpression("Interval.POS_INF"); } else if (value instanceof BigDecimal) { BigDecimal bigDecimal = (BigDecimal) value; ObjectCreationExpr newExpression = JavaParser.parseExpression("new BigDecimal()"); StringLiteralExpr stringRep = new StringLiteralExpr(bigDecimal.toString()); newExpression.addArgument(stringRep); valueExpr = newExpression; } else if (value instanceof String) { String string = (String) value; StringLiteralExpr newExpression = new StringLiteralExpr(); newExpression.setString(string); valueExpr = newExpression; } else { <START> throw new UnsupportedOperationException("TODO"); <END> } Expression typeExpr = null; if (bound.getBoundaryType() == RangeBoundary.OPEN) { typeExpr = JavaParser.parseExpression("RangeBoundary.OPEN"); } else if (bound.getBoundaryType() == RangeBoundary.CLOSED) { typeExpr = JavaParser.parseExpression("RangeBoundary.CLOSED"); } else { throw new IllegalStateException("??"); } ObjectCreationExpr newExpression = JavaParser.parseExpression("new Bound()"); newExpression.addArgument(valueExpr); newExpression.addArgument(typeExpr); newExpression.addArgument(new NullLiteralExpr()); return newExpression; }</code><technical_language>Please add a message this exception</technical_language>

Target:
private static Expression boundAsExpression(Bound<?> bound) { Comparable<?> value = bound.getValue(); Expression valueExpr = null; if (value == Interval.NEG_INF) { valueExpr = JavaParser.parseExpression("Interval.NEG_INF"); } else if (value == Interval.POS_INF) { valueExpr = JavaParser.parseExpression("Interval.POS_INF"); } else if (value instanceof BigDecimal) { BigDecimal bigDecimal = (BigDecimal) value; ObjectCreationExpr newExpression = JavaParser.parseExpression("new BigDecimal()"); StringLiteralExpr stringRep = new StringLiteralExpr(bigDecimal.toString()); newExpression.addArgument(stringRep); valueExpr = newExpression; } else if (value instanceof String) { String string = (String) value; StringLiteralExpr newExpression = new StringLiteralExpr(); newExpression.setString(string); valueExpr = newExpression; } else { throw new UnsupportedOperationException("boundAsExpression value " + value + "not supported."); } Expression typeExpr = null; if (bound.getBoundaryType() == RangeBoundary.OPEN) { typeExpr = JavaParser.parseExpression("RangeBoundary.OPEN"); } else if (bound.getBoundaryType() == RangeBoundary.CLOSED) { typeExpr = JavaParser.parseExpression("RangeBoundary.CLOSED"); } else { throw new IllegalStateException("illegal getBoundaryType"); } ObjectCreationExpr newExpression = JavaParser.parseExpression("new Bound()"); newExpression.addArgument(valueExpr); newExpression.addArgument(typeExpr); newExpression.addArgument(new NullLiteralExpr()); return newExpression; }
Source:
<code>public boolean equals(Object o) { if (!(o instanceof Map.Entry)) <START> return <END> false; Map.Entry<?,?> e = (Map.Entry<?,?>)o; return ((key == null ? e.getKey() == null : key.equals(e.getKey())) && (value == null ? e.getValue() == null : value.equals(e.getValue()))); }</code><technical_language>braces</technical_language>

Target:
public boolean equals(Object o) { if (!(o instanceof Map.Entry)) { return false; } Map.Entry<?,?> e = (Map.Entry<?,?>)o; return ((key == null ? e.getKey() == null : key.equals(e.getKey())) && (value == null ? e.getValue() == null : value.equals(e.getValue()))); }
Source:
<code>public void testLength() { <START> double x1 = -71.05, y1 = 42.36, END> x2 = -87.62, y2 = 41.87, x3 = -122.41, y3 = 37.77; double distance1 = 1365691.096620299, distance2 = 2985175.539584118; double length = distance1 + distance2; assertLength("LINESTRING EMPTY", null); assertLength(format("LINESTRING (%.2f %.2f)", x1, y1),0.0); assertLength(format("LINESTRING (%.2f %.2f, %.2f %.2f, %.2f %.2f)", x1, y1, x1, y1, x1, y1), 0.0); assertDistance(format("POINT (%.2f %.2f)", x1, y1), format("POINT (%.2f %.2f)", x2, y2), distance1); assertDistance(format("POINT (%.2f %.2f)", x2, y2), format("POINT (%.2f %.2f)", x3, y3), distance2); assertLength(format("LINESTRING (%.2f %.2f, %.2f %.2f, %.2f %.2f)", x1, y1, x2, y2, x3, y3), length); assertLength(format("LINESTRING (%.2f %.2f, %.2f %.2f, %.2f %.2f)", x3, y3, x2, y2, x1, y1), length); double earthCircumference = 4.0075e7; assertLength(format("LINESTRING (%.2f %.2f, %.2f %.2f)", 0.0, 90.0, 0.0, -90.0), earthCircumference / 2, 1e-2); }</code><technical_language>declare variable separately</technical_language>

Target:
public void testLength() { assertLength("LINESTRING EMPTY", null); assertLength("LINESTRING (0 0)", 0.0); assertLength("LINESTRING (0 0, 0 0, 0 0)", 0.0); double length = 4350866.6362; assertLength("LINESTRING (-71.05 42.36, -87.62 41.87, -122.41 37.77)", length); assertLength("LINESTRING (-122.41 37.77, -87.62 41.87, -71.05 42.36)", length); assertLength("LINESTRING (0.0 90.0, 0.0 -90.0, 0.0 90.0)", 4.003e7); assertLength("MULTILINESTRING (EMPTY)", null); assertLength("MULTILINESTRING ((-71.05 42.36, -87.62 41.87, -122.41 37.77))", length); assertLength("MULTILINESTRING ((-71.05 42.36, -87.62 41.87, -122.41 37.77), (-73.05 42.36, -89.62 41.87, -124.41 37.77))", 2 * length); assertLength("MULTILINESTRING ((-71.05 42.36, -87.62 41.87), (-87.62 41.87, -122.41 37.77))", length); }
Source:
<code>public RelatedDRepresentationDecorator(IDiagramElementEditPart hostEditPart) { this.hostEditPart = hostEditPart; session = (DAnalysisSessionImpl) new EObjectQuery(hostEditPart.getNotationView()).getSession(); diagramEventBroker = DiagramEventBroker.getInstance(session.getTransactionalEditingDomain()); dDiagramElement = hostEditPart.resolveDiagramElement(); semanticElement = hostEditPart.resolveTargetSemanticElement(); <START> for (DAnalysis dAnalysis : session.allAnalyses()) { diagramEventBroker.addNotificationListener(dAnalysis, ViewpointPackage.Literals.DANALYSIS__SELECTED_VIEWS, this); diagramEventBroker.addNotificationListener(dAnalysis, ViewpointPackage.Literals.DANALYSIS__REFERENCED_ANALYSIS, this); for (DView dView : dAnalysis.getSelectedViews()) { diagramEventBroker.addNotificationListener(dView, ViewpointPackage.Literals.DVIEW__OWNED_REPRESENTATIONS, this); } } <END> refresh(); }</code><technical_language>a fan of another peripheral class installs low-level listeners, SessionListener is refactored useful, I propose</technical_language>

Target:
public RelatedDRepresentationDecorator(IDiagramElementEditPart hostEditPart) { super(new FilterRelatedDRepresentationDecorator()); this.hostEditPart = hostEditPart; session = (DAnalysisSessionImpl) new EObjectQuery(hostEditPart.getNotationView()).getSession(); diagramEventBroker = DiagramEventBroker.getInstance(session.getTransactionalEditingDomain()); dDiagramElement = hostEditPart.resolveDiagramElement(); semanticElement = hostEditPart.resolveTargetSemanticElement(); for (DAnalysis dAnalysis : session.allAnalyses()) { diagramEventBroker.addNotificationListener(dAnalysis, ViewpointPackage.Literals.DANALYSIS__SELECTED_VIEWS, this); diagramEventBroker.addNotificationListener(dAnalysis, ViewpointPackage.Literals.DANALYSIS__REFERENCED_ANALYSIS, this); for (DView dView : dAnalysis.getSelectedViews()) { diagramEventBroker.addNotificationListener(dView, ViewpointPackage.Literals.DVIEW__OWNED_REPRESENTATIONS, this); } } refresh(); }
Source:
<code>public void triggerJob(){ ResourceBundleProvider.updateLocale(new Locale("en_US")); ArrayList<RuleSetBean> ruleSets = ruleSetDao.findAllRunOnSchedules(true); for (RuleSetBean ruleSet : ruleSets) { if (ruleSet.getStatus().AVAILABLE != null && ruleSet.isRunSchedule()) { if(ruleSet.getItemId()!=null){ System.out.println("*** Item Specific Rule ***"); ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<>(); StudyBean currentStudy = (StudyBean) getStudyDao().findByPK(ruleSet.getStudyId()); ResourceBundleProvider.updateLocale(Locale.getDefault()); UserAccountBean ub = (UserAccountBean) getUserAccountDao().findByPK(1); ruleSetBeans.add(ruleSet); ruleSetService.runRulesInBulk(ruleSetBeans, false, currentStudy, ub, true); }else{ <START> System.out.println("*** Event Specific Rule ***"); <END> StudyEventChangeDetails studyEventChangeDetails = new StudyEventChangeDetails(true, true); ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<>(); ExpressionBean eBean = new ExpressionBean(); eBean.setValue(ruleSet.getTarget().getValue()+".A.B"); ruleSet.setTarget(eBean); ruleSetBeans.add(ruleSet); ruleSetService.runRulesInBeanProperty(ruleSetBeans ,1, studyEventChangeDetails); } } } }</code><technical_language>remove sysouts while it? thx</technical_language>

Target:
public void triggerJob(){ ResourceBundleProvider.updateLocale(new Locale("en_US")); ArrayList<RuleSetBean> ruleSets = ruleSetDao.findAllRunOnSchedules(true); for (RuleSetBean ruleSet : ruleSets) { if (ruleSet.getStatus().AVAILABLE != null && ruleSet.isRunSchedule()) { if(ruleSet.getItemId()!=null){ ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<>(); StudyBean currentStudy = (StudyBean) getStudyDao().findByPK(ruleSet.getStudyId()); ResourceBundleProvider.updateLocale(Locale.getDefault()); UserAccountBean ub = (UserAccountBean) getUserAccountDao().findByPK(1); ruleSetBeans.add(ruleSet); ruleSetService.runRulesInBulk(ruleSetBeans, false, currentStudy, ub, true); }else{ StudyEventChangeDetails studyEventChangeDetails = new StudyEventChangeDetails(true, true); ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<>(); ExpressionBean eBean = new ExpressionBean(); eBean.setValue(ruleSet.getTarget().getValue()+".A.B"); ruleSet.setTarget(eBean); ruleSetBeans.add(ruleSet); ruleSetService.runRulesInBeanProperty(ruleSetBeans ,1, studyEventChangeDetails); } } } }
Source:
<code>protected AbstractNodeMonitorDescriptor() { <START> this(TimeUnit.MINUTES.toMillis(PERIOD_MINUTES)); <END> }</code><technical_language>suggestion this(PERIOD));</technical_language>

Target:
protected AbstractNodeMonitorDescriptor() { this(PERIOD); }
Source:
<code>public void setWorkingSets(IWorkingSet[] workingSets) { <START> if (workingSets == null) { <END> throw new IllegalArgumentException(); } workingSetGroup.setWorkingSets(workingSets); }</code><technical_language>set EMPTY_WORKING_SET_ARRAY in this case instead of throwing exception</technical_language>

Target:
public void setWorkingSets(IWorkingSet[] workingSets) { if (workingSets == null) { workingSetGroup.setWorkingSets(EMPTY_WORKING_SET_ARRAY); } workingSetGroup.setWorkingSets(workingSets); }
Source:
<code>public void commit() throws IOException { if (execute != null) { long beforeWait = System.currentTimeMillis(); BulkResponse actionGet = execute.actionGet(); if (actionGet.hasFailures()) { for (BulkItemResponse item : actionGet) { if (item.isFailed()) { throw new RuntimeException("First failure in bulk: " + item.getFailureMessage()); } } } long msWaited = System.currentTimeMillis() - beforeWait; <START> LOG.info("Previous took in ms " + actionGet.getTookInMillis() <END> + ", including wait " + msWaited); execute = null; } if (bulk != null) { if (bulkDocs > 0) { execute = bulk.execute(); } bulk = null; } if (createNewBulk) { bulk = client.prepareBulk(); bulkDocs = 0; bulkLength = 0; } }</code><technical_language>Logging improved parameterized messages <LINK_0></technical_language>

Target:
public void commit() throws IOException { if (execute != null) { long beforeWait = System.currentTimeMillis(); BulkResponse actionGet = execute.actionGet(); if (actionGet.hasFailures()) { for (BulkItemResponse item : actionGet) { if (item.isFailed()) { throw new RuntimeException("First failure in bulk: " + item.getFailureMessage()); } } } long msWaited = System.currentTimeMillis() - beforeWait; LOG.info("Previous took in ms {}, including wait {}", actionGet.getTookInMillis(), msWaited); execute = null; } if (bulk != null) { if (bulkDocs > 0) { execute = bulk.execute(); } bulk = null; } if (createNewBulk) { bulk = client.prepareBulk(); bulkDocs = 0; bulkLength = 0; } }
Source:
<code>public Map<String, String> getDeploymentConfiguration() { org.wso2.carbon.kernel.utils.Utils.checkSecurity(); File configFile = ConfigurationUtils.getConfigurationFileLocation(filename).toFile(); try (FileInputStream fileInputStream = new FileInputStream(configFile)) { String xmlFileString = getDeploymentContent(fileInputStream); String jsonString = ConfigResolverUtils.convertXMLToJSON(xmlFileString); return getDeploymentConfigMap(jsonString); } catch (IOException e) { <START> String errorMessage = "Failed populate Deployment Configuration from " + configFile.getName(); <END> logger.error(errorMessage, e); throw new RuntimeException(errorMessage, e); } }</code><technical_language>Do need letters of "Deployment Configuration" uppercase</technical_language>

Target:
public Map<String, String> getDeploymentConfiguration() throws CarbonConfigurationException { org.wso2.carbon.kernel.utils.Utils.checkSecurity(); if (filename == null) { throw new CarbonConfigurationException("Error while reading the configuration file, filename is null"); } try { byte[] contentBytes = Files.readAllBytes(ConfigurationUtils.getConfigurationFileLocation(filename)); String xmlFileString = new String(contentBytes, StandardCharsets.UTF_8); String yamlString = ConfigurationUtils.convertXMLToYAML(xmlFileString); return ConfigurationUtils.getDeploymentConfigMap(yamlString); } catch (IOException e) { String errorMessage = "Failed populate deployment configuration from " + filename; logger.error(errorMessage, e); throw new CarbonConfigurationException(errorMessage, e); } }
Source:
<code>private <START> Boolean canDrop(List<Collaboration> <END> droppedObjects) { return droppedObjects.stream().filter((c) -> (SystemElementsUtils.isBaseProtocol(c) || SystemElementsUtils.isSystemProtocol(c))).collect(Collectors.toList()).isEmpty(); }</code><technical_language>return a Boolean wrapper object</technical_language>

Target:
private boolean canDrop(List<Collaboration> droppedObjects) { return !droppedObjects.stream().anyMatch((c) -> (SystemElementsUtils.isBaseProtocol(c) || SystemElementsUtils.isSystemProtocol(c))); }
Source:
<code>public static Memory range(Environment env, TraceInfo trace, Memory low, Memory high, Memory step){ <START> int err = 0; <END> if (low.getRealType() == Memory.Type.DOUBLE || high.getRealType() == Memory.Type.DOUBLE || step.getRealType() == Memory.Type.DOUBLE) { return _range_double(env, trace, low.toDouble(), high.toDouble(), step.toDouble()); } else { return _range_long(env, trace, low.toLong(), high.toLong(), step.toLong()); } }</code><technical_language>unused variable</technical_language>

Target:
public static Memory range(Environment env, TraceInfo trace, Memory low, Memory high, Memory step){ if (low.getRealType() == Memory.Type.DOUBLE || high.getRealType() == Memory.Type.DOUBLE || step.getRealType() == Memory.Type.DOUBLE) { return _range_double(env, trace, low.toDouble(), high.toDouble(), step.toDouble()); } else { return _range_long(env, trace, low.toLong(), high.toLong(), step.toLong()); } }
Source:
<code>public List<Task<? extends Serializable>> handle(Context context) throws SemanticException { DropDatabaseMessage msg = deserializer.getDropDatabaseMessage(context.dmd.getPayload()); String actualDbName = context.isDbNameEmpty() ? msg.getDB() : context.dbName; <START> DropDatabaseDesc desc = new DropDatabaseDesc(actualDbName, true); <END> Task<? extends Serializable> dropDBTask = TaskFactory .get(new DDLWork(new HashSet<>(), new HashSet<>(), desc), context.hiveConf); context.log.info( "Added drop database task : {}:{}", dropDBTask.getId(), desc.getDatabaseName()); updatedMetadata.set(context.dmd.getEventTo().toString(), actualDbName, null, null); return Collections.singletonList(dropDBTask); }</code><technical_language>DDLTask.dropDatabase check repl state decide if need continue drop not. This is for idempotent behaviour</technical_language>

Target:
public List<Task<? extends Serializable>> handle(Context context) throws SemanticException { DropDatabaseMessage msg = deserializer.getDropDatabaseMessage(context.dmd.getPayload()); String actualDbName = context.isDbNameEmpty() ? msg.getDB() : context.dbName; DropDatabaseDesc desc = new DropDatabaseDesc(actualDbName, true, context.eventOnlyReplicationSpec()); Task<? extends Serializable> dropDBTask = TaskFactory .get(new DDLWork(new HashSet<>(), new HashSet<>(), desc), context.hiveConf); context.log.info( "Added drop database task : {}:{}", dropDBTask.getId(), desc.getDatabaseName()); updatedMetadata.set(context.dmd.getEventTo().toString(), actualDbName, null, null); return Collections.singletonList(dropDBTask); }
Source:
<code>protected void autoMountPages() { if (!AutoMounter.mountAll(this)) { <START> LOG.warn("Unable to Automount pages."); <END> } final Class<? extends WebPage> authPage = getSignInPageClass(); if (authPage != null) { final MountPath mp = authPage.getAnnotation(MountPath.class); if (mp == null) { final SecureAutoMount annot = getClass().getAnnotation(SecureAutoMount.class); String root = annot.defaultRoot().trim(); if (!root.isEmpty() && !root.endsWith("/")) { root = root + "/"; } String mime = annot.defaultMimeExtension().trim(); if (!mime.isEmpty() && !mime.startsWith(".")) { mime = "." + mime; } final String loginPagePath = root + "login" + mime; LOG.info("Mounting SignInPageClass: to path {}", authPage, loginPagePath); mountPage(loginPagePath, authPage); } } }</code><technical_language>return</technical_language>

Target:
protected boolean autoMountPages() { final boolean mountOk = AutoMounter.mountAll(this); if (!mountOk) { LOG.warn("Unable to Automount pages."); } final Class<? extends WebPage> authPage = getSignInPageClass(); if (authPage != null) { final MountPath mp = authPage.getAnnotation(MountPath.class); if (mp == null) { final SecureAutoMount annot = getClass().getAnnotation(SecureAutoMount.class); String root = annot.defaultRoot().trim(); if (!root.isEmpty() && !root.endsWith("/")) { root = root + "/"; } String mime = annot.defaultMimeExtension().trim(); if (!mime.isEmpty() && !mime.startsWith(".")) { mime = "." + mime; } final String loginPagePath = root + "login" + mime; LOG.info("Mounting SignInPageClass: to path {}", authPage, loginPagePath); mountPage(loginPagePath, authPage); } } return mountOk; }
Source:
<code>private void createSkipLine(int row, SkippedLine line) { FlowPanel p = new FlowPanel(); InlineLabel l1 = new InlineLabel(" " + PatchUtil.C.patchSkipRegionStart() + " "); InlineLabel l2 = new InlineLabel(" " + PatchUtil.C.patchSkipRegionEnd() + " "); Anchor all = new Anchor(String.valueOf(line.getSize())); all.addClickHandler(expandAllListener); all.setStyleName(Gerrit.RESOURCES.css().skipLine()); if (line.getSize() > 30) { Anchor b = new Anchor(); Anchor a = new Anchor(); b.setHTML(PatchUtil.M.expandBefore(NUM_ROWS_TO_EXPAND)); <START> a.setHTML(PatchUtil.M.expandAfter(NUM_ROWS_TO_EXPAND)); <END> b.addClickHandler(expandBeforeListener); a.addClickHandler(expandAfterListener); b.setStyleName(Gerrit.RESOURCES.css().skipLine()); a.setStyleName(Gerrit.RESOURCES.css().skipLine()); p.add(b); p.add(l1); p.add(all); p.add(l2); p.add(a); } else { p.add(l1); p.add(all); p.add(l2); } table.setWidget(row, 1, p); }</code><technical_language>hovering mouse expand links mouse cursor is a text cursor, for other links (expand line number links) mouse cursor turns a hand cursor hovering. I for links show hand cursor, this cursor a clickable link user. played a bit code Anchor b = new Anchor(); b.setHTML(PatchUtil.M.expandBefore(NUM_ROWS_TO_EXPAND)); shows a text cursor hovering while Anchor b = new Anchor(PatchUtil.M.expandBefore(NUM_ROWS_TO_EXPAND), true); shows a hand cursor hovering. is this difference in behaviour, I suggest simply for coding fix this issue</technical_language>

Target:
private void createSkipLine(int row, SkippedLine line) { FlowPanel p = new FlowPanel(); InlineLabel l1 = new InlineLabel(" " + PatchUtil.C.patchSkipRegionStart() + " "); InlineLabel l2 = new InlineLabel(" " + PatchUtil.C.patchSkipRegionEnd() + " "); Anchor all = new Anchor(String.valueOf(line.getSize())); all.addClickHandler(expandAllListener); all.setStyleName(Gerrit.RESOURCES.css().skipLine()); if (line.getSize() > 30) { Anchor b = new Anchor(PatchUtil.M.expandBefore(NUM_ROWS_TO_EXPAND), true); Anchor a = new Anchor(PatchUtil.M.expandAfter(NUM_ROWS_TO_EXPAND), true); b.addClickHandler(expandBeforeListener); a.addClickHandler(expandAfterListener); b.setStyleName(Gerrit.RESOURCES.css().skipLine()); a.setStyleName(Gerrit.RESOURCES.css().skipLine()); p.add(b); p.add(l1); p.add(all); p.add(l2); p.add(a); } else { p.add(l1); p.add(all); p.add(l2); } table.setWidget(row, 1, p); }
Source:
<code>public void free() { try { store.releaseLease(path, leaseID); } catch (IOException e) { <START> LOG.info("Exception when trying to free lease " + leaseID + " on " + path + ". " + e.getMessage()); <END> } finally { leaseFreed = true; LOG.debug("Freed lease " + leaseID + " on " + path + " managed by thread " + renewer.getName()); } }</code><technical_language>switch SLF4J logging style; include full stack @ debug level</technical_language>

Target:
public void free() { try { LOG.debug("lease path: {}, release lease id: {}", path, leaseID); client.releaseLease(getRelativePath(path), leaseID); } catch (IOException e) { LOG.info("Exception when trying to release lease on {}. Lease will be left to expire: {}", leaseID, path, e.getMessage()); LOG.debug("Exception releasing lease", e); } finally { leaseFreed = true; LOG.debug("Freed lease on managed by thread {}", leaseID, path, renewer.getName()); } }