Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 162422 Details for
Bug 300957
Stereotype Profil
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
propal to change
bug.txt (text/plain), 2.44 KB, created by
TimeSquare Mising name
on 2010-03-18 11:19:13 EDT
(
hide
)
Description:
propal to change
Filename:
MIME Type:
Creator:
TimeSquare Mising name
Created:
2010-03-18 11:19:13 EDT
Size:
2.44 KB
patch
obsolete
>// propal to change on > >package org.eclipse.uml2.uml.internal.operations > >public class ElementOperations extends UMLUtil >{ >...... > >/*** >//old methode >//public static EObject applyStereotype(Element element, Stereotype stereotype) { >// EClass definition = getDefinition(element, stereotype); >// >// if (definition == null || getExtension(element, stereotype) == null >// || element.getStereotypeApplication(stereotype) != null) { >// >// throw new IllegalArgumentException(String.valueOf(stereotype)); >// } >// >// return applyStereotype(element, definition); >// } >// >*/// > >public static EObject applyStereotype(Element element, Stereotype stereotype) { > EClass definition = getDefinition2(element, stereotype); > > if (getExtension(element, stereotype) == null) { > throw new IllegalArgumentException(String.valueOf(stereotype) + ": Extension is Null"); > } > if (element.getStereotypeApplication(stereotype) != null) { > > throw new IllegalArgumentException(String.valueOf(stereotype) + ": StereotypeApplciation is not null "); > } > > return applyStereotype(element, definition); > } > > >// change >// EClass getDefinition(Element element, Stereotype stereotype) >// return null ==> throw new IllegalArgumentException ("message ") >// > >protected static EClass getDefinition2(Element element, Stereotype stereotype) { > > if (stereotype == null) > throw new IllegalArgumentException("Stereotype is Null "); > > Profile profile = stereotype.getProfile(); > if (profile == null) > throw new IllegalArgumentException(String.valueOf(stereotype) + ": Profil is null"); > > org.eclipse.uml2.uml.Package package_ = element.getNearestPackage(); > > if (package_ == null) > throw new IllegalArgumentException(String.valueOf(stereotype) + ": Package is null"); > ProfileApplication profileApplication = package_.getProfileApplication(profile, true); > > if (profileApplication == null) > throw new IllegalArgumentException(String.valueOf(stereotype) + ": ProfileApplication is null"); > > ENamedElement appliedDefinition = profileApplication.getAppliedDefinition(stereotype); > > if (appliedDefinition instanceof EClass) { > EClass eClass = (EClass) appliedDefinition; > > if (!eClass.isAbstract()) { > return eClass; > } > throw new IllegalArgumentException(String.valueOf(stereotype) + ": Definition is abstract Eclass"); > > } > throw new IllegalArgumentException(String.valueOf(stereotype) + ": Definition is not EClass "); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 300957
: 162422