auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public synchronized void createIndexes( IndexRule... rules ) throws IOException <END> { IndexMap indexMap = indexMapRef.indexMapSnapshot(); IndexPopulationJob populationJob = null; for ( IndexRule rule : rules ) { long ruleId = rule.getId(); IndexProxy index = indexMap.getIndexProxy( ruleId ); if ( index != null && state == State.NOT_STARTED ) { indexMap.putIndexProxy( ruleId, index ); indexMapRef.setIndexMap( indexMap ); continue; } final IndexDescriptor descriptor = rule.getIndexDescriptor(); SchemaIndexProvider.Descriptor providerDescriptor = rule.getProviderDescriptor(); boolean flipToTentative = rule.canSupportUniqueConstraint(); if ( state == State.RUNNING ) { populationJob = populationJob == null ? newIndexPopulationJob() : populationJob; index = indexProxyCreator.createPopulatingIndexProxy( ruleId, descriptor, providerDescriptor, flipToTentative, monitor, populationJob ); index.start(); } else { index = indexProxyCreator.createRecoveringIndexProxy( descriptor, providerDescriptor ); } indexMap.putIndexProxy( rule.getId(), index ); } if ( populationJob != null ) { startIndexPopulation( populationJob ); } indexMapRef.setIndexMap( indexMap ); }</code><technical_language>createIndexes dropIndex synchronise IndexingService monitor lock I see. This means state in is inconsistently synchronised. If worried concurrent updates indexMapRef, synchronise that, do consistently. This synchronisation could, for instance, move IndexMapReference class exposed atomic update method takes a lambda, that</technical_language>

Target:
public void createIndexes( IndexRule... rules ) throws IOException { indexMapRef.modify( indexMap -> { IndexPopulationJob populationJob = null; for ( IndexRule rule : rules ) { long ruleId = rule.getId(); IndexProxy index = indexMap.getIndexProxy( ruleId ); if ( index != null && state == State.NOT_STARTED ) { indexMap.putIndexProxy( ruleId, index ); continue; } final IndexDescriptor descriptor = rule.getIndexDescriptor(); SchemaIndexProvider.Descriptor providerDescriptor = rule.getProviderDescriptor(); boolean flipToTentative = rule.canSupportUniqueConstraint(); if ( state == State.RUNNING ) { populationJob = populationJob == null ? newIndexPopulationJob() : populationJob; index = indexProxyCreator.createPopulatingIndexProxy( ruleId, descriptor, providerDescriptor, flipToTentative, monitor, populationJob ); index.start(); } else { index = indexProxyCreator.createRecoveringIndexProxy( descriptor, providerDescriptor ); } indexMap.putIndexProxy( rule.getId(), index ); } if ( populationJob != null ) { startIndexPopulation( populationJob ); } return indexMap; } ); }
Source:
<code>protected void run() throws Exception { <START> LsRemoteCommand command = Git.lsRemoteRepository().setRemote(remote); <END> TreeSet<Ref> refs = new TreeSet<Ref>(new Comparator<Ref>() { public int compare(Ref r1, Ref r2) { return r1.getName().compareTo(r2.getName()); } }); refs.addAll(command.call()); for (final Ref r : refs) { show(r.getObjectId(), r.getName()); if (r.getPeeledObjectId() != null) show(r.getPeeledObjectId(), r.getName() + "^{}"); } }</code><technical_language>handling "timeout" anymore</technical_language>

Target:
protected void run() throws Exception { LsRemoteCommand command = Git.lsRemoteRepository().setRemote(remote) .setTimeout(timeout); TreeSet<Ref> refs = new TreeSet<Ref>(new Comparator<Ref>() { public int compare(Ref r1, Ref r2) { return r1.getName().compareTo(r2.getName()); } }); refs.addAll(command.call()); for (final Ref r : refs) { show(r.getObjectId(), r.getName()); if (r.getPeeledObjectId() != null) show(r.getPeeledObjectId(), r.getName() + "^{}"); } }
Source:
<code>public StreamBlockQueue(String path, String nonce) throws java.io.IOException { m_persistentDeque = new PersistentBinaryDeque( nonce, new VoltFile(path), exportLog); m_path = path; m_nonce = nonce; m_reader = m_persistentDeque.openForRead(m_nonce); if (exportLog.isDebugEnabled()) { <START> exportLog.info(m_nonce + " At SBQ creation, PBD size is " <END> + (m_reader.sizeInBytes() - (StreamBlock.HEADER_SIZE * m_reader.getNumObjects()))); } }</code><technical_language>Do this INFO level</technical_language>

Target:
public StreamBlockQueue(String path, String nonce) throws java.io.IOException { m_persistentDeque = new PersistentBinaryDeque( nonce, new VoltFile(path), exportLog); m_path = path; m_nonce = nonce; m_reader = m_persistentDeque.openForRead(m_nonce); if (exportLog.isDebugEnabled()) { exportLog.debug(m_nonce + " At SBQ creation, PBD size is " + (m_reader.sizeInBytes() - (8 * m_reader.getNumObjects()))); } }
Source:
<code>private void init() { setTitle(ConstantsManager.getInstance().getConstants().editLogicalNetworkTitle()); setHelpTag(HelpTag.edit_logical_network); setHashName("edit_logical_network"); getName().setEntity(getNetwork().getName()); if (isManagemet()) { getName().setIsChangable(false); } getDescription().setEntity(getNetwork().getDescription()); getComment().setEntity(getNetwork().getComment()); getIsStpEnabled().setEntity(getNetwork().getStp()); getHasVLanTag().setEntity(getNetwork().getVlanId() != null); getVLanTag().setEntity((getNetwork().getVlanId() == null ? Integer.valueOf(0) : getNetwork().getVlanId())); initIsVm(); getExport().setEntity(getNetwork().isExternal()); getExport().setIsChangable(false); <START> initMtu(); <END> getExternalProviders().setIsChangable(false); getNetworkLabel().setSelectedItem(getNetwork().getLabel()); toggleProfilesAvailability(); }</code><technical_language>If correct flow of depends order of calls, is wrong. need change it</technical_language>

Target:
private void init() { setTitle(ConstantsManager.getInstance().getConstants().editLogicalNetworkTitle()); setHelpTag(HelpTag.edit_logical_network); setHashName("edit_logical_network"); getName().setEntity(getNetwork().getName()); if (isManagemet()) { getName().setIsChangable(false); } getDescription().setEntity(getNetwork().getDescription()); getComment().setEntity(getNetwork().getComment()); getIsStpEnabled().setEntity(getNetwork().getStp()); getHasVLanTag().setEntity(getNetwork().getVlanId() != null); getVLanTag().setEntity((getNetwork().getVlanId() == null ? Integer.valueOf(0) : getNetwork().getVlanId())); initMtu(); initIsVm(); getExport().setEntity(getNetwork().isExternal()); getExport().setIsChangable(false); getExternalProviders().setIsChangable(false); getNetworkLabel().setSelectedItem(getNetwork().getLabel()); toggleProfilesAvailability(); }
Source:
<code><START> public static List<Range> getCDSExonRanges(GeneChromosomePosition chromPos){ <END> if ( chromPos.getOrientation() == '+') return getCDSExonRangesForward(chromPos,CDS); return getCDSExonRangesReverse(chromPos,CDS); }</code><technical_language>Range parameterised, compiler warnings for it. for other occurrences</technical_language>

Target:
public static List<Range<Integer>> getCDSExonRanges(GeneChromosomePosition chromPos){ if ( chromPos.getOrientation() == '+') return getCDSExonRangesForward(chromPos,CDS); return getCDSExonRangesReverse(chromPos,CDS); }
Source:
<code>protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); final Layout layout = getLayout(); if (layout != null) { final int lineCount = layout.getLineCount(); if (lineCount == mMaxLines) { <START> if (layout.getEllipsisCount(lineCount - 1) > 0 && getTextSize() > mMinTextSizePx) { <END> final float textSize = getTextSize(); setTextSize(TypedValue.COMPLEX_UNIT_PX, (textSize - 2)); measure(widthMeasureSpec, heightMeasureSpec); } } } }</code><technical_language>if (lineCount == mMaxLines && layout.getEllipsisCount(lineCount - 1) > 0 && getTextSize() > mMinTextSizePx)</technical_language>

Target:
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); final Layout layout = getLayout(); if (layout != null) { final int lineCount = layout.getLineCount(); if (lineCount == MAX_LINES && layout.getEllipsisCount(lineCount - 1) > 0 && getTextSize() > mMinTextSizePx) { final float textSize = getTextSize(); setTextSize(TypedValue.COMPLEX_UNIT_PX, (textSize - 2)); measure(widthMeasureSpec, heightMeasureSpec); } } }
Source:
<code>public void setWinner(Team winner) { <START> this.nextGame.removeTeam(this.winner); <END> this.winner = winner; this.nextGame.addTeam(this.winner); }</code><technical_language>remove winning team this game add</technical_language>

Target:
public void setWinner(Team winner) { this.nextGame.removeTeam(this.winner); this.winner = winner; this.nextGame.addTeam(winner); }
Source:
<code>static void setExceptionHandler(Runnable runnable) { Thread.UncaughtExceptionHandler exceptionHandler = (t, e) -> { <START> log.error(String.format("Uncaught exception in thread (name=%s). Exiting process now.", t.getName(), e)); <END> e.printStackTrace(System.err); runnable.run(); }; Thread.setDefaultUncaughtExceptionHandler(exceptionHandler); }</code><technical_language>Remove "Exiting process now." message here, in runnable</technical_language>

Target:
static void setExceptionHandler(Runnable runnable) { Thread.UncaughtExceptionHandler exceptionHandler = (t, e) -> { log.error(String.format("Uncaught exception in thread (name=%s).", t.getName(), e)); e.printStackTrace(System.err); runnable.run(); }; Thread.setDefaultUncaughtExceptionHandler(exceptionHandler); }
Source:
<code>protected void run() throws UnloggedFailure { if (!loader.isRemoteInstallEnabled()) { <START> throw die("remote installation is disabled"); <END> } if (names != null && !names.isEmpty()) { loader.disablePlugins(Sets.newHashSet(names)); } }</code><technical_language>again, "remote installation..." a confusing error message remove a plugin</technical_language>

Target:
protected void run() throws UnloggedFailure { if (!loader.isRemoteInstallEnabled()) { throw die("remote plugin administration is disabled"); } if (names != null && !names.isEmpty()) { loader.disablePlugins(Sets.newHashSet(names)); } }
Source:
<code><START> private int getNumberOfCommas(ExpressionTree expression) { <END> int ret = 0; if (expression.is(Kind.COMMA_OPERATOR)) { BinaryExpressionTree binaryExpression = (BinaryExpressionTree) expression; ret = getNumberOfCommas(binaryExpression.leftOperand()) + 1; } return ret; }</code><technical_language>![MAJOR](<LINK_1> "getNumberOfCommas" a "static" method. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private int getNumberOfCommas(ExpressionTree expression) { int nbCommas = 0; if (expression.is(Kind.COMMA_OPERATOR)) { BinaryExpressionTree binaryExpression = (BinaryExpressionTree) expression; nbCommas = getNumberOfCommas(binaryExpression.leftOperand()) + 1; } return nbCommas; }
Source:
<code>private boolean isMvccRecoveryMessageRequired() { ClusterNode mvccCrdNode = null; if (mvccCrd != null && mvccCrd.nodeId() != null) mvccCrdNode = cctx.node(mvccCrd.nodeId()); return node.isClient() && mvccCrdNode != null && (cctx.kernalContext().coordinators().mvccEnabled() || <START> !IgniteFeatures.nodeSupports(mvccCrdNode, IgniteFeatures.MVCC_TX_RECOVERY_PROTOCOL_V2)); <END> }</code><technical_language>Please remind do need this all? Apache Ignite compatibility versions. get rid of feature check entirely, assume "always true"</technical_language>

Target:
private boolean isMvccRecoveryMessageRequired() { ClusterNode mvccCrdNode = null; if (mvccCrd != null && mvccCrd.nodeId() != null) mvccCrdNode = cctx.node(mvccCrd.nodeId()); return node.isClient() && mvccCrdNode != null && cctx.kernalContext().coordinators().mvccEnabled(); }
Source:
<code>public void invalidateSession( String subjectName, Function<HttpSession, String> sessionSubjectExtractor) { final List<AbstractSession> matchingSessions = getHttpSessionStream() .filter(s -> subjectName.equals(sessionSubjectExtractor.apply(s))) <START> .map(AbstractSession.class::cast) <END> .distinct() .collect(Collectors.toList()); for (AbstractSession matchingSession : matchingSessions) { idManager.removeSession(matchingSession); if (matchingSession.isValid()) { matchingSession.invalidate(); } } }</code><technical_language>note self: figure out filtering a key prevent linear search idManager.sessionMap.values() @coyotesqrl wants clue in I dig tomorrow</technical_language>

Target:
public void invalidateSession( String subjectName, Function<HttpSession, String> sessionSubjectExtractor) { final List<AbstractSession> matchingSessions = getHttpSessionStream() .filter(s -> subjectName.equals(sessionSubjectExtractor.apply(s))) .filter(AbstractSession.class::isInstance) .map(AbstractSession.class::cast) .distinct() .collect(Collectors.toList()); for (AbstractSession matchingSession : matchingSessions) { idManager.removeSession(matchingSession); if (matchingSession.isValid()) { matchingSession.invalidate(); } } }
Source:
<code>private static void setDisplayTeam(BattleFragment battleFragment, JSONObject object) throws JSONException { object = object.getJSONObject("side"); JSONArray team = object.getJSONArray("pokemon"); for (int i = 0; i < team.length(); i++) { JSONObject info = team.getJSONObject(i); PokemonInfo pkm = parsePokemonInfo(battleFragment, info); <START> if (battleFragment.getPlayer1Team().size() <= i) { <END> battleFragment.getPlayer1Team().add(pkm); } else { battleFragment.getPlayer1Team().set(i, pkm); } } }</code><technical_language>I method add(int index, E element)</technical_language>

Target:
private static void setDisplayTeam(BattleFragment battleFragment, JSONObject object) throws JSONException { object = object.getJSONObject("side"); JSONArray team = object.getJSONArray("pokemon"); for (int i = 0; i < team.length(); i++) { JSONObject info = team.getJSONObject(i); PokemonInfo pkm = parsePokemonInfo(battleFragment, info); battleFragment.getPlayer1Team().add(i, pkm); } }
Source:
<code>public void canHandleHoleInTail() { UUID streamID = UUID.randomUUID(); CorfuTable<String, String> corfuTable = getDefaultRuntime() .getObjectsView() .build() .setTypeToken(new TypeToken<CorfuTable<String, String>>() {}) .setStreamID(streamID) .open(); corfuTable.put("k1", "dog fox cat"); corfuTable.put("k2", "dog bat"); corfuTable.put("k3", "fox"); TokenResponse tokenResponse = getDefaultRuntime() .getSequencerView() .next(streamID); Token token = tokenResponse.getToken(); <START> getDefaultRuntime().getAddressSpaceView() <END> .write(tokenResponse, LogData.getHole(token)); for (int i = 0; i < ITERATIONS; i++) { getDefaultRuntime().getObjectsView().TXBuild() .type(TransactionType.SNAPSHOT) .snapshot(token) .build() .begin(); corfuTable.scanAndFilter(item -> true); getDefaultRuntime().getObjectsView().TXEnd(); } assertThat(((CorfuCompileProxy) ((ICorfuSMR) corfuTable). getCorfuSMRProxy()).getUnderlyingObject().getSmrStream().pos()).isEqualTo(3); }</code><technical_language>read address a hole</technical_language>

Target:
public void canHandleHoleInTail() { UUID streamID = UUID.randomUUID(); CorfuTable<String, String> corfuTable = getDefaultRuntime() .getObjectsView() .build() .setTypeToken(new TypeToken<CorfuTable<String, String>>() {}) .setStreamID(streamID) .open(); corfuTable.put("k1", "dog fox cat"); corfuTable.put("k2", "dog bat"); corfuTable.put("k3", "fox"); TokenResponse tokenResponse = getDefaultRuntime() .getSequencerView() .next(streamID); Token token = tokenResponse.getToken(); getDefaultRuntime().getAddressSpaceView() .write(tokenResponse, LogData.getHole(token)); assertThat(getDefaultRuntime().getAddressSpaceView() .read(token.getSequence()).isHole()).isTrue(); for (int i = 0; i < ITERATIONS; i++) { getDefaultRuntime().getObjectsView().TXBuild() .type(TransactionType.SNAPSHOT) .snapshot(token) .build() .begin(); corfuTable.scanAndFilter(item -> true); getDefaultRuntime().getObjectsView().TXEnd(); } assertThat(((CorfuCompileProxy) ((ICorfuSMR) corfuTable). getCorfuSMRProxy()).getUnderlyingObject().getSmrStream().pos()).isEqualTo(3); }
Source:
<code>static BufferedReader openReader(File inputFile) { BufferedReader in = null; <START> try { <END> in = new BufferedReader(new FileReader(inputFile)); } catch (Exception e) { logger.error("Can't open '" + inputFile + "' for input: " + e); System.exit(1); } return in; }</code><technical_language>exiting, STDERR</technical_language>

Target:
static BufferedReader openReader(File inputFile) { BufferedReader in = null; try { in = new BufferedReader(new FileReader(inputFile)); } catch (Exception e) { System.err.println("Can't open '" + inputFile + "' for input: " + e); System.exit(1); } return in; }
Source:
<code>public Object randomValue() { <START> return (boolean) ThreadLocalRandom.current().nextBoolean(); <END> }</code><technical_language>nit: redundant casting</technical_language>

Target:
public Object randomValue() { return ThreadLocalRandom.current().nextBoolean(); }
Source:
<code>public static BooleanStatus create() { BooleanStatus b = new BooleanStatus(false); AutoLoader a = new AutoLoader(); a.setShouldBeRunning(b); a.updateWhen(Igneous.globalPeriodic); <START> BooleanMixing.whenBooleanBecomes(b, false).send(new EventOutput() { <END> @Override public void event() { Elevator.elevatorControl.set(false); } }); return b; }</code><technical_language>Try onRelease</technical_language>

Target:
public static BooleanStatus create() { BooleanStatus b = new BooleanStatus(false); AutoLoader a = new AutoLoader(); a.setShouldBeRunning(b); a.updateWhen(Igneous.globalPeriodic); Elevator.elevatorControl.setFalseWhen(BooleanMixing.onRelease(b)); return b; }
Source:
<code>public void visitAnnotation(@DottedClassName String annotationClass, Map<String, ElementValue> map, boolean runtimeVisible) { if (!Objects.equal(annotationClass, "javax.persistence.Column")) { return; } ElementValue specifiedName = map.get("name"); if (specifiedName != null) { detectLongName(specifiedName.stringifyValue()); } else { <START> String columnName = getFieldName(); <END> detectLongName(columnName); } }</code><technical_language>I tested code, I this line throw exception. of course, write @Column(name = XXXXX) if behave correctly. @Column public String getLongColumnNameWitoutAnnotationParameter() { return longColumnNameWitoutAnnotationParameter; } note: I test this @column upper method grammar much, try, throw exception. JPA specification permit it</technical_language>

Target:
public void visitAnnotation(@DottedClassName String annotationClass, Map<String, ElementValue> map, boolean runtimeVisible) { if (!Objects.equal(annotationClass, "javax.persistence.Column")) { return; } ElementValue specifiedName = map.get("name"); final String columnName; if (specifiedName != null) { columnName = specifiedName.stringifyValue(); } else if (visitingField()){ columnName = getFieldName(); } else if (visitingMethod()) { Method targetMethod = getMethod(); columnName = findFieldWhichisVisitedIn(targetMethod); if (columnName == null) { throw new IllegalClassException(String.format( "Method which is annotated with @Column should access to field, but %s#%s does not access.", getClassContext().getClassDescriptor().getClassName().replace('/', '.'), targetMethod.getName())); } } else { throw new IllegalClassException("@Column should annotate method or field."); } detectLongName(columnName); }
Source:
<code>private void registerHll() { <START> String p = "asd"; <END> SketchDescriptor sd = new SketchDescriptor("hll"); sd.register(DATA_TO_SKETCH, org.apache.datasketches.hive.hll.DataToSketchUDAF.class); sd.register(SKETCH_TO_ESTIMATE_WITH_ERROR_BOUNDS, org.apache.datasketches.hive.hll.SketchToEstimateAndErrorBoundsUDF.class); sd.register(SKETCH_TO_ESTIMATE, org.apache.datasketches.hive.hll.SketchToEstimateUDF.class); sd.register(SKETCH_TO_STRING, org.apache.datasketches.hive.hll.SketchToStringUDF.class); sd.register(UNION_SKETCH1, org.apache.datasketches.hive.hll.UnionSketchUDF.class); sd.register(UNION_SKETCH, org.apache.datasketches.hive.hll.UnionSketchUDAF.class); sketchClasses.add(sd); }</code><technical_language>used</technical_language>

Target:
private void registerHll() { SketchDescriptor sd = new SketchDescriptor("hll"); sd.register(DATA_TO_SKETCH, org.apache.datasketches.hive.hll.DataToSketchUDAF.class); sd.register(SKETCH_TO_ESTIMATE_WITH_ERROR_BOUNDS, org.apache.datasketches.hive.hll.SketchToEstimateAndErrorBoundsUDF.class); sd.register(SKETCH_TO_ESTIMATE, org.apache.datasketches.hive.hll.SketchToEstimateUDF.class); sd.register(SKETCH_TO_STRING, org.apache.datasketches.hive.hll.SketchToStringUDF.class); sd.register(UNION_SKETCH1, org.apache.datasketches.hive.hll.UnionSketchUDF.class); sd.register(UNION_SKETCH, org.apache.datasketches.hive.hll.UnionSketchUDAF.class); sketchClasses.add(sd); }
Source:
<code>protected SchemaDescriptor initDefaultSchemaDescriptor() throws StandardException{ if(cachedInitialDefaultSchemaDescr==null){ DataDictionary dd=getDataDictionary(); if (defaultSchema != null) { <START> return dd.getSchemaDescriptor(defaultSchema, getTransactionCompile(), true); <END> } SchemaDescriptor sd= dd.getSchemaDescriptor( getSessionUserId(),getTransactionCompile(),false); if(sd==null){ sd=new SchemaDescriptor( dd, getSessionUserId(), getSessionUserId(), null, false); } cachedInitialDefaultSchemaDescr=sd; } return cachedInitialDefaultSchemaDescr; }</code><technical_language>I need set cachedInitialDefaultSchemaDescr returned schema descriptor returning function</technical_language>

Target:
protected SchemaDescriptor initDefaultSchemaDescriptor() throws StandardException{ if(cachedInitialDefaultSchemaDescr==null){ DataDictionary dd=getDataDictionary(); SchemaDescriptor sd; if (defaultSchema != null) { sd = dd.getSchemaDescriptor(defaultSchema, getTransactionCompile(), true); } else { sd = dd.getSchemaDescriptor( getSessionUserId(), getTransactionCompile(), false); } if(sd==null){ sd=new SchemaDescriptor( dd, getSessionUserId(), getSessionUserId(), null, false); } cachedInitialDefaultSchemaDescr=sd; } return cachedInitialDefaultSchemaDescr; }
Source:
<code>public SslContextBuilder keyManager(KeyManager keyManager) { <START> if (forServer) { <END> checkNotNull(keyManager, "keyManager required for servers"); } this.keyManagerFactory = new KeyManagerFactoryWrapper(keyManager); keyCertChain = null; key = null; keyPassword = null; return this; }</code><technical_language>forServer == false flow wrong. If null is passed, KeyManagerFactoryWrapper throw (and want keyManagerFactory null in case)</technical_language>

Target:
public SslContextBuilder keyManager(KeyManager keyManager) { if (forServer) { checkNotNull(keyManager, "keyManager required for servers"); } if (keyManager != null) { this.keyManagerFactory = new KeyManagerFactoryWrapper(keyManager); } else { this.keyManagerFactory = null; } keyCertChain = null; key = null; keyPassword = null; return this; }
Source:
<code>private static TypeConverter<?> create(TypeConverter elementConverter, Class type) { return value -> { <START> String[] elements = value.split(","); <END> Object[] ar = (Object[]) Array.newInstance(type, elements.length); for (int i = 0; i < elements.length; i++) { ar[i] = elementConverter.convert(elements[i]); } return ar; }; }</code><technical_language>possibility delimiter is else? also, wary of empty null values. Do protect converter scenarios</technical_language>

Target:
private static TypeConverter<?> create(TypeConverter elementConverter, Class type) { return value -> { value = value.trim(); if (value.isEmpty()) { return Array.newInstance(type, 0); } String[] elements = value.split(","); Object[] ar = (Object[]) Array.newInstance(type, elements.length); for (int i = 0; i < elements.length; i++) { ar[i] = elementConverter.convert(elements[i]); } return ar; }; }
Source:
<code>public void shouldAttemptToDeleteStateDirectoryWhenCloseDirtyAndEosEnabled() throws IOException { final IMocksControl ctrl = EasyMock.createStrictControl(); final ProcessorStateManager stateManager = ctrl.createMock(ProcessorStateManager.class); stateDirectory = ctrl.createMock(StateDirectory.class); stateManager.registerGlobalStateStores(Collections.emptyList()); EasyMock.expectLastCall(); EasyMock.expect(stateManager.taskId()).andReturn(taskId); stateManager.close(); EasyMock.expectLastCall(); EasyMock.expect(stateManager.baseDir()).andReturn(TestUtils.tempDirectory("state_store")); stateDirectory.unlock(taskId); EasyMock.expectLastCall(); ctrl.checkOrder(true); ctrl.replay(); task = createStatefulTask(createConfig(true, "100"), true, stateManager); task.transitionTo(Task.State.RESTORING); task.transitionTo(Task.State.RUNNING); <START> task.transitionTo(Task.State.SUSPENDED); <END> task.prepareCloseDirty(); task.closeDirty(); task = null; ctrl.verify(); }</code><technical_language>transit SUSPENDED prepare-closing? Originally want check CREATED state trigger close</technical_language>

Target:
public void shouldAttemptToDeleteStateDirectoryWhenCloseDirtyAndEosEnabled() throws IOException { final IMocksControl ctrl = EasyMock.createStrictControl(); final ProcessorStateManager stateManager = ctrl.createMock(ProcessorStateManager.class); stateDirectory = ctrl.createMock(StateDirectory.class); stateManager.registerGlobalStateStores(Collections.emptyList()); EasyMock.expectLastCall(); EasyMock.expect(stateManager.taskId()).andReturn(taskId); stateManager.close(); EasyMock.expectLastCall(); EasyMock.expect(stateManager.baseDir()).andReturn(TestUtils.tempDirectory("state_store")); stateDirectory.unlock(taskId); EasyMock.expectLastCall(); ctrl.checkOrder(true); ctrl.replay(); task = createStatefulTask(createConfig(true, "100"), true, stateManager); task.prepareCloseDirty(); task.closeDirty(); task = null; ctrl.verify(); }
Source:
<code>public boolean addGroupingPair(char start, char end) { if (started) { <START> return false; <END> } if (groupingPairs == null) { groupingPairs = new OneToOneMap<>(); } String startString = Character.toString(start); String endString = Character.toString(end); if (groupingPairs.containsKey(endString) || groupingPairs.containsValue(startString)) { return false; } String oldEnd = groupingPairs.get(startString); String oldStart = groupingPairs.getKeyFor(endString); if ((oldStart != null) && !oldStart.equals(startString) || (oldEnd != null) && !oldEnd.equals(endString)) { return false; } groupingPairs.put(startString, endString); return true; }</code><technical_language>throw IllegalStateException this point? I prefer funny business highly visible</technical_language>

Target:
public void addGroupingPair(char start, char end) { if (started) { throw new IllegalStateException( "Cannot add grouping pairs to the ParsingSeparator " + "once parsing has been started"); } if (groupingPairs == null) { groupingPairs = new OneToOneMap<>(); } String startString = Character.toString(start); String endString = Character.toString(end); if (groupingPairs.containsKey(endString) || groupingPairs.containsValue(startString)) { throw new IllegalStateException( "Cannot add grouping pairs to the ParsingSeparator " + "if a key or value has already been added as a separator"); } String oldEnd = groupingPairs.get(startString); String oldStart = groupingPairs.getKeyFor(endString); if ((oldStart != null) && !oldStart.equals(startString) || (oldEnd != null) && !oldEnd.equals(endString)) { throw new IllegalStateException( "Cannot add grouping pairs to the ParsingSeparator " + "if a key or value has already been added as a separator"); } groupingPairs.put(startString, endString); }
Source:
<code>public void initExecutor() { pageProviderService = Framework.getService(PageProviderService.class); <START> skipAggregates = ctx.getHttpHeaders().getRequestHeaders().getFirst(PageProvider.SKIP_AGGREGATES_PROP) != null; <END> }</code><technical_language>set true if is "true"</technical_language>

Target:
public void initExecutor() { pageProviderService = Framework.getService(PageProviderService.class); skipAggregates = Boolean.parseBoolean( ctx.getHttpHeaders().getRequestHeaders().getFirst(PageProvider.SKIP_AGGREGATES_PROP)); }
Source:
<code>public synchronized void forceServerSync() { if (started.get()) { try { this.jobDirectoryManifestCreatorService.invalidateCachedDirectoryManifest(jobDirectoryPath); <START> this.taskScheduler.schedule(this::pushManifest, Instant.now()); <END> } catch (Exception e) { log.error("Failed to force push a fresh manifest", e); } } }</code><technical_language>if want force this synchronous current thread instead of putting a scheduler? I a effort schedule soon possible</technical_language>

Target:
public synchronized Optional<ScheduledFuture<?>> forceServerSync() { if (started.get()) { try { this.jobDirectoryManifestCreatorService.invalidateCachedDirectoryManifest(jobDirectoryPath); return Optional.of(this.taskScheduler.schedule(this::pushManifest, Instant.now())); } catch (Exception e) { log.error("Failed to force push a fresh manifest", e); } } return Optional.empty(); }
Source:
<code>protected void configureServlets() { if (Boolean.valueOf(System.getenv("CHE_TRACING_ENABLED"))) { install(new org.eclipse.che.core.tracing.web.TracingWebModule()); } <START> if (Boolean.valueOf(System.getenv("CHE_WSMASTER_CORS_FILTER_ENABLED"))) { <END> final Map<String, String> corsFilterParams = new HashMap<>(); corsFilterParams.put("cors.allowed.origins", "*"); corsFilterParams.put( "cors.allowed.methods", "GET," + "POST," + "HEAD," + "OPTIONS," + "PUT," + "DELETE"); corsFilterParams.put( "cors.allowed.headers", "Content-Type," + "X-Requested-With," + "accept," + "Origin," + "Access-Control-Request-Method," + "Access-Control-Request-Headers"); corsFilterParams.put("cors.support.credentials", "true"); corsFilterParams.put("cors.preflight.maxage", "10"); bind(CorsFilter.class).in(Singleton.class); filter("/*").through(CorsFilter.class, corsFilterParams); } filter("/*").through(RequestIdLoggerFilter.class); serveRegex("^(?!/websocket.?)(.*)").with(GuiceEverrestServlet.class); install(new org.eclipse.che.swagger.deploy.BasicSwaggerConfigurationModule()); if (Boolean.valueOf(System.getenv("CHE_MULTIUSER"))) { configureMultiUserMode(); } else { configureSingleUserMode(); } }</code><technical_language>Env name is compliant other env names have. Consider CHE_CORS__FILTER_ENABLED CHE_CORS__FILTER__ENABLED</technical_language>

Target:
protected void configureServlets() { if (Boolean.valueOf(System.getenv("CHE_TRACING_ENABLED"))) { install(new org.eclipse.che.core.tracing.web.TracingWebModule()); } if (isCheCorsEnabled()) { filter("/*").through(CheCorsFilter.class); } filter("/*").through(RequestIdLoggerFilter.class); serveRegex("^(?!/websocket.?)(.*)").with(GuiceEverrestServlet.class); install(new org.eclipse.che.swagger.deploy.BasicSwaggerConfigurationModule()); if (Boolean.valueOf(System.getenv("CHE_MULTIUSER"))) { configureMultiUserMode(); } else { configureSingleUserMode(); } if (Boolean.valueOf(System.getenv("CHE_METRICS_ENABLED"))) { install(new org.eclipse.che.core.metrics.MetricsServletModule()); } }
Source:
<code>protected boolean isDeprecated() { if (isDeprecated == null) { <START> boolean isDeprecated = false; <END> if (parent instanceof AbstractProperty) { AbstractProperty absParent = (AbstractProperty) parent; isDeprecated = absParent.isDeprecated(); Property parentDeprecatedFallback = absParent.deprecatedFallback; if (isDeprecated && parentDeprecatedFallback != null) { deprecatedFallback = parentDeprecatedFallback.resolvePath(getName()); } } if (!isDeprecated) { String name = getXPath(); String schema = getSchema().getName(); SchemaManager schemaManager = Framework.getService(SchemaManager.class); isDeprecated = schemaManager.isPropertyDeprecated(schema, name); if (isDeprecated) { String fallback = schemaManager.getDeprecatedPropertyFallback(schema, name); if (fallback != null) { deprecatedFallback = resolvePath('/' + fallback); } } } this.isDeprecated = Boolean.valueOf(isDeprecated); } return isDeprecated.booleanValue(); }</code><technical_language>Please name local variable differently field, for instance deprecated, reading code is a bit confusing. This avoid this.isDeprecated a bit down</technical_language>

Target:
protected boolean isDeprecated() { if (isDeprecated == null) { boolean deprecated = false; if (parent instanceof AbstractProperty) { AbstractProperty absParent = (AbstractProperty) parent; deprecated = absParent.isDeprecated(); Property parentDeprecatedFallback = absParent.deprecatedFallback; if (deprecated && parentDeprecatedFallback != null) { deprecatedFallback = parentDeprecatedFallback.resolvePath(getName()); } } if (!deprecated) { String name = getXPath(); String schema = getSchema().getName(); SchemaManager schemaManager = Framework.getService(SchemaManager.class); PropertyDeprecationHandler deprecatedProperties = schemaManager.getDeprecatedProperties(); deprecated = deprecatedProperties.isMarked(schema, name); if (deprecated) { String fallback = deprecatedProperties.getFallback(schema, name); if (fallback != null) { deprecatedFallback = resolvePath('/' + fallback); } } } isDeprecated = Boolean.valueOf(deprecated); } return isDeprecated.booleanValue(); }
Source:
<code>public GatheringByteArrayInputStream(List<byte[]> buffers, long totalBytes) { checkArgument(totalBytes >= 0, "totalBytes should equal to or greater than 0"); this.buffers = requireNonNull(buffers, "buffers is null").iterator(); this.remainingBytes = totalBytes; currentBuffer = new byte[0]; currentBufferPosition = 0; <START> singleByte = new byte[1]; <END> }</code><technical_language>move initializations field definition</technical_language>

Target:
public GatheringByteArrayInputStream(List<byte[]> buffers, long totalBytes) { checkArgument(totalBytes >= 0, "totalBytes should equal to or greater than 0"); this.buffers = requireNonNull(buffers, "buffers is null").iterator(); this.remainingBytes = totalBytes; }
Source:
<code>public void displayHelp( PrintStream stdout ) { stdout.println(); PrintWriter pw = new PrintWriter( stdout ); HelpFormatter formatter = new HelpFormatter(); <START> formatter.printHelp( pw, 120, "mvn [options] [<goal(s)>] [<phase(s)>]", "\nOptions:", <END> options, HelpFormatter.DEFAULT_LEFT_PAD, HelpFormatter.DEFAULT_DESC_PAD, "\n", false ); pw.flush(); }</code><technical_language>is this a literal a static final? Ideally, calculate width of terminal, this is out of scope here</technical_language>

Target:
public void displayHelp( PrintStream stdout ) { stdout.println(); PrintWriter pw = new PrintWriter( stdout ); HelpFormatter formatter = new HelpFormatter(); formatter.printHelp( pw, HelpFormatter.DEFAULT_WIDTH, "mvn [options] [<goal(s)>] [<phase(s)>]", "\nOptions:", options, HelpFormatter.DEFAULT_LEFT_PAD, HelpFormatter.DEFAULT_DESC_PAD, "\n", false ); pw.flush(); }
Source:
<code>public void start() { if (!running) { ChannelBindingServiceProperties channelBindingServiceProperties = null; try { ChannelBindingService channelBindingService = this.applicationContext .getBean(ChannelBindingService.class); channelBindingServiceProperties = channelBindingService.getChannelBindingServiceProperties(); Map<String, Bindable> bindables = this.applicationContext.getBeansOfType(Bindable.class); for (Bindable bindable : bindables.values()) { bindable.bindOutputs(channelBindingService); } } catch (BeansException e) { throw new IllegalStateException( "Cannot perform binding, no proper implementation found", e); } <START> if (channelBindingServiceProperties != null && channelBindingServiceProperties.isAutoStartup()) { <END> this.running = true; this.applicationContext.start(); } } }</code><technical_language><LINK_0> context autostart optional</technical_language>

Target:
public void start() { if (!running) { try { ChannelBindingService channelBindingService = this.applicationContext .getBean(ChannelBindingService.class); Map<String, Bindable> bindables = this.applicationContext.getBeansOfType(Bindable.class); for (Bindable bindable : bindables.values()) { bindable.bindOutputs(channelBindingService); } } catch (BeansException e) { throw new IllegalStateException( "Cannot perform binding, no proper implementation found", e); } this.running = true; if (channelBindingServiceProperties != null && channelBindingServiceProperties.isAutoStartContext()) { this.applicationContext.start(); } } }
Source:
<code>private void handleAllocation(RequestMsg req, ChannelHandlerContext ctx, IServerRouter r) { final TokenRequestMsg tokenRequest = req.getPayload().getTokenRequest(); long newTail = globalLogTail + tokenRequest.getNumTokens(); ImmutableMap.Builder<UUID, Long> backPointerMap = ImmutableMap.builder(); for (UuidMsg id : tokenRequest.getStreamsList()) { streamTailToGlobalTailMap.compute(getUUID(id), (k, v) -> { if (v == null) { backPointerMap.put(k, Address.NON_EXIST); return newTail - 1; } else { backPointerMap.put(k, v); return newTail - 1; } }); streamsAddressMap.compute(getUUID(id), (streamId, addressMap) -> { if (addressMap == null) { addressMap = new StreamAddressSpace( Address.NON_ADDRESS, new Roaring64NavigableMap() ); } for (long i = globalLogTail; i < newTail; i++) { addressMap.addAddress(i); } return addressMap; }); } if (tokenRequest.hasTxnResolution()) { tokenRequest.getTxnResolution().getWriteConflictParamsSetList() .forEach((item) -> { item.getValueList().forEach(conflictParam -> cache.put(new ConflictTxStream(getUUID(item.getKey()), conflictParam.toByteArray(), newTail - 1))); }); } <START> log.trace("handleAllocation: token={} backpointers={}", globalLogTail, backPointerMap.build()); <END> Token newToken = new Token(sequencerEpoch, globalLogTail); globalLogTail = newTail; ResponseMsg response = getResponseMsg( req.getHeader(), getTokenResponseMsg(newToken, backPointerMap.build())); r.sendResponse(response, ctx); }</code><technical_language>wrap this log.isTraceEnabled</technical_language>

Target:
private void handleAllocation(RequestMsg req, ChannelHandlerContext ctx, IServerRouter r) { final TokenRequestMsg tokenRequest = req.getPayload().getTokenRequest(); long newTail = globalLogTail + tokenRequest.getNumTokens(); ImmutableMap.Builder<UUID, Long> backPointerMap = ImmutableMap.builder(); for (UuidMsg id : tokenRequest.getStreamsList()) { UUID uuid = getUUID(id); streamTailToGlobalTailMap.compute(uuid, (k, v) -> { if (v == null) { backPointerMap.put(k, Address.NON_EXIST); return newTail - 1; } else { backPointerMap.put(k, v); return newTail - 1; } }); streamsAddressMap.compute(uuid, (streamId, addressMap) -> { if (addressMap == null) { addressMap = new StreamAddressSpace( Address.NON_ADDRESS, new Roaring64NavigableMap() ); } for (long i = globalLogTail; i < newTail; i++) { addressMap.addAddress(i); } return addressMap; }); } if (tokenRequest.hasTxnResolution()) { tokenRequest.getTxnResolution().getWriteConflictParamsSetList() .forEach((item) -> { item.getValueList().forEach(conflictParam -> cache.put(new ConflictTxStream(getUUID(item.getKey()), conflictParam.toByteArray(), newTail - 1))); }); } if (log.isTraceEnabled()) { log.trace("handleAllocation: token={} backpointers={}", globalLogTail, backPointerMap.build()); } Token newToken = new Token(sequencerEpoch, globalLogTail); globalLogTail = newTail; ResponseMsg response = getResponseMsg( req.getHeader(), getTokenResponseMsg(newToken, backPointerMap.build())); r.sendResponse(response, ctx); }
Source:
<code>private List<String> getPaths(String pathWithWildcard) { String pattern = "**" + pathWithWildcard; PathMatcher pathMatcher = FileSystems.getDefault().getPathMatcher("glob:" + pattern); Path startPath = Paths.get(""); try { List<String> paths = Files.find(startPath, Integer.MAX_VALUE, (path, basicFileAttributes) -> pathMatcher.matches(path)) <START> .filter(path -> path.toString().contains(".jar")) <END> .map(Path::toString) .collect(Collectors.toList()); if (paths == null || paths.isEmpty()) { throw new IllegalStateException("Cannot find any jars files in selected path"); } return paths; } catch (IOException e) { throw new IllegalStateException("Cannot find any jars files in selected path"); } }</code><technical_language>this right</technical_language>

Target:
private List<String> getPaths(String pathWithWildcard) { String pathWithoutWildcards = pathWithWildcard.replace("*", ""); try { List<String> paths = Files.list(Paths.get(pathWithoutWildcards)) .map(Path::toString) .filter(path -> path.toLowerCase().endsWith(".jar")) .collect(Collectors.toList()); if (paths == null || paths.isEmpty()) { throw new IllegalStateException("Cannot find any jars files in selected path"); } return paths; } catch (IOException e) { throw new IllegalStateException("Cannot find any jars files in selected path"); } }
Source:
<code>public void getAllNonEmptyEntitylessAttributesByNameWhenOnlyDefinitionExists() throws Exception { System.out.println(CLASS_NAME + "getAllNonEmptyEntitylessAttributesByNameWhenOnlyDefinitionExists"); Attribute entitylessAttr = setUpEntitylessAttribute(); AttributeDefinition entitylessAttrDef = setUpEntitylessAttributeDefinition(); cacheManager.setEntitylessAttribute(entitylessAttr, subject); List<Attribute> attrs = cacheManager.getAllNonEmptyEntitylessAttributesByName(entitylessAttrDef.getName()); <START> assertTrue("result should not contain entityless attribute definition", !attrs.contains(new Attribute(entitylessAttrDef))); <END> assertTrue("there should be no returned attributes", attrs.isEmpty()); }</code><technical_language>above</technical_language>

Target:
public void getAllNonEmptyEntitylessAttributesByNameWhenOnlyDefinitionExists() throws Exception { System.out.println(CLASS_NAME + "getAllNonEmptyEntitylessAttributesByNameWhenOnlyDefinitionExists"); Attribute entitylessAttr = setUpEntitylessAttribute(); AttributeDefinition entitylessAttrDef = setUpEntitylessAttributeDefinition(); cacheManager.setEntitylessAttribute(entitylessAttr, subject); List<Attribute> attrs = cacheManager.getAllNonEmptyEntitylessAttributesByName(entitylessAttrDef.getName()); assertTrue("result should not contain entityless attribute definition", !attrs.contains(entitylessAttrDef)); assertTrue("there should be no returned attributes", attrs.isEmpty()); }
Source:
<code><START> boolean deregisterIndexGauges(String storeId) { <END> String prefix = storeId + SEPERATOR; return registry.remove(MetricRegistry.name(Log.class, prefix + "CurrentCapacityUsed")) && registry.remove( MetricRegistry.name(Log.class, prefix + "PercentageUsedCapacity")) && registry.remove( MetricRegistry.name(Log.class, prefix + "CurrentSegmentCount")); }</code><technical_language>this function private</technical_language>

Target:
private boolean deregisterIndexGauges(String storeId) { String prefix = storeId + SEPERATOR; return registry.remove(MetricRegistry.name(Log.class, prefix + "CurrentCapacityUsed")) && registry.remove( MetricRegistry.name(Log.class, prefix + "PercentageUsedCapacity")) && registry.remove( MetricRegistry.name(Log.class, prefix + "CurrentSegmentCount")); }
Source:
<code>private String getLabel(Viewer viewer, Object e1) { <START> String name1; <END> if (viewer == null || !(viewer instanceof ContentViewer)) { name1 = e1.toString(); } else { IBaseLabelProvider prov = ((ContentViewer) viewer) .getLabelProvider(); if (prov instanceof ILabelProvider) { ILabelProvider lprov = (ILabelProvider) prov; name1 = lprov.getText(e1); } else { name1 = e1.toString(); } } if (name1 == null) { name1 = ""; } return name1; }</code><technical_language>call variable "label" "name1"</technical_language>

Target:
private String getLabel(Viewer viewer, Object e1) { String name; if (viewer == null || !(viewer instanceof ContentViewer)) { name = e1.toString(); } else { IBaseLabelProvider prov = ((ContentViewer) viewer) .getLabelProvider(); if (prov instanceof ILabelProvider) { ILabelProvider lprov = (ILabelProvider) prov; name = lprov.getText(e1); } else { name = e1.toString(); } } if (name == null) { name = ""; } return name; }
Source:
<code>private Long convertToLong(Serializable identifier) { <START> return Long.valueOf(identifier.toString()); <END> }</code><technical_language>I this is right. fall conversion service if do it: suggestion if (canConvertFromStringTo(Long.class)) { idAsLong = conversionService.convert(identitifier, Long.class); } else { idAsLong = Long.valueOf(identifier.toString()); } return isAsLong;</technical_language>

Target:
private Long convertToLong(Serializable identifier) { Long idAsLong; if (canConvertFromStringTo(Long.class)) { idAsLong = conversionService.convert(identifier, Long.class); } else { idAsLong = Long.valueOf(identifier.toString()); } return idAsLong; }
Source:
<code>public boolean onBackPressed() { LocalPictureListFragment curPage = (LocalPictureListFragment)((TabsAdapter)getViewPager().getAdapter()) .getStoredFragment(getViewPager().getCurrentItem()); <START> if ((curPage != null) && !curPage.atRootDirectory()) { <END> curPage.onBackPressed(); return true; } return false; }</code><technical_language>atRootDirectory check is faulty. I get a loop pressing music tab (currently test)</technical_language>

Target:
public boolean onBackPressed() { LocalMediaFileListFragment curPage = (LocalMediaFileListFragment)((TabsAdapter)getViewPager().getAdapter()) .getStoredFragment(getViewPager().getCurrentItem()); if ((curPage != null) && !curPage.atRootDirectory()) { curPage.onBackPressed(); return true; } return false; }
Source:
<code>private void validateRazEnablement(SdxClusterRequest sdxClusterRequest, DetailedEnvironmentResponse environment) { ValidationResultBuilder validationBuilder = new ValidationResultBuilder(); <START> boolean razEntitlement = entitlementService.razEnabled(environment.getCreator(), Crn.safeFromString(environment.getCreator()).getAccountId()); <END> if (sdxClusterRequest.isEnableRangerRaz()) { if (!razEntitlement) { validationBuilder.error("Provisioning Ranger Raz is not enabled for this account."); } if (!AZURE.name().equalsIgnoreCase(environment.getCloudPlatform())) { validationBuilder.error("Provisioning Ranger Raz is only valid for Microsft Azure."); } } ValidationResult validationResult = validationBuilder.build(); if (validationResult.hasError()) { throw new BadRequestException(validationResult.getFormattedErrors()); } }</code><technical_language>razEntitlementEnabled</technical_language>

Target:
private void validateRazEnablement(SdxClusterRequest sdxClusterRequest, DetailedEnvironmentResponse environment) { ValidationResultBuilder validationBuilder = new ValidationResultBuilder(); if (sdxClusterRequest.isEnableRangerRaz()) { boolean razEntitlementEnabled = entitlementService.razEnabled(environment.getCreator(), Crn.safeFromString(environment.getCreator()).getAccountId()); if (!razEntitlementEnabled) { validationBuilder.error("Provisioning Ranger Raz is not enabled for this account."); } if (!AZURE.name().equalsIgnoreCase(environment.getCloudPlatform())) { validationBuilder.error("Provisioning Ranger Raz is only valid for Microsft Azure."); } if (!isRazSupported(sdxClusterRequest.getRuntime())) { validationBuilder.error("Provisioning Ranger Raz is only valid for CM version > 7.2.0 and not " + sdxClusterRequest.getRuntime()); } } ValidationResult validationResult = validationBuilder.build(); if (validationResult.hasError()) { throw new BadRequestException(validationResult.getFormattedErrors()); } }
Source:
<code>private void loadSubscriptions() { if (disposable != null) { disposable.dispose(); } emptyView.hide(); progressBar.setVisibility(View.VISIBLE); disposable = Observable.fromCallable(DBReader::getNavDrawerData) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { navDrawerData = result; subscriptionAdapter.notifyDataSetChanged(); emptyView.updateVisibility(); progressBar.setVisibility(View.GONE); }, error -> Log.e(TAG, Log.getStackTraceString(error))); if (UserPreferences.getFeedFilter() != UserPreferences.FEED_FILTER_NONE) filterMsg.setVisibility(View.VISIBLE); else <START> filterMsg.setVisibility(View.GONE); <END> }</code><technical_language>Please add braces. more checkstyle violations, please a output of static-analysis CI task</technical_language>

Target:
private void loadSubscriptions() { if (disposable != null) { disposable.dispose(); } emptyView.hide(); progressBar.setVisibility(View.VISIBLE); disposable = Observable.fromCallable(DBReader::getNavDrawerData) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { navDrawerData = result; subscriptionAdapter.notifyDataSetChanged(); emptyView.updateVisibility(); progressBar.setVisibility(View.GONE); }, error -> Log.e(TAG, Log.getStackTraceString(error))); if (UserPreferences.getFeedFilter() != UserPreferences.FEED_FILTER_NONE) { feedsFilteredMsg.setText("{md-info-outline} " + getString(R.string.subscriptions_are_filtered)); Iconify.addIcons(feedsFilteredMsg); feedsFilteredMsg.setVisibility(View.VISIBLE); } else { feedsFilteredMsg.setVisibility(View.GONE); } }