<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by 辰 on Medium]]></title>
        <description><![CDATA[Stories by 辰 on Medium]]></description>
        <link>https://medium.com/@onacit?source=rss-dc01d89081b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*UxBSzrIVQKTk9cT7.png</url>
            <title>Stories by 辰 on Medium</title>
            <link>https://medium.com/@onacit?source=rss-dc01d89081b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 13:30:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@onacit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Adding installed JDKs into jenv]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">Disclaimer: I might be reinventing the wheel.</p><p class="medium-feed-link"><a href="https://onacit.medium.com/adding-installed-jdks-into-jenv-81ef3f7c5c65?source=rss-dc01d89081b5------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://onacit.medium.com/adding-installed-jdks-into-jenv-81ef3f7c5c65?source=rss-dc01d89081b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/81ef3f7c5c65</guid>
            <category><![CDATA[jenv]]></category>
            <category><![CDATA[jdk]]></category>
            <dc:creator><![CDATA[辰]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 05:33:34 GMT</pubDate>
            <atom:updated>2026-01-20T05:33:34.568Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Getting column names from an entity class]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">EclipseLink</p><p class="medium-feed-link"><a href="https://onacit.medium.com/getting-column-names-from-an-entity-class-6f136c52a502?source=rss-dc01d89081b5------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://onacit.medium.com/getting-column-names-from-an-entity-class-6f136c52a502?source=rss-dc01d89081b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f136c52a502</guid>
            <category><![CDATA[eclipselink]]></category>
            <category><![CDATA[hibernate]]></category>
            <category><![CDATA[jpa]]></category>
            <category><![CDATA[jakarta-persistence]]></category>
            <dc:creator><![CDATA[辰]]></dc:creator>
            <pubDate>Wed, 03 Dec 2025 05:59:07 GMT</pubDate>
            <atom:updated>2025-12-03T05:59:07.753Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Checking words against SQL]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">I wrote a page for checking words for SQL worlds.</p><p class="medium-feed-link"><a href="https://onacit.medium.com/checking-words-against-sql-dba4df94e43b?source=rss-dc01d89081b5------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://onacit.medium.com/checking-words-against-sql-dba4df94e43b?source=rss-dc01d89081b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/dba4df94e43b</guid>
            <category><![CDATA[reserved-words]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[辰]]></dc:creator>
            <pubDate>Fri, 18 Jul 2025 12:44:41 GMT</pubDate>
            <atom:updated>2025-07-18T12:44:41.906Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Remove all tags of SNAPSHOTS]]></title>
            <link>https://onacit.medium.com/remove-all-tags-of-snapshots-a11ed04aecc5?source=rss-dc01d89081b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a11ed04aecc5</guid>
            <category><![CDATA[snapshot]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[辰]]></dc:creator>
            <pubDate>Wed, 11 Jun 2025 07:32:35 GMT</pubDate>
            <atom:updated>2026-01-20T05:41:34.302Z</atom:updated>
            <content:encoded><![CDATA[<pre>#!/bin/sh<br># shellcheck disable=SC2046<br>git push --delete origin $(git tag | grep &#39;\-SNAPSHOT&#39;)<br>git tag -d $(git tag | grep &#39;\-SNAPSHOT&#39;)</pre><h4>What an AI</h4><pre>#!/bin/sh<br><br># Default to &#39;origin&#39; if no argument is provided<br>REMOTE=&quot;${1:-origin}&quot;<br><br># 1. Verify the remote exists<br>if ! git remote | grep -q &quot;^$REMOTE$&quot;; then<br>    echo &quot;Error: Remote &#39;$REMOTE&#39; not found.&quot;<br>    echo &quot;Available remotes:&quot;<br>    git remote<br>    exit 1<br>fi<br><br># 2. Identify tags (matching -SNAPSHOT- anywhere in the name)<br>SNAPSHOT_TAGS=$(git tag -l &quot;*-SNAPSHOT*&quot;)<br><br>if [ -z &quot;$SNAPSHOT_TAGS&quot; ]; then<br>    echo &quot;No tags containing &#39;-SNAPSHOT&#39; found.&quot;<br>    exit 0<br>fi<br><br># 3. Display and Confirm<br>echo &quot;Target Remote: $REMOTE&quot;<br>echo &quot;-----------------------------------&quot;<br>printf &quot;%s\n&quot; &quot;$SNAPSHOT_TAGS&quot;<br>echo &quot;-----------------------------------&quot;<br>printf &quot;Confirm batch deletion from &#39;$REMOTE&#39; and local? (y/N): &quot;<br>read -r CONFIRM<br><br>if [ &quot;$CONFIRM&quot; != &quot;y&quot; ] &amp;&amp; [ &quot;$CONFIRM&quot; != &quot;Y&quot; ]; then<br>    echo &quot;Operation cancelled.&quot;<br>    exit 0<br>fi<br><br># 4. Batch Delete from Remote<br>echo &quot;Batch deleting from $REMOTE...&quot;<br># shellcheck disable=SC2086<br>echo &quot;$SNAPSHOT_TAGS&quot; | xargs git push &quot;$REMOTE&quot; --delete<br><br># 5. Batch Delete Locally<br>echo &quot;Batch deleting locally...&quot;<br># shellcheck disable=SC2086<br>echo &quot;$SNAPSHOT_TAGS&quot; | xargs git tag -d<br><br>echo &quot;Successfully cleaned up snapshot tags.&quot;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a11ed04aecc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My toString template for IntelliJ IDEA]]></title>
            <link>https://onacit.medium.com/my-tostring-template-for-intellij-idea-2f30278222f3?source=rss-dc01d89081b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f30278222f3</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[intellij]]></category>
            <category><![CDATA[tostring]]></category>
            <dc:creator><![CDATA[辰]]></dc:creator>
            <pubDate>Sat, 07 Jun 2025 05:35:58 GMT</pubDate>
            <atom:updated>2025-06-07T05:35:58.907Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>Named `super.toString() and String concat(+)`</li><li>Starts with super.toString</li><li>No quotes for String values</li><li>No space(s) after commas</li></ul><pre>public java.lang.String toString() {<br>return super.toString() + &#39;{&#39; +<br>#if ( $members.size() &gt; 0 )<br>#set ( $i = 0 )<br>#foreach( $member in $members )<br>#if ( $i == 0 )<br>     &quot;##<br>#else<br>     &quot;,##<br>#end<br>#if ( $member.objectArray )<br>#if ($java_version &lt; 5)<br>$member.name=&quot; + ($member.accessor == null ? null : java.util.Arrays.asList($member.accessor)) +<br>#else<br>$member.name=&quot; + java.util.Arrays.toString($member.accessor) +<br>#end<br>#elseif ( $member.primitiveArray &amp;&amp; $java_version &gt;= 5)<br>$member.name=&quot; + java.util.Arrays.toString($member.accessor) +<br>#else<br>$member.name=&quot; + $member.accessor +<br>#end<br>#set ( $i = $i + 1 )<br>#end<br>    &#39;}&#39;;<br>#end<br>}</pre><pre>    @Override<br>    public String toString() {<br>        return super.toString() + &#39;{&#39; +<br>               &quot;field1=&quot; + field1 +<br>               &quot;,field2=&quot; + field2 +<br>               &#39;}&#39;;<br>    }</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f30278222f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting maximum message length for RSA with Java]]></title>
            <link>https://onacit.medium.com/getting-maximum-message-length-for-rsa-with-java-41d50f117eaa?source=rss-dc01d89081b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/41d50f117eaa</guid>
            <dc:creator><![CDATA[辰]]></dc:creator>
            <pubDate>Sun, 10 Nov 2024 04:17:10 GMT</pubDate>
            <atom:updated>2024-11-10T04:22:02.570Z</atom:updated>
            <content:encoded><![CDATA[<h3>RSA/ECB/PKCS1Padding</h3><pre>static final Map&lt;Integer, Integer&gt; M_LEN = new HashMap&lt;&gt;() {{<br>    put(1024, 117);<br>    put(2048, 245);<br>}};<br><br>final var mLen = M_LEN.computeIfAbsent(keySize, ks -&gt; {<br>    // https://datatracker.ietf.org/doc/html/rfc8017#section-7.2.1<br>    final var k = ks &gt;&gt; 3;<br>    return k - 11; // mLen &lt;= k - 11<br>});</pre><h3>RSA/ECB/OAEPWithSHA-1AndMGF1Padding</h3><pre>private static final Map&lt;Integer, Integer&gt; M_LEN = new HashMap&lt;&gt;() {{<br>    put(1024, 86);<br>    put(2048, 214);<br>}};<br><br>final int mLen = M_LEN.computeIfAbsent(keySize, ks -&gt; {<br>    // https://datatracker.ietf.org/doc/html/rfc8017#section-7.1.1<br>    final var k = ks &gt;&gt; 3;<br>    final var hLen = 160 &gt;&gt; 3;  // TODO: define as a constant<br>    return k - (hLen &lt;&lt; 1) - 2; // mLen &lt;= k - 2hLen - 2<br>});</pre><h3>RSA/ECB/OAEPWithSHA-256AndMGF1Padding</h3><pre>private static final Map&lt;Integer, Integer&gt; M_LEN = new HashMap&lt;&gt;() {{<br>    put(1024, 62);<br>    put(2048, 190);<br>}};<br><br>final int mLen = M_LEN.computeIfAbsent(keySize, ks -&gt; {<br>    // https://datatracker.ietf.org/doc/html/rfc8017#section-7.1.1<br>    final var k = ks &gt;&gt; 3;<br>    final var hLen = 256 &gt;&gt; 3;  // TODO: define as a constant<br>    return k - (hLen &lt;&lt; 1) - 2; // mLen &lt;= k - 2hLen - 2<br>});</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41d50f117eaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Verifying no duplicate serialVersionUIDs]]></title>
            <link>https://onacit.medium.com/verifying-no-duplicate-serialversionuids-a303e37b45d5?source=rss-dc01d89081b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a303e37b45d5</guid>
            <category><![CDATA[serialversionuid]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[辰]]></dc:creator>
            <pubDate>Fri, 22 Mar 2024 04:29:09 GMT</pubDate>
            <atom:updated>2024-03-22T04:29:09.754Z</atom:updated>
            <content:encoded><![CDATA[<p>Verifying no duplicate serialVersionUIDs in a package within specific parent class.</p><pre>static Stream&lt;Class&lt;?&gt;&gt; classStream() throws IOException {<br>    return ClassPath.from(Thread.currentThread().getContextClassLoader())<br>            .getAllClasses()<br>            .stream()<br>            .filter(ci -&gt; ci.getPackageName().equals(_Package_Test.class.getPackageName()))<br>            .filter((ci -&gt; !ci.getName().equals(&quot;module-info&quot;)))<br>            .map(ClassPath.ClassInfo::load)<br>            ;<br>}<br><br>@DisplayName(&quot;no duplicate serialVersionUIDs&quot;)<br>@Test<br>void __NoDuplicateSerialVersionUIDs_BaseType() throws Exception {<br>    final var grouped = classStream()<br>            .filter(_BaseType.class::isAssignableFrom) // filter<br>            .collect(Collectors.groupingBy(c -&gt; {<br>                return Optional.ofNullable(ObjectStreamClass.lookup(c))<br>                        .map(ObjectStreamClass::getSerialVersionUID)<br>                        .orElse(0L);<br>            }));<br>    for (var entry : grouped.entrySet()) {<br>        assertThat(entry.getValue())<br>                .as(&quot;classes with %d&quot;, entry.getKey())<br>                .hasSize(1);<br>    }</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a303e37b45d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Eclipse dynamic weaving with Apache Maven]]></title>
            <link>https://onacit.medium.com/eclipse-dynamic-weaving-with-apache-maven-50a44eae47b7?source=rss-dc01d89081b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/50a44eae47b7</guid>
            <category><![CDATA[jakarta-persistence]]></category>
            <category><![CDATA[eclipselink]]></category>
            <category><![CDATA[dynamic-weaving]]></category>
            <category><![CDATA[apache-maven]]></category>
            <dc:creator><![CDATA[辰]]></dc:creator>
            <pubDate>Sun, 03 Mar 2024 06:49:38 GMT</pubDate>
            <atom:updated>2024-03-03T06:49:38.200Z</atom:updated>
            <content:encoded><![CDATA[<ul><li><a href="https://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Performance/Weaving/Dynamic_Weaving">https://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Performance/Weaving/Dynamic_Weaving</a></li><li><a href="https://stackoverflow.com/a/65283669/330457">https://stackoverflow.com/a/65283669/330457</a></li></ul><pre>&lt;dependencyManagement&gt;<br>  &lt;dependencies&gt;<br>    &lt;dependency&gt;<br>      &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;<br>      &lt;artifactId&gt;eclipselink&lt;/artifactId&gt;<br>      &lt;version&gt;${version.org.eclipse.persistence}&lt;/version&gt;<br>    &lt;/dependency&gt;<br>  &lt;/dependencies&gt;<br>&lt;/dependencyManagement&gt;<br><br>&lt;properties&gt; &lt;!-- for maven-(surefire|failsafe)-plugin --&gt;<br>  &lt;argLine&gt;-javaagent:&quot;${settings.localRepository}/org/eclipse/persistence/eclipselink/${version.org.eclipse.persistence}/eclipselink-${version.org.eclipse.persistence}.jar&quot;&lt;/argLine&gt;<br>&lt;/properties&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50a44eae47b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Allowing an Insecure Protocol for accessing repository via HTTP]]></title>
            <link>https://onacit.medium.com/allowing-an-insecure-protocol-for-accessing-repository-via-http-749800945f41?source=rss-dc01d89081b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/749800945f41</guid>
            <category><![CDATA[nexus]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[https]]></category>
            <dc:creator><![CDATA[辰]]></dc:creator>
            <pubDate>Tue, 22 Jun 2021 07:41:22 GMT</pubDate>
            <atom:updated>2021-07-02T04:28:17.385Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, Gradle started complaining about an insecure protocol for my maven repositories configured in build.gradle.</p><pre>repositories {<br>    mavenCentral()<br>    maven {<br>        url &quot;http://nexus...&quot;<br>    }<br>}</pre><p>I realized that I can’t change the protocol of the server and I put allowInsecureProtocol true to the configuration.</p><pre>repositories {<br>    mavenCentral()<br>    maven {<br>        url &quot;http://nexus...&quot;<br>        allowInsecureProtocol true<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=749800945f41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using a generic wrapper class for marshalling/unmarshalling with JAXB]]></title>
            <link>https://onacit.medium.com/using-a-generic-wrapper-class-for-marshalling-unmarshalling-with-jaxb-5deb2dde70b7?source=rss-dc01d89081b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/5deb2dde70b7</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[jaxb]]></category>
            <dc:creator><![CDATA[辰]]></dc:creator>
            <pubDate>Sun, 07 Mar 2021 06:07:48 GMT</pubDate>
            <atom:updated>2021-03-07T06:12:36.170Z</atom:updated>
            <content:encoded><![CDATA[<p>This is an in-action case of <a href="http://blog.bdoughan.com/2012/11/creating-generic-list-wrapper-in-jaxb.html">Creating a Generic List Wrapper in JAXB</a>.</p><p>The Wrapper class is final, its no-args constructor is private and even the factory method is private.</p><pre>public final Wrapper&lt;T&gt; {</pre><pre>    private static &lt;T&gt; of(final List&lt;T&gt; elements) {<br>        Objects.requireNonNull(elements);<br>        final Wrapper&lt;T&gt; instance = new Wrapper&lt;&gt;();<br>        instance.elements = elements;<br>        return instance;<br>    }</pre><pre>    private Wrapper() {<br>        super();<br>    }</pre><pre>    @XmlAnyElement(lax = true)<br>    private List&lt;T&gt; elements;<br>}</pre><h4>&lt;T&gt; List&lt;T&gt; unmarshal(Class&lt;T&gt;, Source)</h4><p>The unmarshal method is quite simple.</p><pre>static &lt;T&gt; List&lt;T&gt; unmarshal(Class&lt;T&gt; type, Source source)<br>        throws JAXBException {<br>    JAXBContext context<br>            = JAXBContext.newInstance(Wrapper.class, type);<br>    Unmarshaller unmarshaller = context.createUnmarshaller();<br>    Wrapper&lt;T&gt; wrapper = unmarshaller.unmarshal(source, Wrapper.class).getValue();<br>    return wrapper.elements;<br>}</pre><h4>&lt;T&gt; void marshal(Class&lt;T&gt;, List&lt;T&gt;, String, Object)</h4><p>A little work needed to be done for the marshal method.</p><pre>static &lt;T&gt; void marshal(Class&lt;T&gt; type, List&lt;T&gt; elements,<br>                        String name, Object target)<br>        throws JAXBException {<br>    JAXBContext context<br>         = JAXBContext.newInstance(Wrapper.class, type);<br>    JAXBElement&lt;Wrapper&lt;T&gt;&gt; wrapped = new JAXBElement&lt;&gt;(<br>        new QName(myURI, name),<br>        (Class&lt;Wrapper&lt;T&gt;&gt;) (Class&lt;?&gt;) Wrapper.class,<br>        Wrapper.of(elements));<br>    Marshaller marshaller = context.createMarshaller();<br>    // find the right &#39;marshal&#39; method for the target<br>    Method method = stream(Marshaller.class.getMethods())<br>        .filter(m -&gt; &quot;marshal&quot;.equals(m.getName()))<br>        .filter(m -&gt; {<br>            Class&lt;?&gt;[] types = m.getParameterTypes();<br>            return types.length == 2<br>               &amp;&amp; types[1].isAssignableFrom(target.getClass());<br>        })<br>        .findFirst()<br>        .orElseThrow(() -&gt; new IllegalArgumentException(<br>            &quot;no &#39;marshal&#39; method found for &quot; + target));<br>    try {<br>        method.invoke(marshaller, wrapped, target);<br>    } catch (final ReflectiveOperationException roe) {<br>        throw new RuntimeException(<br>            &quot;failed to marshal to &quot; + target, roe);<br>    }<br>}</pre><h4>Examples</h4><pre>List&lt;Catalog&gt; catalogs = getCatalogs();<br>File file = file();<br>Wrapper.marshal(Catalog.class, catalogs, &quot;catalogs&quot;, file); </pre><p>The output file looks like this.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;<br>&lt;catalogs xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;<br>          xmlns=&quot;<a href="http://github.com/jinahya/database/metadata/bind">http://c</a>onfigured/in/package-info.java&quot;&gt;<br>    &lt;catalog/&gt;<br>    &lt;catalog/&gt;<br>&lt;/catalogs&gt;</pre><p>See the <a href="https://github.com/jinahya/database-metadata-bind/blob/develop/src/main/java/com/github/jinahya/database/metadata/bind/Wrapper.java">full source file</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5deb2dde70b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>