test_class.declarator: jndiKey = "someKey"
test_class.modifier: private final
test_class.original_string: private final String jndiKey = "someKey";
test_class.type: String
test_class.var_name: jndiKey
test_class.declarator: jndiAdressProvider
test_class.modifier: private
test_class.original_string: private JndiAddressProvider jndiAdressProvider;
test_class.type: JndiAddressProvider
test_class.var_name: jndiAdressProvider
test_class.file: simple-spring-memcached/src/test/java/com/google/code/ssm/config/JndiAddressProviderTest.java
test_class.identifier: JndiAddressProviderTest
test_case.body: @Test
      public void getAddressesNullKey() {
          jndiAdressProvider.setJndiKey(null);
          List<InetSocketAddress> result = jndiAdressProvider.getAddresses();
          assertNotNull(result);
          assertEquals(1, result.size());
          assertEquals("127.0.0.1", result.get(0).getAddress().getHostAddress());
          assertEquals(11211, result.get(0).getPort());
  
          jndiAdressProvider = new JndiAddressProvider(null, "127.0.0.1:11211");
          result = jndiAdressProvider.getAddresses();
          assertNotNull(result);
          assertEquals(1, result.size());
          assertEquals("127.0.0.1", result.get(0).getAddress().getHostAddress());
          assertEquals(11211, result.get(0).getPort());
      }
test_case.class_method_signature: JndiAddressProviderTest.getAddressesNullKey()
test_case.full_signature: @Test public void getAddressesNullKey()
test_case.identifier: getAddressesNullKey
test_case.invocations: setJndiKey getAddresses assertNotNull assertEquals size assertEquals getHostAddress getAddress get assertEquals getPort get getAddresses assertNotNull assertEquals size assertEquals getHostAddress getAddress get assertEquals getPort get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getAddressesNullKey()
focal_class.declarator: jndiTemplate = new JndiTemplate()
focal_class.modifier: private final
focal_class.original_string: private final JndiTemplate jndiTemplate = new JndiTemplate();
focal_class.type: JndiTemplate
focal_class.var_name: jndiTemplate
focal_class.declarator: jndiKey
focal_class.modifier: @Getter
      @Setter
      private
focal_class.original_string: @Getter
      @Setter
      private String jndiKey;
focal_class.type: String
focal_class.var_name: jndiKey
focal_class.file: simple-spring-memcached/src/main/java/com/google/code/ssm/config/JndiAddressProvider.java
focal_class.identifier: JndiAddressProvider
focal_class.interfaces: implements InitializingBean
focal_class.class_method_signature: JndiAddressProvider.JndiAddressProvider()
focal_class.full_signature: public  JndiAddressProvider()
focal_class.identifier: JndiAddressProvider
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  JndiAddressProvider()
focal_class.class_method_signature: JndiAddressProvider.JndiAddressProvider(final String jndiKey, final String address)
focal_class.full_signature: public  JndiAddressProvider(final String jndiKey, final String address)
focal_class.identifier: JndiAddressProvider
focal_class.modifiers: public
focal_class.parameters: (final String jndiKey, final String address)
focal_class.signature:  JndiAddressProvider(final String jndiKey, final String address)
focal_class.class_method_signature: JndiAddressProvider.afterPropertiesSet()
focal_class.full_signature: @Override public void afterPropertiesSet()
focal_class.identifier: afterPropertiesSet
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void afterPropertiesSet()
focal_class.class_method_signature: JndiAddressProvider.getAddresses()
focal_class.full_signature: @Override public List<InetSocketAddress> getAddresses()
focal_class.identifier: getAddresses
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<InetSocketAddress>
focal_class.signature: List<InetSocketAddress> getAddresses()
focal_class.class_method_signature: JndiAddressProvider.lookup(final String key)
focal_class.full_signature: protected Object lookup(final String key)
focal_class.identifier: lookup
focal_class.modifiers: protected
focal_class.parameters: (final String key)
focal_class.return: Object
focal_class.signature: Object lookup(final String key)
focal_class.superclass: extends DefaultAddressProvider
focal_method.body: @Override
      public List<InetSocketAddress> getAddresses() {
          Object ips = null;
          List<InetSocketAddress> addrs = null;
          try {
              if (jndiKey != null && (ips = lookup(jndiKey)) != null) {
                  getLogger().info("Addresses from JNDI will be used to connect to memcached servers. Addresses: {}", ips);
                  addrs = getAddresses((String) ips);
              } else {
                  addrs = super.getAddresses();
              }
          } catch (NamingException ex) {
              getLogger()
                      .warn(String.format("Name of the JNDI key with memcached addresses is set but wrong value is bound to this key: %s",
                              jndiKey), ex);
              addrs = super.getAddresses();
          }
  
          return addrs;
      }
focal_method.class_method_signature: JndiAddressProvider.getAddresses()
focal_method.full_signature: @Override public List<InetSocketAddress> getAddresses()
focal_method.identifier: getAddresses
focal_method.invocations: lookup info getLogger getAddresses getAddresses warn getLogger format getAddresses
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: List<InetSocketAddress>
focal_method.signature: List<InetSocketAddress> getAddresses()