frizbog / gedcom4j

Java library for reading/writing genealogy files in GEDCOM format
http://gedcom4j.org
55 stars 37 forks source link

Parser doesn't work correctly when a family record is before a spouse individual record #63

Closed PeWu closed 10 years ago

PeWu commented 10 years ago

The parser when loading a family entity assumes that he cross-referenced individuals (wife, husband, children) have already been loaded.

This is a sample Gedcom file that fails to load correctly:

0 HEAD
1 SOUR 0
1 GEDC
2 VERS 5.5
2 FORM LINEAGE-LINKED
1 CHAR ANSEL
0 @I001@ INDI
1 NAME Husband /Gedcom/
1 FAMS @F001@
0 @F001@ FAM
1 HUSB @I001@
1 WIFE @I002@
0 @I002@ INDI
1 NAME Wife /Gedcom/
1 FAMS @F001@
0 TRLR

In particular, gedcom.families.get("@F001@").wife does not contain the correct individual information for this file.

frizbog commented 10 years ago

That would definitely be a problem. I will start work on this.

Thanks for the excellently clear bug report!

On Jun 26, 2014, at 9:55 AM, PeWu notifications@github.com wrote:

The parser when loading a family entity assumes that he cross-referenced individuals (wife, husband, children) have already been loaded.

This is a sample Gedcom file that fails to load correctly:

0 HEAD 1 SOUR 0 1 GEDC 2 VERS 5.5 2 FORM LINEAGE-LINKED 1 CHAR ANSEL 0 @I001@ INDI 1 NAME Husband /Gedcom/ 1 FAMS @F001@ 0 @F001@ FAM 1 HUSB @I001@ 1 WIFE @I002@ 0 @I002@ INDI 1 NAME Wife /Gedcom/ 1 FAMS @F001@ 0 TRLR In particular, gedcom.families.get("@F001@").wife does not contain the correct individual information for this file.

— Reply to this email directly or view it on GitHub.

PeWu commented 10 years ago

Thanks!

frizbog commented 10 years ago

Fixed in v2.1.8 which is now released on the site and in Maven Central.