MiMa (6) [Avatar] Offline
#1
Hi,

some bookcode don't want to work because some Methods will be to cross through.

Chapter 02 MyFirstTika.java
.getMimetype (will be to cross through)
.toURL (will be too)

chater 05 LuceneIndexerExtended
IndexWriter writer = new IndexWriter (new IndexWriter will be cross through)
MaxFieldLength (too) The import will be there

chapter 06 MetadataAwareLuceneIndexer
.CREATOR (will be to cross through)
.DATE (will be to cross through)
.FORMAT (will be to cross through)
.SUBJECT (will be to cross through)

RecentFiles.java
Line: StringBuffer output = new StringBuffer();
Message: StringBuffer can be replaced with StringBuilder ??????
Assign Return Value to New Variable ??

Line: output.append(emitTag("guid", doc.get(DublinCore.SOURCE),
Line: output.append(emitTag("link", doc.get(DublinCore.SOURCE), null,
Messages:Method get in class Document cannot be applied given types.
required: String
found: Property

.TITLE (will be to cross through)
.CREATOR (will be to cross through)
.SUBJECT (will be to cross through)


chaper07 LanguageDetectingParser.java
.LANGUAGE (will be to cross through)

and so on ???

Michael
chris.mattmann (14) [Avatar] Offline
#2
Re: Some book Code dont want work
Hi MiMa,

I'm guessing by cross-through, you mean deprecated? That's entirely possible. That means that at the time of writing the book, the coding examples depended on methods that themselves were eventually deprecated. Those methods will still work in later versions even if you see them as crossed-out in your IDE.

HTH!

Cheers,
Chris