Skip to content
Snippets Groups Projects
Commit e872cfb4 authored by Simon Barner's avatar Simon Barner
Browse files

YELLOW

Resolve TODO in AnnotationInstSpec.
refs 2964
parent cba2e07c
No related branches found
No related tags found
No related merge requests found
ColumnHandle.java 66d0399a03dec18a67df08f19746a6a7c08a5c98 GREEN
GenericAnnotationView.java 68a0c93c3863c172da3dfbee32de53349c510f5f GREEN
ColumnHandle.java 133a43480037921ac4501b9f43feab56aed46941 YELLOW
GenericAnnotationView.java 3780e3791589ed81abcbd5b5c809007560b3bce1 YELLOW
HierarchicalNameViewerComparator.java edf1d012a3d18860d2ef7f9e07baf46cdfeec381 GREEN
......@@ -30,9 +30,8 @@ public class ColumnHandle<T extends IAnnotatedSpecification> extends AnnotationI
implements Comparable<ColumnHandle<T>> {
/** Constructs a new {@link ColumnHandle}. */
@SuppressWarnings("unchecked")
public ColumnHandle(AnnotationEntry entry, T annotatedSpecification) {
super(entry, (Class<T>)annotatedSpecification.getClass(), annotatedSpecification);
super(entry, annotatedSpecification);
}
/**
......@@ -42,7 +41,7 @@ public class ColumnHandle<T extends IAnnotatedSpecification> extends AnnotationI
public String getColumnName() {
// Determine column name
String specName =
getEntry().getSpecificationAnnotationName(getAnnotatedSpecification().getClass());
getEntry().getSpecificationAnnotationName(getAnnotatedSpecificationType());
if(specName == null || specName.isEmpty()) {
specName = "<Unnamed Annotation>";
......
......@@ -400,8 +400,7 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
(Class<T>)((AnnotationLabelProvider)labelProv).getAnnotationType();
T spec = selEntry.getSpecification(annotationType);
AnnotationInstSpec<T> instSpec =
new AnnotationInstSpec<T>(selEntry, annotationType, spec);
AnnotationInstSpec<T> instSpec = new AnnotationInstSpec<T>(selEntry, spec);
// By Construction of the map, we can ensure that this cast will always be
// valid.
@SuppressWarnings("unchecked") IAnnotationValueProvider<T> valProvider =
......
AnnotationInstSpec.java 3b4dc57e844b75a549ef68acd327613a259dad80 RED
AnnotationInstSpec.java 34db1b7a39ea92e5ad39dfc8d59fc4be9df46182 YELLOW
DerivedAnnotationValueProviderBase.java ae12ab7e386cc53a6a66dfc331ba43549b864b93 GREEN
EStructuralFeatureDescriptor.java b4093c8997472d0ab63a69c1d025d9aeb9b4f294 GREEN
EStructuralFeatureValueProviderBase.java eb50feb4f0d1dd4b1dea9c489b84d1e9d240460f GREEN
......
......@@ -31,13 +31,6 @@ public class AnnotationInstSpec<T extends IAnnotatedSpecification> {
*/
private AnnotationEntry entry;
// TODO: Check if this can be removed in favor of annotatedSpecification.getClass()
/**
* {@link IAnnotatedSpecification} from {@code entry} to be displayed in the column
* represented by this {@link AnnotationInstSpec}.
*/
private Class<T> annotatedSpecificationClass;
/**
* {@link IAnnotatedSpecification} from {@code entry} to be displayed in the column
* represented by this {@link AnnotationInstSpec}.
......@@ -45,10 +38,8 @@ public class AnnotationInstSpec<T extends IAnnotatedSpecification> {
private IAnnotatedSpecification annotatedSpecification;
/** Constructor. */
public AnnotationInstSpec(AnnotationEntry entry, Class<T> annotatedSpecificationClass,
T annotatedSpecification) {
public AnnotationInstSpec(AnnotationEntry entry, T annotatedSpecification) {
this.entry = entry;
this.annotatedSpecificationClass = annotatedSpecificationClass;
this.annotatedSpecification = annotatedSpecification;
}
......@@ -64,8 +55,9 @@ public class AnnotationInstSpec<T extends IAnnotatedSpecification> {
* Returns the {@link IAnnotatedSpecification} from {@code entry} to be displayed in the
* column represented by this {@link AnnotationInstSpec}.
*/
@SuppressWarnings("unchecked")
public Class<T> getAnnotatedSpecificationType() {
return annotatedSpecificationClass;
return (Class<T>)annotatedSpecification.getClass();
}
/**
......@@ -88,7 +80,7 @@ public class AnnotationInstSpec<T extends IAnnotatedSpecification> {
*/
@Override
public int hashCode() {
return annotatedSpecificationClass.hashCode();
return getAnnotatedSpecificationType().hashCode();
}
/** {@inheritDoc} */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment