File: ExtensionPointImpl.java

package info (click to toggle)
libjpf-java 1.5.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 2,280 kB
  • ctags: 2,079
  • sloc: java: 13,449; xml: 337; sh: 48; makefile: 19
file content (600 lines) | stat: -rw-r--r-- 25,574 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
/*****************************************************************************
 * Java Plug-in Framework (JPF)
 * Copyright (C) 2004-2007 Dmitry Olshansky
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *****************************************************************************/
package org.java.plugin.registry.xml;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.java.plugin.registry.Extension;
import org.java.plugin.registry.ExtensionMultiplicity;
import org.java.plugin.registry.ExtensionPoint;
import org.java.plugin.registry.Identity;
import org.java.plugin.registry.IntegrityCheckReport;
import org.java.plugin.registry.ManifestProcessingException;
import org.java.plugin.registry.ParameterMultiplicity;
import org.java.plugin.registry.ParameterType;
import org.java.plugin.registry.PluginDescriptor;
import org.java.plugin.registry.PluginRegistry;
import org.java.plugin.registry.IntegrityCheckReport.ReportItem;

/**
 * @version $Id$
 */
class ExtensionPointImpl extends PluginElementImpl<ExtensionPoint> implements ExtensionPoint {
    private final ModelExtensionPoint model;
    private Map<String, Extension> connectedExtensions;
    private Map<String, Extension> availableExtensions;
    private List<ParameterDefinition> parameterDefinitions;
    private Boolean isValid;
    private boolean paramDefsMerged = false;
    private List<ExtensionPoint> descendants;

    ExtensionPointImpl(final PluginDescriptorImpl descr,
            final PluginFragmentImpl aFragment,
            final ModelExtensionPoint aModel)
            throws ManifestProcessingException {
        super(descr, aFragment, aModel.getId(), aModel.getDocumentation());
        model = aModel;
        if ((model.getParentPointId() != null)
                && (model.getParentPluginId() == null)) {
            log.warn("parent plug-in ID not specified together with parent" //$NON-NLS-1$
                    + " extension point ID, using declaring plug-in ID," //$NON-NLS-1$
                    + " extension point is " + getUniqueId()); //$NON-NLS-1$
            model.setParentPluginId(descr.getId());
        }
        parameterDefinitions = new ArrayList<ParameterDefinition>(model.getParamDefs().size());
        Set<String> names = new HashSet<String>();
        ParameterDefinitionImpl def;
        for (ModelParameterDef modelParameterDef : model.getParamDefs()) {
            def = new ParameterDefinitionImpl(null, modelParameterDef);
            if (names.contains(def.getId())) {
                throw new ManifestProcessingException(
                        PluginRegistryImpl.PACKAGE_NAME,
                        "duplicateParameterDefinition", //$NON-NLS-1$
                        new Object[] {def.getId(), getId(), descr.getId()});
            }
            names.add(def.getId());
            parameterDefinitions.add(def);
        }
        parameterDefinitions =
            Collections.unmodifiableList(parameterDefinitions);
        if (log.isDebugEnabled()) {
            log.debug("object instantiated: " + this); //$NON-NLS-1$
        }
    }

    /**
     * @see org.java.plugin.registry.UniqueIdentity#getUniqueId()
     */
    public String getUniqueId() {
        return getDeclaringPluginDescriptor().getRegistry().makeUniqueId(
                getDeclaringPluginDescriptor().getId(), getId());
    }
    
    /**
     * @see org.java.plugin.registry.ExtensionPoint#getMultiplicity()
     */
    public ExtensionMultiplicity getMultiplicity() {
        return model.getExtensionMultiplicity();
    }

    private void updateExtensionsLists() {
        connectedExtensions = new HashMap<String, Extension>();
        availableExtensions = new HashMap<String, Extension>();
        for (PluginDescriptor descr : getDeclaringPluginDescriptor().getRegistry()
                .getPluginDescriptors()) {
            for (Extension ext : descr.getExtensions()) {
                if (getDeclaringPluginDescriptor().getId().equals(
                        ext.getExtendedPluginId())
                        && getId().equals(ext.getExtendedPointId())) {
                    availableExtensions.put(ext.getUniqueId(), ext);
                    if (ext.isValid()) {
                        if (log.isDebugEnabled()) {
                            log.debug("extension " + ext //$NON-NLS-1$
                                    + " connected to point " + this); //$NON-NLS-1$
                        }
                        connectedExtensions.put(ext.getUniqueId(), ext);
                    } else {
                        log.warn("extension " + ext.getUniqueId() //$NON-NLS-1$
                                + " is invalid and doesn't connected to" //$NON-NLS-1$
                                + " extension point " + getUniqueId()); //$NON-NLS-1$
                    }
                }
            }
        }
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#getAvailableExtensions()
     */
    public Collection<Extension> getAvailableExtensions() {
        if (availableExtensions == null) {
            updateExtensionsLists();
        }
        return Collections.unmodifiableCollection(availableExtensions.values());
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#getAvailableExtension(
     *      java.lang.String)
     */
    public Extension getAvailableExtension(final String uniqueId) {
        if (availableExtensions == null) {
            updateExtensionsLists();
        }
        Extension result = availableExtensions.get(uniqueId);
        if (result == null) {
            throw new IllegalArgumentException("extension " + uniqueId //$NON-NLS-1$
                + " not available in point " + getUniqueId()); //$NON-NLS-1$
        }
        return result;
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#isExtensionAvailable(
     *      java.lang.String)
     */
    public boolean isExtensionAvailable(final String uniqueId) {
        if (availableExtensions == null) {
            updateExtensionsLists();
        }
        return availableExtensions.containsKey(uniqueId);
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#getConnectedExtensions()
     */
    public Collection<Extension> getConnectedExtensions() {
        if (connectedExtensions == null) {
            updateExtensionsLists();
        }
        return Collections.unmodifiableCollection(connectedExtensions.values());
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#getConnectedExtension(
     *      java.lang.String)
     */
    public Extension getConnectedExtension(final String uniqueId) {
        if (connectedExtensions == null) {
            updateExtensionsLists();
        }
        Extension result = connectedExtensions.get(uniqueId);
        if (result == null) {
            throw new IllegalArgumentException("extension " + uniqueId //$NON-NLS-1$
                + " not connected to point " + getUniqueId()); //$NON-NLS-1$
        }
        return result;
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#isExtensionConnected(
     *      java.lang.String)
     */
    public boolean isExtensionConnected(final String uniqueId) {
        if (connectedExtensions == null) {
            updateExtensionsLists();
        }
        return connectedExtensions.containsKey(uniqueId);
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#isValid()
     */
    public boolean isValid() {
        if (isValid == null) {
            validate();
        }
        return isValid.booleanValue();
    }
    
    Collection<ReportItem> validate() {
        if ((model.getParentPluginId() != null)
                && (model.getParentPointId() != null)) {
            try {
                if (!isExtensionPointAvailable(model.getParentPluginId(),
                        model.getParentPointId())) {
                    isValid = Boolean.FALSE;
                    return Collections.singletonList((ReportItem)
                            new IntegrityChecker.ReportItemImpl(
                                    IntegrityCheckReport.Severity.ERROR, this,
                                    IntegrityCheckReport.Error.INVALID_EXTENSION_POINT,
                                    "parentExtPointNotAvailable", //$NON-NLS-1$
                                    new Object[] {
                                            getDeclaringPluginDescriptor()
                                            .getRegistry().makeUniqueId(
                                                    model.getParentPluginId(),
                                                    model.getParentPointId()),
                                                    getUniqueId()}));
                }
            } catch (Throwable t) {
                isValid = Boolean.FALSE;
                if (log.isDebugEnabled()) {
                    log.debug("failed checking availability of extension point " //$NON-NLS-1$
                            + getDeclaringPluginDescriptor().getRegistry()
                                .makeUniqueId(model.getParentPluginId(),
                                        model.getParentPointId()), t);
                }
                return Collections.singletonList((ReportItem)
                        new IntegrityChecker.ReportItemImpl(
                                IntegrityCheckReport.Severity.ERROR, this,
                                IntegrityCheckReport.Error.INVALID_EXTENSION_POINT,
                                "parentExtPointAvailabilityCheckFailed", //$NON-NLS-1$
                                new Object[] {
                                        getDeclaringPluginDescriptor()
                                        .getRegistry().makeUniqueId(
                                                model.getParentPluginId(),
                                                model.getParentPointId()),
                                                getUniqueId(), t}));
            }
        }
        switch (getMultiplicity()) {
        case ANY:
            isValid = Boolean.TRUE;
            return Collections.emptyList();
        case ONE:
            isValid = Boolean.valueOf(getAvailableExtensions().size() == 1);
            if (!isValid.booleanValue()) {
                return Collections.singletonList((ReportItem)
                        new IntegrityChecker.ReportItemImpl(
                                IntegrityCheckReport.Severity.ERROR, this,
                                IntegrityCheckReport.Error.INVALID_EXTENSION_POINT,
                                "toManyOrFewExtsConnected", getUniqueId())); //$NON-NLS-1$
            }
            break;
        case NONE:
            isValid = Boolean.valueOf(getAvailableExtensions().size() == 0);
            if (!isValid.booleanValue()) {
                return Collections.singletonList((ReportItem)
                        new IntegrityChecker.ReportItemImpl(
                                IntegrityCheckReport.Severity.ERROR, this,
                                IntegrityCheckReport.Error.INVALID_EXTENSION_POINT,
                                "extsConnectedToAbstractExtPoint", getUniqueId())); //$NON-NLS-1$
            }
            break;
        case ONE_PER_PLUGIN:
            isValid = Boolean.TRUE;
            final Set<String> foundPlugins = new HashSet<String>();
            String pluginId;
            for (Extension extension : getAvailableExtensions()) {
                pluginId = extension.getDeclaringPluginDescriptor().getId();
                if (!foundPlugins.add(pluginId)) {
                    isValid = Boolean.FALSE;
                    return Collections.singletonList((ReportItem)
                            new IntegrityChecker.ReportItemImpl(
                                    IntegrityCheckReport.Severity.ERROR, this,
                                    IntegrityCheckReport.Error.INVALID_EXTENSION_POINT,
                                    "toManyExtsConnected", getUniqueId())); //$NON-NLS-1$
                }
            }
            break;
        }
        return Collections.emptyList();
    }

    private boolean isExtensionPointAvailable(final String pluginId,
            final String pointId) {
        PluginRegistry registry = getDeclaringPluginDescriptor().getRegistry();
        if (!registry.isPluginDescriptorAvailable(pluginId)) {
            return false;
        }
        for (ExtensionPoint extensionPoint : registry.getPluginDescriptor(pluginId)
                .getExtensionPoints()) {
            if (extensionPoint.getId().equals(pointId)) {
                return true;
            }
        }
        return false;
    }
    
    /**
     * @see org.java.plugin.registry.ExtensionPoint#getParameterDefinitions()
     */
    public Collection<ParameterDefinition> getParameterDefinitions() {
        if ((model.getParentPluginId() == null)
                || (model.getParentPointId() == null) || paramDefsMerged) {
            return parameterDefinitions;
        }
        final Set<String> names = new HashSet<String>();
        final Collection<ParameterDefinition> parentParamDefs =
            getDeclaringPluginDescriptor().getRegistry().getExtensionPoint(
                    model.getParentPluginId(), model.getParentPointId())
                    .getParameterDefinitions();
        final List<ParameterDefinition> newParamDefs = new ArrayList<ParameterDefinition>(parameterDefinitions.size()
                + parentParamDefs.size());
        for (ParameterDefinition def : parameterDefinitions) {
            names.add(def.getId());
            newParamDefs.add(def);
        }
        for (ParameterDefinition def : parentParamDefs) {
            if (names.contains(def.getId()))
                continue;
            newParamDefs.add(def);
        }
        paramDefsMerged = true;
        parameterDefinitions = Collections.unmodifiableList(newParamDefs);
        return parameterDefinitions;
    }
    
    /**
     * @see org.java.plugin.registry.ExtensionPoint#getParameterDefinition(
     *      java.lang.String)
     */
    public ParameterDefinition getParameterDefinition(final String id) {
        for (ParameterDefinition parameterDefinition : getParameterDefinitions()) {
            ParameterDefinitionImpl def = (ParameterDefinitionImpl) parameterDefinition;
            if (def.getId().equals(id)) {
                return def;
            }
        }
        throw new IllegalArgumentException("parameter definition with ID " + id //$NON-NLS-1$
            + " not found in extension point " + getUniqueId() //$NON-NLS-1$
            + " and all it parents"); //$NON-NLS-1$
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#getParentPluginId()
     */
    public String getParentPluginId() {
        return model.getParentPluginId();
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#getParentExtensionPointId()
     */
    public String getParentExtensionPointId() {
        return model.getParentPointId();
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#isSuccessorOf(
     *      org.java.plugin.registry.ExtensionPoint)
     */
    public boolean isSuccessorOf(final ExtensionPoint extensionPoint) {
        if ((model.getParentPluginId() == null)
                || (model.getParentPointId() == null)) {
            return false;
        }
        if (model.getParentPluginId().equals(
                extensionPoint.getDeclaringPluginDescriptor().getId())
                && model.getParentPointId().equals(extensionPoint.getId())) {
            return true;
        }
        try {
            return getDeclaringPluginDescriptor().getRegistry()
                .getExtensionPoint(model.getParentPluginId(),
                        model.getParentPointId()).isSuccessorOf(extensionPoint);
        } catch (IllegalArgumentException iae) {
            return false;
        }
    }

    private void collectDescendants() {
        descendants = new LinkedList<ExtensionPoint>();
        for (PluginDescriptor descr : getDeclaringPluginDescriptor().getRegistry()
                .getPluginDescriptors()) {
            for (ExtensionPoint extp : descr.getExtensionPoints()) {
                if (extp.isSuccessorOf(this)) {
                    if (log.isDebugEnabled()) {
                        log.debug("extension point " + extp //$NON-NLS-1$
                                + " is descendant of point " + this); //$NON-NLS-1$
                    }
                    descendants.add(extp);
                }
            }
        }
        descendants = Collections.unmodifiableList(descendants);
    }

    /**
     * @see org.java.plugin.registry.ExtensionPoint#getDescendants()
     */
    public Collection<ExtensionPoint> getDescendants() {
        if (descendants == null) {
            collectDescendants();
        }
        return descendants;
    }

    /**
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "{ExtensionPoint: uid=" + getUniqueId() + "}"; //$NON-NLS-1$ //$NON-NLS-2$
    }
    
    void registryChanged() {
        isValid = null;
        connectedExtensions = null;
        availableExtensions = null;
        descendants = null;
    }
    
    class ParameterDefinitionImpl extends PluginElementImpl<ParameterDefinition>
            implements ParameterDefinition {
        private List<ParameterDefinition> subDefinitions;
        private final ParameterDefinitionImpl superDefinition;
        private final ModelParameterDef modelParamDef;
        private final ParameterValueParser valueParser;

        ParameterDefinitionImpl(final ParameterDefinitionImpl aSuperDefinition,
                final ModelParameterDef aModel)
                throws ManifestProcessingException {
            super(ExtensionPointImpl.this.getDeclaringPluginDescriptor(),
                    ExtensionPointImpl.this.getDeclaringPluginFragment(),
                    aModel.getId(), aModel.getDocumentation());
            superDefinition = aSuperDefinition;
            modelParamDef = aModel;
            valueParser = new ParameterValueParser(
                    getDeclaringPluginDescriptor().getRegistry(), this,
                    modelParamDef.getDefaultValue());
            if (!valueParser.isParsingSucceeds()) {
                log.warn("parsing default value for parameter definition " //$NON-NLS-1$
                        + this + " failed, message is: " //$NON-NLS-1$
                        + valueParser.getParsingMessage());
                throw new ManifestProcessingException(
                        PluginRegistryImpl.PACKAGE_NAME,
                        "invalidDefaultValueAttribute", //$NON-NLS-1$
                        new Object[] {modelParamDef.getDefaultValue(),
                            ExtensionPointImpl.this.getId(),
                            ExtensionPointImpl.this
                                .getDeclaringPluginDescriptor().getId()});
            }
            if (ParameterType.ANY == modelParamDef.getType()) {
                subDefinitions = Collections.emptyList();
            } else {
                subDefinitions = new ArrayList<ParameterDefinition>(
                        modelParamDef.getParamDefs().size());
                final Set<String> names = new HashSet<String>();
                for (ModelParameterDef modelParameterDef : modelParamDef.getParamDefs()) {
                    ParameterDefinitionImpl def = new ParameterDefinitionImpl(this, modelParameterDef);
                    if (names.contains(def.getId())) {
                        throw new ManifestProcessingException(
                                PluginRegistryImpl.PACKAGE_NAME,
                                "duplicateParameterDefinition", //$NON-NLS-1$
                                new Object[] {def.getId(),
                                    ExtensionPointImpl.this.getId(),
                                    ExtensionPointImpl.this.
                                    getDeclaringPluginDescriptor().getId()});
                    }
                    names.add(def.getId());
                    subDefinitions.add(def);
                }
                subDefinitions = Collections.unmodifiableList(subDefinitions);
            }
            if (log.isDebugEnabled()) {
                log.debug("object instantiated: " + this); //$NON-NLS-1$
            }
        }
        
        ParameterValueParser getValueParser() {
            return valueParser;
        }
        
        /**
         * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
         *      #getDeclaringExtensionPoint()
         */
        public ExtensionPoint getDeclaringExtensionPoint() {
            return ExtensionPointImpl.this;
        }

        /**
         * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
         *      #getMultiplicity()
         */
        public ParameterMultiplicity getMultiplicity() {
            return modelParamDef.getMultiplicity();
        }

        /**
         * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
         *      #getSubDefinitions()
         */
        public Collection<ParameterDefinition> getSubDefinitions() {
            return subDefinitions;
        }

        /**
         * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
         *      #getSuperDefinition()
         */
        public ParameterDefinition getSuperDefinition() {
            return superDefinition;
        }
        
        /**
         * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
         *      #getSubDefinition(java.lang.String)
         */
        public ParameterDefinition getSubDefinition(final String id) {
            for (ParameterDefinition parameterDefinition : subDefinitions) {
                ParameterDefinitionImpl def = (ParameterDefinitionImpl) parameterDefinition;
                if (def.getId().equals(id)) {
                    return def;
                }
            }
            throw new IllegalArgumentException(
                    "parameter definition with ID " + id //$NON-NLS-1$
                    + " not found in extension point " + getUniqueId()); //$NON-NLS-1$
        }

        /**
         * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition#getType()
         */
        public ParameterType getType() {
            return modelParamDef.getType();
        }

        /**
         * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
         *      #getCustomData()
         */
        public String getCustomData() {
            return modelParamDef.getCustomData();
        }
        
        /**
         * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
         *      #getDefaultValue()
         */
        public String getDefaultValue() {
            return modelParamDef.getDefaultValue();
        }
        
        /**
         * @see java.lang.Object#toString()
         */
        @Override
        public String toString() {
            return "{PluginExtensionPoint.ParameterDefinition: extPointUid=" //$NON-NLS-1$
                + getDeclaringExtensionPoint().getUniqueId() + "; id=" + getId() //$NON-NLS-1$
                + "}"; //$NON-NLS-1$
        }
        
        /**
         * @see org.java.plugin.registry.xml.IdentityImpl#isEqualTo(
         *      org.java.plugin.registry.Identity)
         */
        @Override
        protected boolean isEqualTo(final Identity idt) {
            if (!super.isEqualTo(idt)) {
                return false;
            }
            ParameterDefinitionImpl other = (ParameterDefinitionImpl) idt;
            if ((getSuperDefinition() == null)
                    && (other.getSuperDefinition() == null)) {
                return true;
            }
            if ((getSuperDefinition() == null)
                    || (other.getSuperDefinition() == null)) {
                return false;
            }
            return getSuperDefinition().equals(other.getSuperDefinition());
        }
    }
}