This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
i have a osgi application which uses the EventAdmin bundle from apache to communicate with each module.
I defined a big big enum CommunicationAction which holds all communications like REQUESTSONGFORPLAYER ... and its still getting bigger.
So i thought i refactor it and split the CommunicationAction enum into many, for every module one enum which holds all regarding requests and responses for only that module.
The problem is now that i have some .java files (for every module) containing 2 enums, called Request and Response. The compiler says there is a redefinition of the class Request/Response.
Thats because the enum's are intern used as final classes in the same namespace (if i understand the documentation from the jvm correctly), but i dont want to change the package name nor the Request/Response name.
Is there any way how i can achieve this?
for better understanding:
the package org.dyndns.soundbox.communicationaction contains those files (browser, player, downloader):
Joined: Jun 20, 2009
i created a new package eg. communicationaction.browser, communicationaction.player, ... where in everyone is a enum request and response... its not exactly what i wanted, but its ok as solution, as the other approach is impossible...