Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: include executed statements of exception throwing block ignored by Jacoco #118

Merged
merged 6 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/install_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ mvn clean test -DskipTests -Dmaven.compiler.source=$SRC_VERSION -Dmaven.compiler
# Compile real projects
if [ $JAVA_MAJOR_VERSION -eq "8" ]; then
mvn clean test -DskipTests -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8 -B -f examples/math_70/
mvn clean test -DskipTests -Dmaven.compiler.source=1.5 -Dmaven.compiler.target=1.5 -B -f examples/cl2/
fi

# Copy compiled classes to non-maven mirror projects
Expand Down
105 changes: 105 additions & 0 deletions examples/cl2/DEVELOPERS-GUIDE.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<html>
<head>
<title>Developers guide for Jakarta Commons "Lang" Package</title>
<head>
<body bgcolor="white">


<div align="center">
<h1>The Jakarta Commons <em>Lang</em> Package</h1>
<h2>Developers Guide</h2>
$Id: DEVELOPERS-GUIDE.html,v 1.1 2002/12/22 21:07:35 scolebourne Exp $<br />
<a href="#Introduction">[Introduction]</a>
<a href="#PackageStructure">[Package Structure]</a>
<a href="#UtilityClasses">[Utility Classes]</a>
<a href="#Javadoc">[Javadoc]</a>
<br /><br />
</div>


<a name="Introduction"></a>
<h3>1. INTRODUCTION</h3>

<p>The <em>Lang</em> package contains a set of Java classes that extend
the basic JDK classes. This developers guide seeks to set
out rules for the naming of classes and methods within the package. The purpose
of this, as with all naming standards, is to improve the coherency and
consistency of the whole API.</p>

<p>The philosophy of the naming standards is to follow those of the JDK
if possible.</p>



<a name="PackageStructure"></a>
<h3>2. PACKAGE STRUCTURE</h3>

<p>The main package for Lang is <code>org.apache.commons.lang</code>. Subpackages should
be created for each group of related items. </p>

<p>Each package should have a <code>package.html</code> file for javadoc. This should
describe the use of the package and its scope.</p>



<a name="UtilityClasses"></a>
<h3>3. UTILITY CLASSES</h3>

<p>Utility classes provide additional functionality around a class or interface.
Examples include StringUtils and SerializationUtils.</p>

<p>Each class shall follow the naming pattern XxxUtils where Xxx relates to the
class or interface that the utility services. Variations on a theme (<code>Integer</code>
as opposed to <code>Number</code>) should be dealt with in one Utils class where possible.
Each Utils class shall:</p>

<ul>
<li>be a single, static method based, class</li>
<li>have a name consisting of the interface name plus 'Utils'</li>
<li>deal with one class or interface and its variations (subclasses)</li>
<li>provide methods that perform useful utility functions</li>
</ul>

<p>A utility class can act as a factory for specific implementations of a class or
interface. In such cases the implementations should be non-public, static, inner classes
of the utility class. However, if warranted due to maintenance or other reasons, these
decorator classes may be moved to top-level classes in a subpackage. The
naming of such a subpackage should be discussed and agreed upon on the
developers mailing list.</p>



<a name="Javadoc"></a>
<h3>4. JAVADOC</h3>

<p>The Sun javadoc guidelines are the starting point for Lang. These points are
an extension to make it easier for users reading the generated
docs and developers with javadoc-popup capabilities from within their IDE.</p>

<h4>General</h4>
<p>References to other objects, interfaces or methods use the @link-tag the
first time it is referenced in a class or interface. On the following
references always enclose it inside &lt;code&gt;&lt;/code&gt;.</p>

<p>References to <code>null</code>, <code>this</code>, <code>long</code>,
<code>int</code>, <code>short</code>, <code>char</code>, <code>byte</code>,
<code>double</code>, <code>float</code> and <code>boolean</code> should be enclosed
in &lt;code&gt;&lt;/code&gt;.</p>

<h4>Classes/Interfaces/Methods</h4>
<p>Use a short description of what the class/interface/method is used for,
enclose with &lt;p&gt;&lt;/p&gt;.</p>

<p>A longer description about what the class/interface/method is used for
and if it is needed how it is done. If it is nessesary include
description of the parameters, what they are used for and how. Enclose
with &lt;p&gt;&lt;/p&gt; where it is needed, try to divide into smaller parts (not
to small!) to enhance readability of the generated Javadoc.</p>

<p>If an example is needed enclose it with &lt;pre&gt;&lt;/pre&gt;.
It should be supported with an explanation within a normal paragraph.</p>

</body>
</html>


53 changes: 53 additions & 0 deletions examples/cl2/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [email protected].
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
74 changes: 74 additions & 0 deletions examples/cl2/PROPOSAL.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<html>
<head>
<title>Proposal for Lang Package</title>
</head>
<body bgcolor="white">

<div align="center">
<h1>Proposal for <em>Lang</em> Package</h1>
</div>

<h3>(0) Rationale</h3>

<p>The standard Java libraries fail to provide enough methods for
manipulation of its main components. The <em>Lang</em> Package provides
these extra methods. There are other classes which might justifiably
be included in java.lang someday, this package also provides for them.</p>


<h3>(1) Scope of the Package</h3>

<p>This proposal is to create a package of Java utility classes for the
classes that are in java.lang's hierarchy, or are considered to be so
standard as to justify existence in java.lang. The <em>Lang</em> Package
also applies to primitives and arrays.</p>


<h3>(1.5) Interaction With Other Packages</h3>

<p><em>Lang</em> relies only on standard JDK 1.2 (or later) APIs for
production deployment. It utilizes the JUnit unit testing framework for
developing and executing unit tests, but this is of interest only to
developers of the component. Lang will be a dependency for
several existing components in the open source world.</p>

<p>No external configuration files are utilized.</p>


<h3>(2) Initial Source of the Package</h3>

<p>The initial classes came from the Commons.Util subproject.</p>

<p>The proposed package name for the new component is
<code>org.apache.commons.lang</code>.</p>


<h3>(3) Required Jakarta-Commons Resources</h3>

<ul>
<li>CVS Repository - New directory <code>lang</code> in the
<code>jakarta-commons</code> CVS repository.</li>
<li>Mailing List - Discussions will take place on the general
<em>[email protected]</em> mailing list. To help
list subscribers identify messages of interest, it is suggested that
the message subject of messages about this component be prefixed with
[lang].</li>
<li>Bugzilla - New component "Lang" under the "Commons" product
category, with appropriate version identifiers as needed.</li>
<li>Jyve FAQ - New category "commons-lang" (when available).</li>
</ul>


<h3>(4) Initial Committers</h3>

<p>The initial committers on the Lang component shall be as follows:
<ul>
<li>Henri Yandell (bayard)</li>
<li>Daniel Rall (dlr)</li>
<li>Stephen Colebourne (scolebourne)</li>
<!-- Add your real name and user name here -->
</ul>
</p>

</body>
</html>
146 changes: 146 additions & 0 deletions examples/cl2/RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
$Id: RELEASE-NOTES.txt,v 1.4 2002/09/25 10:29:56 scolebourne Exp $

Commons Lang Package
Version 1.0
Release Notes


INTRODUCTION:

This document contains the release notes for this version of the Commons
Lang package. Commons Lang is a set of utility functions and reusable
components that should be a help in any Java environment.

NEW FEATURES:

Since the release of the b1 package the following have been added:

lang.
SystemUtils:
Brings together many system specific variables under one easy component.

exception.
ExceptionUtils:
Provides helpful static functions for dealing with Exceptions.
NestableError :
Adds nesting ability to Errors.

enum sub-package:
A solid version of the typical Java translation of a C enum.

builder sub-package:
A series of helpers for handling standard Object methods such as equals,
toString, compareTo and hashCode in a professional manner.


BUG FIXES:

StringUtils.stripStart and stripEnd were improved to match their Javadoc.
StringUtils.convertUnicodeToNative and convertNativeToUnicode both removed.
Both methods did not work properly.


DEPRECATIONS:

Much of the exception subpackage was reworked betwen 1.0-b1 and 1.0. Apart
from this the API should have a high level of backward compatibility.


CHANGES: [In 'diff' format]

Jar changes
===========
> org.apache.commons.lang.exception.ExceptionUtils
> org.apache.commons.lang.exception.NestableError
> org.apache.commons.lang.ObjectUtils$Null
> org.apache.commons.lang.ObjectUtils$1
> org.apache.commons.lang.enums.Enum$Entry
> org.apache.commons.lang.enums.Enum$1
> org.apache.commons.lang.enums.Enum
> org.apache.commons.lang.enums.EnumUtils
> org.apache.commons.lang.enums.ValuedEnum
> org.apache.commons.lang.builder.CompareToBuilder
> org.apache.commons.lang.builder.EqualsBuilder
> org.apache.commons.lang.builder.HashCodeBuilder
> org.apache.commons.lang.builder.StandardToStringStyle
> org.apache.commons.lang.builder.ToStringStyle$DefaultToStringStyle
> org.apache.commons.lang.builder.ToStringStyle$NoFieldNameToStringStyle
> org.apache.commons.lang.builder.ToStringStyle$SimpleToStringStyle
> org.apache.commons.lang.builder.ToStringStyle$MultiLineToStringStyle
> org.apache.commons.lang.builder.ToStringStyle$1
> org.apache.commons.lang.builder.ToStringStyle
> org.apache.commons.lang.builder.ToStringBuilder
> org.apache.commons.lang.SystemUtils


Class changes
=============
org.apache.commons.lang.exception.Nestable
--------------------
< public abstract int getLength();
> public abstract int getThrowableCount();
< public abstract int indexOfThrowable(int, java.lang.Class);
---
> public abstract int indexOfThrowable(java.lang.Class, int);
> public abstract void printStackTrace(java.io.PrintStream);

org.apache.commons.lang.exception.NestableDelegate
--------------------
< int getLength();
< java.lang.String getMessage(java.lang.String);
> java.lang.String getMessage(java.lang.String);
> java.lang.String getMessages()[];
> int getThrowableCount();
< java.lang.String getMessages()[];
< int indexOfThrowable(int, java.lang.Class);
---
> int indexOfThrowable(java.lang.Class, int);

org.apache.commons.lang.exception.NestableException
--------------------
< public int getLength();
> public java.lang.String getMessage(int);
> public int getThrowableCount();
< public java.lang.String getMessage(int);
< public int indexOfThrowable(int, java.lang.Class);
---
> public int indexOfThrowable(java.lang.Class, int);

org.apache.commons.lang.exception.NestableRuntimeException
--------------------
< public int getLength();
> public java.lang.String getMessage(int);
> public int getThrowableCount();
< public java.lang.String getMessage(int);
< public int indexOfThrowable(int, java.lang.Class);
---
> public int indexOfThrowable(java.lang.Class, int);

org.apache.commons.lang.NumberUtils
--------------------
> public static long minimum(long, long, long);
> public static long maximum(long, long, long);
> public static int compare(double, double);
> public static int compare(float, float);

org.apache.commons.lang.ObjectUtils
--------------------
> public static final org.apache.commons.lang.ObjectUtils.Null NULL;
> public org.apache.commons.lang.ObjectUtils();
> public static java.lang.String identityToString(java.lang.Object);
> static {};
> public static class org.apache.commons.lang.ObjectUtils. Null extends java.lang.Object implements java.io.Serializable

org.apache.commons.lang.RandomStringUtils
--------------------
> public org.apache.commons.lang.RandomStringUtils();

org.apache.commons.lang.StringUtils
--------------------
> public org.apache.commons.lang.StringUtils();
< public static java.lang.String stackTrace(java.lang.Throwable);
< public static java.lang.String convertUnicodeToNative(java.lang.String, java.lang.String) throws java.io.IOException;
< public static java.lang.String convertNativeToUnicode(java.lang.String, java.lang.String) throws java.io.IOException;
---
> public static boolean containsOnly(java.lang.String, char[]);

Loading