Java 为什么我的while循环不起作用?

Java 为什么我的while循环不起作用?,java,loops,logfile,Java,Loops,Logfile,基本上,它是一个日志文件读取器函数,使用其他日志读取器类及其函数,如 readLine()和hasMoreLines()我不知道为什么我的while循环不能正常工作 因为支持输出我使用标记器生成的所有标记 public void readLogFile() throws Exception { LogReader lr = new LogReader(); LogEntry [] arr = new LogEntry[700]; String logLine;

基本上,它是一个日志文件读取器函数,使用其他日志读取器类及其函数,如 readLine()和hasMoreLines()我不知道为什么我的while循环不能正常工作 因为支持输出我使用标记器生成的所有标记

public void readLogFile() throws Exception {

    LogReader lr = new LogReader();
    LogEntry [] arr = new LogEntry[700];
    String logLine;
    int count = 0;
    System.out.println("OUTSIDE WHILE LOOP"); // for testing

        logLine = lr.fileReader.nextLine(); // objct log reader
        System.out.println("A DAM LINE IN OUTER LOOP"); // for testing
        while (lr.hasMoreLines()) {
            StringTokenizer token = new StringTokenizer(lr.readLine());
            String date = token.nextToken();
            String time = token.nextToken();
            String siteName = token.nextToken();
            String computerName = token.nextToken();
            String sIpAddress = token.nextToken();
            String csMethod = token.nextToken();
            String csUriStem = token.nextToken();
            String csUriQuery = token.nextToken();
            String sPort = token.nextToken();
            String csUsername = token.nextToken();
            String csIpAddress = token.nextToken();
            String csVersion = token.nextToken();
            String csUserAgent = token.nextToken();
            String csCookie = token.nextToken();
            String csReferer = token.nextToken();
            String csHost = token.nextToken();
            String scStatus = token.nextToken();
            String scSubStatus = token.nextToken();
            String scWin32Status = token.nextToken();
            String scBytes = token.nextToken();
            String csBytes = token.nextToken();
            String timeTaken = token.nextToken();
//基本上它不执行下面的这一部分

            LogEntry le = new LogEntry(date, time, siteName, computerName,
                    csMethod, sIpAddress, csUriStem, csUriQuery, sPort,
                    csUsername, csIpAddress, csVersion, csUserAgent,
                    csCookie, csReferer, csHost, scStatus, scSubStatus,
                    scWin32Status, scBytes, csBytes, timeTaken);
            arr[count++]=le;
            System.out.println(le.toString());
            System.out.println("A DAM LINE IN WHILE LOOP"); // for testing
        }

lr刚刚初始化。我看不到任何辅助信息,这说明控件没有进入while循环

不工作意味着什么<代码>输出不正确,
错误或异常
?什么?如果其
输出不正确
,那么接下来会发生什么以及预期会发生什么?如果其
错误或异常
,则发布相关详细信息。不正确的输出,仅在之前显示输出行,而while循环需要输出与string Method关联的日志文件如果其
不正确的输出
,则发布即将出现的内容和预期的内容?你可以更新你的问题。