From 72dea1b93cd129e458ad20ac3d68c4a207077486 Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Mon, 26 Sep 2016 16:41:39 +0000 Subject: [PATCH] ICU-12739 JDK8 as the reference platform - use Java 8 version of ICUTaglet implementation by default. X-SVN-Rev: 39349 --- .gitattributes | 1 + icu4j/build.xml | 15 +-- icu4j/tools/build/.classpath | 4 +- .../.settings/org.eclipse.jdt.core.prefs | 6 +- icu4j/tools/build/build.xml | 19 +-- .../icu/dev/tool/docs/ICUTagletAdapter.java | 109 ++++++++---------- .../icu/dev/tool/docs/ICUTagletAdapter.java | 49 +++++--- 7 files changed, 104 insertions(+), 99 deletions(-) rename icu4j/tools/build/{src8 => src-pre8}/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java (51%) diff --git a/.gitattributes b/.gitattributes index 41a0c9ad4d9..5e7c02437b2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -538,6 +538,7 @@ icu4j/tools/build/icu4j54.api3.gz -text icu4j/tools/build/icu4j55.api3.gz -text icu4j/tools/build/icu4j56.api3.gz -text icu4j/tools/build/icu4j57.api3.gz -text +icu4j/tools/build/src-pre8/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java -text tools/currency/.classpath -text tools/currency/.project -text tools/currency/.settings/org.eclipse.core.resources.prefs -text diff --git a/icu4j/build.xml b/icu4j/build.xml index 329790cfce0..b252e1cd67a 100644 --- a/icu4j/build.xml +++ b/icu4j/build.xml @@ -82,14 +82,15 @@ - - + + + @@ -542,10 +543,10 @@ - + - + @@ -553,8 +554,8 @@ - - + + @@ -565,7 +566,7 @@ - + diff --git a/icu4j/tools/build/.classpath b/icu4j/tools/build/.classpath index f88bc4ed2fc..eac3c340f64 100644 --- a/icu4j/tools/build/.classpath +++ b/icu4j/tools/build/.classpath @@ -1,7 +1,7 @@ - - + + diff --git a/icu4j/tools/build/.settings/org.eclipse.jdt.core.prefs b/icu4j/tools/build/.settings/org.eclipse.jdt.core.prefs index 59cc759450a..4421badc58a 100644 --- a/icu4j/tools/build/.settings/org.eclipse.jdt.core.prefs +++ b/icu4j/tools/build/.settings/org.eclipse.jdt.core.prefs @@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -98,7 +98,7 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 diff --git a/icu4j/tools/build/build.xml b/icu4j/tools/build/build.xml index 4401cc68542..15d458e6599 100644 --- a/icu4j/tools/build/build.xml +++ b/icu4j/tools/build/build.xml @@ -11,8 +11,11 @@ - - + + + + + @@ -33,25 +36,25 @@ - + - + - - + + - + - + \ No newline at end of file diff --git a/icu4j/tools/build/src8/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java b/icu4j/tools/build/src-pre8/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java similarity index 51% rename from icu4j/tools/build/src8/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java rename to icu4j/tools/build/src-pre8/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java index 94ed1bb416d..60736473e00 100644 --- a/icu4j/tools/build/src8/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java +++ b/icu4j/tools/build/src-pre8/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java @@ -1,60 +1,49 @@ -// © 2016 and later: Unicode, Inc. and others. -// License & terms of use: http://www.unicode.org/copyright.html#License -/* - ******************************************************************************* - * Copyright (C) 2015, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - */ -package com.ibm.icu.dev.tool.docs; - -import com.sun.javadoc.Doc; -import com.sun.javadoc.Tag; -import com.sun.tools.doclets.formats.html.markup.RawHtml; -import com.sun.tools.doclets.internal.toolkit.Content; -import com.sun.tools.doclets.internal.toolkit.taglets.Taglet; -import com.sun.tools.doclets.internal.toolkit.taglets.TagletWriter; - -/** - * The ICUTagletAdapter class is the abstract base class that adapts the ICUTaglet class to different implementations of the JavaDoc API. - * The methods in this class are meant to minimize the dual maintenance nature of supporting multiple JavaDoc APIs. - * - * This adapter supports the v8 JavaDoc API - */ -public abstract class ICUTagletAdapter implements Taglet { - - public abstract String toString(Tag tag); - - public abstract String toString(Tag[] tags); - - public Content getTagletOutput(Tag tag, TagletWriter writer) - throws IllegalArgumentException { - - // addContext doesn't except nulls so filter them out - String encodedText = toString(tag); - if(encodedText == null) return null; - - Content out = writer.getOutputInstance(); - out.addContent(new RawHtml(encodedText)); - - return out; - } - - public Content getTagletOutput(Doc holder, TagletWriter writer) - throws IllegalArgumentException { - - Content out = writer.getOutputInstance(); - Tag[] tags = holder.tags(getName()); - if (tags.length == 0) { - return null; - } - - // addContext doesn't except nulls so filter them out - String encodedText = toString(tags[0]); - if(encodedText == null) return null; - - out.addContent(new RawHtml(encodedText)); - return out; - } - -} +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html#License +/* + ******************************************************************************* + * Copyright (C) 2015, International Business Machines Corporation and * + * others. All Rights Reserved. * + ******************************************************************************* + */ +package com.ibm.icu.dev.tool.docs; + +import com.sun.javadoc.Doc; +import com.sun.javadoc.Tag; +import com.sun.tools.doclets.internal.toolkit.taglets.Taglet; +import com.sun.tools.doclets.internal.toolkit.taglets.TagletOutput; +import com.sun.tools.doclets.internal.toolkit.taglets.TagletWriter; + +/** + * The ICUTagletAdapter class is the abstract base class that adapts the ICUTaglet class to different implementations of the JavaDoc API. + * The methods in this class are meant to minimize the dual maintenance nature of supporting multiple JavaDoc APIs. + * + * This adapter supports the v7 and earlier JavaDoc API + */ +public abstract class ICUTagletAdapter implements Taglet { + + public abstract String toString(Tag tag); + + public abstract String toString(Tag[] tags); + + public TagletOutput getTagletOutput(Tag tag, TagletWriter writer) + throws IllegalArgumentException { + + TagletOutput out = writer.getTagletOutputInstance(); + out.setOutput(toString(tag)); + return out; + } + + public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) + throws IllegalArgumentException { + + TagletOutput out = writer.getTagletOutputInstance(); + Tag[] tags = holder.tags(getName()); + if (tags.length == 0) { + return null; + } + out.setOutput(toString(tags[0])); + return out; + } + +} diff --git a/icu4j/tools/build/src/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java b/icu4j/tools/build/src/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java index c7ad01ae000..94ed1bb416d 100644 --- a/icu4j/tools/build/src/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java +++ b/icu4j/tools/build/src/com/ibm/icu/dev/tool/docs/ICUTagletAdapter.java @@ -10,40 +10,51 @@ package com.ibm.icu.dev.tool.docs; import com.sun.javadoc.Doc; import com.sun.javadoc.Tag; +import com.sun.tools.doclets.formats.html.markup.RawHtml; +import com.sun.tools.doclets.internal.toolkit.Content; import com.sun.tools.doclets.internal.toolkit.taglets.Taglet; -import com.sun.tools.doclets.internal.toolkit.taglets.TagletOutput; import com.sun.tools.doclets.internal.toolkit.taglets.TagletWriter; /** * The ICUTagletAdapter class is the abstract base class that adapts the ICUTaglet class to different implementations of the JavaDoc API. * The methods in this class are meant to minimize the dual maintenance nature of supporting multiple JavaDoc APIs. * - * This adapter supports the v7 and earlier JavaDoc API + * This adapter supports the v8 JavaDoc API */ public abstract class ICUTagletAdapter implements Taglet { - + public abstract String toString(Tag tag); public abstract String toString(Tag[] tags); - public TagletOutput getTagletOutput(Tag tag, TagletWriter writer) - throws IllegalArgumentException { - - TagletOutput out = writer.getTagletOutputInstance(); - out.setOutput(toString(tag)); - return out; + public Content getTagletOutput(Tag tag, TagletWriter writer) + throws IllegalArgumentException { + + // addContext doesn't except nulls so filter them out + String encodedText = toString(tag); + if(encodedText == null) return null; + + Content out = writer.getOutputInstance(); + out.addContent(new RawHtml(encodedText)); + + return out; + } + + public Content getTagletOutput(Doc holder, TagletWriter writer) + throws IllegalArgumentException { + + Content out = writer.getOutputInstance(); + Tag[] tags = holder.tags(getName()); + if (tags.length == 0) { + return null; } - public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) - throws IllegalArgumentException { + // addContext doesn't except nulls so filter them out + String encodedText = toString(tags[0]); + if(encodedText == null) return null; - TagletOutput out = writer.getTagletOutputInstance(); - Tag[] tags = holder.tags(getName()); - if (tags.length == 0) { - return null; - } - out.setOutput(toString(tags[0])); - return out; - } + out.addContent(new RawHtml(encodedText)); + return out; + } } -- 2.40.0