auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public StreamingResponseBody streamEvents( @PathVariable("subscription_id") final String subscriptionId, @Nullable @RequestParam(value = "max_uncommitted_events", required = false) final Integer maxUncommittedEvents, @Nullable @RequestParam(value = "batch_limit", required = false) final Integer batchLimit, @Nullable @RequestParam(value = "stream_limit", required = false) final Long streamLimit, @Nullable @RequestParam(value = "batch_flush_timeout", required = false) final Integer batchTimeout, @Nullable @RequestParam(value = "stream_timeout", required = false) final Long streamTimeout, @Nullable @RequestParam(value = "stream_keep_alive_limit", required = false) final Integer streamKeepAliveLimit, final HttpServletRequest request, final HttpServletResponse response, final Client client) <START> throws IOException, UnprocessableEntityException { <END> final UserStreamParameters userParameters = new UserStreamParameters(batchLimit, streamLimit, batchTimeout, streamTimeout, streamKeepAliveLimit, maxUncommittedEvents, ImmutableList.of()); final StreamParameters streamParameters = StreamParameters.of(userParameters, nakadiSettings.getDefaultCommitTimeoutSeconds(), client); return stream(subscriptionId, request, response, client, streamParameters); }</code><technical_language>IOException UnprocessableEntityException thrown, is difference previous method, throws UnprocessableEntityException</technical_language>

Target:
public StreamingResponseBody streamEvents( @PathVariable("subscription_id") final String subscriptionId, @Nullable @RequestParam(value = "max_uncommitted_events", required = false) final Integer maxUncommittedEvents, @Nullable @RequestParam(value = "batch_limit", required = false) final Integer batchLimit, @Nullable @RequestParam(value = "stream_limit", required = false) final Long streamLimit, @Nullable @RequestParam(value = "batch_flush_timeout", required = false) final Integer batchTimeout, @Nullable @RequestParam(value = "stream_timeout", required = false) final Long streamTimeout, @Nullable @RequestParam(value = "stream_keep_alive_limit", required = false) final Integer streamKeepAliveLimit, final HttpServletRequest request, final HttpServletResponse response, final Client client) { final UserStreamParameters userParameters = new UserStreamParameters(batchLimit, streamLimit, batchTimeout, streamTimeout, streamKeepAliveLimit, maxUncommittedEvents, ImmutableList.of()); final StreamParameters streamParameters = StreamParameters.of(userParameters, nakadiSettings.getDefaultCommitTimeoutSeconds(), client); return stream(subscriptionId, request, response, client, streamParameters); }
Source:
<code>private Iterable<String> xemblyList(final int count) { final Collection<String> xemblies = new ArrayList<String>(); for (int idx = 0; idx < count; ++idx) { <START> xemblies.add("χemβly 'line"); <END> } return xemblies; }</code><technical_language>XemblyLine for exact formatting.</technical_language>

Target:
private Iterable<String> xemblyList(final int count) { final Collection<String> xemblies = new ArrayList<String>(); for (int idx = 0; idx < count; ++idx) { xemblies.add(this.xembly()); } return xemblies; }
Source:
<code>private void refreshInfoBar() { String info = queue.size() + getString(R.string.episodes_suffix); if(queue.size() > 0) { long timeLeft = 0; for(FeedItem item : queue) { float playbackSpeed = item.getFeedPlaybackSpeed(); if (playbackSpeed == SPEED_USE_GLOBAL) { <START> playbackSpeed = UserPreferences.getPlaybackSpeed(); <END> } if(item.getMedia() != null) { timeLeft += (long) ((item.getMedia().getDuration() - item.getMedia().getPosition()) / playbackSpeed); } } info += " \u2022 "; info += getString(R.string.time_left_label); info += Converter.getDurationStringLocalized(getActivity(), timeLeft); } infoBar.setText(info); }</code><technical_language>Video audio. UserPreferences.getPlaybackSpeed changed accept media type parameter. is longer forget video speed anywhere. Additionally, name "getPlaybackSpeed" is a bit misleading. "getGlobalPlaybackSpeed"? I work this is</technical_language>

Target:
private void refreshInfoBar() { String info = queue.size() + getString(R.string.episodes_suffix); if(queue.size() > 0) { long timeLeft = 0; for(FeedItem item : queue) { float playbackSpeed = PlaybackSpeedHelper.getCurrentPlaybackSpeed(item.getMedia()); if(item.getMedia() != null) { timeLeft += (long) ((item.getMedia().getDuration() - item.getMedia().getPosition()) / playbackSpeed); } } info += " • "; info += getString(R.string.time_left_label); info += Converter.getDurationStringLocalized(getActivity(), timeLeft); } infoBar.setText(info); }
Source:
<code>public PDataType getDataType() { <START> return children.get(0).getDataType(); <END> }</code><technical_language>This return PDataType for element of array</technical_language>

Target:
public PDataType getDataType() { return PDataType.fromTypeId(children.get(0).getDataType().getSqlType() - Types.ARRAY); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.reportProblemMenuItem) { if (getActivity() instanceof BookingActivity) { BookingActivity a = (BookingActivity)getActivity(); CollectBookingFeedbackCommand handler = a.reportProblemHandler(); if (handler != null) { viewModel.reportProblem(handler, new CollectBookingFeedbackCommand.Param(getActivity())) .takeUntil(lifecycle().onDestroy()) .subscribe(new Action1<Config>() { @Override public void call(Config config) { UserVoice.init(config, getActivity()); <START> UserVoice.launchContactUs(getActivity()); <END> } }, ErrorActions.showUnexpectedError(getActivity())); } } return true; } else { return super.onOptionsItemSelected(item); } }</code><technical_language>UserVoice stuff belong app logic instead of library logic</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.reportProblemMenuItem) { if (getActivity() instanceof BookingActivity) { BookingActivity a = (BookingActivity) getActivity(); a.reportProblem(); } return true; } else { return super.onOptionsItemSelected(item); } }
Source:
<code>private Connection getConnection() { <START> Connection connection = conn.get(); <END> try { connection.setAutoCommit(true); return connection; } catch (SQLException e) { throw new RuntimeException(e); } }</code><technical_language>is unheard of for a connection db server fail. attempt retry failing</technical_language>

Target:
private Connection getConnection() { Connection connection = conn.get(); try { connection.setAutoCommit(true); connection.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE); return connection; } catch (SQLException e) { throw new RuntimeException(e); } }
Source:
<code>public static Map<Integer, SubQueryPlan> instantiate(final List<PlanFragmentEncoding> fragments, final ConstructArgs args) throws CatalogException { int idx = 0; for (PlanFragmentEncoding fragment : fragments) { fragment.setFragmentIndex(idx++); } sanityCheckEdges(fragments); assignWorkersToFragments(fragments, args); Map<Integer, PlanFragmentEncoding> op2OwnerFragmentMapping = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { for (OperatorEncoding<?> op : fragment.operators) { op2OwnerFragmentMapping.put(op.opId, fragment); } } Map<Integer, Operator> allOperators = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { instantiateFragmentOperators(fragment, args, allOperators); } int loopCount = 0; while (setConsumerSchema(fragments, allOperators) && loopCount++ < allOperators.size()) { } <START> Preconditions.checkArgument(loopCount < allOperators.size()); <END> Map<Integer, SubQueryPlan> plan = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { RootOperator op = instantiateFragment(fragment, args, allOperators); for (Integer worker : fragment.workers) { if (!plan.containsKey(worker)) { plan.put(worker, new SubQueryPlan()); } SubQueryPlan workerPlan = plan.get(worker); workerPlan.addRootOp(op); } } return plan; }</code><technical_language>If preceding loop terminates loopCount == allOperators.size(), post-increment violate this invariant (actually I loopCount == allOperators.size()+1)? note setConsumerSchema() called allOperators.size()+1 times, part of conjunction is evaluated part. This fixed swapping parts of conjunction force short-circuiting</technical_language>

Target:
public static Map<Integer, SubQueryPlan> instantiate( final List<PlanFragmentEncoding> fragments, final ConstructArgs args) throws CatalogException { int idx = 0; for (PlanFragmentEncoding fragment : fragments) { fragment.setFragmentIndex(idx++); } sanityCheckEdges(fragments); assignWorkersToFragments(fragments, args); Map<Integer, PlanFragmentEncoding> op2OwnerFragmentMapping = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { for (OperatorEncoding<?> op : fragment.operators) { op2OwnerFragmentMapping.put(op.opId, fragment); } } Map<Integer, Operator> allOperators = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { instantiateFragmentOperators(fragment, args, allOperators); } int loopCount = 0; while (setConsumerSchema(fragments, allOperators)) { loopCount++; if (loopCount == allOperators.size()) { break; } } Preconditions.checkArgument(loopCount <= allOperators.size()); Map<Integer, SubQueryPlan> plan = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { RootOperator op = instantiateFragment(fragment, args, allOperators); for (Integer worker : fragment.workers) { if (!plan.containsKey(worker)) { plan.put(worker, new SubQueryPlan()); } SubQueryPlan workerPlan = plan.get(worker); workerPlan.addRootOp(op); } } return plan; }
Source:
<code>private void setUpLayout() { LinearLayout widgetLayout = new LinearLayout(getContext()); widgetLayout.setOrientation(LinearLayout.VERTICAL); chooseFileButton = getSimpleButton(getContext().getString(R.string.choose_file)); chooseFileButton.setEnabled(!getFormEntryPrompt().isReadOnly()); answerLayout = new LinearLayout(getContext()); answerLayout.setOrientation(LinearLayout.HORIZONTAL); answerLayout.setGravity(Gravity.CENTER); ImageView attachmentImg = new ImageView(getContext()); attachmentImg.setImageResource(R.drawable.ic_attachment); chosenFileNameTextView = getAnswerTextView(binaryName); chosenFileNameTextView.setGravity(Gravity.CENTER); answerLayout.addView(attachmentImg); answerLayout.addView(chosenFileNameTextView); answerLayout.setVisibility(binaryName == null ? GONE : VISIBLE); answerLayout.setOnClickListener(view -> openFile()); widgetLayout.addView(chooseFileButton); widgetLayout.addView(answerLayout); Resources resources = this.getResources(); int marginStandard = dpFromPx(getContext(), resources.getDimensionPixelSize(R.dimen.margin_standard)); <START> int margin = marginStandard - FIELD_HORIZONTAL_MARGIN_MODIFIER; <END> addAnswerView(widgetLayout, margin); }</code><technical_language>This FIELD_HORIZONTAL_MARGIN_MODIFIER StringWidget margin smaller be. modify standard margin widgets feel need it? If StringWidget needs move constant else</technical_language>

Target:
private void setUpLayout() { LinearLayout widgetLayout = new LinearLayout(getContext()); widgetLayout.setOrientation(LinearLayout.VERTICAL); chooseFileButton = getSimpleButton(getContext().getString(R.string.choose_file)); chooseFileButton.setEnabled(!getFormEntryPrompt().isReadOnly()); answerLayout = new LinearLayout(getContext()); answerLayout.setOrientation(LinearLayout.HORIZONTAL); answerLayout.setGravity(Gravity.CENTER); ImageView attachmentImg = new ImageView(getContext()); attachmentImg.setImageResource(R.drawable.ic_attachment); chosenFileNameTextView = getAnswerTextView(binaryName); chosenFileNameTextView.setGravity(Gravity.CENTER); answerLayout.addView(attachmentImg); answerLayout.addView(chosenFileNameTextView); answerLayout.setVisibility(binaryName == null ? GONE : VISIBLE); answerLayout.setOnClickListener(view -> openFile()); widgetLayout.addView(chooseFileButton); widgetLayout.addView(answerLayout); addAnswerView(widgetLayout); }
Source:
<code>public UsageDetailMode getItemResultBehaviorMode() { final UsageDetailMode mode = staticConfig.getItemResultBehaviorMode(); <START> if (mode.compareTo(UsageDetailMode.AGGREGATE) != 0 || mode.compareTo(UsageDetailMode.DETAIL) != 0) { <END> return UsageDetailMode.AGGREGATE; } return mode; }</code><technical_language>simplify (use ==)</technical_language>

Target:
public UsageDetailMode getItemResultBehaviorMode() { final UsageDetailMode mode = staticConfig.getItemResultBehaviorMode(); if (mode == UsageDetailMode.AGGREGATE || mode == UsageDetailMode.DETAIL) { return mode; } return UsageDetailMode.AGGREGATE; }
Source:
<code>private <T> T withHandle(Fn.Function<Long, T> fn, T def) { synchronized (lock) { if (handle != 0) { return fn.apply(handle); } <START> Log.w(LogDomain.DATABASE, "Function called on freed object", new Exception()); <END> return def; } }</code><technical_language>new Exception() here</technical_language>

Target:
private <T> T withHandle(Fn.Function<Long, T> fn, T def) { synchronized (lock) { if (handle != 0) { return fn.apply(handle); } Log.w(LogDomain.DATABASE, "Function called on freed C4Document", new Exception()); return def; } }
Source:
<code>public void testLoadOnlyOnce() throws Exception { Assert.assertTrue(manager.getKnownIDs().isEmpty()); ConcurrentMap<String, String> map = new ConcurrentHashMap<>(); <START> Callable<String> populator; <END> String v = factory.populateCache(id, namespace, null, map); Assert.assertEquals("bar", map.get("foo")); Assert.assertEquals(null, map.get("baz")); Assert.assertNotNull(v); String v2 = factory.populateCache(id, namespace, v, map); Assert.assertEquals(v, v2); Assert.assertEquals("bar", map.get("foo")); Assert.assertEquals(null, map.get("baz")); }</code><technical_language>unused</technical_language>

Target:
public void testLoadOnlyOnce() throws Exception { Assert.assertTrue(manager.getKnownIDs().isEmpty()); ConcurrentMap<String, String> map = new ConcurrentHashMap<>(); String v = factory.populateCache(id, namespace, null, map); Assert.assertEquals("bar", map.get("foo")); Assert.assertEquals(null, map.get("baz")); Assert.assertNotNull(v); String v2 = factory.populateCache(id, namespace, v, map); Assert.assertEquals(v, v2); Assert.assertEquals("bar", map.get("foo")); Assert.assertEquals(null, map.get("baz")); }
Source:
<code>public final Object convert(Object source, ParameterContext context) throws ArgumentConversionException { if (!sourceType.isAssignableFrom(source.getClass())) { throw new ArgumentConversionException("Can only convert objects of type " + sourceType); } if (!targetType.isAssignableFrom(context.getParameter().getType())) { throw new ArgumentConversionException("Can only convert to type " + targetType); } <START> return convert((S) source); <END> }</code><technical_language>@SuppressWarnings avoided via: suggestion return convert(sourceType.cast(source));</technical_language>

Target:
public final Object convert(Object source, ParameterContext context) throws ArgumentConversionException { if (!sourceType.isAssignableFrom(source.getClass())) { throw new ArgumentConversionException("Can only convert objects of type " + sourceType); } if (!targetType.isAssignableFrom(context.getParameter().getType())) { throw new ArgumentConversionException("Can only convert to type " + targetType); } return convert(sourceType.cast(source)); }
Source:
<code><START> String serializeInstallCmd(Collection<String> packages) { <END> if (packages.isEmpty()) { return ""; } else { return CommandInfo.CMD_INSTALL + " " + String.join(" ", packages); } }</code><technical_language>if this is guideline, I prefer protected visibility package protected one</technical_language>

Target:
protected String serializeInstallCmd(Collection<String> packages) { if (packages.isEmpty()) { return ""; } else { return CommandInfo.CMD_INSTALL + " " + String.join(" ", packages); } }
Source:
<code>CheckConstraints(TransactionContext txnCtx, InputFactory inputFactory, ReferenceResolver<E> refResolver, DocTableInfo table) { InputFactory.Context<E> ctx = inputFactory.ctxForRefs(txnCtx, refResolver); notNullColumns = new ArrayList<>(table.notNullColumns()); for (int i = 0; i < notNullColumns.size(); i++) { ColumnIdent columnIdent = notNullColumns.get(i); Reference notNullRef = table.getReadReference(columnIdent); assert notNullRef != null : "ColumnIdent retrieved via `table.notNullColumns` must be available via `table.getReadReference`"; inputs.add(ctx.add(notNullRef)); } expressions = ctx.expressions(); <START> checkConstraints = table .checkConstraints() .stream() .collect(Collectors.toMap( CheckConstraint::name, chk -> new Tuple<>(ctx.add(chk.cargo()), chk.expressionStr()) )); <END> }</code><technical_language>I a simple ArrayList instead of a map? name unique all. area is performance sensitive, avoid expensive heavy structures if possible</technical_language>

Target:
CheckConstraints(TransactionContext txnCtx, InputFactory inputFactory, ReferenceResolver<E> refResolver, DocTableInfo table) { InputFactory.Context<E> ctx = inputFactory.ctxForRefs(txnCtx, refResolver); notNullColumns = new ArrayList<>(table.notNullColumns()); for (int i = 0; i < notNullColumns.size(); i++) { ColumnIdent columnIdent = notNullColumns.get(i); Reference notNullRef = table.getReadReference(columnIdent); assert notNullRef != null : "ColumnIdent retrieved via `table.notNullColumns` must be available via `table.getReadReference`"; inputs.add(ctx.add(notNullRef)); } expressions = ctx.expressions(); checkConstraints = Lists2.map(table.checkConstraints(), chk -> new Tuple<>(ctx.add(chk.expression()), chk)); }
Source:
<code>LearnerHandler(Socket sock, BufferedInputStream bufferedInput, LearnerMaster learnerMaster) throws IOException { super("LearnerHandler-" + sock.getRemoteSocketAddress()); this.sock = sock; this.learnerMaster = learnerMaster; this.bufferedInput = bufferedInput; if (Boolean.getBoolean(FORCE_SNAP_SYNC)) { forceSnapSync = true; LOG.info("Forcing snapshot sync is enabled"); } try { QuorumAuthServer authServer = learnerMaster.getQuorumAuthServer(); if (authServer != null) { authServer.authenticate(sock, new DataInputStream(bufferedInput)); } } catch (IOException e) { LOG.error("Server failed to authenticate quorum learner, addr: {}, closing connection", sock.getRemoteSocketAddress(), e); try { sock.close(); } catch (IOException ie) { LOG.error("Exception while closing socket", ie); } throw new SaslException("Authentication failure: " + e.getMessage()); } <START> this.messageTracker = new MessageTracker(BUFFERED_MESSAGE_SIZE); <END> }</code><technical_language>@hanm provide option disable this default, worried performance impact tracking this, enable this is potential consistency issue want debug</technical_language>

Target:
LearnerHandler(Socket sock, BufferedInputStream bufferedInput, LearnerMaster learnerMaster) throws IOException { super("LearnerHandler-" + sock.getRemoteSocketAddress()); this.sock = sock; this.learnerMaster = learnerMaster; this.bufferedInput = bufferedInput; if (Boolean.getBoolean(FORCE_SNAP_SYNC)) { forceSnapSync = true; LOG.info("Forcing snapshot sync is enabled"); } try { QuorumAuthServer authServer = learnerMaster.getQuorumAuthServer(); if (authServer != null) { authServer.authenticate(sock, new DataInputStream(bufferedInput)); } } catch (IOException e) { LOG.error("Server failed to authenticate quorum learner, addr: {}, closing connection", sock.getRemoteSocketAddress(), e); try { sock.close(); } catch (IOException ie) { LOG.error("Exception while closing socket", ie); } throw new SaslException("Authentication failure: " + e.getMessage()); } this.messageTracker = new MessageTracker(MessageTracker.BUFFERED_MESSAGE_SIZE); }
Source:
<code>private void waitForSeries(double[] expected) { <START> WaitUtils.waitUntil(new IWaitCondition() { <END> @Override public boolean test() throws Exception { UIThreadRunnable.syncExec(() -> { fDensityViewer.refresh(); fTableViewer.refresh(); }); double[] ySeries = getSeries().getYSeries(); return Arrays.equals(expected, ySeries); } @Override public String getFailureMessage() { return "Unable to refresh viewer series"; } }, SWTBOT_WAIT_TIMEOUT); }</code><technical_language>In a SWTBot test, recommended SWTBotUtils.waitUntil() instead, SWTBotPreferences.TIMEOUT</technical_language>

Target:
private void waitForSeries(double[] expected) { SWTBotUtils.waitUntil(expected1 -> { UIThreadRunnable.syncExec(() -> { fDensityViewer.refresh(); fTableViewer.refresh(); }); double[] ySeries = getSeries().getYSeries(); return Arrays.equals(expected1, ySeries); }, expected, "Unable to refresh viewer series"); }
Source:
<code>private void fillStudentDetailsForm(String studentName, String teamName, String studentEmail, String comments) { if (studentName != null) { fillTextBox(studentNameTextbox, studentName); } if (teamName != null) { fillTextBox(teamNameTextbox, teamName); } if (studentEmail != null) { fillTextBox(studentEmailTextbox, studentEmail); } if (comments != null) { fillTextBox(commentsTextbox, comments); } if (teamName == null) { if (studentEmail == null) { click(submitButton); } else { clickAndConfirm(submitButton); } } else { if (studentEmail == null) { clickAndConfirm(submitButton); } else { <START> clickAndConfirmTwoTimes(submitButton); <END> } } }</code><technical_language>this, call clickAndConfirm similarly handle modal separately? simplify routine: java clickAndConfirm(submitButton); if (studentEmail != null) { clickNoOnModal(); // implement }</technical_language>

Target:
private void fillStudentDetailsForm(String studentName, String teamName, String studentEmail, String comments) { if (studentName != null) { fillTextBox(studentNameTextbox, studentName); } if (teamName != null) { fillTextBox(teamNameTextbox, teamName); } if (studentEmail != null) { fillTextBox(studentEmailTextbox, studentEmail); } if (comments != null) { fillTextBox(commentsTextbox, comments); } if (teamName == null) { if (studentEmail == null) { click(submitButton); } else { clickAndConfirm(submitButton); } } else { clickAndConfirmWithoutWaitingForModalDisappearance(submitButton); if (studentEmail != null) { clickNoOnModal(); } } }
Source:
<code>public List<T> toList() { T[] elementsArray = (T[]) queue.toArray(); <START> return List.copyOf(Arrays.asList(elementsArray)); <END> }</code><technical_language>is a reason for copying anonymous list created a moment ago</technical_language>

Target:
public List<T> toList() { return List.copyOf(queue); }
Source:
<code>private void startConsoleReporter(String period) { try { <START> period = period.trim(); <END> if (period.endsWith("ms")) { startConsoleReporter(Integer.parseInt(period.substring(0, period.length() - 2)), TimeUnit.MILLISECONDS); } else if (period.endsWith("s")) { startConsoleReporter(Integer.parseInt(period.substring(0, period.length() - 1)), TimeUnit.SECONDS); } else if (period.endsWith("m")) { startConsoleReporter(Integer.parseInt(period.substring(0, period.length() - 1)), TimeUnit.MINUTES); } else { throw new VertexiumException("Could not parse period, unknown prefix, try ms, s, or m: " + period); } } catch (NumberFormatException ex) { throw new VertexiumException("Could not parse period: " + period, ex); } }</code><technical_language>Consider switching this [support Java duration strings](<LINK_0></technical_language>

Target:
private void startConsoleReporter(String period) { try { Duration duration = parseDuration(period); startConsoleReporter(duration.toMillis(), TimeUnit.MILLISECONDS); } catch (Exception ex) { throw new VertexiumException("Could not parse period: " + period, ex); } }
Source:
<code>public String getShortErrorMessage() { if(getErrorDetails() == null || getErrorDetails().isEmpty() == true) { <START> return getErrorStackTrace().split("[\\r\\n]+")[0]; END> }else { return getErrorDetails(); } }</code><technical_language>Caused by: java.lang.NullPointerException hudson.tasks.junit.CaseResult.getShortErrorMessage(CaseResult.java:304) ... 84 more failures related</technical_language>

Target:
public String getShortErrorMessage() { if(errorDetails != null && errorDetails.isEmpty() == false) { return errorDetails; }else if(errorStackTrace != null) { return errorStackTrace.split("[\\r\\n]+")[0]; }else { return ""; } }
Source:
<code>public static void startSession(String shortMethodName, <START> String callerIdentification) { <END> getSessions().startSession(shortMethodName, callerIdentification); }</code><technical_language>Wasting \n</technical_language>

Target:
public static void startSession(String shortMethodName, String callerIdentification) { getSessionManager().startSession(shortMethodName, callerIdentification); }
Source:
<code>private static ObjectStream<NameSample> createNameSampleStream() throws IOException { ObjectStream<File> documentStream = new DirectorySampleStream(new File( EvalUtil.getOpennlpDataDir(), "ontonotes4/data/files/data/english"), file -> { if (file.isFile()) { return file.getName().endsWith(".name"); } return file.isDirectory(); }, true); return new OntoNotesNameSampleStream(new FileToStringSampleStream( <START> documentStream, Charset.forName("UTF-8"))); <END> }</code><technical_language>change this StandardCharsets.UTF_8</technical_language>

Target:
private static ObjectStream<NameSample> createNameSampleStream() throws IOException { ObjectStream<File> documentStream = new DirectorySampleStream(new File( EvalUtil.getOpennlpDataDir(), "ontonotes4/data/files/data/english"), file -> { if (file.isFile()) { return file.getName().endsWith(".name"); } return file.isDirectory(); }, true); return new OntoNotesNameSampleStream(new FileToStringSampleStream( documentStream, StandardCharsets.UTF_8)); }
Source:
<code><START> private short X(short x) { <END> if (x == -1) return (short) (width - 1); if (x == width) return (short) 0; return x; }</code><technical_language>bad name of method <LINK_0></technical_language>

Target:
private short X(short x) { if (x == -1) { return (short) (width - 1); } if (x == width) { return (short) 0; } return x; }
Source:
<code>private ImportAction handlePreImportException(final SuperCSVException e) { <START> log("Exception caught while reading release file. Continuing with next row. {}", e.getMessage()); <END> importContext.getLogger().warn("Exception caught while reading release file. Continuing with next row.", e); return ImportAction.CONTINUE; }</code><technical_language>If vararg Objects land in SLF4J Logger, propagate exceptions additional parameter now, get a stack trace exception message in log output. other opportunities do below</technical_language>

Target:
private ImportAction handlePreImportException(final SuperCSVException e) { log("Exception caught while reading release file. Continuing with next row.", e); importContext.getLogger().warn("Exception caught while reading release file. Continuing with next row.", e); return ImportAction.CONTINUE; }
Source:
<code>protected void testCreateActiveParticipantFromUser(LogEventRequestType request, Boolean isRequesting, AssertionType assertion) { if (isRequesting) { ActiveParticipant userActiveParticipant = null; List<ActiveParticipant> activeParticipant = request.getAuditMessage().getActiveParticipant(); for (ActiveParticipant item : activeParticipant) { if (item.getRoleIDCode().get(0).getCode() != null && item.getRoleIDCode().get(0).getCode().equals("Code")) { userActiveParticipant = item; break; } } assertNotNull("userActiveParticipant is null", userActiveParticipant); assertNotNull("UserID is null", userActiveParticipant.getUserID()); <START> assertEquals("UserName mismatch", <END> assertion.getUserInfo().getPersonName().getGivenName() + " " + assertion.getUserInfo().getPersonName().getFamilyName(), userActiveParticipant.getUserName()); assertEquals("RoleIDCode.Code mismatch", assertion.getUserInfo().getRoleCoded().getCode(), userActiveParticipant.getRoleIDCode().get(0).getCode()); assertEquals("RoleIDCode.CodeSystemName mismatch", assertion.getUserInfo().getRoleCoded().getCodeSystemName(), userActiveParticipant.getRoleIDCode().get(0).getCodeSystemName()); assertEquals("RoleIDCode.DisplayName mismatch", assertion.getUserInfo().getRoleCoded().getDisplayName(), userActiveParticipant.getRoleIDCode().get(0).getDisplayName()); assertEquals("UserID and LogEventRequestType.UserId mismatch", userActiveParticipant.getUserID(), request.getUserId()); } }</code><technical_language>loosening this test? knew User ID this change. Is longer match this passed in assertion</technical_language>

Target:
protected void testCreateActiveParticipantFromUser(LogEventRequestType request, Boolean isRequesting, AssertionType assertion) { if (isRequesting) { ActiveParticipant userActiveParticipant = null; List<ActiveParticipant> activeParticipant = request.getAuditMessage().getActiveParticipant(); for (ActiveParticipant item : activeParticipant) { if (item.getRoleIDCode().get(0).getCode() != null && item.getRoleIDCode().get(0).getCode().equals("Code")) { userActiveParticipant = item; break; } } assertNotNull("userActiveParticipant is null", userActiveParticipant); assertEquals("UserID mismatch", assertion.getUserInfo().getUserName(), userActiveParticipant.getUserID()); assertEquals("UserName mismatch", assertion.getUserInfo().getPersonName().getGivenName() + " " + assertion.getUserInfo().getPersonName().getFamilyName(), userActiveParticipant.getUserName()); assertEquals("RoleIDCode.Code mismatch", assertion.getUserInfo().getRoleCoded().getCode(), userActiveParticipant.getRoleIDCode().get(0).getCode()); assertEquals("RoleIDCode.CodeSystemName mismatch", assertion.getUserInfo().getRoleCoded().getCodeSystemName(), userActiveParticipant.getRoleIDCode().get(0).getCodeSystemName()); assertEquals("RoleIDCode.DisplayName mismatch", assertion.getUserInfo().getRoleCoded().getDisplayName(), userActiveParticipant.getRoleIDCode().get(0).getDisplayName()); assertEquals("UserID and LogEventRequestType.UserId mismatch", userActiveParticipant.getUserID(), request.getUserId()); } }
Source:
<code><START> public synchronized void mark(int readlimit) { <END> this.mark = buffer.position(); }</code><technical_language>This class is thread safe. synchronized is unnecessary I is misleading</technical_language>

Target:
public void mark(int readlimit) { this.mark = buffer.position(); }
Source:
<code>boolean cubePosChanged() { return blockToCube(playerEntity.posX) != this.getManagedCubePosX() || blockToCube(playerEntity.posY) != this.getManagedCubePosY() <START> || blockToCube(playerEntity.posZ) != this.getManagedCubePosZ(); <END> }</code><technical_language>Formatting. unrelated change</technical_language>

Target:
boolean cubePosChanged() { double blockDX = blockToCube(playerEntity.posX) - this.getManagedCubePosX(); double blockDY = blockToCube(playerEntity.posY) - this.getManagedCubePosY(); double blockDZ = blockToCube(playerEntity.posZ) - this.getManagedCubePosZ(); double distanceSquared = blockDX * blockDX + blockDY * blockDY + blockDZ * blockDZ; return distanceSquared > 0.9; }
Source:
<code>static void decodeCube(PacketBuffer in, Cube cube) { cube.setClientCube(); boolean isEmpty = in.readBoolean(); boolean hasStorage = in.readBoolean(); <START> ExtendedBlockStorage storage = new ExtendedBlockStorage( <END> Coords.cubeToMinBlock(cube.getY()), !cube.getCubicWorld().getProvider().hasNoSky()); cube.setStorage(storage); if (!isEmpty) { storage.getData().read(in); } if(hasStorage) { in.readBytes(storage.getBlocklightArray().getData()); if (!cube.getCubicWorld().getProvider().hasNoSky()) { in.readBytes(storage.getSkylightArray().getData()); } } if (!isEmpty) { byte[] heightmaps = new byte[256 * 4]; in.readBytes(heightmaps); ClientHeightMap coi = ((ClientHeightMap) cube.getColumn().getOpacityIndex()); coi.setData(heightmaps); storage.removeInvalidBlocks(); } }</code><technical_language>making storage adding cube if one</technical_language>

Target:
static void decodeCube(PacketBuffer in, Cube cube) { cube.setClientCube(); boolean isEmpty = in.readBoolean(); boolean hasStorage = in.readBoolean(); ExtendedBlockStorage storage = null; if (hasStorage) { storage = new ExtendedBlockStorage(Coords.cubeToMinBlock(cube.getY()), !cube.getCubicWorld().getProvider().hasNoSky()); cube.setStorage(storage); } if (!isEmpty) { storage.getData().read(in); } if (hasStorage) { in.readBytes(storage.getBlocklightArray().getData()); if (!cube.getCubicWorld().getProvider().hasNoSky()) { in.readBytes(storage.getSkylightArray().getData()); } } if (!isEmpty) { byte[] heightmaps = new byte[256 * 4]; in.readBytes(heightmaps); ClientHeightMap coi = ((ClientHeightMap) cube.getColumn().getOpacityIndex()); coi.setData(heightmaps); storage.removeInvalidBlocks(); } }
Source:
<code><START> public void triggerHousekeeping(Object projectIdOrPath) throws GitLabApiException { <END> Form formData = null; post(Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "housekeeping"); }</code><technical_language>This method is defined causing a compile failure</technical_language>

Target:
public void triggerHousekeeping(Object projectIdOrPath) throws GitLabApiException { post(Response.Status.OK, (Form) null, "projects", getProjectIdOrPath(projectIdOrPath), "housekeeping"); }
Source:
<code>protected void _onPause() { if (campaignsAndResourcesExecutor != null) { campaignsAndResourcesExecutor.shutdown(); } mustCleanInstance = true; Activity activity = getActivityContext(); if (activity != null) { mustCleanInstance = isActivityFinishing(activity); } SwrveLogger.i(LOG_TAG, "onPause"); flushToDisk(); generateNewSessionInterval(); if (config.isTalkEnabled()) { <START> saveCampaignSettings(); <END> } }</code><technical_language>+1: do need check if config.isTalkEnabled</technical_language>

Target:
protected void _onPause() { if (campaignsAndResourcesExecutor != null) { campaignsAndResourcesExecutor.shutdown(); } mustCleanInstance = true; Activity activity = getActivityContext(); if (activity != null) { mustCleanInstance = isActivityFinishing(activity); } SwrveLogger.i(LOG_TAG, "onPause"); flushToDisk(); generateNewSessionInterval(); saveCampaignsState(); }
Source:
<code>private void initVmTemplate() { OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmTemplateFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmTemplateFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); setVmTemplate(vmTemplateFromConfiguration); getParameters().setVmTemplate(vmTemplateFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskTemplateMap() != null) { ArrayList imageList = new ArrayList<>(getParameters().getDiskTemplateMap().values()); vmTemplateFromConfiguration.setDiskList(imageList); ensureDomainMap(imageList, getParameters().getDestDomainId()); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: '{}':\n{}", ovfEntityData.getOvfData(), <START> e.getMessage()); <END> log.debug("Exception", e); } } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }</code><technical_language>reorder</technical_language>

Target:
private void initVmTemplate() { OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmTemplateFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmTemplateFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); setVmTemplate(vmTemplateFromConfiguration); getParameters().setVmTemplate(vmTemplateFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskTemplateMap() != null) { ArrayList imageList = new ArrayList<>(getParameters().getDiskTemplateMap().values()); vmTemplateFromConfiguration.setDiskList(imageList); ensureDomainMap(imageList, getParameters().getDestDomainId()); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: '{}':\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }
Source:
<code>public static <B extends BlockStateHolder<B>> BlockData adapt(B block) { checkNotNull(block); <START> int cacheKey = BlockStateIdAccess.getBlockStateId(block.toImmutableState()).orElse(block.hashCode()); <END> return blockDataCache.computeIfAbsent(cacheKey, input -> Bukkit.createBlockData(block.getAsString())).clone(); }</code><technical_language>Similar question here, a string different</technical_language>

Target:
public static <B extends BlockStateHolder<B>> BlockData adapt(B block) { checkNotNull(block); int cacheKey = BlockStateIdAccess.getBlockStateId(block.toImmutableState()).orElseGet(block::hashCode); return blockDataCache.computeIfAbsent(cacheKey, input -> Bukkit.createBlockData(block.getAsString())).clone(); }
Source:
<code>private void fire() { <START> activity.getSceneSwitcher().getGameScene().createTorpedo(new PointF(900, 900), 30); <END> }</code><technical_language>magic numbers</technical_language>

Target:
private void fire() { PointF startPointF = new PointF(900, 900); float angleFire = -20; activity.getSceneSwitcher().getGameScene().createTorpedo(startPointF, angleFire); }
Source:
<code>public String unmangleName(CoreSession session, DocumentRef parentRef, String docName) { if (session == null) { return docName; } Matcher matcher = TRASHED_PATTERN.matcher(docName); if (!matcher.matches()) { return docName; } if (StringUtils.isEmpty(matcher.group(1))) { return docName; } <START> docName = matcher.group(1); <END> matcher = COLLISION_PATTERN.matcher(docName); if (!matcher.matches()) { return docName; } if (StringUtils.isNotEmpty(matcher.group(1))) { String orig = matcher.group(1); String parentPath = session.getDocument(parentRef).getPathAsString(); if (parentPath.equals(PATH_SEPARATOR)) { parentPath = ""; } String newPath = parentPath + PATH_SEPARATOR + orig; if (!session.exists(new PathRef(newPath))) { docName = orig; } } return docName; }</code><technical_language>another variable, a bad practice reuse param variable change it</technical_language>

Target:
public String unmangleName(CoreSession session, DocumentRef parentRef, String docName) { if (session == null) { return docName; } String name = getFirstGroup(TRASHED_PATTERN, docName); String orig = getFirstGroup(COLLISION_PATTERN, name); if (!docName.equals(name)) { String parentPath = session.getDocument(parentRef).getPathAsString(); if (parentPath.equals(PATH_SEPARATOR)) { parentPath = ""; } String newPath = parentPath + PATH_SEPARATOR + orig; if (!session.exists(new PathRef(newPath))) { name = orig; } } return name; }
Source:
<code><START> public HostSetupNetworksParameters createSetupNetworkParams(VdsNetworkInterface nic) { <END> HostSetupNetworksParameters parameters = new HostSetupNetworksParameters(host.getId()); NetworkAttachment managementAttachment = new NetworkAttachment(); managementAttachment.setNetworkId(managementNetwork.getId()); Map<String, VdsNetworkInterface> nicNameToNic = Entities.entitiesByName(host.getInterfaces()); Guid baseNicId = nicNameToNic.get(NetworkUtils.stripVlan(nic)).getId(); managementAttachment.setNicId(baseNicId); IpConfiguration ipConfiguration = new IpConfiguration(); ipConfiguration.getIPv4Addresses().add(createIPv4Address(nic)); ipConfiguration.setBootProtocol(nic.getBootProtocol()); managementAttachment.setIpConfiguration(ipConfiguration); parameters.getNetworkAttachments().add(managementAttachment); return parameters; }</code><technical_language>method name reflect, parameters contains newly created network attachment management network. double important this method is public. needs be; following. I do question visibility, public more important correct name</technical_language>

Target:
public HostSetupNetworksParameters createSetupNetworkParams(VdsNetworkInterface nic) { HostSetupNetworksParameters parameters = new HostSetupNetworksParameters(host.getId()); NetworkAttachment managementAttachment = new NetworkAttachment(); managementAttachment.setNetworkId(managementNetwork.getId()); Map<String, VdsNetworkInterface> nicNameToNic = Entities.entitiesByName(host.getInterfaces()); Guid baseNicId = nicNameToNic.get(NetworkUtils.stripVlan(nic)).getId(); managementAttachment.setNicId(baseNicId); IpConfiguration ipConfiguration = new IpConfiguration(); ipConfiguration.getIPv4Addresses().add(createIPv4Address(nic)); managementAttachment.setIpConfiguration(ipConfiguration); parameters.getNetworkAttachments().add(managementAttachment); return parameters; }
Source:
<code><START> static boolean truish(Boolean b) { <END> return b != null && b; }</code><technical_language>I find useful of package</technical_language>

Target:
public static boolean truish(Boolean b) { return b != null && b; }
Source:
<code>void createIMMenu (long imHandle) { boolean showInputMethod = false; long settings = OS.gtk_settings_get_default (); if (settings != 0) { int buffer = new int [1]; if <START> (!OS.GTK3) { <END> OS.g_object_get (settings, OS.gtk_show_input_method_menu, buffer, 0); showInputMethod = buffer[0] != 0; } } if (imHandle == 0 || !showInputMethod) { this.imHandle = 0; if (imItem != 0) { OS.gtk_widget_destroy (imItem); imItem = 0; } if (imSeparator != 0) { OS.gtk_widget_destroy (imSeparator); imSeparator = 0; } return; } if (this.imHandle == imHandle) return; this.imHandle = imHandle; if (imSeparator == 0) { imSeparator = OS.gtk_separator_menu_item_new (); OS.gtk_widget_show (imSeparator); OS.gtk_menu_shell_insert (handle, imSeparator, -1); } if (imItem == 0) { byte[] buffer = Converter.wcsToMbcs (null, SWT.getMessage("SWT_InputMethods"), true); imItem = OS.gtk_image_menu_item_new_with_label (buffer); OS.gtk_widget_show (imItem); OS.gtk_menu_shell_insert (handle, imItem, -1); } long imSubmenu = OS.gtk_menu_new (); OS.gtk_im_multicontext_append_menuitems (imHandle, imSubmenu); OS.gtk_menu_item_set_submenu (imItem, imSubmenu); }</code><technical_language>If deprecated in Gtk3.10, work Gtk3 <Gtk3.10. wanna put this a version check instead perhaps</technical_language>

Target:
void createIMMenu (long imHandle) { boolean showInputMethod = false; long settings = OS.gtk_settings_get_default (); if (settings != 0) { int buffer = new int [1]; if (OS.GTK_VERSION < OS.VERSION (3, 10, 0)) { OS.g_object_get (settings, OS.gtk_show_input_method_menu, buffer, 0); showInputMethod = buffer[0] != 0; } } if (imHandle == 0 || !showInputMethod) { this.imHandle = 0; if (imItem != 0) { OS.gtk_widget_destroy (imItem); imItem = 0; } if (imSeparator != 0) { OS.gtk_widget_destroy (imSeparator); imSeparator = 0; } return; } if (this.imHandle == imHandle) return; this.imHandle = imHandle; if (imSeparator == 0) { imSeparator = OS.gtk_separator_menu_item_new (); OS.gtk_widget_show (imSeparator); OS.gtk_menu_shell_insert (handle, imSeparator, -1); } if (imItem == 0) { byte[] buffer = Converter.wcsToMbcs (null, SWT.getMessage("SWT_InputMethods"), true); imItem = OS.gtk_image_menu_item_new_with_label (buffer); OS.gtk_widget_show (imItem); OS.gtk_menu_shell_insert (handle, imItem, -1); } long imSubmenu = OS.gtk_menu_new (); OS.gtk_im_multicontext_append_menuitems (imHandle, imSubmenu); OS.gtk_menu_item_set_submenu (imItem, imSubmenu); }
Source:
<code>public static byte[] stringToByteArray(String value) { <START> return value.getBytes(); <END> }</code><technical_language>Check if is null</technical_language>

Target:
public static byte[] stringToByteArray(String value) { if (value == null) throw new NullPointerException("Value cannot be null."); return value.getBytes(); }
Source:
<code>private boolean isVerboseLogging() { <START> return LOGGER.isDebugEnabled() || verboseLogging; <END> }</code><technical_language>invert this for perf</technical_language>

Target:
private boolean isVerboseLogging() { return verboseLogging || LOGGER.isDebugEnabled(); }
Source:
<code>protected void doOperation() { Logic logic = new Logic(); try (Scanner scanner = new Scanner(System.in)) { System.out.println("Enter course to edit: "); String courseId = scanner.nextLine(); System.out.println("Enter new institute name: "); String institute = scanner.nextLine(); <START> List<StudentAttributes> students = logic.getStudentsForCourse(courseId); <END> for (StudentAttributes student : students) { if (student.googleId == null || student.googleId.isEmpty()) { continue; } AccountAttributes account = logic.getAccount(student.googleId); System.out.println("changed for " + account.email + " from " + account.institute + " to " + institute); account.institute = institute; logic.updateAccount(account); } } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>This removed purpose of try is here. that, try-with-resources block stop this scanner is longer this line</technical_language>

Target:
protected void doOperation() { Logic logic = new Logic(); String courseId; String institute; try (Scanner scanner = new Scanner(System.in)) { System.out.println("Enter course to edit: "); courseId = scanner.nextLine(); System.out.println("Enter new institute name: "); institute = scanner.nextLine(); } try { List<StudentAttributes> students = logic.getStudentsForCourse(courseId); for (StudentAttributes student : students) { if (student.googleId == null || student.googleId.isEmpty()) { continue; } AccountAttributes account = logic.getAccount(student.googleId); System.out.println("changed for " + account.email + " from " + account.institute + " to " + institute); account.institute = institute; logic.updateAccount(account); } } catch (Exception e) { e.printStackTrace(); } }
Source:
<code>public void emit(KOut key, VOut value) { List<VOut> list = store.get(key); if (list == null) { <START> list = new LinkedList<VOut>(); <END> List<VOut> prevList = store.putIfAbsent(key, list); if (prevList != null) { list = prevList; } } list.add(value); emitCount.incrementAndGet(); }</code><technical_language>I a LinkedList here. If is for multiple threads call emit key concurrently, need a concurrent structure some kind of synchronization guarantee consistency. 2 concurrent adds for example lose update</technical_language>

Target:
public void emit(KOut key, VOut value) { if (atomicEmit) { synchronized (this) { emitHelper(key, value); } } else { emitHelper(key, value); } }
Source:
<code>FirebaseRecyclerAdapter(Class<T> modelClass, @LayoutRes int modelLayout, Class<VH> viewHolderClass, FirebaseArray snapshots) { mModelClass = modelClass; mModelLayout = modelLayout; mViewHolderClass = viewHolderClass; mSnapshots = snapshots; mSnapshots.setOnChangedListener(new FirebaseArray.OnChangedListener() { @Override public void onChanged(EventType type, int index, int oldIndex) { switch (type) { case ADDED: notifyItemInserted(index); break; case CHANGED: notifyItemChanged(index); break; case REMOVED: notifyItemRemoved(index); break; case MOVED: notifyItemMoved(oldIndex, index); break; default: throw new IllegalStateException("Incomplete case statement"); } } @Override public void onCancelled(DatabaseError databaseError) { FirebaseRecyclerAdapter.this.onCancelled(databaseError); } @Override public void onReady() { <START> FirebaseRecyclerAdapter.this.onDataChanged(); <END> } }); }</code><technical_language>want unify names pick onReady onDataChanged? Other that, LGTM</technical_language>

Target:
FirebaseRecyclerAdapter(Class<T> modelClass, @LayoutRes int modelLayout, Class<VH> viewHolderClass, FirebaseArray snapshots) { mModelClass = modelClass; mModelLayout = modelLayout; mViewHolderClass = viewHolderClass; mSnapshots = snapshots; mSnapshots.setOnChangedListener(new FirebaseArray.OnChangedListener() { @Override public void onChildChanged(EventType type, int index, int oldIndex) { switch (type) { case ADDED: notifyItemInserted(index); break; case CHANGED: notifyItemChanged(index); break; case REMOVED: notifyItemRemoved(index); break; case MOVED: notifyItemMoved(oldIndex, index); break; default: throw new IllegalStateException("Incomplete case statement"); } } @Override public void onCancelled(DatabaseError databaseError) { FirebaseRecyclerAdapter.this.onCancelled(databaseError); } @Override public void onDataChanged() { FirebaseRecyclerAdapter.this.onDataChanged(); } }); }