Skip to content

Commit 0287ac0

Browse files
committed
minor fix to interface and interface method signatures
1 parent 04287b3 commit 0287ac0

33 files changed

+102
-97
lines changed

lsif-semanticdb/src/main/java/com/sourcegraph/lsif_semanticdb/SignatureFormatter.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ private void formatClassSignature(ClassSignature classSignature) {
5252
.anyMatch(t -> t.getTypeRef().getSymbol().equals(ANNOTATION_SYMBOL));
5353

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

5657
printKeywordln(formatAnnotations());
5758

5859
printKeyword(formatAccess());
59-
if (!isEnum && !isAnnotation) printKeyword(formatModifiers());
60+
if (!isEnum && !isAnnotation && !isInterface) printKeyword(formatModifiers());
6061

6162
switch (symbolInformation.getKind()) {
6263
case CLASS:
@@ -149,7 +150,12 @@ private void formatClassSignature(ClassSignature classSignature) {
149150
private void formatMethodSignature(MethodSignature methodSignature) {
150151
printKeywordln(formatAnnotations());
151152
printKeyword(formatAccess());
152-
printKeyword(formatModifiers());
153+
154+
String owner = SymbolDescriptor.parseFromSymbol(symbolInformation.getSymbol()).owner;
155+
SymbolInformation ownerSymbol =
156+
symtab.symbols.get(SymbolDescriptor.parseFromSymbol(symbolInformation.getSymbol()).owner);
157+
if (ownerSymbol != null && ownerSymbol.getKind() != SymbolInformation.Kind.INTERFACE)
158+
printKeyword(formatModifiers());
153159

154160
List<SymbolInformation> typeParameters = getSymlinks(methodSignature.getTypeParameters());
155161
if (!typeParameters.isEmpty()) {
@@ -163,7 +169,6 @@ private void formatMethodSignature(MethodSignature methodSignature) {
163169
printKeyword(formatType(methodSignature.getReturnType()));
164170
s.append(symbolInformation.getDisplayName());
165171
} else {
166-
String owner = SymbolDescriptor.parseFromSymbol(symbolInformation.getSymbol()).owner;
167172
// Fix for https://github.com/sourcegraph/lsif-java/issues/150
168173
if (!owner.equals(SemanticdbSymbols.NONE)) {
169174
s.append(SymbolDescriptor.parseFromSymbol(owner).descriptor.name);

tests/snapshots/src/main/generated/com/airbnb/epoxy/AsyncEpoxyDiffer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ class AsyncEpoxyDiffer {
5353
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer# class AsyncEpoxyDiffer
5454

5555
interface ResultCallback {
56-
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#ResultCallback# abstract static interface ResultCallback
56+
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#ResultCallback# interface ResultCallback
5757
void onResult(@NonNull DiffResult result);
58-
// ^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#ResultCallback#onResult(). public abstract void onResult(DiffResult result)
58+
// ^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#ResultCallback#onResult(). public void onResult(DiffResult result)
5959
// ^^^^^^^ reference androidx/annotation/NonNull#
6060
// ^^^^^^^^^^ reference com/airbnb/epoxy/DiffResult#
6161
// ^^^^^^ definition local0 @NonNull DiffResult result

tests/snapshots/src/main/generated/com/airbnb/epoxy/BaseEpoxyTouchCallback.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// ^^^^ reference android/view/View#
77

88
interface BaseEpoxyTouchCallback<T extends EpoxyModel> {
9-
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BaseEpoxyTouchCallback# abstract interface BaseEpoxyTouchCallback<T extends EpoxyModel>
9+
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BaseEpoxyTouchCallback# interface BaseEpoxyTouchCallback<T extends EpoxyModel>
1010
// ^ definition com/airbnb/epoxy/BaseEpoxyTouchCallback#[T] T extends EpoxyModel
1111
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
1212

@@ -21,7 +21,7 @@ interface BaseEpoxyTouchCallback<T extends EpoxyModel> {
2121
* @see androidx.recyclerview.widget.ItemTouchHelper.Callback#getMovementFlags
2222
*/
2323
int getMovementFlagsForModel(T model, int adapterPosition);
24-
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BaseEpoxyTouchCallback#getMovementFlagsForModel(). public abstract int getMovementFlagsForModel(T model, int adapterPosition)
24+
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BaseEpoxyTouchCallback#getMovementFlagsForModel(). public int getMovementFlagsForModel(T model, int adapterPosition)
2525
// ^ reference com/airbnb/epoxy/BaseEpoxyTouchCallback#[T]
2626
// ^^^^^ definition local0 T model
2727
// ^^^^^^^^^^^^^^^ definition local1 int adapterPosition
@@ -37,7 +37,7 @@ interface BaseEpoxyTouchCallback<T extends EpoxyModel> {
3737
* @param itemView The view being cleared.
3838
*/
3939
void clearView(T model, View itemView);
40-
// ^^^^^^^^^ definition com/airbnb/epoxy/BaseEpoxyTouchCallback#clearView(). public abstract void clearView(T model, unresolved_type itemView)
40+
// ^^^^^^^^^ definition com/airbnb/epoxy/BaseEpoxyTouchCallback#clearView(). public void clearView(T model, unresolved_type itemView)
4141
// ^ reference com/airbnb/epoxy/BaseEpoxyTouchCallback#[T]
4242
// ^^^^^ definition local2 T model
4343
// ^^^^ reference _root_/

tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyAttribute.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ enum Option {
104104
// ^^^^^^ reference com/airbnb/epoxy/EpoxyAttribute#Option#`<init>`().
105105
Option[] value() default {};
106106
//^^^^^^ reference com/airbnb/epoxy/EpoxyAttribute#Option#
107-
// ^^^^^ definition com/airbnb/epoxy/EpoxyAttribute#value(). public abstract Option[] value()
107+
// ^^^^^ definition com/airbnb/epoxy/EpoxyAttribute#value(). public Option[] value()
108108

109109
/**
110110
* Whether or not to include this attribute in equals and hashCode calculations.
@@ -117,7 +117,7 @@ enum Option {
117117
@Deprecated
118118
// ^^^^^^^^^^ reference java/lang/Deprecated#
119119
boolean hash() default true;
120-
// ^^^^ definition com/airbnb/epoxy/EpoxyAttribute#hash(). @Deprecated public abstract boolean hash()
120+
// ^^^^ definition com/airbnb/epoxy/EpoxyAttribute#hash(). @Deprecated public boolean hash()
121121

122122
/**
123123
* Whether or not to generate setter for this attribute.
@@ -130,5 +130,5 @@ enum Option {
130130
@Deprecated
131131
// ^^^^^^^^^^ reference java/lang/Deprecated#
132132
boolean setter() default true;
133-
// ^^^^^^ definition com/airbnb/epoxy/EpoxyAttribute#setter(). @Deprecated public abstract boolean setter()
133+
// ^^^^^^ definition com/airbnb/epoxy/EpoxyAttribute#setter(). @Deprecated public boolean setter()
134134
}

tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyController.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -670,13 +670,13 @@ void addAfterInterceptorCallback(ModelInterceptorCallback callback) {
670670
* to allow changes.
671671
*/
672672
interface ModelInterceptorCallback {
673-
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ModelInterceptorCallback# abstract static interface ModelInterceptorCallback
673+
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ModelInterceptorCallback# interface ModelInterceptorCallback
674674
void onInterceptorsStarted(EpoxyController controller);
675-
// ^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ModelInterceptorCallback#onInterceptorsStarted(). public abstract void onInterceptorsStarted(EpoxyController controller)
675+
// ^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ModelInterceptorCallback#onInterceptorsStarted(). public void onInterceptorsStarted(EpoxyController controller)
676676
// ^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyController#
677677
// ^^^^^^^^^^ definition local18 EpoxyController controller
678678
void onInterceptorsFinished(EpoxyController controller);
679-
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ModelInterceptorCallback#onInterceptorsFinished(). public abstract void onInterceptorsFinished(EpoxyController controller)
679+
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ModelInterceptorCallback#onInterceptorsFinished(). public void onInterceptorsFinished(EpoxyController controller)
680680
// ^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyController#
681681
// ^^^^^^^^^^ definition local19 EpoxyController controller
682682
}
@@ -738,7 +738,7 @@ private void runInterceptors() {
738738

739739
/** A callback that is run after {@link #buildModels()} completes and before diffing is run. */
740740
public interface Interceptor {
741-
// ^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#Interceptor# public abstract static interface Interceptor
741+
// ^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#Interceptor# public interface Interceptor
742742
/**
743743
* This is called immediately after {@link #buildModels()} and before diffing is run and the
744744
* models are set on the adapter. This is a final chance to make any changes to the the models
@@ -750,7 +750,7 @@ public interface Interceptor {
750750
* exception.
751751
*/
752752
void intercept(@NonNull List<EpoxyModel<?>> models);
753-
// ^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#Interceptor#intercept(). public abstract void intercept(List<EpoxyModel<?>> models)
753+
// ^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#Interceptor#intercept(). public void intercept(List<EpoxyModel<?>> models)
754754
// ^^^^^^^ reference androidx/annotation/NonNull#
755755
// ^^^^ reference java/util/List#
756756
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
@@ -1437,7 +1437,7 @@ public static void setGlobalExceptionHandler(
14371437
}
14381438

14391439
public interface ExceptionHandler {
1440-
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ExceptionHandler# public abstract static interface ExceptionHandler
1440+
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ExceptionHandler# public interface ExceptionHandler
14411441
/**
14421442
* This is called when recoverable exceptions happen at runtime. They can be ignored and Epoxy
14431443
* will recover, but you can override this to be aware of when they happen.
@@ -1448,7 +1448,7 @@ public interface ExceptionHandler {
14481448
* @param controller The EpoxyController that the error occurred in.
14491449
*/
14501450
void onException(@NonNull EpoxyController controller, @NonNull RuntimeException exception);
1451-
// ^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ExceptionHandler#onException(). public abstract void onException(EpoxyController controller, RuntimeException exception)
1451+
// ^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyController#ExceptionHandler#onException(). public void onException(EpoxyController controller, RuntimeException exception)
14521452
// ^^^^^^^ reference androidx/annotation/NonNull#
14531453
// ^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyController#
14541454
// ^^^^^^^^^^ definition local63 @NonNull EpoxyController controller

tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyDataBindingLayouts.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
/** A list of databinding layout resources that should have EpoxyModel's generated for them. */
5151
@LayoutRes int[] value();
5252
// ^^^^^^^^^ reference androidx/annotation/LayoutRes#
53-
// ^^^^^ definition com/airbnb/epoxy/EpoxyDataBindingLayouts#value(). @LayoutRes public abstract int[] value()
53+
// ^^^^^ definition com/airbnb/epoxy/EpoxyDataBindingLayouts#value(). @LayoutRes public int[] value()
5454

5555
/**
5656
* If true, any variable whose type does not implement equals and hashcode will have the
@@ -62,5 +62,5 @@
6262
* For details on the nuances of this, see https://github.com/airbnb/epoxy/wiki/DoNotHash
6363
*/
6464
boolean enableDoNotHash() default true;
65-
// ^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDataBindingLayouts#enableDoNotHash(). public abstract boolean enableDoNotHash()
65+
// ^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDataBindingLayouts#enableDoNotHash(). public boolean enableDoNotHash()
6666
}

tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyDataBindingPattern.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*/
4646
Class<?> rClass();
4747
//^^^^^ reference java/lang/Class#
48-
// ^^^^^^ definition com/airbnb/epoxy/EpoxyDataBindingPattern#rClass(). public abstract Class<?> rClass()
48+
// ^^^^^^ definition com/airbnb/epoxy/EpoxyDataBindingPattern#rClass(). public Class<?> rClass()
4949
/**
5050
* A string prefix that your databinding layouts start with. Epoxy will generate a model for each
5151
* databinding layout whose name starts with this.
@@ -55,7 +55,7 @@
5555
*/
5656
String layoutPrefix();
5757
//^^^^^^ reference java/lang/String#
58-
// ^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDataBindingPattern#layoutPrefix(). public abstract String layoutPrefix()
58+
// ^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDataBindingPattern#layoutPrefix(). public String layoutPrefix()
5959

6060
/**
6161
* If true, any variable whose type does not implement equals and hashcode will have the
@@ -67,5 +67,5 @@
6767
* For details on the nuances of this, see https://github.com/airbnb/epoxy/wiki/DoNotHash
6868
*/
6969
boolean enableDoNotHash() default true;
70-
// ^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDataBindingPattern#enableDoNotHash(). public abstract boolean enableDoNotHash()
70+
// ^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDataBindingPattern#enableDoNotHash(). public boolean enableDoNotHash()
7171
}

tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyDragCallback.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* For use with {@link EpoxyModelTouchCallback}
1010
*/
1111
public interface EpoxyDragCallback<T extends EpoxyModel> extends BaseEpoxyTouchCallback<T> {
12-
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDragCallback# public abstract interface EpoxyDragCallback<T extends EpoxyModel> extends BaseEpoxyTouchCallback<T>
12+
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDragCallback# public interface EpoxyDragCallback<T extends EpoxyModel> extends BaseEpoxyTouchCallback<T>
1313
// ^ definition com/airbnb/epoxy/EpoxyDragCallback#[T] T extends EpoxyModel
1414
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
1515
// ^^^^^^^^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/BaseEpoxyTouchCallback#
@@ -27,7 +27,7 @@ public interface EpoxyDragCallback<T extends EpoxyModel> extends BaseEpoxyTouchC
2727
* @param adapterPosition The adapter position of the model
2828
*/
2929
void onDragStarted(T model, View itemView, int adapterPosition);
30-
// ^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDragCallback#onDragStarted(). public abstract void onDragStarted(T model, unresolved_type itemView, int adapterPosition)
30+
// ^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDragCallback#onDragStarted(). public void onDragStarted(T model, unresolved_type itemView, int adapterPosition)
3131
// ^ reference com/airbnb/epoxy/EpoxyDragCallback#[T]
3232
// ^^^^^ definition local0 T model
3333
// ^^^^ reference _root_/
@@ -49,7 +49,7 @@ public interface EpoxyDragCallback<T extends EpoxyModel> extends BaseEpoxyTouchC
4949
* @param toPosition The new adapter position of the model
5050
*/
5151
void onModelMoved(int fromPosition, int toPosition, T modelBeingMoved, View itemView);
52-
// ^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDragCallback#onModelMoved(). public abstract void onModelMoved(int fromPosition, int toPosition, T modelBeingMoved, unresolved_type itemView)
52+
// ^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDragCallback#onModelMoved(). public void onModelMoved(int fromPosition, int toPosition, T modelBeingMoved, unresolved_type itemView)
5353
// ^^^^^^^^^^^^ definition local3 int fromPosition
5454
// ^^^^^^^^^^ definition local4 int toPosition
5555
// ^ reference com/airbnb/epoxy/EpoxyDragCallback#[T]
@@ -72,7 +72,7 @@ public interface EpoxyDragCallback<T extends EpoxyModel> extends BaseEpoxyTouchC
7272
* @param itemView The view that was being dragged
7373
*/
7474
void onDragReleased(T model, View itemView);
75-
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDragCallback#onDragReleased(). public abstract void onDragReleased(T model, unresolved_type itemView)
75+
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyDragCallback#onDragReleased(). public void onDragReleased(T model, unresolved_type itemView)
7676
// ^ reference com/airbnb/epoxy/EpoxyDragCallback#[T]
7777
// ^^^^^ definition local7 T model
7878
// ^^^^ reference _root_/

tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyModel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,9 @@ public void addIf(@NonNull AddPredicate predicate, @NonNull EpoxyController cont
648648
* @see #addIf(AddPredicate, EpoxyController)
649649
*/
650650
public interface AddPredicate {
651-
// ^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#AddPredicate# public abstract static interface AddPredicate
651+
// ^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#AddPredicate# public interface AddPredicate
652652
boolean addIf();
653-
// ^^^^^ definition com/airbnb/epoxy/EpoxyModel#AddPredicate#addIf(). public abstract boolean addIf()
653+
// ^^^^^ definition com/airbnb/epoxy/EpoxyModel#AddPredicate#addIf(). public boolean addIf()
654654
}
655655

656656
/**
@@ -913,9 +913,9 @@ public EpoxyModel<T> spanSizeOverride(@Nullable SpanSizeOverrideCallback spanSiz
913913
}
914914

915915
public interface SpanSizeOverrideCallback {
916-
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#SpanSizeOverrideCallback# public abstract static interface SpanSizeOverrideCallback
916+
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#SpanSizeOverrideCallback# public interface SpanSizeOverrideCallback
917917
int getSpanSize(int totalSpanCount, int position, int itemCount);
918-
// ^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#SpanSizeOverrideCallback#getSpanSize(). public abstract int getSpanSize(int totalSpanCount, int position, int itemCount)
918+
// ^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModel#SpanSizeOverrideCallback#getSpanSize(). public int getSpanSize(int totalSpanCount, int position, int itemCount)
919919
// ^^^^^^^^^^^^^^ definition local54 int totalSpanCount
920920
// ^^^^^^^^ definition local55 int position
921921
// ^^^^^^^^^ definition local56 int itemCount

tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyModelClass.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
*/
4949
@LayoutRes int layout() default 0;
5050
// ^^^^^^^^^ reference androidx/annotation/LayoutRes#
51-
// ^^^^^^ definition com/airbnb/epoxy/EpoxyModelClass#layout(). @LayoutRes public abstract int layout()
51+
// ^^^^^^ definition com/airbnb/epoxy/EpoxyModelClass#layout(). @LayoutRes public int layout()
5252

5353
/**
5454
* If true, any layout file name that has {@link #layout()} as a prefix will be included as a
@@ -59,5 +59,5 @@
5959
* other layout instead of the default.
6060
*/
6161
boolean useLayoutOverloads() default false;
62-
// ^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModelClass#useLayoutOverloads(). public abstract boolean useLayoutOverloads()
62+
// ^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/EpoxyModelClass#useLayoutOverloads(). public boolean useLayoutOverloads()
6363
}

0 commit comments

Comments
 (0)