runtime/testapps/src/main/java/com/google/apphosting/loadtesting/allinone/MainServlet.java [1099:1131]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static String fetchMetadata(URL url) throws IOException {
    String data = null;
    HttpURLConnection connection = null;
    try {
      connection = (HttpURLConnection) url.openConnection();
      connection.setRequestProperty("Metadata-Flavor", "Google");
      InputStream input = connection.getInputStream();
      if (connection.getResponseCode() == 200) {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
          data = Joiner.on("\n").join(CharStreams.readLines(reader));
        }
      }
    } catch (IOException e) {
      if (connection != null) {
        IOException newException;
        try {
          InputStream input = connection.getErrorStream();
          if (input != null) {
            try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
              String error = Joiner.on("\n").join(CharStreams.readLines(reader));
              newException = new IOException("Failed to fetch metadata: " + error);
            }
          } else {
            newException = e;
          }
        } catch (IOException e2) {
          newException = e2;
        }
        throw newException;
      }
    }
    return data;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



runtime/testapps/src/main/java/com/google/apphosting/loadtesting/allinone/ee10/MainServlet.java [1099:1131]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static String fetchMetadata(URL url) throws IOException {
    String data = null;
    HttpURLConnection connection = null;
    try {
      connection = (HttpURLConnection) url.openConnection();
      connection.setRequestProperty("Metadata-Flavor", "Google");
      InputStream input = connection.getInputStream();
      if (connection.getResponseCode() == 200) {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
          data = Joiner.on("\n").join(CharStreams.readLines(reader));
        }
      }
    } catch (IOException e) {
      if (connection != null) {
        IOException newException;
        try {
          InputStream input = connection.getErrorStream();
          if (input != null) {
            try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
              String error = Joiner.on("\n").join(CharStreams.readLines(reader));
              newException = new IOException("Failed to fetch metadata: " + error);
            }
          } else {
            newException = e;
          }
        } catch (IOException e2) {
          newException = e2;
        }
        throw newException;
      }
    }
    return data;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



e2etests/testlocalapps/allinone/src/main/java/allinone/MainServlet.java [1090:1122]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static String fetchMetadata(URL url) throws IOException {
    String data = null;
    HttpURLConnection connection = null;
    try {
      connection = (HttpURLConnection) url.openConnection();
      connection.setRequestProperty("Metadata-Flavor", "Google");
      InputStream input = connection.getInputStream();
      if (connection.getResponseCode() == 200) {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
          data = Joiner.on("\n").join(CharStreams.readLines(reader));
        }
      }
    } catch (IOException e) {
      if (connection != null) {
        IOException newException;
        try {
          InputStream input = connection.getErrorStream();
          if (input != null) {
            try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
              String error = Joiner.on("\n").join(CharStreams.readLines(reader));
              newException = new IOException("Failed to fetch metadata: " + error);
            }
          } else {
            newException = e;
          }
        } catch (IOException e2) {
          newException = e2;
        }
        throw newException;
      }
    }
    return data;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



e2etests/testlocalapps/allinone_jakarta/src/main/java/allinone/MainServlet.java [1104:1136]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static String fetchMetadata(URL url) throws IOException {
    String data = null;
    HttpURLConnection connection = null;
    try {
      connection = (HttpURLConnection) url.openConnection();
      connection.setRequestProperty("Metadata-Flavor", "Google");
      InputStream input = connection.getInputStream();
      if (connection.getResponseCode() == 200) {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
          data = Joiner.on("\n").join(CharStreams.readLines(reader));
        }
      }
    } catch (IOException e) {
      if (connection != null) {
        IOException newException;
        try {
          InputStream input = connection.getErrorStream();
          if (input != null) {
            try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
              String error = Joiner.on("\n").join(CharStreams.readLines(reader));
              newException = new IOException("Failed to fetch metadata: " + error);
            }
          } else {
            newException = e;
          }
        } catch (IOException e2) {
          newException = e2;
        }
        throw newException;
      }
    }
    return data;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



