Are macro parameter names case sensitive or not?

During some tests I found this:

Calling a (test) macro with:
{{onlyTestMacro param1="123" param2="abc" Param1="XYZ"}}Some Content{{/onlyTestMacro}

within the macro
xwiki.context.macro.params.getParameterNames().each {
print "\n##"+" .get('"+it+"') " + xwiki.context.macro.params.get(it) + "##"
}
gives
.get('Param1') 123
.get('param1') 123
.get('param2') abc

O.k. - I see “Param1” and “param1” (both!) in the list of parameter names.
But why evaluates “Param1” to “123” ?

I think generating the set of names by getParameterNames is missing a “.toLowerCase()”

(A note: Because of my laziness in writing, I did not declare the parameter names as an object “WikiMacroParameterClass”.)

Norbert

I think it’s all normal (albeit misleading). If you check the javadoc for the method you called you’ll see:

    /**
     * Returns the set of parameter names provided by user.
     * 
     * @return set of parameter names provided by user
     */
    public Set<String> getParameterNames()

See xwiki-platform/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-wikimacro/xwiki-platform-rendering-wikimacro-api/src/main/java/org/xwiki/rendering/macro/wikibridge/WikiMacroParameters.java at 023ce79c5755dd5b8d7ba2c0437263abdad01467 · xwiki/xwiki-platform · GitHub

So it’s expected to return the parameters as they are entered by the user.