eclipse-mat / mat

The Eclipse Memory Analyzer is a fast and feature-rich Java heap dump analyzer that helps you find memory leaks and reduce memory consumption.
https://eclipse.dev/mat/
Eclipse Public License 2.0
69 stars 13 forks source link

Use generics more for IQueryContext #9

Open eclipsewebmaster opened 4 months ago

eclipsewebmaster commented 4 months ago

| --- | --- | | 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 get(Class type, Argument.Advice advice); It might be a bit harder to convert\ String convertToString(Class type, Argument.Advice advice, Object value)\ to\ String convertToString(Class 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 commented 4 months ago

By Krum Tsvetkov on Sep 17, 2010 06:09

Andrew, in some SAP coding we have classes implementing the IQueryContext, despite of the @noimplement remark. I'd like to check first how the changes you suggest affect these.