Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [wtp-jsf-dev] A problem found in FacesConfigArtifactEdit

I agree; I can't see any reason why this member needs to be static, and of course there are good reasons why it shouldn't be.
 
Logged as https://bugs.eclipse.org/bugs/show_bug.cgi?id=145578.
 
Thanks,
 - Ian
-----Original Message-----
From: wtp-jsf-dev-bounces@xxxxxxxxxxx [mailto:wtp-jsf-dev-bounces@xxxxxxxxxxx]On Behalf Of Shao-feng.Shi@xxxxxxxxxx
Sent: Monday, June 05, 2006 10:52 PM
To: wtp-jsf-dev@xxxxxxxxxxx
Subject: [wtp-jsf-dev] A problem found in FacesConfigArtifactEdit


Hi,

I encountered a problem in using FacesConfigArtifactEdit. I find the reason is that the variable sFileName in this class is static. But I think the instances of this class shouldn't share this value, so I changed it to non-static, then the problem disappeared. Is there anyone could take a look and tell me if this is right? Thanks.

My programs like this:

String facesConfig1 = "WEB-INF/faces-config.xml";
String facesConfig2 = "WEB-INF/face2.xml";

List configFiles = new ArrayList();
configFiles.add(facesConfig1);
configFiles.add(facesConfig2);

List artifactEditList = new ArrayList();

for (int i = 0, n = configFiles.size(); i < n; i++) {
    FacesConfigArtifactEdit artifactEdit = FacesConfigArtifactEdit.getFacesConfigArtifactEditForRead(
                    project, (String) configFiles.get(i));
    artifactEditList.add(artifactEdit);
}

//.....

 for (int i = 0, n = artifactEditList.size(); i < n; i++) {

   FacesConfigArtifactEdit artifactEdit = (FacesConfigArtifactEdit)artifactEditList.get(i);    
   FacesConfigType facesConfig = artifactEdit.getFacesConfig();              
   // problem comes, the "facesConfig" always be the model loaded from "WEB-INF/face2.xml";        
 }


Vincent. Shi

Sybase Software (China) Co., Ltd
Email: shao-feng.shi@xxxxxxxxxx

Back to the top