Content of file cpd.html

<!DOCTYPE html>
<!--
 | Generated by Apache Maven Doxia Site Renderer 1.9.2 from org.apache.maven.plugins:maven-pmd-plugin:3.14.0:cpd at 2023-04-24
 | Rendered using Apache Maven Fluido Skin 1.7
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="Date-Revision-yyyymmdd" content="20230424" />
    <meta http-equiv="Content-Language" content="en" />
    <title>Mistral &#x2013; CPD Results</title>
    <link rel="stylesheet" href="./css/apache-maven-fluido-1.7.min.css" />
    <link rel="stylesheet" href="./css/site.css" />
    <link rel="stylesheet" href="./css/print.css" media="print" />
    <script type="text/javascript" src="./js/apache-maven-fluido-1.7.min.js"></script>
  </head>
  <body class="topBarEnabled">
    <a href="https://github.com/tidalwave-it/thesefoolishthings-src">
      <img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
        src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"
        alt="Fork me on GitHub">
    </a>
    <div id="topbar" class="navbar navbar-fixed-top ">
      <div class="navbar-inner">
            <div class="container" style="width: 90%;"><div class="nav-collapse">
            <ul class="nav">
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Overview <b class="caret"></b></a>
        <ul class="dropdown-menu">
            <li><a href="index.html" title="Introduction">Introduction</a></li>
        </ul>
      </li>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Project Documentation <b class="caret"></b></a>
        <ul class="dropdown-menu">
            <li class="dropdown-submenu">
<a href="project-info.html" title="Project Information">Project Information</a>
              <ul class="dropdown-menu">
                  <li><a href="ci-management.html" title="CI Management">CI Management</a></li>
                  <li><a href="dependency-convergence.html" title="Dependency Convergence">Dependency Convergence</a></li>
                  <li><a href="dependency-info.html" title="Dependency Information">Dependency Information</a></li>
                  <li><a href="dependency-management.html" title="Dependency Management">Dependency Management</a></li>
                  <li><a href="distribution-management.html" title="Distribution Management">Distribution Management</a></li>
                  <li><a href="index.html" title="About">About</a></li>
                  <li><a href="issue-management.html" title="Issue Management">Issue Management</a></li>
                  <li><a href="licenses.html" title="Licenses">Licenses</a></li>
                  <li><a href="modules.html" title="Project Modules">Project Modules</a></li>
                  <li><a href="plugin-management.html" title="Plugin Management">Plugin Management</a></li>
                  <li><a href="plugins.html" title="Plugins">Plugins</a></li>
                  <li><a href="scm.html" title="Source Code Management">Source Code Management</a></li>
                  <li><a href="summary.html" title="Summary">Summary</a></li>
                  <li><a href="team.html" title="Team">Team</a></li>
              </ul>
            </li>
            <li class="dropdown-submenu">
<a href="project-reports.html" title="Project Reports">Project Reports</a>
              <ul class="dropdown-menu">
                  <li><a href="surefire-report.html" title="Surefire Report">Surefire Report</a></li>
                  <li><a href="jacoco-aggregate/index.html" title="JaCoCo Aggregate">JaCoCo Aggregate</a></li>
                  <li><a href="pmd.html" title="PMD">PMD</a></li>
                  <li><a href="cpd.html" title="CPD">CPD</a></li>
                  <li><a href="checkstyle-aggregate.html" title="Checkstyle">Checkstyle</a></li>
                  <li><a href="dependency-check-report.html" title="dependency-check:aggregate">dependency-check:aggregate</a></li>
              </ul>
            </li>
        </ul>
      </li>
            </ul>
<form id="search-form" action="https://www.google.com/search" method="get"  class="navbar-search pull-right" >
  <input value="http://tidalwave.it/project/mistral" name="sitesearch" type="hidden"/>
  <input class="search-query" name="q" id="query" type="text" />
</form>
<script type="text/javascript">asyncJs( 'https://cse.google.com/brand?form=search-form' )</script>
            </div>
        </div>
      </div>
    </div>
    <div class="container">
      <div id="banner">
        <div class="pull-left"><a href="https://tidalwave.it/projects/thesefoolishthings" id="bannerLeft"><h2>Mistral</h2>
</a></div>
        <div class="pull-right"><div id="bannerRight"><img src="../../media/Tidalwave%20Logo.png"  alt=""/></div>
</div>
        <div class="clear"><hr/></div>
      </div>

      <div id="breadcrumbs">
        <ul class="breadcrumb">
        <li id="publishDate">Last Published: 2023-04-24<span class="divider">|</span>
</li>
          <li id="projectVersion">Version: 1.0-ALPHA-8-SNAPSHOT</li>
        </ul>
      </div>
        <div id="bodyColumn" >
<section>
<h2><a name="CPD_Results"></a>CPD Results</h2>
<p>The following document contains the results of PMD's  <a class="externalLink" href="https://pmd.github.io/latest/pmd_userdocs_cpd.html">CPD</a> 6.29.0.</p></section><section>
<h2><a name="Duplications"></a>Duplications</h2>
<table border="0" class="table table-striped">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td>it/tidalwave/mistral/example/AbstractViewerPanel.java</td>
<td>Mistral Examples HistogramViewer</td>
<td>53</td></tr>
<tr class="a">
<td>it/tidalwave/mistral/example/AbstractViewerPanel.java</td>
<td>Mistral Examples Viewer</td>
<td>53</td></tr>
<tr class="b"><td colspan='3'>
<div>
<pre>public class AbstractViewerPanel extends JPanel
  {
    protected final EditableImageRenderer imageRenderer = new EditableImageRenderer();

    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public void loadImage (final String fileName)
            throws MalformedURLException
      {
        try // used during development
          {
            final var file = Path.of(&quot;../../../www/images/&quot; + fileName);

            if (Files.exists(file) &amp;&amp; Files.isReadable(file))
              {
                loadImage(file);
              }

            else
              {
                throw new FileNotFoundException(file.toString());
              }
          }
        catch (Exception e)
          {
            // used by the deployed examples
            loadImage(new URL(&quot;https://mistral.dev.java.net/images/&quot; + fileName));
          }
      }

    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    protected void loadImage (final Object input)
      {
        final var label = new JLabel(&quot;Loading &quot; + input + &quot;...&quot;);
        label.setForeground(Color.WHITE);
        label.setHorizontalAlignment(SwingConstants.CENTER);
        label.setFont(new Font(&quot;sansserif&quot;, Font.BOLD, 14));

        final var overlay = new Overlay()
          {
            @Override
            public boolean isVisible()
              {
                return true;
              }

            @Override
            public void paint (final Graphics2D g, final EditableImageRenderer imageRenderer)
              {
                label.setBounds(imageRenderer.getBounds());
                label.paint(g);
              }
          };

//        final OverlaidPanel overlay = new OverlaidPanel();
//        overlay.setLayout(new BorderLayout());
//        overlay.add(label, BorderLayout.CENTER);

        imageRenderer.addOverlay(overlay);
        imageRenderer.repaint(); // FIXME: should not be needed
should not be needed
// A SwingWorker would be good here final var loaderThread = new Thread(() -&gt; { try { final var image = EditableImage.create(new ReadOp(input)); SwingUtilities.invokeLater(() -&gt; { imageRenderer.setImage(image); imageRenderer.removeOverlay(overlay); final var hMargin = image.getWidth() / 4; final var vMargin = image.getHeight() / 4; imageRenderer.setMargin(new Insets(vMargin, hMargin, vMargin, hMargin)); onImageLoaded(image); }); } catch (final Throwable e) { SwingUtilities.invokeLater(() -&gt; { label.setText(e.toString()); imageRenderer.repaint(); // FIXME: should not be needed // imageRenderer.removeOverlay(overlay); e.printStackTrace(); final var message = &quot;&lt;html&gt;Cannot load the image.&lt;br&gt;An Internet connection is required.&lt;/html&gt;&quot;; final var title = &quot;Error&quot;; JOptionPane.showMessageDialog(AbstractViewerPanel.this, message, title, JOptionPane.ERROR_MESSAGE); }); } }); loaderThread.start(); } /******************************************************************************************************************* * * ******************************************************************************************************************/ protected void onImageLoaded (final EditableImage image) { } }</pre></div></td></tr></table> <table border="0" class="table table-striped"> <tr class="a"> <th>File</th> <th>Project</th> <th>Line</th></tr> <tr class="b"> <td>it/tidalwave/image/java2d/Java2DUtils.java</td> <td>Mistral Core</td> <td>489</td></tr> <tr class="a"> <td>it/tidalwave/image/java2d/Java2DUtils.java</td> <td>Mistral Core</td> <td>520</td></tr> <tr class="b"><td colspan='3'> <div> <pre>private static String toString (final SinglePixelPackedSampleModel sampleModel) { final var buffer = new StringBuilder(); buffer.append(sampleModel.getClass().getName()); buffer.append(&quot;[width: &quot;); buffer.append(sampleModel.getWidth()); buffer.append(&quot;, height: &quot;); buffer.append(sampleModel.getHeight()); buffer.append(&quot;, numBands: &quot;); buffer.append(sampleModel.getNumBands()); buffer.append(&quot;, dataType: &quot;); buffer.append(sampleModel.getDataType()); buffer.append(&quot;, scanlineStride: &quot;); buffer.append(sampleModel.getScanlineStride()); buffer.append(&quot;, transferType: &quot;); buffer.append(sampleModel.getTransferType()); buffer.append(&quot;, numDataElements: &quot;); buffer.append(sampleModel.getNumDataElements()); buffer.append(&quot;, bitMasks: &quot;);</pre></div></td></tr></table></section> </div> </div> <hr/> <footer> <div class="container"> <div class="row"> <p>Copyright &copy;2003&#x2013;2023 <a href="http://tidalwave.it">Tidalwave s.a.s.</a>. All rights reserved.</p> </div> <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a> </p> <div id="ohloh" class="pull-right"> <script type="text/javascript" src="https://www.ohloh.net/p/TheseFoolishThings/widgets/project_factoids.js"></script> </div> </div> </footer> </body> </html>