Add XML::LibXML Node localName method alias

Aperta Adatta ai principianti
#2,164 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, perl
Ambito
backend

Direzione di ricerca

La tabella dei metodi per la registrazione di XML::LibXML::Node si trova in XMLLibXML.java, dove localname e getLocalName sono già associati alla stessa implementazione. Inizia da lì e aggiungi localName come ulteriore alias di quella voce. La riproduzione minima nell'issue, eseguita tramite ./jperl e ./jperl --interpreter, dovrebbe stampare schema; un test di regressione mirato alla grafia camelCase dovrebbe passare su entrambi i backend e con Perl standard.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Perl
Stelle
67
Fork
8
Merge medio
4h 36m
PR unite (30g)
123

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fglock/PerlOnJava

Tutte le issue di fglock/PerlOnJava

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.