auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Timestamp fromLong(Long millisFromEpoch, Schema schema, LogicalType type) { if (millisFromEpoch < 0) { throw new IllegalArgumentException("given value is negative"); } long seconds = millisFromEpoch / THOUSAND; int nanos = (int) (millisFromEpoch - seconds * THOUSAND) * MILLION; return Timestamp.newBuilder().setSeconds(seconds).setNanos(nanos).build(); }

Target:
public Timestamp fromLong(Long millisFromEpoch, Schema schema, LogicalType type) throws IllegalArgumentException { return ProtoConversions.fromLong(millisFromEpoch, TimestampPrecise.Millis); }
Source:
protected void initModel(String projectName, String modelName, Bundle bundle) throws CoreException, IOException { project = ProjectUtils.createProject(projectName); diModelFile = PapyrusProjectUtils.copyPapyrusModel(project, bundle, getSourcePath(), modelName); if(diModelFile!=null){ System.out.println("jhghg"); } }

Target:
protected void initModel(String projectName, String modelName, Bundle bundle) throws CoreException, IOException { project = ProjectUtils.createProject(projectName); diModelFile = PapyrusProjectUtils.copyPapyrusModel(project, bundle, getSourcePath(), modelName); }
Source:
public void setReadOnly(boolean readOnly) throws SQLException { checkClosed(); if (readOnly == this.readOnly && cacheXactState) { return; } if (queryExecutor.getTransactionState() != TransactionState.IDLE) { throw new PSQLException( GT.tr("Cannot change transaction read-only property in the middle of a transaction."), PSQLState.ACTIVE_SQL_TRANSACTION); } String readOnlySql = "SET SESSION CHARACTERISTICS AS TRANSACTION " + (readOnly ? "READ ONLY" : "READ WRITE"); execSQLUpdate(readOnlySql); this.readOnly = readOnly; LOGGER.log(Level.FINE, " setReadOnly = {0}", readOnly); }

Target:
public void setReadOnly(boolean readOnly) throws SQLException { checkClosed(); if (queryExecutor.getTransactionState() != TransactionState.IDLE) { throw new PSQLException( GT.tr("Cannot change transaction read-only property in the middle of a transaction."), PSQLState.ACTIVE_SQL_TRANSACTION); } if (this.readOnly == readOnly && cacheReadOnlyState) { return; } String readOnlySql = "SET SESSION CHARACTERISTICS AS TRANSACTION " + (readOnly ? "READ ONLY" : "READ WRITE"); execSQLUpdate(readOnlySql); this.readOnly = readOnly; LOGGER.log(Level.FINE, " setReadOnly = {0}", this.readOnly); }
Source:
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) throws IOException, UnprocessableEntityException { 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); }

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:
private Iterable<String> xemblyList(final int count) { final Collection<String> xemblies = new ArrayList<String>(); for (int idx = 0; idx < count; ++idx) { xemblies.add("χemβly 'line"); } return xemblies; }

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:
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) { playbackSpeed = UserPreferences.getPlaybackSpeed(); } 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); }

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:
public PDataType getDataType() { return children.get(0).getDataType(); }

Target:
public PDataType getDataType() { return PDataType.fromTypeId(children.get(0).getDataType().getSqlType() - Types.ARRAY); }
Source:
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()); UserVoice.launchContactUs(getActivity()); } }, ErrorActions.showUnexpectedError(getActivity())); } } return true; } else { return super.onOptionsItemSelected(item); } }

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:
private Connection getConnection() { Connection connection = conn.get(); try { connection.setAutoCommit(true); return connection; } catch (SQLException e) { throw new RuntimeException(e); } }

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:
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()) { } 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; }

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:
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)); int margin = marginStandard - FIELD_HORIZONTAL_MARGIN_MODIFIER; addAnswerView(widgetLayout, margin); }

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:
public UsageDetailMode getItemResultBehaviorMode() { final UsageDetailMode mode = staticConfig.getItemResultBehaviorMode(); if (mode.compareTo(UsageDetailMode.AGGREGATE) != 0 || mode.compareTo(UsageDetailMode.DETAIL) != 0) { return UsageDetailMode.AGGREGATE; } return mode; }

Target:
public UsageDetailMode getItemResultBehaviorMode() { final UsageDetailMode mode = staticConfig.getItemResultBehaviorMode(); if (mode == UsageDetailMode.AGGREGATE || mode == UsageDetailMode.DETAIL) { return mode; } return UsageDetailMode.AGGREGATE; }
Source:
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 object", new Exception()); return def; } }

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:
public void testLoadOnlyOnce() throws Exception { Assert.assertTrue(manager.getKnownIDs().isEmpty()); ConcurrentMap<String, String> map = new ConcurrentHashMap<>(); Callable<String> populator; 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")); }

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:
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((S) source); }

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:
String serializeInstallCmd(Collection<String> packages) { if (packages.isEmpty()) { return ""; } else { return CommandInfo.CMD_INSTALL + " " + String.join(" ", packages); } }

Target:
protected String serializeInstallCmd(Collection<String> packages) { if (packages.isEmpty()) { return ""; } else { return CommandInfo.CMD_INSTALL + " " + String.join(" ", packages); } }
Source:
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 = table .checkConstraints() .stream() .collect(Collectors.toMap( CheckConstraint::name, chk -> new Tuple<>(ctx.add(chk.cargo()), chk.expressionStr()) )); }

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:
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(BUFFERED_MESSAGE_SIZE); }

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:
private void waitForSeries(double[] expected) { WaitUtils.waitUntil(new IWaitCondition() { @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); }

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:
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 { clickAndConfirmTwoTimes(submitButton); } } }

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:
public List<T> toList() { T[] elementsArray = (T[]) queue.toArray(); return List.copyOf(Arrays.asList(elementsArray)); }

Target:
public List<T> toList() { return List.copyOf(queue); }
Source:
private void startConsoleReporter(String period) { try { period = period.trim(); 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); } }

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:
public String getShortErrorMessage() { if(getErrorDetails() == null || getErrorDetails().isEmpty() == true) { return getErrorStackTrace().split("[\\r\\n]+")[0]; }else { return getErrorDetails(); } }

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:
public static void startSession(String shortMethodName, String callerIdentification) { getSessions().startSession(shortMethodName, callerIdentification); }

Target:
public static void startSession(String shortMethodName, String callerIdentification) { getSessionManager().startSession(shortMethodName, callerIdentification); }
Source:
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, Charset.forName("UTF-8"))); }

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:
private short X(short x) { if (x == -1) return (short) (width - 1); if (x == width) return (short) 0; return x; }

Target:
private short X(short x) { if (x == -1) { return (short) (width - 1); } if (x == width) { return (short) 0; } return x; }
Source:
private ImportAction handlePreImportException(final SuperCSVException e) { log("Exception caught while reading release file. Continuing with next row. {}", e.getMessage()); importContext.getLogger().warn("Exception caught while reading release file. Continuing with next row.", e); return ImportAction.CONTINUE; }

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:
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()); 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()); } }

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:
public synchronized void mark(int readlimit) { this.mark = buffer.position(); }

Target:
public void mark(int readlimit) { this.mark = buffer.position(); }
Source:
boolean cubePosChanged() { return blockToCube(playerEntity.posX) != this.getManagedCubePosX() || blockToCube(playerEntity.posY) != this.getManagedCubePosY() || blockToCube(playerEntity.posZ) != this.getManagedCubePosZ(); }

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:
static void decodeCube(PacketBuffer in, Cube cube) { cube.setClientCube(); boolean isEmpty = in.readBoolean(); boolean hasStorage = in.readBoolean(); ExtendedBlockStorage 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(); } }

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:
public void triggerHousekeeping(Object projectIdOrPath) throws GitLabApiException { Form formData = null; post(Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "housekeeping"); }

Target:
public void triggerHousekeeping(Object projectIdOrPath) throws GitLabApiException { post(Response.Status.OK, (Form) null, "projects", getProjectIdOrPath(projectIdOrPath), "housekeeping"); }
Source:
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()) { saveCampaignSettings(); } }

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:
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(), e.getMessage()); log.debug("Exception", e); } } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }

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:
public static <B extends BlockStateHolder<B>> BlockData adapt(B block) { checkNotNull(block); int cacheKey = BlockStateIdAccess.getBlockStateId(block.toImmutableState()).orElse(block.hashCode()); return blockDataCache.computeIfAbsent(cacheKey, input -> Bukkit.createBlockData(block.getAsString())).clone(); }

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:
private void fire() { activity.getSceneSwitcher().getGameScene().createTorpedo(new PointF(900, 900), 30); }

Target:
private void fire() { PointF startPointF = new PointF(900, 900); float angleFire = -20; activity.getSceneSwitcher().getGameScene().createTorpedo(startPointF, angleFire); }
Source:
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; } docName = matcher.group(1); 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; }

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:
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)); ipConfiguration.setBootProtocol(nic.getBootProtocol()); managementAttachment.setIpConfiguration(ipConfiguration); parameters.getNetworkAttachments().add(managementAttachment); return parameters; }

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:
static boolean truish(Boolean b) { return b != null && b; }

Target:
public static boolean truish(Boolean b) { return b != null && b; }
Source:
void createIMMenu (long imHandle) { boolean showInputMethod = false; long settings = OS.gtk_settings_get_default (); if (settings != 0) { int buffer = new int [1]; if (!OS.GTK3) { 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); }

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:
public static byte[] stringToByteArray(String value) { return value.getBytes(); }

Target:
public static byte[] stringToByteArray(String value) { if (value == null) throw new NullPointerException("Value cannot be null."); return value.getBytes(); }
Source:
private boolean isVerboseLogging() { return LOGGER.isDebugEnabled() || verboseLogging; }

Target:
private boolean isVerboseLogging() { return verboseLogging || LOGGER.isDebugEnabled(); }
Source:
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(); 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(); } }

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:
public void emit(KOut key, VOut value) { List<VOut> list = store.get(key); if (list == null) { list = new LinkedList<VOut>(); List<VOut> prevList = store.putIfAbsent(key, list); if (prevList != null) { list = prevList; } } list.add(value); emitCount.incrementAndGet(); }

Target:
public void emit(KOut key, VOut value) { if (atomicEmit) { synchronized (this) { emitHelper(key, value); } } else { emitHelper(key, value); } }
Source:
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() { FirebaseRecyclerAdapter.this.onDataChanged(); } }); }

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(); } }); }
Source:
public BigDecimal getBigDecimal(String key) { String value = getRawString(key); if (value == null) return notFound(); try { return BigDecimal.valueOf(Long.valueOf(value)); } catch (NumberFormatException e) { return parseError(key, value, e); } }

Target:
public BigDecimal getBigDecimal(String key) { String value = interpolate(key); if (value == null) return notFound(); try { return new BigDecimal(value); } catch (NumberFormatException e) { return parseError(key, value, e); } }
Source:
protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); if( btn instanceof GuiImgButton ) { final boolean backwards = Mouse.isButtonDown( 1 ); final GuiImgButton iBtn = (GuiImgButton) btn; if( iBtn.getSetting() != Settings.ACTIONS ) { final Enum cv = iBtn.getCurrentValue(); final Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); if( btn == this.terminalStyleBox ) { AEConfig.instance().getConfigManager().putSetting( iBtn.getSetting(), next ); } else if( btn == this.searchBoxSettings ) { AEConfig.instance().getConfigManager().putSetting( iBtn.getSetting(), next ); } else { try { NetworkHandler.instance().sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) ); } catch( final IOException e ) { AELog.debug( e ); } } iBtn.set( next ); if( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class ) { this.reinitalize(); } } } }

Target:
protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); if( btn instanceof GuiImgButton ) { final boolean backwards = Mouse.isButtonDown( 1 ); final GuiImgButton iBtn = (GuiImgButton) btn; if( iBtn.getSetting() != Settings.ACTIONS ) { final Enum cv = iBtn.getCurrentValue(); final Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); if( btn == this.terminalStyleBox || btn == this.searchBoxSettings ) { AEConfig.instance().getConfigManager().putSetting( iBtn.getSetting(), next ); } else { try { NetworkHandler.instance().sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) ); } catch( final IOException e ) { AELog.debug( e ); } } iBtn.set( next ); if( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class ) { this.reinitalize(); } } } }
Source:
public String formatDateToNumber(long timestamp) { return dateInNumberFormat.format(new Date(timestamp)); }

Target:
public String formatDateToNumber(long timestamp) { return shortDateFormat.format(new Date(timestamp)); }
Source:
public void switchOnAdminMode() { info("Switch ON admin mode"); if (!isAdminModeOn()) { info("Admin mode is off. Switching it ON"); getHeader().switchingAdminMode(); } info("Admin mode is switched ON"); }

Target:
public void switchOnAdminMode() { info("Switching ON admin mode..."); if (!isAdminModeOn()) { info("Admin mode is off. Switching it ON"); getHeader().switchingAdminMode(); } else { info("Admin mode was switched on already, doing nothing"); } info("Admin mode is switched ON"); }
Source:
public String toString() { return String.format(Locale.ENGLISH, "{ResponseInfo:%s,status:%d, reqId:%s, xlog:%s, host:%s, duration:%d, error:%s}", super.toString(), statusCode, reqId, xlog, host, duration, error); }

Target:
public String toString() { return String.format(Locale.ENGLISH, "{ResponseInfo:%s,status:%d, reqId:%s, xlog:%s, host:%s, duration:%f s, error:%s}", super.toString(), statusCode, reqId, xlog, host, duration, error); }