<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:54:36 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>[YANGTOOLS-895] MAC address does not match regular expression pattern</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-895</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;Hello.&lt;/p&gt;

&lt;p&gt;There is a problem with parsing MAC address from json&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
Caused by: java.lang.IllegalArgumentException: Value &lt;span class=&quot;code-quote&quot;&gt;&apos;00:00:00:00:00:00&apos;&lt;/span&gt; does not match regular expression &lt;span class=&quot;code-quote&quot;&gt;&apos;^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$&apos;&lt;/span&gt;
	at org.opendaylight.yangtools.yang.data.impl.codec.CompiledPatternContext.validate(CompiledPatternContext.java:48)
	at org.opendaylight.yangtools.yang.data.impl.codec.StringPatternCheckingCodec.validate(StringPatternCheckingCodec.java:39)
	at org.opendaylight.yangtools.yang.data.impl.codec.StringStringCodec.deserialize(StringStringCodec.java:43)
	at org.opendaylight.yangtools.yang.data.impl.codec.StringStringCodec.deserialize(StringStringCodec.java:22)
	at org.opendaylight.yangtools.yang.data.codec.gson.AbstractJSONCodec.parseValue(AbstractJSONCodec.java:34)
	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.translateValueByType(JsonParserStream.java:341)
	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.setValue(JsonParserStream.java:335)
	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:240)
	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:300)
	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.parse(JsonParserStream.java:163)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But the pattern actually matches the string.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;When java.util.regex.Pattern is created, I found out that it receives pattern string&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
^(?:\^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}\$)$
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;instead of what is defined in yang file&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I&#160;am using 2.0.6 version but checked also 2.0.7 and 2.0.10 and it happened too.&lt;/p&gt;</description>
                <environment>&lt;p&gt;yang-data-codec-gson-2.0.6.jar&lt;/p&gt;</environment>
        <key id="30633">YANGTOOLS-895</key>
            <summary>MAC address does not match regular expression pattern</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.opendaylight.org/images/icons/priorities/blocker.svg">Highest</priority>
                        <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="10001">Won&apos;t Do</resolution>
                                        <assignee username="rovarga">Robert Varga</assignee>
                                    <reporter username="mibanik">Michal Banik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Aug 2018 10:34:24 +0000</created>
                <updated>Mon, 27 Aug 2018 17:00:45 +0000</updated>
                            <resolved>Mon, 27 Aug 2018 16:51:41 +0000</resolved>
                                    <version>2.0.6</version>
                    <version>2.0.7</version>
                    <version>2.0.10</version>
                                                    <component>codecs</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="64764" author="rovarga" created="Fri, 24 Aug 2018 15:58:48 +0000"  >&lt;p&gt;What is the corresponding model?&lt;/p&gt;</comment>
                            <comment id="64768" author="rovarga" created="Sat, 25 Aug 2018 19:48:40 +0000"  >&lt;p&gt;This is not a bug, your model is wrong &#8211; YANG regular expressions are implicitly anchored and &apos;^&apos; and &apos;$&apos; are normal characters. Fix your models.&lt;/p&gt;</comment>
                            <comment id="64780" author="mibanik" created="Mon, 27 Aug 2018 09:17:20 +0000"  >&lt;p&gt;sorry I forgot to mention the model&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I uses openconfig models &lt;ins&gt;&lt;em&gt;openconfig-if-ethernet.yang&lt;/em&gt;&lt;/ins&gt; - leaf &lt;em&gt;mac-address&lt;/em&gt; has type&#160;&lt;em&gt;oc-yang:mac-address&lt;/em&gt; from&#160;&lt;ins&gt;&lt;em&gt;openconfig-yang-types.yang&lt;/em&gt;&lt;/ins&gt;&lt;/p&gt;

&lt;p&gt;mac-address is defined:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
typedef mac-address {
    type string {
      pattern &lt;span class=&quot;code-quote&quot;&gt;&apos;^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$&apos;&lt;/span&gt;;
    }
    description
      &lt;span class=&quot;code-quote&quot;&gt;&quot;An IEEE 802 MAC address&quot;&lt;/span&gt;;
  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;I still think there is a bug.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Actually, the&#160;pattern string&#160;that is in yang model&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Pattern pattern = Pattern.compile(&lt;span class=&quot;code-quote&quot;&gt;&quot;^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$&quot;&lt;/span&gt;);
pattern.matcher(&lt;span class=&quot;code-quote&quot;&gt;&quot;00:00:00:00:00:00&quot;&lt;/span&gt;).matches();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;returns&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;but, the pattern string that&#160;is actually&#160;set in pattern instance in &lt;em&gt;CompiledPatternContext&lt;/em&gt; class&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Pattern pattern = Pattern.compile(&lt;span class=&quot;code-quote&quot;&gt;&quot;^(?:\\^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}\\$)$&quot;&lt;/span&gt;);
pattern.matcher(&lt;span class=&quot;code-quote&quot;&gt;&quot;00:00:00:00:00:00&quot;&lt;/span&gt;).matches();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;returns&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="64783" author="rovarga" created="Mon, 27 Aug 2018 16:50:49 +0000"  >&lt;p&gt;OpenConfig is violating RFC7950 section 9.4.5, as detailed in &lt;a href=&quot;https://github.com/openconfig/public/issues/44&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/openconfig/public/issues/44&lt;/a&gt; . In the context of YANG specification, pattern statement argument is interpreted according to &lt;a href=&quot;https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#regexs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#regexs&lt;/a&gt; . That specifically means that both caret and ampersand are character literals &#8211; and for the purposes of use with java.util.regex.Pattern are escaped.&lt;/p&gt;

&lt;p&gt;POSIX (used by OpenConfig), XSD (used by YANG) and java.util.regex.Pattern regular expressions, while sharing basic concepts and basic lexical structure in simple cases, are not interchangeable in the general sense.&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_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03i3r:</customfieldvalue>

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