/* * [Bug.java] * * Summary: Generate a reference to a bug in the Oracle Bug database. * * Copyright: (c) 2009-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.8 2009-02-06 include go package in ZIP bundle. * 1.9 2014-03-29 rename from SunBug to Bug * 2.0 2014-04-13 allowed for alphanumeric ids. */ package com.mindprod.htmlmacros.macro; import com.mindprod.fastcat.FastCat; import static java.lang.System.*; /** * Generate a reference to a bug in the Oracle Bug database. * * @author Roedy Green, Canadian Mind Products * @version 2.0 2014-04-13 allowed for alphanumeric ids * @see RFE * @since 2009 */ public final class Bug extends Macro { /** * how to use the macro */ private static final String USAGE = "\nBug macro needs bugID description"; /** * guts to Generate reference to a Oracle Bug report. * * @param bugID usually 7 digits. * @param description description of the bug * * @return expanded to reference sun bug database */ private static String expand( String bugID, String description ) { final FastCat sb = new FastCat( 8 ); sb.append( "\n
Oracle bug number ", bugID, " : ", description, "
\n" ); return sb.toString(); } /** * typical use: * * @param parms macro params * @param quiet true if want output suppressed. * @param verbose @return expanded macro HTML */ public String expandMacro( final String[] parms, final boolean quiet, final boolean verbose ) { if ( !quiet ) { out.print( "B" ); } if ( parms.length != 2 ) { throw new IllegalArgumentException( USAGE ); } final String bugID = parms[ 0 ]; final String description = parms[ 1 ]; return expand( bugID, description ); } }