@@ -104,18 +104,21 @@ public static ProjectHelper getInstance(PageConfig cfg) {
104
104
}
105
105
106
106
/**
107
- * Get repository info for particular project
107
+ * Get repository info list for particular project. A copy of the list is
108
+ * returned always to allow concurrent modifications of the list in the
109
+ * caller. The items in the list shall not be modified concurrently, though.
108
110
*
109
- * @param p Project
110
- * @return List of repository info or empty List if no info is found
111
+ * @param p the project for which we find the repository info list
112
+ * @return Copy of a list of repository info or empty list if no info is
113
+ * found
111
114
*/
112
115
public List <RepositoryInfo > getRepositoryInfo (Project p ) {
113
116
if (!cfg .isAllowed (p )) {
114
117
return new ArrayList <>();
115
118
}
116
119
Map <Project , List <RepositoryInfo >> map = cfg .getEnv ().getProjectRepositoriesMap ();
117
120
List <RepositoryInfo > info = map .get (p );
118
- return info == null ? new ArrayList <>() : info ;
121
+ return info == null ? new ArrayList <>() : new ArrayList <>( info ) ;
119
122
}
120
123
121
124
/**
@@ -249,7 +252,7 @@ public Set<Project> getProjects(Group g) {
249
252
}
250
253
return cacheProjects (PROJECT_HELPER_GROUPED_PROJECT_GROUP + g .getName ().toLowerCase (), g .getProjects ());
251
254
}
252
-
255
+
253
256
/**
254
257
* @param g group
255
258
* @return filtered group's repositories
@@ -421,7 +424,7 @@ public boolean test(Project t) {
421
424
cfg .setRequestAttribute (PROJECT_HELPER_FAVOURITE_GROUP , p );
422
425
return val ;
423
426
}
424
-
427
+
425
428
/**
426
429
* Checks if the project is a favourite project
427
430
*
0 commit comments