@ -73,8 +73,12 @@ public class IpLogMeta {
private static final String S_CQ = "CQ" ;
private static final String S_CONSUMES = "consumes" ;
private static final String K_NAME = "name" ;
private static final String K_VERSION = "version" ;
private static final String K_COMMENTS = "comments" ;
private static final String K_SKIP_COMMIT = "skipCommit" ;
@ -89,31 +93,29 @@ public class IpLogMeta {
private List < Project > projects = new ArrayList < Project > ( ) ;
private List < Project > consumedProjects = new ArrayList < Project > ( ) ;
private Set < CQ > cqs = new HashSet < CQ > ( ) ;
List < Project > getProjects ( ) {
return projects ;
}
List < Project > getConsumedProjects ( ) {
return consumedProjects ;
}
Set < CQ > getCQs ( ) {
return cqs ;
}
void loadFrom ( Config cfg ) {
projects . clear ( ) ;
consumedProjects . clear ( ) ;
cqs . clear ( ) ;
for ( String id : cfg . getSubsections ( S_PROJECT ) ) {
String name = cfg . getString ( S_PROJECT , id , K_NAME ) ;
Project project = new Project ( id , name ) ;
project . setComments ( cfg . getString ( S_PROJECT , id , K_COMMENTS ) ) ;
for ( String c : cfg . getStringList ( S_PROJECT , id , K_SKIP_COMMIT ) )
project . addSkipCommit ( ObjectId . fromString ( c ) ) ;
for ( String license : cfg . getStringList ( S_PROJECT , id , K_LICENSE ) )
project . addLicense ( license ) ;
projects . add ( project ) ;
}
projects . addAll ( parseProjects ( cfg , S_PROJECT ) ) ;
consumedProjects . addAll ( parseProjects ( cfg , S_CONSUMES ) ) ;
for ( String id : cfg . getSubsections ( S_CQ ) ) {
CQ cq = new CQ ( Long . parseLong ( id ) ) ;
@ -126,6 +128,24 @@ public class IpLogMeta {
}
}
private List < Project > parseProjects ( final Config cfg ,
final String sectionName ) {
final List < Project > dst = new ArrayList < Project > ( ) ;
for ( String id : cfg . getSubsections ( sectionName ) ) {
String name = cfg . getString ( sectionName , id , K_NAME ) ;
Project project = new Project ( id , name ) ;
project . setVersion ( cfg . getString ( sectionName , id , K_VERSION ) ) ;
project . setComments ( cfg . getString ( sectionName , id , K_COMMENTS ) ) ;
for ( String c : cfg . getStringList ( sectionName , id , K_SKIP_COMMIT ) )
project . addSkipCommit ( ObjectId . fromString ( c ) ) ;
for ( String license : cfg . getStringList ( sectionName , id , K_LICENSE ) )
project . addLicense ( license ) ;
dst . add ( project ) ;
}
return dst ;
}
/ * *
* Query the Eclipse Foundation ' s IPzilla database for CQ records .
* < p >