最终类java8上的ClassFormatError

时间:2015-11-03 23:19:39

标签: java class java-8

我在课堂上获得ClassFormatError的例外:

import org.restlet.ext.jaxb.JaxbRepresentation;

import com.common.client.model.Error;

public final class ErrorHelper {

    /**
     * Private constructor as this is a utility class.
     */
    private ErrorHelper() {
        // do nothing.
    }

    /**
     * Creates a new Error.
     * 
     * @param code
     *            The error code.
     * @param message
     *            The error message.
     * @return The new error.
     */
    public static Error createError(int code, String message) {
        Error error = new Error();
        error.setCode(String.valueOf(code));
        error.setMessage(message);
        return error;
    }

    /**
     * This method creates a JaxbRepresentation of the Error object.
     * 
     * @param code
     *            The error code.
     * @param message
     *            The error message.
     * @return The JaxbRepresentation of the error.
     * @deprecated call getErrorRepresentation from BaseResource
     */
    public static JaxbRepresentation<Error> getJaxbErrorRepresentation(
            int code, String message) {
        Error error = ErrorHelper.createError(code, message);
        JaxbRepresentation<Error> representation = new JaxbRepresentation<Error>(
                error);
        representation.setContextPath(Constants.JAXB_MODEL_PACKAGE);
        return representation;
    }

}

任何想法?

0 个答案:

没有答案