auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static Matcher<MkQuery> queryContainingHeader(final String header) { return new BaseMatcher<MkQuery>() { @Override public boolean matches(final Object object) { <START> final MkQuery query = (MkQuery) object; <END> return query.headers().containsKey(header); } @Override public void describeTo(final Description description) { description.appendText("contains "); description.appendText(header); } }; }</code><technical_language>@westonized inline this</technical_language>

Target:
private static Matcher<MkQuery> queryContainingHeader(final String header) { return new TypeSafeMatcher<MkQuery>() { @Override protected boolean matchesSafely(final MkQuery query) { return query.headers().containsKey(header); } @Override public void describeTo(final Description description) { description.appendText("contains "); description.appendText(header); } }; }
Source:
<code>public LabelTypes getLabelTypes() { <START> Set<LabelType> r = Sets.newHashSet(); <END> String destBranch = getChange().getDest().get(); for (LabelType l : getProjectControl().getLabelTypes().getLabelTypes()) { List<String> refs = l.getRefPatterns(); if (refs == null) { r.add(l); } else { for (String refPattern : refs) { if (RefConfigSection.isValid(refPattern) && match(destBranch, refPattern)) { r.add(l); break; } } } } return new LabelTypes(Lists.newArrayList(r)); }</code><technical_language>this a List. iterating a single list of LabelTypes, duplicates</technical_language>

Target:
public LabelTypes getLabelTypes() { List<LabelType> r = Lists.newArrayList(); String destBranch = getChange().getDest().get(); for (LabelType l : getProjectControl().getLabelTypes().getLabelTypes()) { List<String> refs = l.getRefPatterns(); if (refs == null) { r.add(l); } else { for (String refPattern : refs) { if (RefConfigSection.isValid(refPattern) && match(destBranch, refPattern)) { r.add(l); break; } } } } return new LabelTypes(r); }
Source:
<code>public void onEvent(RedoEvent event) { final CommandResult<ScenarioSimulationViolation> status = scenarioCommandRegistry.redo(context); if (Objects.equals(CommandResult.Type.ERROR, status.getType())) { String violations = StreamSupport.stream(status.getViolations().spliterator(), false) .map(violation -> violation.getMessage()) .collect(Collectors.joining("\r\n")); String message = new StringBuilder() <START> .append("Redo: " + status.getType()) <END> .append("\r\n") .append(violations) .toString(); notificationEvent.fire(new NotificationEvent(message, NotificationEvent.NotificationType.ERROR)); } }</code><technical_language>This needs i18nized</technical_language>

Target:
public void onEvent(RedoEvent event) { final CommandResult<ScenarioSimulationViolation> status = scenarioCommandRegistry.redo(context); if (Objects.equals(CommandResult.Type.ERROR, status.getType())) { commonNotifyError(status, ScenarioSimulationEditorConstants.INSTANCE.redo()); } }
Source:
<code>public BufferedMultipleAtomicCallField(String paramName, Stream<String> paramValues) { super(paramName); <START> this.paramValues = (String[]) paramValues.toArray(); <END> }</code><technical_language>understanding is preferred construct array is lambda, in: paramValues.toArray(size -> new String[size]) way, array is constructed correct type correct number of elements for filling stream</technical_language>

Target:
public BufferedMultipleAtomicCallField(String paramName, Stream<String> paramValues) { super(paramName); this.paramValues = paramValues.toArray(size -> new String[size]); }
Source:
<code>public boolean isSatisfied() { javax.security.auth.Subject subject = javax.security.auth.Subject.getSubject(AccessController.getContext()); return subject .getPrincipals() .stream() .map(Principal::getName) .collect(Collectors.toList()) <START> .containsAll(Arrays.asList(args)); <END> }</code><technical_language>Avoid creating a new list for args time containsAll() is called; want create list in constructor instead</technical_language>

Target:
public boolean isSatisfied() { javax.security.auth.Subject subject = javax.security.auth.Subject.getSubject(AccessController.getContext()); Set<Principal> principals = subject.getPrincipals(); List<String> principalNameList = new ArrayList<>(); for (Principal principal : principals) { principalNameList.add(principal.getName()); } return principalNameList.containsAll(argsAsList); }
Source:
<code>public Object visitGetKeysInGroupCommand(InvocationContext ctx, GetKeysInGroupCommand command) throws Throwable { final String groupName = command.getGroupName(); final boolean isOwner = groupManager.isOwner(groupName); updateTopologyId(command); final int commandTopologyId = command.getTopologyId(); if (ctx.isOriginLocal()) { Object localResult; try { localResult = invokeNextInterceptor(ctx, command); if (isOwner && currentTopologyId() != commandTopologyId) { logRetry(command); int newTopologyId = Math.max(currentTopologyId(), commandTopologyId + 1); command.setTopologyId(newTopologyId); waitForTransactionData(newTopologyId); localResult = visitGetKeysInGroupCommand(ctx, command); } } catch (CacheException e) { Throwable ce = e; while (ce instanceof RemoteException) { ce = ce.getCause(); } if (!(ce instanceof OutdatedTopologyException) && !(ce instanceof SuspectException)) throw e; <START> logRetry(command); <END> int newTopologyId = Math.max(currentTopologyId(), commandTopologyId + 1); command.setTopologyId(newTopologyId); waitForTransactionData(newTopologyId); localResult = visitGetKeysInGroupCommand(ctx, command); } return localResult; } else { Object result = invokeNextInterceptor(ctx, command); if (isOwner && currentTopologyId() != commandTopologyId) { throw new OutdatedTopologyException("Cache topology changed while the command was executing: expected " + commandTopologyId + ", got " + currentTopologyId()); } return result; } }</code><technical_language>this is duplicate in local origin, nice consolidated 1 method</technical_language>

Target:
public Object visitGetKeysInGroupCommand(InvocationContext ctx, GetKeysInGroupCommand command) throws Throwable { final String groupName = command.getGroupName(); final boolean isOwner = groupManager.isOwner(groupName); updateTopologyId(command); final int commandTopologyId = command.getTopologyId(); if (ctx.isOriginLocal()) { Object localResult; try { localResult = invokeNextInterceptor(ctx, command); if (isOwner && currentTopologyId() != commandTopologyId) { localResult = retryVisitGetKeysInGroupCommand(ctx, command, commandTopologyId); } } catch (CacheException e) { Throwable ce = e; while (ce instanceof RemoteException) { ce = ce.getCause(); } if (!(ce instanceof OutdatedTopologyException) && !(ce instanceof SuspectException)) throw e; localResult = retryVisitGetKeysInGroupCommand(ctx, command, commandTopologyId); } return localResult; } else { Object result = invokeNextInterceptor(ctx, command); if (isOwner && currentTopologyId() != commandTopologyId) { throw new OutdatedTopologyException("Cache topology changed while the command was executing: expected " + commandTopologyId + ", got " + currentTopologyId()); } return result; } }
Source:
<code><START> public void createOrUpdateMeter(String classSimpleName, String key, String metricName, long value) { <END> validateArguments(classSimpleName, metricName); String fullMetricName = MetricRegistry.name(classSimpleName, key, metricName); Meter meter = (Meter) checkCache(classSimpleName, fullMetricName).orElse(_metricRegistry.getMeters().get(fullMetricName)); if (meter == null) { meter = _metricRegistry.meter(fullMetricName); } meter.mark(value); updateCache(classSimpleName, fullMetricName, meter); }</code><technical_language>optimizations other ones: Meter meter = (Meter) checkCache(classSimpleName, fullMetricName).orElse(_metricRegistry.meter(fullMetricName)); remove "if (meter == null)" check</technical_language>

Target:
public void createOrUpdateMeter(String classSimpleName, String key, String metricName, long value) { validateArguments(classSimpleName, metricName); String fullMetricName = MetricRegistry.name(classSimpleName, key, metricName); Meter meter = (Meter) checkCache(classSimpleName, fullMetricName).orElse(_metricRegistry.meter(fullMetricName)); meter.mark(value); updateCache(classSimpleName, fullMetricName, meter); }
Source:
<code>public static boolean isValidPriority(String string) { <START> return "P1".equals(string) || "P2".equals(string) || "P3".equals(string) || "P4".equals(string) <END> || "P5".equals(string); }</code><technical_language>Instead of duplicating values, PriorityLevel.valueOf() (I other methods worry it)</technical_language>

Target:
public static boolean isValidPriority(String string) { try { PriorityLevel.valueOf(string); return true; } catch (IllegalArgumentException e) { return false; } }
Source:
<code>public static void getClusterListByName(AsyncQuery aQuery, String name) { aQuery.converterCallback = new IAsyncConverter() { @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { List<VDSGroup> result = new ArrayList<VDSGroup>(); <START> if (source == null || !(source instanceof VDSGroup)) <END> { return result; } result.add((VDSGroup) source); return result; } }; Frontend.getInstance().runQuery(VdcQueryType.GetVdsGroupByName, new NameQueryParameters(name), aQuery); }</code><technical_language>query return a VDSGroup object? failure</technical_language>

Target:
public static void getClusterListByName(AsyncQuery aQuery, String name) { aQuery.converterCallback = new IAsyncConverter() { @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { List<VDSGroup> result = new ArrayList<VDSGroup>(); if (source == null) { return result; } result.add((VDSGroup) source); return result; } }; Frontend.getInstance().runQuery(VdcQueryType.GetVdsGroupByName, new NameQueryParameters(name), aQuery); }
Source:
<code>protected void log(@Nullable WikiSite wiki, Object... params) { int rate = getSampleRate(); if (rate != SAMPLE_LOG_DISABLE) { boolean chosen = app.getEventLogSamplingID() % rate == 0 || ReleaseUtil.isDevRelease(); if (chosen) { JSONObject eventData = new JSONObject(); String logString = this.getClass().getSimpleName() + ": Sending event"; for (int i = 0; i < params.length; i += 2) { preprocessData(eventData, params[i].toString(), params[i + 1]); logString += ", event_" + params[i] + " = " + params[i + 1]; } L.d(logString); EventLoggingEvent event = new EventLoggingEvent( schemaName, revision, wiki == null ? app.getWikiSite().dbName() : wiki.dbName(), preprocessData(eventData) ); <START> WikipediaApp.getInstance().getApplicationContext().startService(AnalyticsIntentService.getIntent(event.getData().toString())); <END> } } }</code><technical_language>architectural note: send events pretty frequently portions of app. Therefore, pushing a new entry database table fast possible. AFAIK, starting IntentService is a expensive operation (I wrong, though). If do this for event is sent, slow significantly. For task of inserting event db, consider a plain AsyncTask HandlerThread</technical_language>

Target:
protected void log(@Nullable WikiSite wiki, Object... params) { int rate = getSampleRate(); if (rate != SAMPLE_LOG_DISABLE) { boolean chosen = app.getEventLogSamplingID() % rate == 0 || ReleaseUtil.isDevRelease(); if (chosen) { JSONObject eventData = new JSONObject(); String logString = this.getClass().getSimpleName() + ": Sending event"; for (int i = 0; i < params.length; i += 2) { preprocessData(eventData, params[i].toString(), params[i + 1]); logString += ", event_" + params[i] + " = " + params[i + 1]; } L.d(logString); EventLoggingEvent event = new EventLoggingEvent( schemaName, revision, wiki == null ? app.getWikiSite().dbName() : wiki.dbName(), preprocessData(eventData) ); AnalyticsIntentService.enqueueService(WikipediaApp.getInstance(), event.getData().toString()); } } }
Source:
<code>void setUp() { <START> factory = shouldHaveSizeGreaterThan(newArrayList('a', 'b'), 4, 2); <END> }</code><technical_language>CharSequence instead of Object for actual's type</technical_language>

Target:
void setUp() { factory = shouldHaveSizeGreaterThan("ab", 4, 2); }
Source:
<code><START> public org.hibernate.query.Query<R> setEntity(int position, Object val) { <END> throw new UnsupportedOperationException( "setEntity(int,Object) is not implemented in Hibernate Search queries" ); }</code><technical_language>simpler FullTextQuery<R> here? (and in next diff) advantage of making FullTextQueryImpl compatible Hibernate ORM 5.2.3 lower, I guess irrelevant introduce incompatibilities in other places (FullTextSharedSessionBuilderDelegator.java in particular)</technical_language>

Target:
public FullTextQuery<R> setEntity(int position, Object val) { throw new UnsupportedOperationException( "setEntity(int,Object) is not implemented in Hibernate Search queries" ); }
Source:
<code>public <T> boolean checkAndCommit(String family, String qualifier, T value) throws IOException { Preconditions.checkState(mPut != null, "checkAndCommit must be paired with a call to begin()"); final KijiColumnName kijiColumnName = new KijiColumnName(family, qualifier); final HBaseColumnName columnName = mTranslator.toHBaseColumnName(kijiColumnName); final CellSpec cellSpec = mTable.getLayout().getCellSpec(kijiColumnName) .setSchemaTable(mTable.getKiji().getSchemaTable()); final KijiCellEncoder cellEncoder = DefaultKijiCellEncoderFactory.get().create(cellSpec); final byte[] encoded = cellEncoder.encode(value); for (KeyValue kv : mHopper) { mPut.add(kv); } boolean retVal = mHTable.checkAndPut( mId, columnName.getFamily(), columnName.getQualifier(), encoded, mPut); if (retVal) { if (!mHTable.isAutoFlush()) { mHTable.flushCommits(); } <START> mPut = null; <END> mEntityId = null; mHopper = null; mId = null; mLGNames = Sets.newHashSet(); } return retVal; }</code><technical_language>a private internal method reset() out of 5 statements</technical_language>

Target:
public <T> boolean checkAndCommit(String family, String qualifier, T value) throws IOException { Preconditions.checkState(mPut != null, "checkAndCommit must be paired with a call to begin()"); final KijiColumnName kijiColumnName = new KijiColumnName(family, qualifier); final HBaseColumnName columnName = mTranslator.toHBaseColumnName(kijiColumnName); final CellSpec cellSpec = mTable.getLayout().getCellSpec(kijiColumnName) .setSchemaTable(mTable.getKiji().getSchemaTable()); final KijiCellEncoder cellEncoder = DefaultKijiCellEncoderFactory.get().create(cellSpec); final byte[] encoded = cellEncoder.encode(value); for (KeyValue kv : mHopper) { mPut.add(kv); } boolean retVal = mHTable.checkAndPut( mId, columnName.getFamily(), columnName.getQualifier(), encoded, mPut); if (retVal) { if (!mHTable.isAutoFlush()) { mHTable.flushCommits(); } reset(); } return retVal; }
Source:
<code>public abstract void run() throws Exception; @Override public Void call() throws Exception { additionalValidation(); if(embedded) throw new UnsupportedOperationException( "The \"--embedded\" option is not supported yet"); if(noRetry) <START> retry = 1; <END> run(); return null; }</code><technical_language>Number of retries zero if noRetry; number of "tries" 1..</technical_language>

Target:
public abstract void run() throws Exception; @Override public Void call() throws Exception { additionalValidation(); if(embedded) throw new UnsupportedOperationException( "The \"--embedded\" option is not supported yet"); if(noRetry) retry = 0; run(); return null; }
Source:
<code><START> public void run() { <END> try { final Manufacturer manufacturer = this.findManufacturer(this.eventRetrievalScheduledTaskManufacturerName); if (manufacturer == null) { return; } final List<DeviceModel> deviceModels = this.findDeviceModels(manufacturer); if (deviceModels == null || deviceModels.isEmpty()) { return; } final List<Device> devices = this.findDevices(deviceModels); if (devices.isEmpty()) { return; } final List<Device> devicesToContact = this.findDevicesToContact(devices, this.eventRetrievalScheduledTaskMaximumAllowedAge); if (devicesToContact.isEmpty()) { return; } this.contactDevices(devicesToContact, DeviceFunction.GET_STATUS); } catch (final Exception e) { LOGGER.error("Exception caught during EventRetrievalScheduledTask.run()", e); } }</code><technical_language>![MAJOR](<LINK_0> Cyclomatic Complexity of this method "run" is 12 is greater 10 authorized. [![rule](<LINK_2>](<LINK_1></technical_language>

Target:
public void run() { try { final Manufacturer manufacturer = this.findManufacturer(this.eventRetrievalScheduledTaskManufacturerName); if (manufacturer == null) { return; } final List<DeviceModel> deviceModels = this.findDeviceModels(manufacturer); if (deviceModels == null || deviceModels.isEmpty()) { return; } final List<Device> devices = this.findDevices(deviceModels, Ssld.SSLD_TYPE); if (devices.isEmpty()) { return; } final List<Device> devicesToContact = this.findDevicesToContact(devices, this.eventRetrievalScheduledTaskMaximumAllowedAge); if (devicesToContact == null || devicesToContact.isEmpty()) { return; } this.contactDevices(devicesToContact, DeviceFunction.GET_STATUS); } catch (final Exception e) { LOGGER.error("Exception caught during EventRetrievalScheduledTask.run()", e); } }
Source:
<code><START> public boolean supportsRefreshing() { <END> for (AbstractTaskEditorPart part : subParts) { if (!part.supportsRefreshing()) { return false; } } return true; }</code><technical_language>return false if !super.supportsRefreshing()</technical_language>

Target:
public boolean supportsRefreshing() { if (!super.supportsRefreshing()) { return false; } for (AbstractTaskEditorPart part : subParts) { if (!part.supportsRefreshing()) { return false; } } return true; }
Source:
<code>public ObjectId readCherryPickHead() throws IOException, NoWorkTreeException { if (isBare() || getDirectory() == null) throw new NoWorkTreeException(); File mergeHeadFile = new File(getDirectory(), Constants.CHERRY_PICK_HEAD); byte[] raw; try { raw = IO.readFully(mergeHeadFile); } catch (FileNotFoundException notFound) { return null; } if (raw.length == 0) return null; <START> ObjectId head = ObjectId.fromString(raw, 0); <END> return head; }</code><technical_language>Style-nit: is good reason for this local variable "head"</technical_language>

Target:
public ObjectId readCherryPickHead() throws IOException, NoWorkTreeException { if (isBare() || getDirectory() == null) throw new NoWorkTreeException(); File mergeHeadFile = new File(getDirectory(), Constants.CHERRY_PICK_HEAD); byte[] raw; try { raw = IO.readFully(mergeHeadFile); } catch (FileNotFoundException notFound) { return null; } if (raw.length == 0) return null; return ObjectId.fromString(raw, 0); }
Source:
<code>private void determineAtomicFileCreationSupport() { AtomicFileCreation ret = getAtomicFileCreationSupportOption( <START> GlobalConfigCache.getInstance().getUserConfig()); <END> if (ret == AtomicFileCreation.UNDEFINED && StringUtils.isEmptyOrNull(SystemReader.getInstance() .getenv(Constants.GIT_CONFIG_NOSYSTEM_KEY))) { ret = getAtomicFileCreationSupportOption( SystemReader.getInstance().openSystemConfig(null, this)); } if (ret == AtomicFileCreation.UNDEFINED) { ret = AtomicFileCreation.SUPPORTED; } supportsAtomicCreateNewFile = ret; }</code><technical_language>throw RuntimeException</technical_language>

Target:
private void determineAtomicFileCreationSupport() { AtomicFileCreation ret; try { ret = getAtomicFileCreationSupportOption( GlobalConfigCache.getInstance().getUserConfig()); } catch (IOException | ConfigInvalidException e) { ret = AtomicFileCreation.UNDEFINED; } if (ret == AtomicFileCreation.UNDEFINED && StringUtils.isEmptyOrNull(SystemReader.getInstance() .getenv(Constants.GIT_CONFIG_NOSYSTEM_KEY))) { ret = getAtomicFileCreationSupportOption( SystemReader.getInstance().openSystemConfig(null, this)); } if (ret == AtomicFileCreation.UNDEFINED) { ret = AtomicFileCreation.SUPPORTED; } supportsAtomicCreateNewFile = ret; }
Source:
<code>private void maybeUpdateServer(IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, 100); IRemoteConnection conn = fRemoteServicesDelegate.getRemoteConnection(); LMLDAServer server = (LMLDAServer) RemoteServerManager.getServer(LMLDAServer.SERVER_ID, conn); <START> server.waitForServerStart(60000); <END> server.setWorkDir(new Path(conn.getWorkingDirectory()).append(JAXBControlConstants.ECLIPSESETTINGS).toString()); try { server.updateServer(progress.newChild(100)); } catch (IOException e) { throw CoreExceptionUtils.newException(e.getMessage(), e); } }</code><technical_language>This a long time wait. a problem cached model</technical_language>

Target:
private void maybeUpdateServer(IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, 100); IRemoteConnection conn = fRemoteServicesDelegate.getRemoteConnection(); LMLDAServer server = (LMLDAServer) RemoteServerManager.getServer(LMLDAServer.SERVER_ID, conn); server.setWorkDir(new Path(conn.getWorkingDirectory()).append(JAXBControlConstants.ECLIPSESETTINGS).toString()); try { server.updateServer(progress.newChild(100)); } catch (IOException e) { throw CoreExceptionUtils.newException(e.getMessage(), e); } }
Source:
<code>public void testHasSolidTumor() throws Exception { Set<TumorType> tumorTypeSet = new HashSet<>(); TumorType tt1 = new TumorType(); TumorType tt2 = new TumorType(); tt1.setId(0); tt1.setId(1); tumorTypeSet.add(tt1); tumorTypeSet.add(tt2); <START> assertFalse("No tumor type should be solid tumor", TumorTypeUtils.hasSolidTumor(tumorTypeSet)); <END> tt1.setTissue("EYE"); assertTrue("One tumor type is solid tumor, should be true", TumorTypeUtils.hasSolidTumor(tumorTypeSet)); tt2.setTissue("BONE"); assertTrue("Both tumor types are solid tumor, should be true", TumorTypeUtils.hasSolidTumor(tumorTypeSet)); tt1.setTissue("BLOOD"); tt2.setTissue("BONE"); assertTrue("One tumor type is solid tumor, should be true", TumorTypeUtils.hasSolidTumor(tumorTypeSet)); }</code><technical_language>above. confirm double negative pattern</technical_language>

Target:
public void testHasSolidTumor() throws Exception { Set<TumorType> tumorTypeSet = new HashSet<>(); TumorType tt1 = new TumorType(); TumorType tt2 = new TumorType(); tt1.setId(0); tt1.setId(1); tumorTypeSet.add(tt1); tumorTypeSet.add(tt2); assertFalse("Empty tumor type set has solid tumor, but it should not.", TumorTypeUtils.hasSolidTumor(tumorTypeSet)); tt1.setTissue("EYE"); assertTrue("Tumor types set does not have solid tumor, but it should because of EYE is solid tumor.", TumorTypeUtils.hasSolidTumor(tumorTypeSet)); tt2.setTissue("BONE"); assertTrue("Tumor types set does not have solid tumor, but both tumor types in the set are solid tumor.", TumorTypeUtils.hasSolidTumor(tumorTypeSet)); tt1.setTissue("BLOOD"); tt2.setTissue("BONE"); assertTrue("Tumor types set does not have solid tumor, but one of tumor types BONE is solid tumor.", TumorTypeUtils.hasSolidTumor(tumorTypeSet)); }
Source:
<code>public AddinsCommandManager(EventBus events, final Session session) { events_ = events; bindings_ = new FileBacked<EditorKeyBindings>( KEYBINDINGS_PATH, false, EditorKeyBindings.create()); events_.addHandler( SessionInitEvent.TYPE, new SessionInitHandler() { @Override public void onSessionInit(SessionInitEvent sie) { MainWindowObject.rAddins().set(session.getSessionInfo().getAddins()); loadBindings(); } }); events_.addHandler( AddinsKeyBindingsChangedEvent.TYPE, new AddinsKeyBindingsChangedEvent.Handler() { @Override public void onAddinsKeyBindingsChanged(AddinsKeyBindingsChangedEvent event) { registerBindings(event.getBindings(), null); } }); events_.addHandler( AddinRegistryUpdatedEvent.TYPE, new AddinRegistryUpdatedEvent.Handler() { @Override public void onAddinRegistryUpdated(AddinRegistryUpdatedEvent event) { <START> MainWindowObject.rAddins().set(event.getData()); <END> loadBindings(); } }); }</code><technical_language>this result in main window object set repeatedly (x number of satellites) event is fired</technical_language>

Target:
public AddinsCommandManager(EventBus events, final Session session) { events_ = events; bindings_ = new FileBacked<EditorKeyBindings>( KEYBINDINGS_PATH, false, EditorKeyBindings.create()); events_.addHandler( SessionInitEvent.TYPE, new SessionInitHandler() { @Override public void onSessionInit(SessionInitEvent sie) { MainWindowObject.rAddins().set(session.getSessionInfo().getAddins()); loadBindings(); } }); events_.addHandler( AddinsKeyBindingsChangedEvent.TYPE, new AddinsKeyBindingsChangedEvent.Handler() { @Override public void onAddinsKeyBindingsChanged(AddinsKeyBindingsChangedEvent event) { registerBindings(event.getBindings(), null); } }); events_.addHandler( AddinRegistryUpdatedEvent.TYPE, new AddinRegistryUpdatedEvent.Handler() { @Override public void onAddinRegistryUpdated(AddinRegistryUpdatedEvent event) { if (SourceWindowManager.isMainSourceWindow()) MainWindowObject.rAddins().set(event.getData()); loadBindings(); } }); }
Source:
<code>public ForkJoinPoolHierarchicalTestExecutorService(ParallelExecutionConfiguration configuration) { <START> this(new ForkJoinPoolFactory().apply(configuration)); <END> }</code><technical_language>suggestion this(ForkJoinPoolFactory.create(configuration));</technical_language>

Target:
public ForkJoinPoolHierarchicalTestExecutorService(ParallelExecutionConfiguration configuration) { this(ForkJoinPoolFactory.create(configuration)); }
Source:
<code>private boolean updateLeaseInfo(Guid snapshotLeaseDomainId) { if <START> ((getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO && snapshotLeaseDomainId == null) || ( getParameters().getSnapshotAction() == SnapshotActionEnum.COMMIT && snapshotLeaseDomainId == null)) <END> { vmDynamicDao.updateVmLeaseInfo(getParameters().getVmId(), null); return true; } VDSReturnValue retVal = null; try { retVal = runVdsCommand(VDSCommandType.GetVmLeaseInfo, new VmLeaseVDSParameters(getStoragePoolId(), snapshotLeaseDomainId, getParameters().getVmId())); } catch (EngineException e) { log.error("Failure in getting lease info for VM {}, message: {}", getParameters().getVmId(), e.getMessage()); } if (retVal == null || !retVal.getSucceeded()) { log.error("Failed to get info on the lease of VM {}", getParameters().getVmId()); return false; } vmDynamicDao.updateVmLeaseInfo( getParameters().getVmId(), (Map<String, String>) retVal.getReturnValue()); return true; }</code><technical_language>replaced "snapshotLeaseDomainId == null"</technical_language>

Target:
private boolean updateLeaseInfo(Guid snapshotLeaseDomainId) { if (snapshotLeaseDomainId == null) { vmDynamicDao.updateVmLeaseInfo(getParameters().getVmId(), null); return true; } VDSReturnValue retVal = null; try { retVal = runVdsCommand(VDSCommandType.GetVmLeaseInfo, new VmLeaseVDSParameters(getStoragePoolId(), snapshotLeaseDomainId, getParameters().getVmId())); } catch (EngineException e) { log.error("Failure in getting lease info for VM {}, message: {}", getParameters().getVmId(), e.getMessage()); } if (retVal == null || !retVal.getSucceeded()) { log.error("Failed to get info on the lease of VM {}", getParameters().getVmId()); return false; } vmDynamicDao.updateVmLeaseInfo( getParameters().getVmId(), (Map<String, String>) retVal.getReturnValue()); return true; }
Source:
<code>public Float getTIC() { <START> Float tic = MsSpectrumUtil.getTIC(intensityValues, getMzBinaryDataInfo().getArrayLength()); <END> return tic; }</code><technical_language>Calculating TIC requires loading datapoints, TIC a Float variable initially set null, calculate time this function is called. next time need calculated again</technical_language>

Target:
public Float getTIC() { Float tic = null; try { tic = Float.valueOf(getCVValue(MzMLCV.cvTIC)); } catch (Exception e) { e.printStackTrace(); } if (tic == null) tic = MsSpectrumUtil.getTIC(getIntensityValues(), getMzBinaryDataInfo().getArrayLength()); return tic; }
Source:
<code><START> public void configure(ServerHttpSecurity http) { <END> ReactiveAuthenticationManager authenticationManager = getAuthenticationManager(); X509PrincipalExtractor principalExtractor = getPrincipalExtractor(); AuthenticationWebFilter filter = new AuthenticationWebFilter(authenticationManager); filter.setServerAuthenticationConverter(new ServerX509AuthenticationConverter(principalExtractor)); http.addFilterAt(filter, SecurityWebFiltersOrder.AUTHENTICATION); }</code><technical_language>Please this protected avoid exposing methods consumers of API do care about</technical_language>

Target:
protected void configure(ServerHttpSecurity http) { ReactiveAuthenticationManager authenticationManager = getAuthenticationManager(); X509PrincipalExtractor principalExtractor = getPrincipalExtractor(); AuthenticationWebFilter filter = new AuthenticationWebFilter(authenticationManager); filter.setServerAuthenticationConverter(new ServerX509AuthenticationConverter(principalExtractor)); http.addFilterAt(filter, SecurityWebFiltersOrder.AUTHENTICATION); }
Source:
<code>public WatchableOutputStream(@Nonnull OutputStream delegate) { <START> Objects.requireNonNull(delegate, "null pass passed into a WatchableOutputStream"); <END> this.delegate = delegate; this.completionFuture = new Future(); }</code><technical_language>suggestion Objects.requireNonNull(delegate, "null passed a WatchableOutputStream");</technical_language>

Target:
public WatchableOutputStream(@Nonnull OutputStream delegate) { Objects.requireNonNull(delegate, "null was passed into a WatchableOutputStream"); this.delegate = delegate; this.completionFuture = new Future(); }
Source:
<code>public void testGetBytesMiddle() throws CTFReaderException { @NonNull byte[] data = new byte[5]; ByteBuffer bb = ByteBuffer.wrap(new String("hello world").getBytes()); if( bb == null){ throw new IllegalStateException("Failed to allocate memory"); <START> } <END> fixture = new BitBuffer(bb); fixture.position(6 * 8); fixture.get(data); String actual = new String(data); assertEquals("world", actual); }</code><technical_language>Ctrl+Shift+F this file</technical_language>

Target:
public void testGetBytesMiddle() throws CTFReaderException { @NonNull byte[] data = new byte[5]; fixture = new BitBuffer(testMemory(ByteBuffer.wrap(new String("hello world").getBytes()))); fixture.position(6 * 8); fixture.get(data); String actual = new String(data); assertEquals("world", actual); }
Source:
<code>public DruidPredicateFactory predicateFactory(final ExtractionFn extractionFn) { return new DruidPredicateFactory() { @Override public Predicate<String> makeStringPredicate() { if (extractionFn != null) { return new Predicate<String>() { @Override public boolean apply(String input) { return matches(extractionFn.apply(input)); } }; } else { return new Predicate<String>() { @Override public boolean apply(String input) { return matches(input); } }; } } @Override public DruidLongPredicate makeLongPredicate() { if (extractionFn != null) { return new DruidLongPredicate() { @Override public boolean applyLong(long input) { return matches(extractionFn.apply(input)); } }; } else { return new DruidLongPredicate() { @Override public boolean applyLong(long input) { return matches(String.valueOf(input)); } }; } } @Override public DruidFloatPredicate makeFloatPredicate() { if (extractionFn != null) { return new DruidFloatPredicate() { @Override public boolean applyFloat(float input) { return matches(extractionFn.apply(input)); } }; } else { return new DruidFloatPredicate() { @Override public boolean applyFloat(float input) { return matches(String.valueOf(input)); } }; } } @Override <START> public DruidDoublePredicate makeDoublePredicate() <END> { return input -> { if (extractionFn != null) { return matches(extractionFn.apply(input)); } return matches(String.valueOf(input)); }; } }; }</code><technical_language>Please align other methods in this class, extractionFn is checked of lambda</technical_language>

Target:
public DruidPredicateFactory predicateFactory(final ExtractionFn extractionFn) { return new DruidPredicateFactory() { @Override public Predicate<String> makeStringPredicate() { if (extractionFn != null) { return new Predicate<String>() { @Override public boolean apply(String input) { return matches(extractionFn.apply(input)); } }; } else { return new Predicate<String>() { @Override public boolean apply(String input) { return matches(input); } }; } } @Override public DruidLongPredicate makeLongPredicate() { if (extractionFn != null) { return input -> matches(extractionFn.apply(input)); } else { return input -> matches(String.valueOf(input)); } } @Override public DruidFloatPredicate makeFloatPredicate() { if (extractionFn != null) { return input -> matches(extractionFn.apply(input)); } else { return input -> matches(String.valueOf(input)); } } @Override public DruidDoublePredicate makeDoublePredicate() { if (extractionFn != null) { return input -> matches(extractionFn.apply(input)); } else { return input -> matches(String.valueOf(input)); } } }; }
Source:
<code>public void cancel(Throwable cause) { Stream .concat( pendingRequests.keySet().stream(), fulfilledRequests.keySet().stream()) .flatMap(group -> executions.get(group).stream()) <START> .forEach(id -> logicalSlotRequestCanceller.accept(id, cause)); <END> }</code><technical_language>Collections.unmodifiableSet a bit cheaper here</technical_language>

Target:
public void cancel(Throwable cause) { for (ExecutionSlotSharingGroup group : pendingRequests.keySet()) { for (ExecutionVertexID id : executions.get(group)) { logicalSlotRequestCanceller.accept(id, cause); } } for (ExecutionSlotSharingGroup group : fulfilledRequests.keySet()) { for (ExecutionVertexID id : executions.get(group)) { logicalSlotRequestCanceller.accept(id, cause); } } }
Source:
<code>void propagateCostImprovements(RelNode rel) { RelMetadataQuery mq = rel.getCluster().getMetadataQuery(); Map<RelNode, RelOptCost> propagateRels = new HashMap<>(); PriorityQueue<RelNode> propagateHeap = new PriorityQueue<>((o1, o2) -> { RelOptCost c1 = propagateRels.get(o1); RelOptCost c2 = propagateRels.get(o2); if (c1.equals(c2)) { return 0; } else if (c1.isLt(c2)) { return -1; } return 1; }); propagateRels.put(rel, getCost(rel, mq)); propagateHeap.offer(rel); while (!propagateHeap.isEmpty()) { RelNode relNode = propagateHeap.poll(); RelOptCost cost = propagateRels.get(relNode); for (RelSubset subset : getSet(relNode).subsets) { if (relNode.getTraitSet().satisfies(subset.getTraitSet())) { if (cost.isLt(subset.bestCost)) { subset.timestamp++; LOGGER.trace("Subset cost changed: subset cost was now {}", subset, subset.bestCost, cost); subset.bestCost = cost; subset.best = relNode; mq.clearCache(subset); <START> subset.getParents().forEach(parent -> { <END> mq.clearCache(parent); if (propagateRels.put(parent, getCost(parent, mq)) != null) { propagateHeap.remove(parent); } propagateHeap.offer(parent); }); } } } } }</code><technical_language>this a regular for loop</technical_language>

Target:
void propagateCostImprovements(RelNode rel) { RelMetadataQuery mq = rel.getCluster().getMetadataQuery(); Map<RelNode, RelOptCost> propagateRels = new HashMap<>(); PriorityQueue<RelNode> propagateHeap = new PriorityQueue<>((o1, o2) -> { RelOptCost c1 = propagateRels.get(o1); RelOptCost c2 = propagateRels.get(o2); if (c1.equals(c2)) { return 0; } else if (c1.isLt(c2)) { return -1; } return 1; }); propagateRels.put(rel, getCost(rel, mq)); propagateHeap.offer(rel); while (!propagateHeap.isEmpty()) { RelNode relNode = propagateHeap.poll(); RelOptCost cost = propagateRels.get(relNode); for (RelSubset subset : getSet(relNode).subsets) { if (!relNode.getTraitSet().satisfies(subset.getTraitSet())) { continue; } if (!cost.isLt(subset.bestCost)) { continue; } subset.timestamp++; LOGGER.trace("Subset cost changed: subset cost was now {}", subset, subset.bestCost, cost); subset.bestCost = cost; subset.best = relNode; mq.clearCache(subset); for (RelNode parent : subset.getParents()) { mq.clearCache(parent); RelOptCost newCost = getCost(parent, mq); RelOptCost existingCost = propagateRels.get(parent); if (existingCost == null || newCost.isLt(existingCost)) { propagateRels.put(parent, newCost); if (existingCost != null) { propagateHeap.remove(parent); } propagateHeap.offer(parent); } } } } }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); LayoutInflater layoutInflater = getLayoutInflater(); updateAccountsList(); <START> swipeRefresh = (SwipeRefreshLayout) findViewById(R.id.swipeRefresh); <END> swipeRefresh.setColorSchemeResources(R.color.swipe1, R.color.swipe2, R.color.swipe1, R.color.swipe2); swipeRefresh.setOnRefreshListener(this); mainListView = (ListView) findViewById(R.id.main_app_list); mainListView.addHeaderView(layoutInflater.inflate(R.layout.main_list_header, null), null, false); footer = layoutInflater.inflate(R.layout.main_list_footer, null); footer.setVisibility(View.INVISIBLE); mainListView.addFooterView(footer, null, false); adapter = new MainListAdapter(this, accountName, currentStatsMode); mainListView.setAdapter(adapter); mainViewSwitcher = (ViewSwitcher) findViewById(R.id.main_viewswitcher); statusText = (TextView) findViewById(R.id.main_app_status_line); aniPrevIn = AnimationUtils.loadAnimation(Main.this, R.anim.activity_fade_in); currentStatsMode = Preferences.getStatsMode(this); updateStatsMode(); State lastState = (State) getLastCustomNonConfigurationInstance(); if (lastState != null) { state = lastState; state.attachAll(this); if (state.lastAppList != null) { adapter.setAppInfos(state.lastAppList); setSkipMainReload(true); } } if (isUpdate()) { showChangelog(); } }</code><technical_language>a tab instead of 4 spaces</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); LayoutInflater layoutInflater = getLayoutInflater(); updateAccountsList(); mainListView = (ListView) findViewById(R.id.main_app_list); mainListView.addHeaderView(layoutInflater.inflate(R.layout.main_list_header, null), null, false); footer = layoutInflater.inflate(R.layout.main_list_footer, null); footer.setVisibility(View.INVISIBLE); mainListView.addFooterView(footer, null, false); adapter = new MainListAdapter(this, accountName, currentStatsMode); mainListView.setAdapter(adapter); mainViewSwitcher = (ViewSwitcher) findViewById(R.id.main_viewswitcher); statusText = (TextView) findViewById(R.id.main_app_status_line); aniPrevIn = AnimationUtils.loadAnimation(Main.this, R.anim.activity_fade_in); currentStatsMode = Preferences.getStatsMode(this); updateStatsMode(); State lastState = (State) getLastCustomNonConfigurationInstance(); if (lastState != null) { state = lastState; state.attachAll(this); if (state.lastAppList != null) { adapter.setAppInfos(state.lastAppList); setSkipMainReload(true); } } if (isUpdate()) { showChangelog(); } }
Source:
<code>public void getOutline(@NonNull Outline outline) { if (android.os.Build.VERSION.SDK_INT >= 21) { Path backgroundPath = new Path(); float[] backgroundRadii = { Math.max(0, borderTopLeftRadius), Math.max(0, borderTopLeftRadius), Math.max(0, borderTopRightRadius), Math.max(0, borderTopRightRadius), Math.max(0, borderBottomRightRadius), Math.max(0, borderBottomRightRadius), Math.max(0, borderBottomLeftRadius), Math.max(0, borderBottomLeftRadius) }; backgroundPath.addRoundRect(new RectF(getBounds()), backgroundRadii, Path.Direction.CW); outline.setConvexPath(backgroundPath); } else { <START> super.getOutline(outline); <END> } }</code><technical_language>I getOutline added in API 21 technically is super call API levels. throw exception throw new IllegalStateException("Method supported API 21 higher");</technical_language>

Target:
public void getOutline(@NonNull Outline outline) { if (android.os.Build.VERSION.SDK_INT >= 21) { Path backgroundPath = new Path(); float[] backgroundRadii = { Math.max(0, borderTopLeftRadius), Math.max(0, borderTopLeftRadius), Math.max(0, borderTopRightRadius), Math.max(0, borderTopRightRadius), Math.max(0, borderBottomRightRadius), Math.max(0, borderBottomRightRadius), Math.max(0, borderBottomLeftRadius), Math.max(0, borderBottomLeftRadius) }; backgroundPath.addRoundRect(new RectF(getBounds()), backgroundRadii, Path.Direction.CW); outline.setConvexPath(backgroundPath); } else { throw new IllegalStateException("Method supported on API 21 or higher"); } }
Source:
<code>private SaveablesProvider createSaveablesProvider(NavigatorContentDescriptor descriptor) { NavigatorContentExtension extension = contentService .getExtension(descriptor, true); ITreeContentProvider contentProvider = extension .getContentProvider(); <START> return (SaveablesProvider)Adapters.getAdapter(contentProvider, SaveablesProvider.class, true); <END> }</code><technical_language>Unnecessary cast</technical_language>

Target:
private SaveablesProvider createSaveablesProvider(NavigatorContentDescriptor descriptor) { NavigatorContentExtension extension = contentService .getExtension(descriptor, true); ITreeContentProvider contentProvider = extension .getContentProvider(); return Adapters.getAdapter(contentProvider, SaveablesProvider.class, true); }
Source:
<code>public V get(K key, final Callable<? extends V> valueLoader) throws ExecutionException { V value = cache.get(key); if (value != null) return value; try { value = valueLoader.call(); <START> cache.put(key, value); <END> return value; } catch (Exception e) { throw new ISE(e, "got an exception while loading key [%s]", key); } }</code><technical_language>thread safe</technical_language>

Target:
public V get(K key, final Callable<? extends V> valueLoader) throws ExecutionException { synchronized (key) { V value = cache.get(key); if (value != null) { return value; } try { value = valueLoader.call(); cache.put(key, value); return value; } catch (Exception e) { throw new ISE(e, "got an exception while loading key [%s]", key); } } }
Source:
<code>public void destroySession(final HttpServletRequest request) { <START> String logoutMessage; <END> if ("GET".equals(request.getMethod())) { logoutMessage = uncompressLogoutMessage(CommonUtils.safeGetParameter(request, this.frontLogoutParameterName)); } else { logoutMessage = CommonUtils.safeGetParameter(request, this.logoutParameterName, this.safeParameters); } logger.trace("Logout request:\n{}", logoutMessage); final String token = XmlUtils.getTextForElement(logoutMessage, "SessionIndex"); if (CommonUtils.isNotBlank(token)) { final HttpSession session = this.sessionMappingStorage.removeSessionByMappingId(token); if (session != null) { String sessionID = session.getId(); logger.debug("Invalidating session for token [{}]", sessionID, token); try { session.invalidate(); } catch (final IllegalStateException e) { logger.debug("Error invalidating session.", e); } try { request.logout(); } catch (final ServletException e) { logger.debug("Error performing request.logout."); } } } }</code><technical_language>prep for building a logout message handled strategy classes</technical_language>

Target:
private void destroySession(final HttpServletRequest request) { final String logoutMessage; if (isFrontChannelLogoutRequest(request)) { logoutMessage = uncompressLogoutMessage(CommonUtils.safeGetParameter(request, this.frontLogoutParameterName)); } else { logoutMessage = CommonUtils.safeGetParameter(request, this.logoutParameterName, this.safeParameters); } logger.trace("Logout request:\n{}", logoutMessage); final String token = XmlUtils.getTextForElement(logoutMessage, "SessionIndex"); if (CommonUtils.isNotBlank(token)) { final HttpSession session = this.sessionMappingStorage.removeSessionByMappingId(token); if (session != null) { String sessionID = session.getId(); logger.debug("Invalidating session for token [{}]", sessionID, token); try { session.invalidate(); } catch (final IllegalStateException e) { logger.debug("Error invalidating session.", e); } try { request.logout(); } catch (final ServletException e) { logger.debug("Error performing request.logout."); } } } }
Source:
<code>public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.card_template_editor, menu); <START> if (mModel.getInt("type") == 1) { <END> Timber.d("Editing cloze model, disabling add/delete card template functionality"); menu.findItem(R.id.action_add).setVisible(false); menu.findItem(R.id.action_delete).setVisible(false); } super.onCreateOptionsMenu(menu, inflater); }</code><technical_language>Consts.MODEL_CLOZE. Sadly this a suggestion needs import</technical_language>

Target:
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.card_template_editor, menu); if (mModel.getInt("type") == Consts.MODEL_CLOZE) { Timber.d("Editing cloze model, disabling add/delete card template functionality"); menu.findItem(R.id.action_add).setVisible(false); menu.findItem(R.id.action_delete).setVisible(false); } super.onCreateOptionsMenu(menu, inflater); }
Source:
<code>public void withdrawPatchUnauthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) .withName("Sub Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, child1) .withName("Collection 1").build(); Item item = ItemBuilder.createItem(context, col1) .withTitle("Public item 1") .withIssueDate("2017-10-17") .withAuthor("Smith, Donald").withAuthor("Doe, John") .withSubject("ExtraEntry") .build(); List<Operation> ops = new ArrayList<Operation>(); <START> ReplaceOperation replaceOperation = new ReplaceOperation("/withdrawn", "true"); <END> ops.add(replaceOperation); String patchBody = getPatchContent(ops); getClient().perform(patch("/api/core/items/" + item.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isUnauthorized()); String tokenAdmin = getAuthToken(eperson.getEmail(), password); getClient(tokenAdmin).perform(get("/api/core/items/" + item.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.uuid", Matchers.is(item.getID().toString()))) .andExpect(jsonPath("$.withdrawn", Matchers.is(false))) .andExpect(jsonPath("$.inArchive", Matchers.is(true))); }</code><technical_language>official true instead "true"</technical_language>

Target:
public void withdrawPatchUnauthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) .withName("Sub Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, child1) .withName("Collection 1").build(); Item item = ItemBuilder.createItem(context, col1) .withTitle("Public item 1") .withIssueDate("2017-10-17") .withAuthor("Smith, Donald").withAuthor("Doe, John") .withSubject("ExtraEntry") .build(); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/withdrawn", true); ops.add(replaceOperation); String patchBody = getPatchContent(ops); getClient().perform(patch("/api/core/items/" + item.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isUnauthorized()); String tokenAdmin = getAuthToken(eperson.getEmail(), password); getClient(tokenAdmin).perform(get("/api/core/items/" + item.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.uuid", Matchers.is(item.getID().toString()))) .andExpect(jsonPath("$.withdrawn", Matchers.is(false))) .andExpect(jsonPath("$.inArchive", Matchers.is(true))); }
Source:
<code>public Response handle() throws Exception { ServerSideSession session = getDriver().getSession(getRequest().getSession()); JSONObject payload = getRequest().getPayload(); String type = payload.getString("type"); WebDriverLog log = (WebDriverLog) session.getLogManager().getLog(type); <START> List<LogEntry> entries = (log == null ? null : log.getAndClearEntries()); <END> return createResponse(entries); }</code><technical_language>Return empty list (ImmutableList.of()), null, if log == null</technical_language>

Target:
public Response handle() throws Exception { ServerSideSession session = getDriver().getSession(getRequest().getSession()); JSONObject payload = getRequest().getPayload(); String type = payload.getString("type"); List<LogEntry> entries = session.getLogManager().getLog(type); return createResponse(entries); }