public void expand(BibtexFile bibtexFile) throws ExpansionException {
		HashMap entryKey2Entry = new HashMap();
		ArrayList entriesWithCrossReference = new ArrayList();
		for (Iterator entryIt = bibtexFile.getEntries().iterator(); entryIt.hasNext();) {
			BibtexAbstractEntry abstractEntry = (BibtexAbstractEntry) entryIt.next();
			if (!(abstractEntry instanceof BibtexEntry))
				continue;
			BibtexEntry entry = (BibtexEntry) abstractEntry;
			entryKey2Entry.put(entry.getEntryKey().toLowerCase(), abstractEntry);
			if (entry.getFields().containsKey("crossref")) {
				entriesWithCrossReference.add(entry);
			}
		}
		for (Iterator entryIt = entriesWithCrossReference.iterator(); entryIt.hasNext();) {
			BibtexEntry entry = (BibtexEntry) entryIt.next();
			String crossrefKey = ((BibtexString) entry.getFields().get("crossref")).getContent().toLowerCase();
			entry.undefineField("crossref");
			BibtexEntry crossrefEntry = (BibtexEntry) entryKey2Entry.get(crossrefKey);
			if (crossrefEntry == null)
				throwExpansionException("Crossref key not found: \"" + crossrefKey + "\"");
			if (crossrefEntry.getFields().containsKey("crossref"))
				throwExpansionException(
					"Nested crossref: \""
						+ crossrefKey
						+ "\" is crossreferenced but crossreferences itself \""
						+ ((BibtexString) crossrefEntry.getFields().get("crossref")).getContent()
						+ "\"");
			Map entryFields = entry.getFields();
			Map crossrefFields = crossrefEntry.getFields();
			for (Iterator fieldIt = crossrefFields.keySet().iterator(); fieldIt.hasNext();) {
				String key = (String) fieldIt.next();
				if (!entryFields.containsKey(key)) {
					entry.setField(key, (BibtexAbstractValue) crossrefFields.get(key));
				}
			}
		}
		finishExpansion();
	}