3434import hudson .model .Run ;
3535import hudson .model .TopLevelItem ;
3636import hudson .model .TopLevelItemDescriptor ;
37- import java .io .IOException ;
3837import java .lang .reflect .ParameterizedType ;
3938import java .lang .reflect .Type ;
4039import java .util .ArrayList ;
@@ -231,9 +230,9 @@ public String itemNameFromItem(@NonNull MultiBranchProject<P,R> parent, @NonNull
231230 if (factory .isProject (item )) {
232231 return NameEncoder .encode (factory .getBranch (item ).getName ());
233232 }
234- String idealName = idealNameFromItem ( parent , item );
235- if (idealName != null ) {
236- return NameEncoder .encode (idealName );
233+ String name = item . getName ( );
234+ if (name != null ) {
235+ return NameEncoder .encode (name );
237236 }
238237 return null ;
239238 }
@@ -245,9 +244,9 @@ public String dirNameFromItem(@NonNull MultiBranchProject<P,R> parent, @NonNull
245244 if (factory .isProject (item )) {
246245 return NameMangler .apply (factory .getBranch (item ).getName ());
247246 }
248- String idealName = idealNameFromItem ( parent , item );
249- if (idealName != null ) {
250- return NameMangler .apply (idealName );
247+ String name = item . getName ( );
248+ if (name != null ) {
249+ return NameMangler .apply (name );
251250 }
252251 return null ;
253252 }
@@ -263,12 +262,5 @@ public String itemNameFromLegacy(@NonNull MultiBranchProject<P, R> parent, @NonN
263262 public String dirNameFromLegacy (@ NonNull MultiBranchProject <P , R > parent , @ NonNull String legacyDirName ) {
264263 return NameMangler .apply (NameEncoder .decode (legacyDirName ));
265264 }
266-
267- // TODO remove after it is removed in cloudbees-folder
268- public void recordLegacyName (MultiBranchProject <P , R > parent , P item , String legacyDirName ) throws IOException {
269- // no-op because we already tracked the name in Branch.getName()
270- }
271-
272265 }
273-
274266}
0 commit comments