History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-20305
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Dmitry Avdeev
Reporter: Selena M1 Feedback user
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

"[Ljava.lang.String;" not understood in constructor-arg

Created: 15 Aug 07 17:06   Updated: 06 Dec 07 18:52
Component/s: J2EE.Spring
Fix Version/s: Selena 7.0.2

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 7,126
Fixed in build: 7,509


 Description  « Hide
Product: IDEA
> Build: 7126
> Evaluator: false
> Name: William Poitras
> Comment: In IDEA 7.0M2: In a Spring context (or perhaps any DTD based XML file) "[Ljava.lang.String;" is not considered a valid type (in this case as a value for the "type" attribute of a constructor-arg element). The inspection claims: "Cannot resolve class String;" when in fact this is the correct class name for an array of strings. For example:
>
>?xml version="1.0" encoding="UTF-8"?>
>
>
>
> >
>
>
> Country: USA
> TimeZone: America/New_York
>
[Created via e-mail received from: william dot poitras at thomson dot com]

 All   Comments   Work Log   Change History      Sort Order:
Taras Tielkes - 20 Aug 07 23:21
Surely there must be a cleaner way than to write synthetic JVM array class names in the "type" attribute..

Dmitry Avdeev - 21 Aug 07 13:55
What do you mean Taras?

Taras Tielkes - 21 Aug 07 15:02
I mean this: using type="[Ljava.lang.String;" is an ugly hack, and the reporter should thank IDEA for marking it red

If the class has multiple overloaded array-based constructors, a clean solution would be to create a static factory method with some specific name ("createFromStringArray"), and use that in the spring xml. Other refactorings are possible as well.


Dmitry Avdeev - 21 Aug 07 16:11
Anyway, valid types should not be highlighted