Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ private void formatClassSignature(ClassSignature classSignature) {
.anyMatch(t -> t.getTypeRef().getSymbol().equals(ANNOTATION_SYMBOL));

boolean isEnum = has(Property.ENUM);
boolean isInterface = symbolInformation.getKind() == SymbolInformation.Kind.INTERFACE;

printKeywordln(formatAnnotations());

printKeyword(formatAccess());
if (!isEnum && !isAnnotation) printKeyword(formatModifiers());
if (!isEnum && !isAnnotation && !isInterface) printKeyword(formatModifiers());

switch (symbolInformation.getKind()) {
case CLASS:
Expand Down Expand Up @@ -149,6 +150,7 @@ private void formatClassSignature(ClassSignature classSignature) {
private void formatMethodSignature(MethodSignature methodSignature) {
printKeywordln(formatAnnotations());
printKeyword(formatAccess());

printKeyword(formatModifiers());

List<SymbolInformation> typeParameters = getSymlinks(methodSignature.getTypeParameters());
Expand Down Expand Up @@ -397,17 +399,13 @@ private String formatAccess() {
return "";
}

// https://checkstyle.sourceforge.io/config_modifier.html#ModifierOrder
private String formatModifiers() {
ArrayList<String> modifiers = new ArrayList<>();
if (has(Property.ABSTRACT)) {
modifiers.add("abstract");
}
if (has(Property.STATIC)) {
modifiers.add("static");
}
if (has(Property.FINAL)) {
modifiers.add("final");
}
if (has(Property.ABSTRACT)) modifiers.add("abstract");
if (has(Property.DEFAULT)) modifiers.add("default");
if (has(Property.STATIC)) modifiers.add("static");
if (has(Property.FINAL)) modifiers.add("final");
return String.join(" ", modifiers);
}

Expand Down
1 change: 1 addition & 0 deletions semanticdb-java/src/main/protobuf/semanticdb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ message SymbolInformation {
SEALED = 0x10;
STATIC = 0x1000;
ENUM = 0x4000;
DEFAULT = 0x8000;
}
reserved 2, 6, 7, 8, 9, 10, 11, 12, 14, 15;
string symbol = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,12 @@ private int semanticdbSymbolInfoProperties(Symbol sym) {
int properties = 0;
properties |= sym.isEnum() ? Property.ENUM_VALUE : 0;
properties |= sym.isStatic() ? Property.STATIC_VALUE : 0;
properties |= (sym.flags() & Flags.ABSTRACT) > 0 ? Property.ABSTRACT_VALUE : 0;
// for default interface methods, Flags.ABSTRACT is also set...
boolean abstractNotDefault =
((sym.flags() & Flags.ABSTRACT) > 0) && ((sym.flags() & Flags.DEFAULT) == 0);
properties |= abstractNotDefault ? Property.ABSTRACT_VALUE : 0;
properties |= (sym.flags() & Flags.FINAL) > 0 ? Property.FINAL_VALUE : 0;
properties |= (sym.flags() & Flags.DEFAULT) > 0 ? Property.DEFAULT_VALUE : 0;
return properties;
}

Expand Down
2 changes: 2 additions & 0 deletions tests/minimized/src/main/java/minimized/Interfaces.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package minimized;

public interface Interfaces {
static void staticInterfaceMethod() {}

String abstractInterfaceMethod();

default String defaultInterfaceMethod() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AsyncEpoxyDiffer {
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer# class AsyncEpoxyDiffer

interface ResultCallback {
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#ResultCallback# abstract static interface ResultCallback
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#ResultCallback# interface ResultCallback
void onResult(@NonNull DiffResult result);
// ^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#ResultCallback#onResult(). public abstract void onResult(DiffResult result)
// ^^^^^^^ reference androidx/annotation/NonNull#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// ^^^^ reference android/view/View#

interface BaseEpoxyTouchCallback<T extends EpoxyModel> {
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BaseEpoxyTouchCallback# abstract interface BaseEpoxyTouchCallback<T extends EpoxyModel>
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BaseEpoxyTouchCallback# interface BaseEpoxyTouchCallback<T extends EpoxyModel>
// ^ definition com/airbnb/epoxy/BaseEpoxyTouchCallback#[T] T extends EpoxyModel
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ void addAfterInterceptorCallback(ModelInterceptorCallback callback) {
* to allow changes.
*/
interface ModelInterceptorCallback {
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ModelInterceptorCallback# abstract static interface ModelInterceptorCallback
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ModelInterceptorCallback# interface ModelInterceptorCallback
void onInterceptorsStarted(EpoxyController controller);
// ^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ModelInterceptorCallback#onInterceptorsStarted(). public abstract void onInterceptorsStarted(EpoxyController controller)
// ^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyController#
Expand Down Expand Up @@ -738,7 +738,7 @@ private void runInterceptors() {

/** A callback that is run after {@link #buildModels()} completes and before diffing is run. */
public interface Interceptor {
// ^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#Interceptor# public abstract static interface Interceptor
// ^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#Interceptor# public interface Interceptor
/**
* This is called immediately after {@link #buildModels()} and before diffing is run and the
* models are set on the adapter. This is a final chance to make any changes to the the models
Expand Down Expand Up @@ -1437,7 +1437,7 @@ public static void setGlobalExceptionHandler(
}

public interface ExceptionHandler {
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ExceptionHandler# public abstract static interface ExceptionHandler
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ExceptionHandler# public interface ExceptionHandler
/**
* This is called when recoverable exceptions happen at runtime. They can be ignored and Epoxy
* will recover, but you can override this to be aware of when they happen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* For use with {@link EpoxyModelTouchCallback}
*/
public interface EpoxyDragCallback<T extends EpoxyModel> extends BaseEpoxyTouchCallback<T> {
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDragCallback# public abstract interface EpoxyDragCallback<T extends EpoxyModel> extends BaseEpoxyTouchCallback<T>
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDragCallback# public interface EpoxyDragCallback<T extends EpoxyModel> extends BaseEpoxyTouchCallback<T>
// ^ definition com/airbnb/epoxy/EpoxyDragCallback#[T] T extends EpoxyModel
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^^^^^^^^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/BaseEpoxyTouchCallback#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ public void addIf(@NonNull AddPredicate predicate, @NonNull EpoxyController cont
* @see #addIf(AddPredicate, EpoxyController)
*/
public interface AddPredicate {
// ^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#AddPredicate# public abstract static interface AddPredicate
// ^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#AddPredicate# public interface AddPredicate
boolean addIf();
// ^^^^^ definition com/airbnb/epoxy/EpoxyModel#AddPredicate#addIf(). public abstract boolean addIf()
}
Expand Down Expand Up @@ -913,7 +913,7 @@ public EpoxyModel<T> spanSizeOverride(@Nullable SpanSizeOverrideCallback spanSiz
}

public interface SpanSizeOverrideCallback {
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#SpanSizeOverrideCallback# public abstract static interface SpanSizeOverrideCallback
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#SpanSizeOverrideCallback# public interface SpanSizeOverrideCallback
int getSpanSize(int totalSpanCount, int position, int itemCount);
// ^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#SpanSizeOverrideCallback#getSpanSize(). public abstract int getSpanSize(int totalSpanCount, int position, int itemCount)
// ^^^^^^^^^^^^^^ definition local54 int totalSpanCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ private void iterateModels(ModelGroupHolder holder, IterateModelsCallback callba
}

private interface IterateModelsCallback {
// ^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModelGroup#IterateModelsCallback# private abstract static interface IterateModelsCallback
// ^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModelGroup#IterateModelsCallback# private interface IterateModelsCallback
void onModel(EpoxyModel model, EpoxyViewHolder viewHolder, int modelIndex);
// ^^^^^^^ definition com/airbnb/epoxy/EpoxyModelGroup#IterateModelsCallback#onModel(). public abstract void onModel(EpoxyModel model, EpoxyViewHolder viewHolder, int modelIndex)
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* For use with {@link EpoxyModelTouchCallback}
*/
public interface EpoxySwipeCallback<T extends EpoxyModel> extends BaseEpoxyTouchCallback<T> {
// ^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxySwipeCallback# public abstract interface EpoxySwipeCallback<T extends EpoxyModel> extends BaseEpoxyTouchCallback<T>
// ^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxySwipeCallback# public interface EpoxySwipeCallback<T extends EpoxyModel> extends BaseEpoxyTouchCallback<T>
// ^ definition com/airbnb/epoxy/EpoxySwipeCallback#[T] T extends EpoxyModel
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^^^^^^^^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/BaseEpoxyTouchCallback#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/** Interface applied to generated models to allow the base adapter to interact with them. */
public interface GeneratedModel<T> {
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/GeneratedModel# public abstract interface GeneratedModel<T>
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/GeneratedModel# public interface GeneratedModel<T>
// ^ definition com/airbnb/epoxy/GeneratedModel#[T] T
/**
* Called on the generated model immediately before the main model onBind method has been called.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ModelList extends ArrayList<EpoxyModel<?>> {
}

interface ModelListObserver {
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/ModelList#ModelListObserver# abstract static interface ModelListObserver
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/ModelList#ModelListObserver# interface ModelListObserver
void onItemRangeInserted(int positionStart, int itemCount);
// ^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/ModelList#ModelListObserver#onItemRangeInserted(). public abstract void onItemRangeInserted(int positionStart, int itemCount)
// ^^^^^^^^^^^^^ definition local1 int positionStart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/** Used to register an onBind callback with a generated model. */
public interface OnModelBoundListener<T extends EpoxyModel<?>, V> {
// ^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelBoundListener# public abstract interface OnModelBoundListener<T extends EpoxyModel<?>, V>
// ^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelBoundListener# public interface OnModelBoundListener<T extends EpoxyModel<?>, V>
// ^ definition com/airbnb/epoxy/OnModelBoundListener#[T] T extends EpoxyModel<?>
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^ definition com/airbnb/epoxy/OnModelBoundListener#[V] V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* alerted to new model changes.
*/
public interface OnModelBuildFinishedListener {
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelBuildFinishedListener# public abstract interface OnModelBuildFinishedListener
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelBuildFinishedListener# public interface OnModelBuildFinishedListener
/**
* Called after {@link EpoxyController#buildModels()} has run and changes have been notified to
* the adapter. This will be called even if no changes existed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// ^^^^^^^^^^^^^^ reference android/widget/CompoundButton#

public interface OnModelCheckedChangeListener<T extends EpoxyModel<?>, V> {
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelCheckedChangeListener# public abstract interface OnModelCheckedChangeListener<T extends EpoxyModel<?>, V>
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelCheckedChangeListener# public interface OnModelCheckedChangeListener<T extends EpoxyModel<?>, V>
// ^ definition com/airbnb/epoxy/OnModelCheckedChangeListener#[T] T extends EpoxyModel<?>
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^ definition com/airbnb/epoxy/OnModelCheckedChangeListener#[V] V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/** Used to register a click listener on a generated model. */
public interface OnModelClickListener<T extends EpoxyModel<?>, V> {
// ^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelClickListener# public abstract interface OnModelClickListener<T extends EpoxyModel<?>, V>
// ^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelClickListener# public interface OnModelClickListener<T extends EpoxyModel<?>, V>
// ^ definition com/airbnb/epoxy/OnModelClickListener#[T] T extends EpoxyModel<?>
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^ definition com/airbnb/epoxy/OnModelClickListener#[V] V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// ^^^^ reference android/view/View#

public interface OnModelLongClickListener<T extends EpoxyModel<?>, V> {
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelLongClickListener# public abstract interface OnModelLongClickListener<T extends EpoxyModel<?>, V>
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelLongClickListener# public interface OnModelLongClickListener<T extends EpoxyModel<?>, V>
// ^ definition com/airbnb/epoxy/OnModelLongClickListener#[T] T extends EpoxyModel<?>
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^ definition com/airbnb/epoxy/OnModelLongClickListener#[V] V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/** Used to register an onUnbind callback with a generated model. */
public interface OnModelUnboundListener<T extends EpoxyModel<?>, V> {
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelUnboundListener# public abstract interface OnModelUnboundListener<T extends EpoxyModel<?>, V>
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelUnboundListener# public interface OnModelUnboundListener<T extends EpoxyModel<?>, V>
// ^ definition com/airbnb/epoxy/OnModelUnboundListener#[T] T extends EpoxyModel<?>
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^ definition com/airbnb/epoxy/OnModelUnboundListener#[V] V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/** Used to register an onVisibilityChanged callback with a generated model. */
public interface OnModelVisibilityChangedListener<T extends EpoxyModel<V>, V> {
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelVisibilityChangedListener# public abstract interface OnModelVisibilityChangedListener<T extends EpoxyModel<V>, V>
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelVisibilityChangedListener# public interface OnModelVisibilityChangedListener<T extends EpoxyModel<V>, V>
// ^ definition com/airbnb/epoxy/OnModelVisibilityChangedListener#[T] T extends EpoxyModel<V>
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^ reference com/airbnb/epoxy/OnModelVisibilityChangedListener#[V]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

/** Used to register an onVisibilityChanged callback with a generated model. */
public interface OnModelVisibilityStateChangedListener<T extends EpoxyModel<V>, V> {
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelVisibilityStateChangedListener# public abstract interface OnModelVisibilityStateChangedListener<T extends EpoxyModel<V>, V>
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/OnModelVisibilityStateChangedListener# public interface OnModelVisibilityStateChangedListener<T extends EpoxyModel<V>, V>
// ^ definition com/airbnb/epoxy/OnModelVisibilityStateChangedListener#[T] T extends EpoxyModel<V>
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^ reference com/airbnb/epoxy/OnModelVisibilityStateChangedListener#[V]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* view is set up to be styled with the Paris library.
*/
public interface StyleBuilderCallback<T> {
// ^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/StyleBuilderCallback# public abstract interface StyleBuilderCallback<T>
// ^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/StyleBuilderCallback# public interface StyleBuilderCallback<T>
// ^ definition com/airbnb/epoxy/StyleBuilderCallback#[T] T
void buildStyle(T builder);
// ^^^^^^^^^^ definition com/airbnb/epoxy/StyleBuilderCallback#buildStyle(). public abstract void buildStyle(T builder)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.airbnb.epoxy;

interface Timer {
// ^^^^^ definition com/airbnb/epoxy/Timer# abstract interface Timer
// ^^^^^ definition com/airbnb/epoxy/Timer# interface Timer
void start(String sectionName);
// ^^^^^ definition com/airbnb/epoxy/Timer#start(). public abstract void start(String sectionName)
// ^^^^^^ reference java/lang/String#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum InnerEnum {
}

public interface InnerInterface<A, B> {
// ^^^^^^^^^^^^^^ definition minimized/InnerClasses#InnerInterface# public abstract static interface InnerInterface<A, B>
// ^^^^^^^^^^^^^^ definition minimized/InnerClasses#InnerInterface# public interface InnerInterface<A, B>
// ^ definition minimized/InnerClasses#InnerInterface#[A] A
// ^ definition minimized/InnerClasses#InnerInterface#[B] B
B apply(A a);
Expand Down
Loading