test_class.file: agent/embedded/src/test/java/org/glowroot/agent/embedded/repo/LazySecretKeyImplTest.java
test_class.identifier: LazySecretKeyImplTest
test_case.body: @Test
      public void testLoadSecretKey2() throws Exception {
          // given
          SecretKey secretKey = Encryption.generateNewKey();
          File confDir = Files.createTempDir();
          File secretKeyFile = new File(confDir, "secret");
          byte[] encodedKey = secretKey.getEncoded();
          Files.write(encodedKey, secretKeyFile);
          // when
          LazySecretKey lazySecretKey = new LazySecretKeyImpl(Arrays.asList(confDir));
          // then
          assertThat(lazySecretKey.getExisting().getEncoded()).isEqualTo(encodedKey);
          // cleanup
          secretKeyFile.delete();
          confDir.delete();
      }
test_case.class_method_signature: LazySecretKeyImplTest.testLoadSecretKey2()
test_case.full_signature: @Test public void testLoadSecretKey2()
test_case.identifier: testLoadSecretKey2
test_case.invocations: generateNewKey createTempDir getEncoded write asList isEqualTo assertThat getEncoded getExisting delete delete
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLoadSecretKey2()
focal_class.declarator: SECRET_FILE_NAME = "secret"
focal_class.modifier: private static final
focal_class.original_string: private static final String SECRET_FILE_NAME = "secret";
focal_class.type: String
focal_class.var_name: SECRET_FILE_NAME
focal_class.declarator: confDirs
focal_class.modifier: private final
focal_class.original_string: private final List<File> confDirs;
focal_class.type: List<File>
focal_class.var_name: confDirs
focal_class.declarator: lock = new Object()
focal_class.modifier: private final
focal_class.original_string: private final Object lock = new Object();
focal_class.type: Object
focal_class.var_name: lock
focal_class.declarator: secretKey
focal_class.modifier: @GuardedBy("lock")
      private @MonotonicNonNull
focal_class.original_string: @GuardedBy("lock")
      private @MonotonicNonNull SecretKey secretKey;
focal_class.type: SecretKey
focal_class.var_name: secretKey
focal_class.file: agent/embedded/src/main/java/org/glowroot/agent/embedded/repo/LazySecretKeyImpl.java
focal_class.identifier: LazySecretKeyImpl
focal_class.interfaces: implements LazySecretKey
focal_class.class_method_signature: LazySecretKeyImpl.LazySecretKeyImpl(List<File> confDirs)
focal_class.full_signature:   LazySecretKeyImpl(List<File> confDirs)
focal_class.identifier: LazySecretKeyImpl
focal_class.parameters: (List<File> confDirs)
focal_class.signature:  LazySecretKeyImpl(List<File> confDirs)
focal_class.class_method_signature: LazySecretKeyImpl.getExisting()
focal_class.full_signature: @Override public @Nullable SecretKey getExisting()
focal_class.identifier: getExisting
focal_class.modifiers: @Override public @Nullable
focal_class.parameters: ()
focal_class.return: SecretKey
focal_class.signature: SecretKey getExisting()
focal_class.class_method_signature: LazySecretKeyImpl.getOrCreate()
focal_class.full_signature: @Override public SecretKey getOrCreate()
focal_class.identifier: getOrCreate
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: SecretKey
focal_class.signature: SecretKey getOrCreate()
focal_class.class_method_signature: LazySecretKeyImpl.getSecretFile(List<File> confDirs)
focal_class.full_signature: private static @Nullable File getSecretFile(List<File> confDirs)
focal_class.identifier: getSecretFile
focal_class.modifiers: private static @Nullable
focal_class.parameters: (List<File> confDirs)
focal_class.return: File
focal_class.signature: File getSecretFile(List<File> confDirs)
focal_class.class_method_signature: LazySecretKeyImpl.loadKey(File secretFile)
focal_class.full_signature: private static SecretKey loadKey(File secretFile)
focal_class.identifier: loadKey
focal_class.modifiers: private static
focal_class.parameters: (File secretFile)
focal_class.return: SecretKey
focal_class.signature: SecretKey loadKey(File secretFile)
focal_method.body: @Override
      public @Nullable SecretKey getExisting() throws Exception {
          synchronized (lock) {
              if (secretKey == null) {
                  File secretFile = getSecretFile(confDirs);
                  if (secretFile != null) {
                      secretKey = loadKey(secretFile);
                  }
              }
              return secretKey;
          }
      }
focal_method.class_method_signature: LazySecretKeyImpl.getExisting()
focal_method.full_signature: @Override public @Nullable SecretKey getExisting()
focal_method.identifier: getExisting
focal_method.invocations: getSecretFile loadKey
focal_method.modifiers: @Override public @Nullable
focal_method.parameters: ()
focal_method.return: SecretKey
focal_method.signature: SecretKey getExisting()