• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

refactoring a big class

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic