2626
2727import static io .microsphere .classloading .Artifact .create ;
2828import static io .microsphere .constants .FileConstants .JAR_EXTENSION ;
29+ import static io .microsphere .constants .PathConstants .SLASH_CHAR ;
2930import static io .microsphere .constants .PropertyConstants .MICROSPHERE_PROPERTY_NAME_PREFIX ;
3031import static io .microsphere .constants .SymbolConstants .COMMA ;
32+ import static io .microsphere .constants .SymbolConstants .HYPHEN_CHAR ;
3133import static io .microsphere .net .URLUtils .isArchiveURL ;
3234import static io .microsphere .util .StringUtils .split ;
3335import static java .lang .System .getProperty ;
@@ -129,22 +131,21 @@ private String resolveArtifactId(Attributes attributes, URL artifactResourceURL,
129131 artifactId = resolveArtifactId (artifactResourceURL );
130132 }
131133
132- if (artifactId == null ) {
133- if (logger .isTraceEnabled ()) {
134- logger .trace ("The artifactId can't be resolved from the {} of artifact[resource: {}] : {}" ,
135- artifactResourceURL .getPath (),
136- MANIFEST_RESOURCE_PATH ,
137- attributes .entrySet ()
138- );
139- }
134+ if (logger .isTraceEnabled ()) {
135+ logger .trace ("The artifactId was resolved from the '{}' of resource URL['{}'] of : {} , attributes : {}" ,
136+ MANIFEST_RESOURCE_PATH ,
137+ artifactResourceURL .getPath (),
138+ artifactId ,
139+ attributes .entrySet ()
140+ );
140141 }
141142
142143 return artifactId ;
143144 }
144145
145146 private String resolveArtifactId (URL artifactResourceURL ) {
146147 String path = artifactResourceURL .getPath ();
147- int lastSlashIndex = path .lastIndexOf ('/' );
148+ int lastSlashIndex = path .lastIndexOf (SLASH_CHAR );
148149 if (lastSlashIndex < 0 ) {
149150 return null ;
150151 }
@@ -153,7 +154,7 @@ private String resolveArtifactId(URL artifactResourceURL) {
153154 return null ;
154155 }
155156 String jarFileName = path .substring (lastSlashIndex + 1 , fileExtensionIndex );
156- int lastHyphenIndex = jarFileName .lastIndexOf ('-' );
157+ int lastHyphenIndex = jarFileName .lastIndexOf (HYPHEN_CHAR );
157158 if (lastHyphenIndex < 0 ) {
158159 return jarFileName ;
159160 }
0 commit comments