summaryrefslogtreecommitdiff
path: root/docs/jacoco-ut/bjc.everge/BadReplParse.java.html
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2019-09-09 20:13:50 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2019-09-09 20:13:50 -0400
commitffdeed6d39f651bc6ffb75ecf9b8134798041f82 (patch)
treeba629e526068b0ba4a21341f8147c48289dce220 /docs/jacoco-ut/bjc.everge/BadReplParse.java.html
parentc6897211cb5da8c5bbbaf267db8ad020eb63a114 (diff)
Upgrade version to 0.2
Diffstat (limited to 'docs/jacoco-ut/bjc.everge/BadReplParse.java.html')
-rw-r--r--docs/jacoco-ut/bjc.everge/BadReplParse.java.html89
1 files changed, 89 insertions, 0 deletions
diff --git a/docs/jacoco-ut/bjc.everge/BadReplParse.java.html b/docs/jacoco-ut/bjc.everge/BadReplParse.java.html
new file mode 100644
index 0000000..4859e42
--- /dev/null
+++ b/docs/jacoco-ut/bjc.everge/BadReplParse.java.html
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>BadReplParse.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">everge</a> &gt; <a href="index.source.html" class="el_package">bjc.everge</a> &gt; <span class="el_source">BadReplParse.java</span></div><h1>BadReplParse.java</h1><pre class="source lang-java linenums">package bjc.everge;
+
+import java.util.ArrayList;
+import java.util.List;
+/**
+ * Exception thrown when ReplPair parsing fails
+ * @author bjculkin
+ *
+ */
+public class BadReplParse extends RuntimeException {
+ /**
+ * Serialization ID.
+ */
+ private static final long serialVersionUID = 4752304282380556849L;
+ /**
+ * The errors that were encountered during parsing.
+ */
+ public List&lt;ReplError&gt; errs;
+
+ /**
+ * Create a new exception for ReplPair parsing failing.
+ *
+ * @param msg
+ * The message for the exception.
+ */
+ public BadReplParse(String msg) {
+<span class="nc" id="L27"> this(msg, new ArrayList&lt;&gt;());</span>
+<span class="nc" id="L28"> }</span>
+
+ /**
+ * Create a new exception for ReplPair parsing failing.
+ *
+ * @param msg
+ * The message for the exception.
+ * @param errs
+ * The list of errors encountered while parsing.
+ */
+ public BadReplParse(String msg, List&lt;ReplError&gt; errs) {
+<span class="fc" id="L39"> super(msg);</span>
+
+<span class="fc" id="L41"> this.errs = errs;</span>
+<span class="fc" id="L42"> }</span>
+
+ @Override
+ public String toString() {
+ String errString;
+<span class="nc bnc" id="L47" title="All 2 branches missed."> if (errs.size() == 0) errString = &quot;An error&quot;;</span>
+<span class="nc" id="L48"> else errString = &quot;Errors&quot;;</span>
+
+<span class="nc" id="L50"> return String.format(&quot;%s occured parsing replacement pairs: %s\n%s&quot;,</span>
+<span class="nc" id="L51"> errString, getMessage(), errs);</span>
+ }
+
+ /**
+ * Convert the exception to a printable format.
+ *
+ * @return The exception as a printable format.
+ */
+ public String toPrintString() {
+<span class="fc" id="L60"> StringBuilder errString = new StringBuilder(&quot;[ERROR] &quot;);</span>
+
+<span class="pc bpc" id="L62" title="1 of 2 branches missed."> if (errs.size() == 0) {</span>
+<span class="nc" id="L63"> errString.append(&quot;No specific errors&quot;);</span>
+<span class="pc bpc" id="L64" title="1 of 2 branches missed."> } else if (errs.size() == 1) {</span>
+<span class="fc" id="L65"> errString.append(&quot;An error&quot;);</span>
+ } else {
+<span class="nc" id="L67"> errString.append(errs.size());</span>
+<span class="nc" id="L68"> errString.append(&quot; errors&quot;);</span>
+ }
+
+<span class="fc" id="L71"> errString.append(&quot; occured parsing replacement pairs:&quot;);</span>
+<span class="pc bpc" id="L72" title="1 of 2 branches missed."> if (!getMessage().equals(&quot;&quot;)) {</span>
+<span class="nc" id="L73"> errString.append(&quot; &quot;);</span>
+<span class="nc" id="L74"> errString.append(getMessage());</span>
+ }
+
+<span class="pc bpc" id="L77" title="1 of 2 branches missed."> if (errs.size() &gt; 0) {</span>
+<span class="fc" id="L78"> errString.append(&quot;\n\t&quot;);</span>
+
+<span class="fc bfc" id="L80" title="All 2 branches covered."> for (ReplError err : errs) {</span>
+<span class="fc" id="L81"> errString.append(err.toPrintString(&quot;\t&quot;));</span>
+<span class="fc" id="L82"> errString.append(&quot;\n\t&quot;);</span>
+<span class="fc" id="L83"> }</span>
+ }
+
+<span class="fc" id="L86"> return errString.toString().trim();</span>
+ }
+}
+</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.2.201808211720</span></div></body></html> \ No newline at end of file