Add XML::LibXML Node localName method alias

未關閉 適合新手
#2,164 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
72/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
java, perl
領域
backend

研究方向

XML::LibXML::Node 註冊的方法表位於 XMLLibXML.java 中,其中 localname 與 getLocalName 已經對應到同一個實作。請從那裡開始,並將 localName 新增為該項目的另一個別名。透過 ./jperl 與 ./jperl --interpreter 執行 issue 中的最小重現範例,應輸出 schema;針對駝峰寫法的專門回歸測試應在兩種後端以及標準 Perl 下通過。

由索引模型根據 Issue 內容生成。

描述

area:runtime bug

Summary

PerlOnJava's XML::LibXML::Node method table does not expose the camel-case localName method. A caller using this public method gets a method-not-found error, even though the XML::LibXML compatibility implementation provides the equivalent DOM operation as localname.

Minimal reproduction

use XML::LibXML;
my $doc = XML::LibXML->load_xml(string => '<schema/>');
my $root = $doc->documentElement;
print $root->localName, "\n";

Expected output:

schema

Observed on both PerlOnJava backends:

Can't locate object method "localName" via package "XML::LibXML::Element"

System Perl with XML::LibXML prints schema.

Root cause

XML::Compile 1.64 calls $this->localName in XML/Compile/Schema.pm while checking the root schema element. In XMLLibXML.java, the XML::LibXML::Node registration table maps localname and getLocalName to the localname implementation, but does not register the exact, case-sensitive method name localName. PerlOnJava's package method dispatch therefore cannot resolve the call. The issue reproduces directly without Data::DublinCore and affects both JVM and interpreter execution.

A likely fix is to register localName as another alias of the existing localname implementation, then add focused coverage for the camel-case API spelling on both backends.

CPAN evidence

  • Distribution: Data-DublinCore 1.00
  • Archived CPAN run: 20261121-154046-78188
  • PerlOnJava failure: t/20rdf.t aborts before running its 8 assertions; t/01use.t and t/99pod.t pass.
  • System-Perl oracle: all 3 target test files pass, 14 tests total, using the run's installed prerequisites.
  • Focused minimal reproduction: ./jperl and ./jperl --interpreter both fail; system Perl succeeds.
  • Environment: macOS 15.6 arm64, OpenJDK 24.0.2; the oracle log reports Perl 5.42.2. The separate focused system-Perl check used Perl 5.34.1.

Acceptance criteria

  • XML::LibXML::Element->localName resolves to the same local-name value as the existing localname method.
  • Add a project-owned focused regression test for the camel-case spelling.
  • The focused test passes on the JVM and interpreter backends and under standard Perl.
  • The Data-DublinCore 1.00 t/20rdf.t test passes with its prerequisites installed.
主要語言
Perl
星號
67
分支
8
平均合併
4 小時 36 分鐘
30 天內合併 PR
123

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。