This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
enable() method of this action searches for META-INF/taglib.tld for JAR files created by IDE (with jarContent). This is wrong approach because now the valid name is not only taglib.tlb. This is slow because it requires access to JAR entries.
A more valid definition of what is a tag library jar would be whether there is any file with extension ".tld" in META-INF. The performance hit on accessing the contents of the jar file is probably OK, because jars are not added to the repository very often.
Performance hit is not OK. Doing I/O activities during enable action breaks possibility to meet criteria for UI responsiveness of context menu and top level menu and it affects all jar files regardless if they are taglib or not.
Here is a summary of the discussions about possible solutions to this performance issue: The issue: with the possibility of multiple tag libraries in a jar, tag library jars are harder to differentiate from other jars. Specifically, this causes a performance problem in a context-sensistive tools menu item (Add to Tag Library Repository) that is currently only enabled on tag library jars. The underlying problem is that we have to open the jar (a file i/o operation) and scan the names of the entries until we find one in /META-INF with extension ".tld". Radim's tests indicate that this can range from 20 ms for jars that are quickly found to be tag library jars, to 200 or 300 ms for large jars that aren't tag library jars (must scan all entries to make a negative conclusion). This is too much time for an enable action, given that the UI requirement for a context menu is 100 ms. (Radim's email from 2/4 describes when the enable method for this action gets called.) One possible mitigation: If we first test for the presence of the /META-INF directory, we can quickly make negative judgements on some non-taglibrary jars. Two problems with this: 1. most jars have manifests in /META-INF anyways; 2. some zip creators don't create entries for directories. So this doesn't seem like a reasonable workaround. Three possible solutions: 0. Eliminate the menu item. However, I remember that this menu item has been used in our tutorials and in a user-written tutorial. (I found out I was wrong about the user-written tutorial -- he was talking about putting tag libraries into the CVS repository. So much for running my brain so early in the morning :) 1. Don't do the full isTaglibJar() check on the enable, but rather do it during action performed, and if not a tag library jar, inform the user with a (nicely worded) dialog that indicates that the jar doesn't have tag libraries in it and so won't be added to the repository. This seems like bait-and-switch on the menu item and doesn't fit with the idea of context-sensitive menu items. In other words, HIE doesn't like this one. There is a precedent, however: if the user selects the execute action on a java file with no main() method, a dialog will come up informing the user of such. 2. Simply allow non-taglibrary jars in the repository. For nevada, this can be OK, since the user will simply get a library in their WEB-INF/lib that isn't a tag library. There's a small risk of semantic confusion, since we call it the tag library repository. However, this poses a bigger problem for later versions, where we plan to redesign the tag library repository to be tld-centric. If there are non-taglib jars in a user's repository, then we will have a difficult time upgrading the repository for the user.
The solution recommended by HIE (renaming contextual menu item and adding a dialog when attempting to add a non-TL jar to the repository) has minimal impact on QA. QA approves of this change for Nevada/NB 3.5.
You have my blessing. I'll communicate this change to Chris.
recommended fix implemented.
Verified in NetBeans dev build 200303030100.