ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/jasper/compiler/DefaultErrorHandler.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/jasper/compiler/DefaultErrorHandler.java
Status
scanned
Type
file
Name
DefaultErrorHandler.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
3299 (3.2 KB)
MD5
d569c7a914737c1b094b85979893b80b
SHA1
f9a1005a25917374744f00b906a0ad4ef62c948f
SHA256
26eb9833813ce3ef8c6610963528f3dff674fc1ca93901fda262a957b64f3ff6
SHA512

      
    
SHA1_git
0ac250d0e6c9d9f9f43c3c0ed5d4937d25de07b0
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
DefaultErrorHandler.java | 3.2 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jasper.compiler; import org.apache.jasper.JasperException; /** * Default implementation of ErrorHandler interface. */ class DefaultErrorHandler implements ErrorHandler { @Override public void jspError(String fname, int line, int column, String errMsg, Exception ex) throws JasperException { throw new JasperException(fname + " (" + Localizer.getMessage("jsp.error.location", Integer.toString(line), Integer.toString(column)) + ") " + errMsg, ex); } @Override public void jspError(String errMsg, Exception ex) throws JasperException { throw new JasperException(errMsg, ex); } @Override public void javacError(JavacErrorDetail[] details) throws JasperException { if (details == null) { return; } Object[] args; StringBuilder buf = new StringBuilder(); for (JavacErrorDetail detail : details) { if (detail.getJspBeginLineNumber() >= 0) { args = new Object[] { Integer.valueOf(detail.getJspBeginLineNumber()), detail.getJspFileName() }; buf.append(System.lineSeparator()); buf.append(System.lineSeparator()); buf.append(Localizer.getMessage("jsp.error.single.line.number", args)); buf.append(System.lineSeparator()); buf.append(detail.getErrorMessage()); buf.append(System.lineSeparator()); buf.append(detail.getJspExtract()); } else { args = new Object[] { Integer.valueOf(detail.getJavaLineNumber()), detail.getJavaFileName() }; buf.append(System.lineSeparator()); buf.append(System.lineSeparator()); buf.append(Localizer.getMessage("jsp.error.java.line.number", args)); buf.append(System.lineSeparator()); buf.append(detail.getErrorMessage()); } } buf.append(System.lineSeparator()); buf.append(System.lineSeparator()); buf.append("Stacktrace:"); throw new JasperException(Localizer.getMessage("jsp.error.unable.compile") + ": " + buf); } @Override public void javacError(String errorReport, Exception exception) throws JasperException { throw new JasperException(Localizer.getMessage("jsp.error.unable.compile"), exception); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
35.95
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9