Project
IntelliJ IDEA
Priority
Normal
Type
Bug
Fix versions
No Fix versions
State
Fixed
Assignee
Dmitry Avdeev
Subsystem
J2EE.Spring
Affected versions
No Affected versions
Fixed in build
108.65  
  • Created by   Exception Robot
    4 years ago (15 Aug 2007 18:06)
  • Updated by   root
    2 years ago (17 Jan 2010 20:51)
  • Jira: IDEADEV-20305
    (history, comments)
 
IDEA-40439 "[Ljava.lang.String;" not understood in constructor-arg
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
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]

Issue was resolved
Comments (4)
 
History
 
Linked Issues (?)
 
Taras Tielkes
  Taras Tielkes
21 Aug 2007 00:21
4 years ago
Surely there must be a cleaner way than to write synthetic JVM array class names in the "type" attribute..
Dmitry Avdeev
  Dmitry Avdeev
21 Aug 2007 14:55
4 years ago
What do you mean Taras?
Taras Tielkes
  Taras Tielkes
21 Aug 2007 16:02
4 years ago
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
  Dmitry Avdeev
21 Aug 2007 17:11
4 years ago
Anyway, valid types should not be highlighted