Skip to content

Commit 4a842b8

Browse files
committed
lower the number of javac warnings
1 parent 7166a2e commit 4a842b8

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

visualvm/jfr.generic/src/org/graalvm/visualvm/jfr/generic/model/impl/JFRGenericEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ protected <T> T getValue(IAttribute<T> attribute) throws JFRPropertyNotAvailable
256256

257257

258258
@Override
259-
public List<Comparable> getDisplayableValues(boolean includeExperimental) {
259+
public List<Comparable<?>> getDisplayableValues(boolean includeExperimental) {
260260
IType type = item.getType();
261-
List<Comparable> values = new ArrayList<>();
261+
List<Comparable<?>> values = new ArrayList<>();
262262
Iterator<IAccessorKey> keys = DisplayableSupport.displayableAccessorKeys(type, includeExperimental);
263263
while (keys.hasNext()) {
264264
IAccessorKey key = keys.next();

visualvm/jfr.jdk11/src/org/graalvm/visualvm/jfr/jdk11/model/impl/DisplayableSupport.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ final class DisplayableSupport {
6464
private static final DefaultProcessor DEFAULT_PROCESSOR = new DefaultProcessor();
6565
private static final DefaultFormat DEFAULT_FORMAT = new DefaultFormat();
6666

67-
private static final FormatProcessor[] FORMAT_PROCESSORS = new FormatProcessor[] {
67+
private static final FormatProcessor<? extends Annotation>[] FORMAT_PROCESSORS = new FormatProcessor<?>[] {
6868
new TimestampFormatProcessor(),
6969
new TimespanFormatProcessor(),
7070
new MemoryAddressFormatProcessor(),
@@ -79,7 +79,7 @@ final class DisplayableSupport {
7979
new RecordedClassLoaderProcessor()
8080
};
8181

82-
private static final Set<String> PRIMITIVE_NUMERIC = new HashSet(Arrays.asList(new String[] {
82+
private static final Set<String> PRIMITIVE_NUMERIC = new HashSet<>(Arrays.asList(new String[] {
8383
"byte", "short", "int", "long", "char", "float", "double" // char?
8484
}));
8585

@@ -164,7 +164,7 @@ static JFRDataDescriptor getDataDescriptor(ValueDescriptor descriptor) {
164164
}
165165

166166

167-
static Comparable getDisplayValue(JFRJDK11Event event, ValueDescriptor descriptor) {
167+
static Comparable<?> getDisplayValue(JFRJDK11Event event, ValueDescriptor descriptor) {
168168
// List<AnnotationElement> annotations = descriptor.getAnnotationElements();
169169
// for (AnnotationElement annotation : annotations) System.err.println(">>> ANNOTATION " + annotation.getTypeName() + " - " + annotation.getValues());
170170
// System.err.println(">>> ContentType " + descriptor.getContentType());
@@ -232,7 +232,7 @@ Format createFormat(ValueDescriptor descriptor, A annotation) {
232232
return null;
233233
}
234234

235-
Comparable createValue(JFRJDK11Event event, ValueDescriptor descriptor, A annotation) throws JFRPropertyNotAvailableException {
235+
Comparable<?> createValue(JFRJDK11Event event, ValueDescriptor descriptor, A annotation) throws JFRPropertyNotAvailableException {
236236
Object value = event.getValue(descriptor.getName());
237237
return value instanceof Comparable ? (Comparable)value :
238238
value != null ? value.toString() : null;
@@ -258,7 +258,7 @@ Format createFormat(ValueDescriptor descriptor, Timestamp annotation) {
258258
}
259259

260260
@Override
261-
Comparable createValue(JFRJDK11Event event, ValueDescriptor descriptor, Timestamp annotation) throws JFRPropertyNotAvailableException {
261+
Comparable<?> createValue(JFRJDK11Event event, ValueDescriptor descriptor, Timestamp annotation) throws JFRPropertyNotAvailableException {
262262
return event.getInstant(descriptor.getName());
263263
}
264264

@@ -290,7 +290,7 @@ Format createFormat(ValueDescriptor descriptor, Timespan annotation) {
290290
}
291291

292292
@Override
293-
Comparable createValue(JFRJDK11Event event, ValueDescriptor descriptor, Timespan annotation) throws JFRPropertyNotAvailableException {
293+
Comparable<?> createValue(JFRJDK11Event event, ValueDescriptor descriptor, Timespan annotation) throws JFRPropertyNotAvailableException {
294294
return event.getDuration(descriptor.getName());
295295
}
296296

@@ -470,7 +470,7 @@ Format createFormat() {
470470
return null;
471471
}
472472

473-
Comparable createValue(JFRJDK11Event event, ValueDescriptor descriptor) throws JFRPropertyNotAvailableException {
473+
Comparable<?> createValue(JFRJDK11Event event, ValueDescriptor descriptor) throws JFRPropertyNotAvailableException {
474474
Object value = event.getValue(descriptor.getName());
475475
return value instanceof Comparable ? (Comparable)value :
476476
value == null ? "" : value.toString();
@@ -535,12 +535,12 @@ String createValue(JFRJDK11Event event, ValueDescriptor descriptor) throws JFRPr
535535

536536
private static class DefaultProcessor {
537537

538-
Comparable createValue(JFRJDK11Event event, ValueDescriptor descriptor) throws JFRPropertyNotAvailableException {
538+
Comparable<?> createValue(JFRJDK11Event event, ValueDescriptor descriptor) throws JFRPropertyNotAvailableException {
539539
Object value = event.getValue(descriptor.getName());
540540

541541
if (value == null) return null;
542542

543-
if (value instanceof Comparable) return (Comparable)value;
543+
if (value instanceof Comparable) return (Comparable<?>)value;
544544

545545
return value.toString(); // Also includes RecordedObject which needs to be handled separately!
546546
}

visualvm/jfr.jdk11/src/org/graalvm/visualvm/jfr/jdk11/model/impl/JFRJDK11Event.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ public Object getValue(String key) throws JFRPropertyNotAvailableException {
9999

100100

101101
@Override
102-
public List<Comparable> getDisplayableValues(boolean includeExperimental) {
103-
List<Comparable> values = new ArrayList();
102+
public List<Comparable<?>> getDisplayableValues(boolean includeExperimental) {
103+
List<Comparable<?>> values = new ArrayList<>();
104104
Iterator<ValueDescriptor> descriptors = DisplayableSupport.displayableValueDescriptors(event.getEventType(), includeExperimental);
105105
while (descriptors.hasNext()) values.add(DisplayableSupport.getDisplayValue(this, descriptors.next()));
106106
return values;

visualvm/jfr.jdk11/src/org/graalvm/visualvm/jfr/jdk11/model/impl/JFRJDK11EventType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public boolean isExperimental() {
8181

8282
@Override
8383
public List<JFRDataDescriptor> getDisplayableDataDescriptors(boolean includeExperimental) {
84-
List<JFRDataDescriptor> ddescriptors = new ArrayList();
84+
List<JFRDataDescriptor> ddescriptors = new ArrayList<>();
8585
Iterator<ValueDescriptor> vdescriptors = DisplayableSupport.displayableValueDescriptors(type, includeExperimental);
8686
while (vdescriptors.hasNext()) ddescriptors.add(DisplayableSupport.getDataDescriptor(vdescriptors.next()));
8787
return ddescriptors;

visualvm/jfr.jdk11/src/org/graalvm/visualvm/jfr/jdk11/model/impl/JFRJDK11Model.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void visitEvents(JFREventVisitor... visitors) {
7575

7676
// Notify visitors that are not done 'visit'
7777
try (RecordingFile events = new RecordingFile(snapshotFile.toPath())) {
78-
List<JFREventVisitor> _visitors = new ArrayList(Arrays.asList(visitors));
78+
List<JFREventVisitor> _visitors = new ArrayList<>(Arrays.asList(visitors));
7979
long id = 0;
8080
while (!_visitors.isEmpty() && events.hasMoreEvents()) {
8181
RecordedEvent revent = events.readEvent();
@@ -103,7 +103,7 @@ public void visitEventTypes(JFREventTypeVisitor... visitors) {
103103
// Notify visitors that are not done 'visit'
104104
try (RecordingFile events = new RecordingFile(snapshotFile.toPath())) {
105105
Iterator<EventType> types = events.readEventTypes().iterator();
106-
List<JFREventTypeVisitor> _visitors = new ArrayList(Arrays.asList(visitors));
106+
List<JFREventTypeVisitor> _visitors = new ArrayList<>(Arrays.asList(visitors));
107107
while (!_visitors.isEmpty() && types.hasNext()) {
108108
EventType etype = types.next();
109109
String typeId = getTypeId(etype);

visualvm/jfr.jdk11/src/org/graalvm/visualvm/jfr/jdk11/model/impl/JFRJDK11StackTrace.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final class JFRJDK11StackTrace extends JFRStackTrace {
4848
@Override
4949
public List<JFRStackFrame> getFrames() {
5050
List<RecordedFrame> recordedFrames = stackTrace.getFrames();
51-
List<JFRStackFrame> frames = new ArrayList(recordedFrames.size());
51+
List<JFRStackFrame> frames = new ArrayList<>(recordedFrames.size());
5252

5353
for (RecordedFrame recordedFrame : recordedFrames)
5454
frames.add(new JFRJDK11StackFrame(recordedFrame));

visualvm/jfr/src/org/graalvm/visualvm/jfr/model/JFREvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ public String getString(String key) throws JFRPropertyNotAvailableException {
118118
public abstract Object getValue(String key) throws JFRPropertyNotAvailableException;
119119

120120

121-
public abstract List<Comparable> getDisplayableValues(boolean includeExperimental);
121+
public abstract List<Comparable<?>> getDisplayableValues(boolean includeExperimental);
122122

123123
}

0 commit comments

Comments
 (0)