@Test public void idempotentNameTest() { context.setName("hello"); context.setName("hello"); }
public void setName(String name) throws IllegalStateException { if (name != null && name.equals(this.name)) { return; } if (this.name == null || CoreConstants.DEFAULT_CONTEXT_NAME.equals(this.name)) { this.name = name; } else { throw new IllegalStateException("Context has been already given a name"); } }
ContextBase implements Context, LifeCycle { public void setName(String name) throws IllegalStateException { if (name != null && name.equals(this.name)) { return; } if (this.name == null || CoreConstants.DEFAULT_CONTEXT_NAME.equals(this.name)) { this.name = name; } else { throw new IllegalStateException("Context has been already given a name"); } } }
ContextBase implements Context, LifeCycle { public void setName(String name) throws IllegalStateException { if (name != null && name.equals(this.name)) { return; } if (this.name == null || CoreConstants.DEFAULT_CONTEXT_NAME.equals(this.name)) { this.name = name; } else { throw new IllegalStateException("Context has been already given a name"); } } ContextBase(); }
ContextBase implements Context, LifeCycle { public void setName(String name) throws IllegalStateException { if (name != null && name.equals(this.name)) { return; } if (this.name == null || CoreConstants.DEFAULT_CONTEXT_NAME.equals(this.name)) { this.name = name; } else { throw new IllegalStateException("Context has been already given a name"); } } ContextBase(); StatusManager getStatusManager(); void setStatusManager(StatusManager statusManager); Map<String, String> getCopyOfPropertyMap(); void putProperty(String key, String val); String getProperty(String key); Object getObject(String key); void putObject(String key, Object value); void removeObject(String key); String getName(); void start(); void stop(); boolean isStarted(); void reset(); void setName(String name); long getBirthTime(); Object getConfigurationLock(); @Override synchronized ExecutorService getExecutorService(); @Override synchronized ScheduledExecutorService getScheduledExecutorService(); void register(LifeCycle component); @Override String toString(); @Override void addScheduledFuture(ScheduledFuture<?> scheduledFuture); List<ScheduledFuture<?>> getScheduledFutures(); }
ContextBase implements Context, LifeCycle { public void setName(String name) throws IllegalStateException { if (name != null && name.equals(this.name)) { return; } if (this.name == null || CoreConstants.DEFAULT_CONTEXT_NAME.equals(this.name)) { this.name = name; } else { throw new IllegalStateException("Context has been already given a name"); } } ContextBase(); StatusManager getStatusManager(); void setStatusManager(StatusManager statusManager); Map<String, String> getCopyOfPropertyMap(); void putProperty(String key, String val); String getProperty(String key); Object getObject(String key); void putObject(String key, Object value); void removeObject(String key); String getName(); void start(); void stop(); boolean isStarted(); void reset(); void setName(String name); long getBirthTime(); Object getConfigurationLock(); @Override synchronized ExecutorService getExecutorService(); @Override synchronized ScheduledExecutorService getScheduledExecutorService(); void register(LifeCycle component); @Override String toString(); @Override void addScheduledFuture(ScheduledFuture<?> scheduledFuture); List<ScheduledFuture<?>> getScheduledFutures();  }