Pattern 0

    FileInputStream inputFile = new FileInputStream(kms.filename);
    if((line = new DataInputStream(inputFile).readLine()) != null) {


Pattern 1

    while ((line = reader.readLine()) != null)
        else if (isDelim || Character.isWhitespace(c))
          keyString = line.substring(start, pos - 1);
        else
          keyString = line.substring(start, pos);
                if (pos == line.length())


Pattern 2

        while ((n = br.readLine()) != null && n.startsWith("parent ")) {
        String rawAuthor = n.substring("author ".length());
        if (n == null || !n.startsWith("committer ")) {
          throw new CorruptObjectException(commitId, "no committer");
        }


Pattern 3

    DataInputStream dataInput = new DataInputStream(socketIn);
    line = dataInput.readLine();
      dataInput.close();


Pattern 4

                        String line = input.readLine();
                            while (length != 0) {
                                byte[] buffer = new byte[length];
                                input.readFully(buffer);
                                input.readLine();
                                length = Integer.parseInt(input.readLine()16);
                            }
                    input.close();


Pattern 5

        while ((n = br.readLine()) != null && n.startsWith("parent ")) {
        if (n == null || !n.startsWith("author ")) {
          throw new CorruptObjectException(commitId, "no author");
        }
        n = br.readLine();


Pattern 6

        n = br.readLine();
        n = br.readLine();
        int msgstart = readBuf.length != readBuf[0== '\n' 0;


Pattern 7

    while ((line = reader.readLine()) != null)
        while (pos < line.length()
                        if (pos + <= line.length())
                          {
                            char uni = (charInteger.parseInt
                              (line.substring(pos, pos + 4)16);
                            element.append(uni);
                            pos += 4;
                          }        // else throw exception?


Pattern 8

        String line = in.readLine();
        if (line.startsWith("GET /")) {
            line = line.substring(5, line.length()-1).trim();
            int index = line.indexOf(' ');
            if (index != -1) {
                path = line.substring(0, index);
            }
        }


Pattern 9

      String line = dis.readLine().trim();
      if (line.equals("exit")) {
        break;
      }


Pattern 10

    if((line = new DataInputStream(inputFile).readLine()) != null) {
      while(index < line.length()) {
        char c = line.charAt(index++);
        boolean currWhiteSpace = Character.isWhitespace(c);
        if(prevWhiteSpace && !currWhiteSpace){
          numAttributes++;
        }   
        prevWhiteSpace = currWhiteSpace;
      }   


Pattern 11

    DataInputStream reader = new DataInputStream(inStream);
        while (pos < line.length()
               && Character.isWhitespace(c = line.charAt(pos)))
          pos++;
                    line = reader.readLine();


Pattern 12

            dataInputStream = new DataInputStream(new BufferedInputStream(is));
            while (dataInputStream.readLine() != null) {


Pattern 13

    DataInputStream reader = new DataInputStream(inStream);
    while ((line = reader.readLine()) != null)
                    line = reader.readLine();


Pattern 14

      DataInputStream dis = new DataInputStream(is);
        String command = ("q" + dis.readLine()).toLowerCase();
        if (command.equals("ping")) {
          byte[][] byteArrays = new byte[1][];
          byteArrays[0"ping".getBytes();
          return new Command(byteArrays);
        }


Pattern 15

    while ((line = reader.readLine()) != null)
        if ((line.length() - pos== 0
            || line.charAt(pos== '#' || line.charAt(pos== '!')
          continue;
                    while (pos < line.length()
                           && Character.isWhitespace(c = line.charAt(pos)))
                      pos++;


Pattern 16

    while ((line = reader.readLine()) != null)
      {
        char c = 0;
        int pos = 0;
        // Leading whitespaces must be deleted first.
        while (pos < line.length()
               && Character.isWhitespace(c = line.charAt(pos)))
          pos++;

        // If empty line or begins with a comment character, skip this line.
        if ((line.length() - pos== 0
            || line.charAt(pos== '#' || line.charAt(pos== '!')
          continue;

        // The characters up to the next Whitespace, ':', or '='
        // describe the key.  But look for escape sequences.
        // Try to short-circuit when there is no escape char.
        int start = pos;
        boolean needsEscape = line.indexOf('\\', pos!= -1;
        StringBuilder key = needsEscape ? new StringBuilder() null;
        while (pos < line.length()
               && ! Character.isWhitespace(c = line.charAt(pos++))
               && c != '=' && c != ':')
          {
            if (needsEscape && c == '\\')
              {
                if (pos == line.length())
                  {
                    // The line continues on the next line.  If there
                    // is no next line, just treat it as a key with an
                    // empty value.
                    line = reader.readLine();
                    if (line == null)
                      line = "";
                    pos = 0;
                    while (pos < line.length()
                           && Character.isWhitespace(c = line.charAt(pos)))
                      pos++;
                  }
                else
                  {
                    c = line.charAt(pos++);
                    switch (c)
                      {
                      case 'n':
                        key.append('\n');
                        break;
                      case 't':
                        key.append('\t');
                        break;
                      case 'r':
                        key.append('\r');
                        break;
                      case 'u':
                        if (pos + <= line.length())
                          {
                            char uni = (charInteger.parseInt
                              (line.substring(pos, pos + 4)16);
                            key.append(uni);
                            pos += 4;
                          }        // else throw exception?
                        break;
                      default:
                        key.append(c);
                        break;
                      }
                  }
              }
            else if (needsEscape)
              key.append(c);
          }

        boolean isDelim = (c == ':' || c == '=');

        String keyString;
        if (needsEscape)
          keyString = key.toString();
        else if (isDelim || Character.isWhitespace(c))
          keyString = line.substring(start, pos - 1);
        else
          keyString = line.substring(start, pos);

        while (pos < line.length()
               && Character.isWhitespace(c = line.charAt(pos)))
          pos++;

        if (! isDelim && (c == ':' || c == '='))
          {
            pos++;
            while (pos < line.length()
                   && Character.isWhitespace(c = line.charAt(pos)))
              pos++;
          }

        // Short-circuit if no escape chars found.
        if (!needsEscape)
          {
            put(keyString, line.substring(pos));
            continue;
          }

        // Escape char found so iterate through the rest of the line.
        StringBuilder element = new StringBuilder(line.length() - pos);
        while (pos < line.length())
          {
            c = line.charAt(pos++);
            if (c == '\\')
              {
                if (pos == line.length())
                  {
                    // The line continues on the next line.
                    line = reader.readLine();

                    // We might have seen a backslash at the end of
                    // the file.  The JDK ignores the backslash in
                    // this case, so we follow for compatibility.
                    if (line == null)
                      break;

                    pos = 0;
                    while (pos < line.length()
                           && Character.isWhitespace(c = line.charAt(pos)))
                      pos++;
                    element.ensureCapacity(line.length() - pos +
                                           element.length());
                  }
                else
                  {
                    c = line.charAt(pos++);
                    switch (c)
                      {
                      case 'n':
                        element.append('\n');
                        break;
                      case 't':
                        element.append('\t');
                        break;
                      case 'r':
                        element.append('\r');
                        break;
                      case 'u':
                        if (pos + <= line.length())
                          {
                            char uni = (charInteger.parseInt
                              (line.substring(pos, pos + 4)16);
                            element.append(uni);
                            pos += 4;
                          }        // else throw exception?
                        break;
                      default:
                        element.append(c);
                        break;
                      }
                  }
              }
            else
              element.append(c);
          }
        put(keyString, element.toString());
      }


Pattern 17

    while ((line = reader.readLine()) != null)
        StringBuilder element = new StringBuilder(line.length() - pos);
                        element.append(c);


Pattern 18

                   while((CurrLine = JCovd.readLine()) != null ) {
                      if CurrLine.startsWith(JcovClassLine) ) {
                                 if (idx != -1) {
                                     clsName = clsName.substring(0, idx);
                                 }


Pattern 19

           if ((CurrLine != null&& CurrLine.startsWith(JcovMagicLine)) {
                   while((CurrLine = JCovd.readLine()) != null ) {
                      if CurrLine.startsWith(JcovClassLine) ) {
                             first = true;
                             for(Enumeration e = SourceClassList.elements(); e.hasMoreElements();) {
                                 String clsName = CurrLine.substring(JcovClassLine.length());
                                 int idx = clsName.indexOf(' ');

                                 if (idx != -1) {
                                     clsName = clsName.substring(0, idx);
                                 }
                                 Class = (String)e.nextElement();
                                 if Class.compareTo(clsName== 0) {
                                     first = false;
                                     break;
                                 }
                             }
                      }


Pattern 20

            while((line = new DataInputStream(in).readLine()) != null) {
                if((numToken = tok.countTokens()) ) {
                    continue;
                }
                    xy[i= Integer.parseInt(tok.nextToken());


Pattern 21

        if (n == null || !n.startsWith("author ")) {
          throw new CorruptObjectException(commitId, "no author");
        }
        n = br.readLine();
          if (n == null || !n.equals("")) {
            throw new CorruptObjectException(commitId,
                "malformed header:"+n);
        }


Pattern 22

            downloadUrl = new URL(url);
            dataInputStream = new DataInputStream(new BufferedInputStream(is));
            while (dataInputStream.readLine() != null) {
                return true;
            }


Pattern 23

      String cmd = in.readLine();
        cmd = cmd.substring(0, cmd.indexOf("\0$")) + cmd.substring(cmd.indexOf("\0$"2);
        else if (cmd == "telnet") {
          pos = params.indexOf(' ');
          if (pos == -1) {
            pout.println("  Usage: telnet <host> <port>");
          else {
            Socket s;
            handleBackgroundJob(in, new Object[] { "telnet " + params, s = new Socket(params.substring(0, pos), Integer.parseInt(params.substring(pos + 1))), s.getOutputStream()new JShStreamForwarder(s.getInputStream(), pout, ss) });
          }
        else if (cmd == "paste") {
          FileOutputStream fos;
          handleBackgroundJob(in, new Object[] { "paste " + params, fos = new FileOutputStream(fp), fos });
        else if (cmd == "jobs") {
          if (params.length() == 0) {
            for (int i = 0; i < jobs.size(); i++) {
              pout.println((i + 1"\t" ((Object[]) jobs.get(i))[0]);
            }
          else {
            handleBackgroundJob(in, (Object[]) jobs.remove(Integer.parseInt(params1));
          }
        else if (cmd == "exit") {
          break;
        else if (cmd == "help") {
          params = params.toLowerCase().intern();
          if (params == "info") {
            pout.println("info: show system properties.");
            pout.println("  Usage: info [property]");
          else if (params == "pwd") {
            pout.println("pwd: show current directory.");
            pout.println("  Usage: pwd");
          else if (params == "cd") {
            pout.println("cd: change directory.");
            pout.println("  Usage: cd <path>");
          else if (params == "ls") {
            pout.println("ls: list directory.");
            pout.println("  Usage: ls");
          else if (params == "exec") {
            pout.println("exec: execute native command.");
            pout.println("  Usage: exec <command>");
          else if (params == "cat") {
            pout.println("cat: show text file.");
            pout.println("  Usage: cat <filename>");
          else if (params == "wget") {
            pout.println("wget: download file.");
            pout.println("  Usage: wget <URL> <filename>");
          else if (params == "telnet") {
            pout.println("telnet: create TCP connection.");
            pout.println("  Usage: telnet <host> <port>");
          else if (params == "paste") {
            pout.println("paste: create text file.");
            pout.println("  Usage: paste <filename>");
          else if (params == "jobs") {
            pout.println("jobs: list or continue jobs.");
            pout.println("  Usage: jobs [index]");
          else if (params == "exit") {
            pout.println("exit: Exit JSh.");
            pout.println("  Usage: exit");
          else {
            pout.println("help: show information about commands.");
            pout.println("  Usage: help [command]");
            pout.println();
            pout.println("Supported commands:");
            pout.println("    help   - show this help");
            pout.println("    info   - list system properties");
            pout.println("    pwd    - show current directory");
            pout.println("    cd     - change directory");
            pout.println("    ls     - list directory");
            pout.println("    exec   - execute native command");
            pout.println("    cat    - show text file");
            pout.println("    wget   - download file");
            pout.println("    telnet - create TCP connection");
            pout.println("    paste  - create text file");
            pout.println("    jobs   - list or continue jobs");
            pout.println("    exit   - Exit JSh");
            pout.println();
            pout.println("When inside an interactive command, enter ~. on a new");
            pout.println("line to exit from that command. Enter ~& to background the command.");
            pout.println("Enter ~~ to start a line with a ~ character");
          }
        else {
          pout.println("Unknown command: " + cmd);
          pout.println("Type help for more info.");
        }


Pattern 24

    DataInputStream dataInput = new DataInputStream(socketIn);
    String line = dataInput.readLine();
    while (line != null && line.length() 0) {
      String[] strs = line.split(":");

      if (strs.length >= 2) {
        putHeaderField(strs[0], strs[1]);
      }

      line = dataInput.readLine();
    }
      dataInput.close();


Pattern 25

        DataInputStream dis = new DataInputStream(bis);
            sb.append((new StringBuilder()).append(dis.readLine()).append(newLineString));
        dis.close();


Pattern 26

    BufferedInputStream bis = new BufferedInputStream(fis);
    DataInputStream dis = new DataInputStream(bis);
      qsb.append(dis.readLine() "\n");
    dis.close();


Pattern 27

      String cmd = in.readLine();
      while (cmd.indexOf("\0$"!= -1) {
        cmd = cmd.substring(0, cmd.indexOf("\0$")) + cmd.substring(cmd.indexOf("\0$"2);
      }
      if (pos != -1) {
        params = cmd.substring(pos + 1);
        cmd = cmd.substring(0, pos);
      }
            pout.println(dir[i].getName() "\t" (dir[i].isDirectory() "[DIR]" "" + dir[i].length()) "\t" new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(dir[i].lastModified())));


Pattern 28

        String line = in.readLine();
                path = line.substring(0, index);
        if (path.length() != 0) {
            return path;
        else {
            throw new IOException("Malformed Header");
        }


Pattern 29

    while ((line = reader.readLine()) != null)
        if ((line.length() - pos== 0
            || line.charAt(pos== '#' || line.charAt(pos== '!')
          continue;
                              (line.substring(pos, pos + 4)16);
                if (pos == line.length())


Pattern 30

      String line = dis.readLine().trim();
      if (line.length() == 0)
        continue;
        String dest = line.substring(pos + 4).trim();
        if (source.startsWith(":")) {
          sourcetarget = 1;
          source = source.substring(1);
        }


Pattern 31

      String line = dis.readLine().trim();
      if (line.length() == 0)
        continue;
      else if (line.startsWith("+")) {
        line = line.substring(1);


Pattern 32

    String str = is.readLine();
    if (!str.startsWith("HTTP/1.0 200 ")) {
      if (str.startsWith("HTTP/1.0 "))
  str = str.substring(9);
      throw new IOException("Proxy reports \"" + str + "\"");
    }
      str = is.readLine();


Pattern 33

    while ((line = reader.readLine()) != null)
            if (needsEscape && c == '\\')
              {
                if (pos == line.length())
                  {
                    // The line continues on the next line.  If there
                    // is no next line, just treat it as a key with an
                    // empty value.
                    line = reader.readLine();
                    if (line == null)
                      line = "";
                    pos = 0;
                    while (pos < line.length()
                           && Character.isWhitespace(c = line.charAt(pos)))
                      pos++;
                  }
                else
                  {
                    c = line.charAt(pos++);
                    switch (c)
                      {
                      case 'n':
                        key.append('\n');
                        break;
                      case 't':
                        key.append('\t');
                        break;
                      case 'r':
                        key.append('\r');
                        break;
                      case 'u':
                        if (pos + <= line.length())
                          {
                            char uni = (charInteger.parseInt
                              (line.substring(pos, pos + 4)16);
                            key.append(uni);
                            pos += 4;
                          }        // else throw exception?
                        break;
                      default:
                        key.append(c);
                        break;
                      }
                  }
              }
            else if (needsEscape)
              key.append(c);
        else if (isDelim || Character.isWhitespace(c))
          keyString = line.substring(start, pos - 1);
        else
          keyString = line.substring(start, pos);


Pattern 34

    while ((line = reader.readLine()) != null)
                if (pos == line.length())
                  {
                    // The line continues on the next line.  If there
                    // is no next line, just treat it as a key with an
                    // empty value.
                    line = reader.readLine();
                    if (line == null)
                      line = "";
                    pos = 0;
                    while (pos < line.length()
                           && Character.isWhitespace(c = line.charAt(pos)))
                      pos++;
                  }
                else
                  {
                    c = line.charAt(pos++);
                    switch (c)
                      {
                      case 'n':
                        key.append('\n');
                        break;
                      case 't':
                        key.append('\t');
                        break;
                      case 'r':
                        key.append('\r');
                        break;
                      case 'u':
                        if (pos + <= line.length())
                          {
                            char uni = (charInteger.parseInt
                              (line.substring(pos, pos + 4)16);
                            key.append(uni);
                            pos += 4;
                          }        // else throw exception?
                        break;
                      default:
                        key.append(c);
                        break;
                      }
                  }
            put(keyString, line.substring(pos));
                    if (line == null)
                      break;


Pattern 35

      String line = dis.readLine().trim();
        line = line.substring(1);
        if (source.startsWith(":")) {
          sourcetarget = 1;
          source = source.substring(1);
        }
        if (dest.startsWith(":")) {
          desttarget = 1;
          dest = dest.substring(1);
        }


Pattern 36

      String cmd = in.readLine();
        else if (cmd == "ls") {
          final File[] roots = File.listRoots();
          for (int i = 0; i < roots.length; i++) {
            pout.println(roots[i].getAbsolutePath() "\t[ROOT]");
          }
          pout.println();
          final File[] dir = pwd.listFiles();
          for (int i = 0; i < dir.length; i++) {
            pout.println(dir[i].getName() "\t" (dir[i].isDirectory() "[DIR]" "" + dir[i].length()) "\t" new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(dir[i].lastModified())));
          }
        else if (cmd == "exec") {
          Process proc;
          handleBackgroundJob(in, new Object[] { "exec " + params, proc = Runtime.getRuntime().exec(params), proc.getOutputStream()new JShStreamForwarder(proc.getInputStream(), pout, ss)new JShStreamForwarder(proc.getErrorStream(), pout, ss) });
        else if (cmd == "cat") {
          final FileInputStream fis = new FileInputStream(fp);
          forward(fis, pout);
        else if (cmd == "wget") {
          pos = params.indexOf(' ');
          if (pos == -1) {
            pout.println("  Usage: wget <URL> <filename>");
          else {
            File f = new File(params.substring(pos + 1));
            if (!f.isAbsolute())
              f = new File(pwd, params.substring(pos + 1));
            final FileOutputStream fos = new FileOutputStream(f);
            forward(new URL(params.substring(0, pos)).openStream(), fos);
            fos.close();
          }
        else if (cmd == "telnet") {
          pos = params.indexOf(' ');
          if (pos == -1) {
            pout.println("  Usage: telnet <host> <port>");
          else {
            Socket s;
            handleBackgroundJob(in, new Object[] { "telnet " + params, s = new Socket(params.substring(0, pos), Integer.parseInt(params.substring(pos + 1))), s.getOutputStream()new JShStreamForwarder(s.getInputStream(), pout, ss) });
          }
        else if (cmd == "paste") {
          FileOutputStream fos;
          handleBackgroundJob(in, new Object[] { "paste " + params, fos = new FileOutputStream(fp), fos });
        else if (cmd == "jobs") {
          if (params.length() == 0) {
            for (int i = 0; i < jobs.size(); i++) {
              pout.println((i + 1"\t" ((Object[]) jobs.get(i))[0]);
            }
          else {
            handleBackgroundJob(in, (Object[]) jobs.remove(Integer.parseInt(params1));
          }
        else if (cmd == "exit") {
          break;
        else if (cmd == "help") {
          params = params.toLowerCase().intern();
          if (params == "info") {
            pout.println("info: show system properties.");
            pout.println("  Usage: info [property]");
          else if (params == "pwd") {
            pout.println("pwd: show current directory.");
            pout.println("  Usage: pwd");
          else if (params == "cd") {
            pout.println("cd: change directory.");
            pout.println("  Usage: cd <path>");
          else if (params == "ls") {
            pout.println("ls: list directory.");
            pout.println("  Usage: ls");
          else if (params == "exec") {
            pout.println("exec: execute native command.");
            pout.println("  Usage: exec <command>");
          else if (params == "cat") {
            pout.println("cat: show text file.");
            pout.println("  Usage: cat <filename>");
          else if (params == "wget") {
            pout.println("wget: download file.");
            pout.println("  Usage: wget <URL> <filename>");
          else if (params == "telnet") {
            pout.println("telnet: create TCP connection.");
            pout.println("  Usage: telnet <host> <port>");
          else if (params == "paste") {
            pout.println("paste: create text file.");
            pout.println("  Usage: paste <filename>");
          else if (params == "jobs") {
            pout.println("jobs: list or continue jobs.");
            pout.println("  Usage: jobs [index]");
          else if (params == "exit") {
            pout.println("exit: Exit JSh.");
            pout.println("  Usage: exit");
          else {
            pout.println("help: show information about commands.");
            pout.println("  Usage: help [command]");
            pout.println();
            pout.println("Supported commands:");
            pout.println("    help   - show this help");
            pout.println("    info   - list system properties");
            pout.println("    pwd    - show current directory");
            pout.println("    cd     - change directory");
            pout.println("    ls     - list directory");
            pout.println("    exec   - execute native command");
            pout.println("    cat    - show text file");
            pout.println("    wget   - download file");
            pout.println("    telnet - create TCP connection");
            pout.println("    paste  - create text file");
            pout.println("    jobs   - list or continue jobs");
            pout.println("    exit   - Exit JSh");
            pout.println();
            pout.println("When inside an interactive command, enter ~. on a new");
            pout.println("line to exit from that command. Enter ~& to background the command.");
            pout.println("Enter ~~ to start a line with a ~ character");
          }
        else {
          pout.println("Unknown command: " + cmd);
          pout.println("Type help for more info.");
        }


Pattern 37

      String cmd = in.readLine();
      if (cmd.length() == 0) {
        continue;
      }
          if (fp.exists() && fp.isDirectory()) {
            pwd = fp.getCanonicalFile();
          else {
            pout.println("Path not found.");
          }
        else if (cmd == "exit") {
          break;
        else if (cmd == "help") {
          params = params.toLowerCase().intern();
          if (params == "info") {
            pout.println("info: show system properties.");
            pout.println("  Usage: info [property]");
          else if (params == "pwd") {
            pout.println("pwd: show current directory.");
            pout.println("  Usage: pwd");
          else if (params == "cd") {
            pout.println("cd: change directory.");
            pout.println("  Usage: cd <path>");
          else if (params == "ls") {
            pout.println("ls: list directory.");
            pout.println("  Usage: ls");
          else if (params == "exec") {
            pout.println("exec: execute native command.");
            pout.println("  Usage: exec <command>");
          else if (params == "cat") {
            pout.println("cat: show text file.");
            pout.println("  Usage: cat <filename>");
          else if (params == "wget") {
            pout.println("wget: download file.");
            pout.println("  Usage: wget <URL> <filename>");
          else if (params == "telnet") {
            pout.println("telnet: create TCP connection.");
            pout.println("  Usage: telnet <host> <port>");
          else if (params == "paste") {
            pout.println("paste: create text file.");
            pout.println("  Usage: paste <filename>");
          else if (params == "jobs") {
            pout.println("jobs: list or continue jobs.");
            pout.println("  Usage: jobs [index]");
          else if (params == "exit") {
            pout.println("exit: Exit JSh.");
            pout.println("  Usage: exit");
          else {
            pout.println("help: show information about commands.");
            pout.println("  Usage: help [command]");
            pout.println();
            pout.println("Supported commands:");
            pout.println("    help   - show this help");
            pout.println("    info   - list system properties");
            pout.println("    pwd    - show current directory");
            pout.println("    cd     - change directory");
            pout.println("    ls     - list directory");
            pout.println("    exec   - execute native command");
            pout.println("    cat    - show text file");
            pout.println("    wget   - download file");
            pout.println("    telnet - create TCP connection");
            pout.println("    paste  - create text file");
            pout.println("    jobs   - list or continue jobs");
            pout.println("    exit   - Exit JSh");
            pout.println();
            pout.println("When inside an interactive command, enter ~. on a new");
            pout.println("line to exit from that command. Enter ~& to background the command.");
            pout.println("Enter ~~ to start a line with a ~ character");
          }
        else {
          pout.println("Unknown command: " + cmd);
          pout.println("Type help for more info.");
        }


Pattern 38

    if (line == null) {
      return null;
    }
    line = in.readLine();
      if (line.isEmpty()) {
        break;
      }
      if (index == -1) {
        header.headers.put(line, "");
      else {
        header.headers.put(line.substring(0, index), line.substring(index + 1).trim());
      }


Pattern 39

                input = new DataInputStream (urlConn.getInputStream ());
                while (null != (str = input.readLine()))
                {
                   returnStr.append(str);
                }


Pattern 40

      dos = new DataOutputStream(conn.getOutputStream());
      dos.flush();
      inStream = new DataInputStream(conn.getInputStream());
      while ((str = inStream.readLine()) != null) {


Pattern 41

      dis = new DataInputStream(new BufferedInputStream(is));
      while ((s = dis.readLine()) != null)
        sb.append(s + "\n");


Pattern 42

        DataInputStream dis = new DataInputStream(new FileInputStream(order));
        while ((line = dis.readLine()) != null) {
          File file = config.getPodcastRootPath(line);
          if (file.exists()) {
            metas.add(new MetaFile(file));
                                                if currentName != null && currentName.equals(file.getName()) )
                                                {
                                                   currentIndex = metas.size() 1;
                                             Log.d("CarCast""currentIndex: " + currentIndex);
                                                }
          }
        }


Pattern 43

    DataInputStream reader = new DataInputStream(inStream);
    while ((line = reader.readLine()) != null)
                    if (line == null)
                      line = "";
                if (pos == line.length())


Pattern 44

    final DataInputStream in = new DataInputStream(new PipedInputStream(signalStream));
      String cmd = in.readLine();
          if (pos == -1) {
            pout.println("  Usage: wget <URL> <filename>");
          else {
            File f = new File(params.substring(pos + 1));
            if (!f.isAbsolute())
              f = new File(pwd, params.substring(pos + 1));
            final FileOutputStream fos = new FileOutputStream(f);
            forward(new URL(params.substring(0, pos)).openStream(), fos);
            fos.close();
          }
        else if (cmd == "paste") {
          FileOutputStream fos;
          handleBackgroundJob(in, new Object[] { "paste " + params, fos = new FileOutputStream(fp), fos });
        else if (cmd == "jobs") {
          if (params.length() == 0) {
            for (int i = 0; i < jobs.size(); i++) {
              pout.println((i + 1"\t" ((Object[]) jobs.get(i))[0]);
            }
          else {
            handleBackgroundJob(in, (Object[]) jobs.remove(Integer.parseInt(params1));
          }
        else if (cmd == "exit") {
          break;
        else if (cmd == "help") {
          params = params.toLowerCase().intern();
          if (params == "info") {
            pout.println("info: show system properties.");
            pout.println("  Usage: info [property]");
          else if (params == "pwd") {
            pout.println("pwd: show current directory.");
            pout.println("  Usage: pwd");
          else if (params == "cd") {
            pout.println("cd: change directory.");
            pout.println("  Usage: cd <path>");
          else if (params == "ls") {
            pout.println("ls: list directory.");
            pout.println("  Usage: ls");
          else if (params == "exec") {
            pout.println("exec: execute native command.");
            pout.println("  Usage: exec <command>");
          else if (params == "cat") {
            pout.println("cat: show text file.");
            pout.println("  Usage: cat <filename>");
          else if (params == "wget") {
            pout.println("wget: download file.");
            pout.println("  Usage: wget <URL> <filename>");
          else if (params == "telnet") {
            pout.println("telnet: create TCP connection.");
            pout.println("  Usage: telnet <host> <port>");
          else if (params == "paste") {
            pout.println("paste: create text file.");
            pout.println("  Usage: paste <filename>");
          else if (params == "jobs") {
            pout.println("jobs: list or continue jobs.");
            pout.println("  Usage: jobs [index]");
          else if (params == "exit") {
            pout.println("exit: Exit JSh.");
            pout.println("  Usage: exit");
          else {
            pout.println("help: show information about commands.");
            pout.println("  Usage: help [command]");
            pout.println();
            pout.println("Supported commands:");
            pout.println("    help   - show this help");
            pout.println("    info   - list system properties");
            pout.println("    pwd    - show current directory");
            pout.println("    cd     - change directory");
            pout.println("    ls     - list directory");
            pout.println("    exec   - execute native command");
            pout.println("    cat    - show text file");
            pout.println("    wget   - download file");
            pout.println("    telnet - create TCP connection");
            pout.println("    paste  - create text file");
            pout.println("    jobs   - list or continue jobs");
            pout.println("    exit   - Exit JSh");
            pout.println();
            pout.println("When inside an interactive command, enter ~. on a new");
            pout.println("line to exit from that command. Enter ~& to background the command.");
            pout.println("Enter ~~ to start a line with a ~ character");
          }
        else {
          pout.println("Unknown command: " + cmd);
          pout.println("Type help for more info.");
        }


Pattern 45

    DataInputStream reader = new DataInputStream(inStream);
                if (pos == line.length())
                  {
                    // The line continues on the next line.  If there
                    // is no next line, just treat it as a key with an
                    // empty value.
                    line = reader.readLine();
                    if (line == null)
                      line = "";
                    pos = 0;
                    while (pos < line.length()
                           && Character.isWhitespace(c = line.charAt(pos)))
                      pos++;
                  }
                else
                  {
                    c = line.charAt(pos++);
                    switch (c)
                      {
                      case 'n':
                        key.append('\n');
                        break;
                      case 't':
                        key.append('\t');
                        break;
                      case 'r':
                        key.append('\r');
                        break;
                      case 'u':
                        if (pos + <= line.length())
                          {
                            char uni = (charInteger.parseInt
                              (line.substring(pos, pos + 4)16);
                            key.append(uni);
                            pos += 4;
                          }        // else throw exception?
                        break;
                      default:
                        key.append(c);
                        break;
                      }
                  }
                    line = reader.readLine();


Pattern 46

             StringBuilder minBINString = new StringBuilder();
                while (null != (str = input.readLine()))
                   returnStr.append(str);
                input.close ();


Pattern 47

                url = new URL ("http://www.ea.com/p/fut/a/card/l/en_GB/s/p/ut/game/ut11/purchased/items");}
                input = new DataInputStream (urlConn.getInputStream ());
                while (null != (str = input.readLine()))
                {
                   returnStr.append(str);
                }
                input.close ();


Pattern 48

      String line = in.readLine();
      if (line.equals("exit")) break;
          if (line.indexOf(' ')== -&& line.indexOf('['== -&& line.indexOf('/'== -1
            line += "/";
                if(mthds[i].getName().startsWith(line.substring(pos+1))) {
                  values[++maxUsed= mthds[i];
                }


Pattern 49

    while ((line = reader.readLine()) != null)
                if (pos == line.length())
                  {
                    // The line continues on the next line.  If there
                    // is no next line, just treat it as a key with an
                    // empty value.
                    line = reader.readLine();
                    if (line == null)
                      line = "";
                    pos = 0;
                    while (pos < line.length()
                           && Character.isWhitespace(c = line.charAt(pos)))
                      pos++;
                  }
                else
                  {
                    c = line.charAt(pos++);
                    switch (c)
                      {
                      case 'n':
                        key.append('\n');
                        break;
                      case 't':
                        key.append('\t');
                        break;
                      case 'r':
                        key.append('\r');
                        break;
                      case 'u':
                        if (pos + <= line.length())
                          {
                            char uni = (charInteger.parseInt
                              (line.substring(pos, pos + 4)16);
                            key.append(uni);
                            pos += 4;
                          }        // else throw exception?
                        break;
                      default:
                        key.append(c);
                        break;
                      }
                  }
            else if (needsEscape)
              key.append(c);
                              (line.substring(pos, pos + 4)16);


Pattern 50

                URLConnection connection = url.openConnection();
                DataInputStream input = new DataInputStream(connection.getInputStream());
                while (null != ((response = input.readLine()))) {
                    System.err.println(response);
                }
                input.close();


Pattern 51

           DataInputStream JCovd = new DataInputStream(
                                                       new BufferedInputStream(
                                                                               new FileInputStream(outFile)));
           CurrLine = JCovd.readLine();
                   while((CurrLine = JCovd.readLine()) != null ) {
                      if CurrLine.startsWith(JcovClassLine) ) {
                             first = true;
                             for(Enumeration e = SourceClassList.elements(); e.hasMoreElements();) {
                                 String clsName = CurrLine.substring(JcovClassLine.length());
                                 int idx = clsName.indexOf(' ');

                                 if (idx != -1) {
                                     clsName = clsName.substring(0, idx);
                                 }
                                 Class = (String)e.nextElement();
                                 if Class.compareTo(clsName== 0) {
                                     first = false;
                                     break;
                                 }
                             }
                      }
                      if (first)        // re-write old class
                          TmpCovTable.addElement(CurrLine);
                   }
           JCovd.close();
        PrintStream CovFile = new PrintStream(new DataOutputStream(new FileOutputStream(outFile)));


Pattern 52

      String cmd = in.readLine();
            if (!f.isAbsolute())
              f = new File(pwd, params.substring(pos + 1));
        else if (cmd == "paste") {
          FileOutputStream fos;
          handleBackgroundJob(in, new Object[] { "paste " + params, fos = new FileOutputStream(fp), fos });
        else if (cmd == "jobs") {
          if (params.length() == 0) {
            for (int i = 0; i < jobs.size(); i++) {
              pout.println((i + 1"\t" ((Object[]) jobs.get(i))[0]);
            }
          else {
            handleBackgroundJob(in, (Object[]) jobs.remove(Integer.parseInt(params1));
          }
        else if (cmd == "exit") {
          break;
        else if (cmd == "help") {
          params = params.toLowerCase().intern();
          if (params == "info") {
            pout.println("info: show system properties.");
            pout.println("  Usage: info [property]");
          else if (params == "pwd") {
            pout.println("pwd: show current directory.");
            pout.println("  Usage: pwd");
          else if (params == "cd") {
            pout.println("cd: change directory.");
            pout.println("  Usage: cd <path>");
          else if (params == "ls") {
            pout.println("ls: list directory.");
            pout.println("  Usage: ls");
          else if (params == "exec") {
            pout.println("exec: execute native command.");
            pout.println("  Usage: exec <command>");
          else if (params == "cat") {
            pout.println("cat: show text file.");
            pout.println("  Usage: cat <filename>");
          else if (params == "wget") {
            pout.println("wget: download file.");
            pout.println("  Usage: wget <URL> <filename>");
          else if (params == "telnet") {
            pout.println("telnet: create TCP connection.");
            pout.println("  Usage: telnet <host> <port>");
          else if (params == "paste") {
            pout.println("paste: create text file.");
            pout.println("  Usage: paste <filename>");
          else if (params == "jobs") {
            pout.println("jobs: list or continue jobs.");
            pout.println("  Usage: jobs [index]");
          else if (params == "exit") {
            pout.println("exit: Exit JSh.");
            pout.println("  Usage: exit");
          else {
            pout.println("help: show information about commands.");
            pout.println("  Usage: help [command]");
            pout.println();
            pout.println("Supported commands:");
            pout.println("    help   - show this help");
            pout.println("    info   - list system properties");
            pout.println("    pwd    - show current directory");
            pout.println("    cd     - change directory");
            pout.println("    ls     - list directory");
            pout.println("    exec   - execute native command");
            pout.println("    cat    - show text file");
            pout.println("    wget   - download file");
            pout.println("    telnet - create TCP connection");
            pout.println("    paste  - create text file");
            pout.println("    jobs   - list or continue jobs");
            pout.println("    exit   - Exit JSh");
            pout.println();
            pout.println("When inside an interactive command, enter ~. on a new");
            pout.println("line to exit from that command. Enter ~& to background the command.");
            pout.println("Enter ~~ to start a line with a ~ character");
          }
        else {
          pout.println("Unknown command: " + cmd);
          pout.println("Type help for more info.");
        }


Pattern 53

      String cmd = in.readLine();
            pout.println(dir[i].getName() "\t" (dir[i].isDirectory() "[DIR]" "" + dir[i].length()) "\t" new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(dir[i].lastModified())));
            File f = new File(params.substring(pos + 1));
          if (pos == -1) {
            pout.println("  Usage: telnet <host> <port>");
          else {
            Socket s;
            handleBackgroundJob(in, new Object[] { "telnet " + params, s = new Socket(params.substring(0, pos), Integer.parseInt(params.substring(pos + 1))), s.getOutputStream()new JShStreamForwarder(s.getInputStream(), pout, ss) });
          }
          if (params.length() == 0) {
            for (int i = 0; i < jobs.size(); i++) {
              pout.println((i + 1"\t" ((Object[]) jobs.get(i))[0]);
            }
          else {
            handleBackgroundJob(in, (Object[]) jobs.remove(Integer.parseInt(params1));
          }


Pattern 54

    dos = new DataOutputStreamconn.getOutputStream() );
    dos.flush();
      inStream = new DataInputStream conn.getInputStream() );
    while (( line = inStream.readLine()) != null) {
      responseString.append(line);
    }


Pattern 55

                printout = new DataOutputStream (urlConn.getOutputStream ());
                printout.writeBytes (content);
                printout.flush ();
                input = new DataInputStream (urlConn.getInputStream ());
                while (null != (str = input.readLine()))


Pattern 56

                URL url = new URL(urlString);
                URLConnection connection = url.openConnection();
                DataInputStream input = new DataInputStream(connection.getInputStream());
                while (null != ((response = input.readLine()))) {
                    System.err.println(response);
                }
                input.close();


Pattern 57

                url = new URL ("http://www.ea.com/p/fut/a/card/l/en_GB/s/p/ut/game/ut11/purchased/items?timestamp=0");
                urlConn = url.openConnection();
                input = new DataInputStream (urlConn.getInputStream ());
                while (null != (str = input.readLine()))
                {
                   returnStr.append(str);
                }
                input.close ();