Github user serranom commented on a diff in the pull request:

    https://github.com/apache/twill/pull/1#discussion_r75528764
  
    --- Diff: 
twill-core/src/main/java/org/apache/twill/internal/ApplicationBundler.java ---
    @@ -215,8 +215,19 @@ public boolean accept(String className, URL classUrl, 
URL classPathUrl) {
       private void putEntry(String className, URL classUrl, URL classPathUrl, 
Set<String> entries, JarOutputStream jarOut) {
         String classPath = classPathUrl.getFile();
         if (classPath.endsWith(".jar")) {
    +      String entryName = classPath.substring(classPath.lastIndexOf('/') + 
1);
    +      // need unique name or else we lose classes (TWILL-181)
    +      if (entries.contains(SUBDIR_LIB + entryName)) {
    +        String[] parts = classPath.split("/");
    --- End diff --
    
    In this context, we know the classPath urls are all unique because they 
come from a set.  What this logic does is to prepending the entry name with 
enough elements of this path to make it unique.  I presumed there was some 
desire to keep the entry names short for other reasons.  By using the elements 
from the path we get something guaranteed to be unique while keeping some 
meaning to the name.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to