Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

refactoring a big class

 
olze oli
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

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):

Browser.java

Player.java

Downloader.java
 
olze oli
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic