src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/CSVParseException.java
author ehelin
Fri, 02 Mar 2018 09:20:16 +0100
changeset 49318 f5954447b0bd
parent 47216 71c04702a3d5
permissions -rw-r--r--
8197842: Remove unused macros VM_STRUCTS_EXT and VM_TYPES_EXT Reviewed-by: sjohanss, lfoltan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40596
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
     1
/*
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
     4
 *
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    10
 *
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    15
 * accompanied this code).
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    16
 *
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    20
 *
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    23
 * questions.
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    24
 */
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    25
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    26
package com.sun.tools.jdeprscan;
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    27
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    28
/**
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    29
 * Exception representing an error encountered during CSV parsing.
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    30
 */
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    31
public class CSVParseException extends IllegalArgumentException {
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    32
    private static final long serialVersionUID = 6822670269555409371L;
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    33
    final String input;
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    34
    final int index;
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    35
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    36
    public CSVParseException(String msg, String input, int index) {
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    37
        super(msg);
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    38
        this.input = input;
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    39
        this.index = index;
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    40
    }
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    41
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    42
    public String getInput() { return input; }
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    43
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    44
    public int getIndex() { return index; }
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    45
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    46
    /**
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    47
     * Returns a string describing the parse error.
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    48
     *
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    49
     * @return a string describing the parse error
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    50
     */
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    51
    @Override
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    52
    public String getMessage() {
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    53
        return super.getMessage() + " at index " + index + ": " + input;
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    54
    }
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents:
diff changeset
    55
}