Skip to content

Commit b4d4eb2

Browse files
committed
Fix error filtering reports
Fixes #718
1 parent 6d9fe45 commit b4d4eb2

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/main/java/com/comphenix/protocol/error/ReportType.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public String toString() {
5555
*/
5656
public static Class<?> getSenderClass(Object sender) {
5757
if (sender == null)
58-
throw new IllegalArgumentException("sender cannot be NUll.");
58+
throw new IllegalArgumentException("sender cannot be null.");
5959
else if (sender instanceof Class<?>)
6060
return (Class<?>) sender;
6161
else
@@ -75,21 +75,21 @@ else if (sender instanceof Class<?>)
7575
*/
7676
public static String getReportName(Object sender, ReportType type) {
7777
if (sender == null)
78-
throw new IllegalArgumentException("sender cannot be NUll.");
78+
throw new IllegalArgumentException("sender cannot be null.");
7979
return getReportName(getSenderClass(sender), type);
8080
}
8181

8282
/**
8383
* Retrieve the full canonical name of a given report type.
8484
* <p>
8585
* This is in the format <i>canonical_name_of_class#report_type</i>
86-
* @param clazz - the sender class.
86+
* @param sender - the sender class.
8787
* @param type - the report instance.
8888
* @return The full canonical name.
8989
*/
9090
private static String getReportName(Class<?> sender, ReportType type) {
9191
if (sender == null)
92-
throw new IllegalArgumentException("sender cannot be NUll.");
92+
throw new IllegalArgumentException("sender cannot be null.");
9393

9494
// Whether or not we need to retrieve the report name again
9595
if (type.reportName == null) {
@@ -138,11 +138,10 @@ public static ReportType[] getReports(Class<?> sender) {
138138
* @return All associated report fields.
139139
*/
140140
private static List<Field> getReportFields(Class<?> clazz) {
141-
return FuzzyReflection.fromClass(clazz).getFieldList(
142-
FuzzyFieldContract.newBuilder().
143-
requireModifier(Modifier.STATIC).
144-
typeDerivedOf(ReportType.class).
145-
build()
146-
);
141+
return FuzzyReflection.fromClass(clazz, true)
142+
.getFieldList(FuzzyFieldContract.newBuilder()
143+
.requireModifier(Modifier.STATIC)
144+
.typeDerivedOf(ReportType.class)
145+
.build());
147146
}
148147
}

0 commit comments

Comments
 (0)