#vulnerable code 
                             public void findPackageAndClass() throws IOException {
		// find name of the package and class in jflex source file
		packageName = null;
		className = null;

		LineNumberReader reader = new LineNumberReader(new FileReader(inputFile));

		while (className == null || packageName == null) {
			String line = reader.readLine();
			if (line == null)	break;

			if (packageName == null) {
                Matcher matcher = PACKAGE_PATTERN.matcher(line);
                if (matcher.find()) {
                    packageName = matcher.group(1);
				}
			}

			if (className == null) {
                Matcher matcher = CLASS_PATTERN.matcher(line);
                if (matcher.find()) {
                    className = matcher.group(1);
                }
			}
		}

		// package name may be null, but class name not
		if (className == null) className = "Yylex";
	} 
                            #location 28 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              public void findPackageAndClass() throws IOException {
    // find name of the package and class in jflex source file
    packageName = null;
    className = null;

    LineNumberReader reader = new LineNumberReader(new FileReader(inputFile));
    try {
      while (className == null || packageName == null) {
        String line = reader.readLine();
        if (line == null)
          break;

        if (packageName == null) {
          Matcher matcher = PACKAGE_PATTERN.matcher(line);
          if (matcher.find()) {
            packageName = matcher.group(1);
          }
        }

        if (className == null) {
          Matcher matcher = CLASS_PATTERN.matcher(line);
          if (matcher.find()) {
            className = matcher.group(1);
          }
        }
      }

      // package name may be null, but class name not
      if (className == null) {
        className = "Yylex";
      }
    } finally {
      reader.close();
    }
  }