Yes. I thought the newer API might use Enum which is limited to the compilation feature. I understand the logic is a different problem.
Thanks. On Fri, Dec 12, 2014 at 11:35 AM, Nathan Leung <[email protected]> wrote: > > This doesn't fully fix the problem. What if your enumeration has W, X, Y, > Z, and Bolt Y subscribes from W which has not been "set" as either a spout > or a bolt? You end up with the exact same problem. > > On Fri, Dec 12, 2014 at 12:59 AM, Mohan Radhakrishnan < > [email protected]> wrote: > >> >> Hi, >> >> It should be possible to use a Java Enum instead of the string in this >> code to prevent it from compiling if the type-safety is violated. So if "X" >> doesn't exist it shouldn't fail during runtime. >> >> That should be possible. Right ? >> >> builder.setSpout("X", tweetSpout, 1); >> builder.setBolt("Y", new Bolt(), 10).shuffleGrouping("X"); >> >> builder.setBolt("Z", new Bolt1(), 15).fieldsGrouping("Y", new >> Fields("word")); >> >> Thanks, >> Mohan >> > >
