mat icon indicating copy to clipboard operation
mat copied to clipboard

Use generics more for IQueryContext

Open eclipsewebmaster opened this issue 9 months ago • 1 comments

| --- | --- | | Bugzilla Link | 325096 | | Status | NEW | | Importance | P3 minor | | Reported | Sep 13, 2010 06:27 EDT | | Modified | Sep 17, 2010 06:09 EDT | | Version | 1.1 | | Reporter | Andrew Johnson |

Description

IQueryContext makes some use of generics, but we could improve type safety by using it a little more.

E.g. instead of
Object get(Class<?> type, Argument.Advice advice);
have
<T> T get(Class<T> type, Argument.Advice advice);

It might be a bit harder to convert
String convertToString(Class<?> type, Argument.Advice advice, Object value)
to
<T> String convertToString(Class<T> type, Argument.Advice advice, T value)

as SnapshotQueryContext converts ISnapshot.class to SnapshotArgument and int.class to HeapObjectParamArgument

Are these compatible changes as the type erasure is the same, and IQueryContext is noimplement, and so the source uses should be compatible.

eclipsewebmaster avatar May 08 '24 18:05 eclipsewebmaster