[
https://issues.jboss.org/browse/JBIDE-17184?page=com.atlassian.jira.plugi...
]
Daniel Azarov commented on JBIDE-17184:
---------------------------------------
I took a look into OpenKeyHelper. It looks like nothing wrong with OpenKeyHelper, but not
all bundles could be found in XModel.
Method findBundles() for bundle - demo.Messages locale - null returns 2 XModelObjects on
Linux and only 1 on Windows.
I inserted some System.out.print strings in this method:
{code}
public XModelObject[] findBundles(XModel model, String bundle, String locale) {
System.out.println("OpenKeyHelper.findBundles bundle - "+bundle+" locale
- "+locale);
ArrayList<XModelObject> l = new ArrayList<XModelObject>();
if(locale == null || locale.length() == 0) locale = getDeafultLocale(model);
String pathPrefix = "/" + bundle.replace('.', '/');
IProject project = EclipseResourceUtil.getProject(model.getRoot());
Set<IFolder> srcs = EclipseResourceUtil.getAllVisibleSourceFolders(project);
Set<XModelObject> srcObjects = new HashSet<XModelObject>();
for (IFolder f: srcs) {
if(f.getProject() != project) {
XModelObject src = EclipseResourceUtil.createObjectForResource(f);
if(src != null) srcObjects.add(src);
}
}
while(locale != null && locale.length() > 0) {
String path = pathPrefix + "_" + locale + ".properties";
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
System.out.println("OpenKeyHelper.findBundles path - "+path);
XModelObject o = model.getByPath(path);
if(o != null) l.add(o);
for (XModelObject src: srcObjects) {
o = src.getChildByPath(path.substring(1));
if(o != null) l.add(o);
}
int i = locale.lastIndexOf('_');
if(i < 0) break;
locale = locale.substring(0, i);
}
String path = pathPrefix + ".properties"; //$NON-NLS-1$ //$NON-NLS-2$
System.out.println("OpenKeyHelper.findBundles path - "+path);
XModelObject o = model.getByPath(path);
if(o != null) l.add(o);
for (XModelObject src: srcObjects) {
o = src.getChildByPath(path.substring(1));
if(o != null) {
l.add(o);
}
}
if(!l.isEmpty()) {
if(o == null) o = l.get(0);
int i = bundle.lastIndexOf('.');
String name = (i < 0) ? bundle : bundle.substring(i + 1);
XModelObject[] ps = o.getParent().getChildren();
for (XModelObject c: ps) {
if(!l.contains(c)) {
String pp = c.getPathPart();
System.out.println("OpenKeyHelper.findBundles pp - "+pp);
if(pp.endsWith(".properties") && (pp.startsWith(name +
".") || pp.startsWith(name + "_"))) {
l.add(c);
}
}
}
}
System.out.println("OpenKeyHelper.findBundles bundles found - "+l.size());
return l.toArray(new XModelObject[0]);
}
{code}
and I got on Linux:
{code}
OpenKeyHelper.findBundles bundle - demo.Messages locale - null
OpenKeyHelper.findBundles path - /demo/Messages_en_US.properties
OpenKeyHelper.findBundles path - /demo/Messages_en.properties
OpenKeyHelper.findBundles path - /demo/Messages.properties
OpenKeyHelper.findBundles pp - utils
OpenKeyHelper.findBundles pp - Messages_de.properties
OpenKeyHelper.findBundles pp - User.java
OpenKeyHelper.findBundles bundles found - 2
{code}
org.jboss.tools.jsf.ui.test failure on Windows
----------------------------------------------
Key: JBIDE-17184
URL:
https://issues.jboss.org/browse/JBIDE-17184
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: jsf
Affects Versions: 4.2.0.Beta1
Reporter: Daniel Azarov
Assignee: Viacheslav Kabanovich
Fix For: 4.2.0.Beta2
Attachments: Linux17184.png, org.jboss.tools.jsf.ui.test.JsfUiAllTests.txt,
Windows17184.png, Windows17184.png
Tests run: 104, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 738.449 sec
<<< FAILURE!
Results :
Failed tests:
testMessagesInLocalizedBundles(org.jboss.tools.jsf.jsp.ca.test.CAJsfMessagesProposalsTest):
The proposal to apply not found.
Tests run: 104, Failures: 1, Errors: 0, Skipped: 0
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)