* the annotations to compress
* @return The same object as passed in the 'annotations' parameter to let
* this function used as a filter.
*/
public static Collection<FileAnnotation> intern(final Collection<FileAnnotation> annotations) {
TreeStringBuilder stringPool = new TreeStringBuilder();
for (FileAnnotation annotation : annotations) {
if (annotation instanceof AbstractAnnotation) {
AbstractAnnotation aa = (AbstractAnnotation) annotation;
aa.intern(stringPool);
}
}
stringPool.dedup();
return annotations;
}