<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:08:28 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[AAA-34] Stop creating static exception instances</title>
                <link>https://jira.opendaylight.org/browse/AAA-34</link>
                <project id="10102" key="AAA">aaa</project>
                    <description>&lt;p&gt;I found that the TokenAuthFilter.java class creates a static exception: &lt;/p&gt;

&lt;p&gt; private static final WebApplicationException UNAVAILABLE_EX = new WebApplicationException(&lt;br/&gt;
            Response.status(Status.SERVICE_UNAVAILABLE)&lt;br/&gt;
                    .type(MediaType.APPLICATION_JSON)&lt;br/&gt;
                    .entity(&quot;&lt;/p&gt;
{\&quot;error\&quot;:\&quot;Authentication service unavailable\&quot;}
&lt;p&gt;&quot;)&lt;br/&gt;
                    .build());&lt;/p&gt;

&lt;p&gt;It seems that the intent was to deduplicate the amount of code written inline with statics. While this is fine for a static Response message, by creating the exception object here and not inline you get incorrect trace information when the exception is thrown.&lt;/p&gt;

&lt;p&gt;We should change this so that the exception is not created here, but just the response (i.e. the response is static).&lt;/p&gt;

&lt;p&gt;Then when we throw the exception in the constructor we should create the new WebApplicationException object. This way the exception will have the proper trace and you get the reusable response. &lt;/p&gt;

&lt;p&gt;While this is a single example, there are other cases in this same file and other files that should be reviewed and fixed as well.&lt;/p&gt;

&lt;p&gt;File: &lt;a href=&quot;https://github.com/opendaylight/aaa/blob/master/aaa-authn-sts/src/main/java/org/opendaylight/aaa/sts/TokenAuthFilter.java&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/opendaylight/aaa/blob/master/aaa-authn-sts/src/main/java/org/opendaylight/aaa/sts/TokenAuthFilter.java&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;NOTE: If we are intentionally doing this for some reason then the code should be commented to describe why.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="22285">AAA-34</key>
            <summary>Stop creating static exception instances</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="rgoulding">Ryan Goulding</assignee>
                                    <reporter username="devin.avery@brocade.com">Devin Avery</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Jun 2015 13:45:59 +0000</created>
                <updated>Thu, 21 Mar 2019 11:56:40 +0000</updated>
                            <resolved>Tue, 21 Jul 2015 13:08:38 +0000</resolved>
                                                                    <component>General</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="42181" author="rgoulding" created="Mon, 20 Jul 2015 15:23:49 +0000"  >&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/23698/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/23698/&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3519</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=3519]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i023ov:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>