langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/ContentBuilder.java
changeset 36500 d31e4986dc8b
parent 35426 374342e56a56
child 42828 cce89649f958
equal deleted inserted replaced
36499:9d823cc0fe98 36500:d31e4986dc8b
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    48         } else
    48         } else
    49             contents.add(content);
    49             contents.add(content);
    50     }
    50     }
    51 
    51 
    52     @Override
    52     @Override
    53     public void addContent(String text) {
    53     public void addContent(CharSequence text) {
    54         if (text.isEmpty())
    54         if (text.length() == 0)
    55             return;
    55             return;
    56         ensureMutableContents();
    56         ensureMutableContents();
    57         Content c = contents.isEmpty() ? null : contents.get(contents.size() - 1);
    57         Content c = contents.isEmpty() ? null : contents.get(contents.size() - 1);
    58         StringContent sc;
    58         StringContent sc;
    59         if (c != null && c instanceof StringContent) {
    59         if (c != null && c instanceof StringContent) {