From 6490ca241eb33428907800aed2c9e493c2a6a9cc Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Sun, 10 Sep 2023 18:04:26 +0100 Subject: [PATCH] [bugfix] Fix an issue in the XQuery Inspection Module whereby QName#toString() was being called instead of QName#getStringValue() --- .../xquery/functions/inspect/InspectFunctionHelper.java | 6 +++--- .../org/exist/xquery/functions/inspect/InspectModule.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exist-core/src/main/java/org/exist/xquery/functions/inspect/InspectFunctionHelper.java b/exist-core/src/main/java/org/exist/xquery/functions/inspect/InspectFunctionHelper.java index cc654ef99dc..94bc0bd79ea 100644 --- a/exist-core/src/main/java/org/exist/xquery/functions/inspect/InspectFunctionHelper.java +++ b/exist-core/src/main/java/org/exist/xquery/functions/inspect/InspectFunctionHelper.java @@ -63,7 +63,7 @@ public static int generateDocs(final FunctionSignature sig, final UserDefinedFun XQDocHelper.parse(sig); final AttributesImpl attribs = new AttributesImpl(); - attribs.addAttribute("", "name", "name", "CDATA", sig.getName().toString()); + attribs.addAttribute("", "name", "name", "CDATA", sig.getName().getStringValue()); attribs.addAttribute("", "module", "module", "CDATA", sig.getName().getNamespaceURI()); final int nodeNr = builder.startElement(FUNCTION_QNAME, attribs); writeParameters(sig, builder); @@ -130,7 +130,7 @@ private static void writeAnnotations(final FunctionSignature signature, final Me final AttributesImpl attribs = new AttributesImpl(); for (final Annotation annot : annots) { attribs.clear(); - attribs.addAttribute(null, "name", "name", "CDATA", annot.getName().toString()); + attribs.addAttribute(null, "name", "name", "CDATA", annot.getName().getStringValue()); attribs.addAttribute(null, "namespace", "namespace", "CDATA", annot.getName().getNamespaceURI()); builder.startElement(ANNOTATION_QNAME, attribs); final LiteralValue[] value = annot.getValue(); @@ -166,7 +166,7 @@ private static void generateDependencies(final UserDefinedFunction function, fin final AttributesImpl attribs = new AttributesImpl(); for (final FunctionSignature signature : signatures) { attribs.clear(); - attribs.addAttribute(null, "name", "name", "CDATA", signature.getName().toString()); + attribs.addAttribute(null, "name", "name", "CDATA", signature.getName().getStringValue()); attribs.addAttribute("", "module", "module", "CDATA", signature.getName().getNamespaceURI()); attribs.addAttribute("", "arity", "arity", "CDATA", Integer.toString(signature.getArgumentCount())); diff --git a/exist-core/src/main/java/org/exist/xquery/functions/inspect/InspectModule.java b/exist-core/src/main/java/org/exist/xquery/functions/inspect/InspectModule.java index af760ffc53b..c9862a6626f 100644 --- a/exist-core/src/main/java/org/exist/xquery/functions/inspect/InspectModule.java +++ b/exist-core/src/main/java/org/exist/xquery/functions/inspect/InspectModule.java @@ -117,7 +117,7 @@ public Sequence eval(final Sequence[] args, final Sequence contextSequence) thro // variables for (final VariableDeclaration var : externalModule.getVariableDeclarations()) { attribs.clear(); - attribs.addAttribute("", "name", "name", "CDATA", var.getName().toString()); + attribs.addAttribute("", "name", "name", "CDATA", var.getName().getStringValue()); final SequenceType type = var.getSequenceType(); if (type != null) { attribs.addAttribute("", "type", "type", "CDATA", Type.getTypeName(type.getPrimaryType()));