< prev index next >

test/compiler/stringopts/TestOptimizeStringConcat.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8068909
  27  * @key regression
  28  * @summary test that string optimizations produce code, that doesn't lead to a crash.
  29  * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestOptimizeStringConcat


  30  * @author axel.siebenborn@sap.com
  31  */



  32 public class TestOptimizeStringConcat {
  33 
  34     static boolean checkArgumentSyntax(String value, String allowedchars, String notallowedchars, String logmsg) {
  35         String rc = null;
  36 
  37         int maxchar = 99999;
  38         int minchar = 1;
  39         if ((allowedchars != null && notallowedchars != null) || minchar > maxchar) {
  40             rc = "internal error";
  41         } else {
  42             if (value == null) {
  43                 rc = "the value null is not allowed, it is missing";
  44             } else if (value != null && minchar > 0 && value.trim().equals("")) {
  45                 rc = "the value must not be empty";
  46             } else if (value != null) {
  47                 if (value.length() < minchar || value.length() > maxchar) {
  48                     if (rc == null) {
  49                         rc = "the value length must be between +minchar+ and +maxchar";
  50                     }
  51                 }




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8068909
  27  * @key regression
  28  * @summary test that string optimizations produce code, that doesn't lead to a crash.
  29  *
  30  * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
  31  *                   compiler.stringopts.TestOptimizeStringConcat
  32  * @author axel.siebenborn@sap.com
  33  */
  34 
  35 package compiler.stringopts;
  36 
  37 public class TestOptimizeStringConcat {
  38 
  39     static boolean checkArgumentSyntax(String value, String allowedchars, String notallowedchars, String logmsg) {
  40         String rc = null;
  41 
  42         int maxchar = 99999;
  43         int minchar = 1;
  44         if ((allowedchars != null && notallowedchars != null) || minchar > maxchar) {
  45             rc = "internal error";
  46         } else {
  47             if (value == null) {
  48                 rc = "the value null is not allowed, it is missing";
  49             } else if (value != null && minchar > 0 && value.trim().equals("")) {
  50                 rc = "the value must not be empty";
  51             } else if (value != null) {
  52                 if (value.length() < minchar || value.length() > maxchar) {
  53                     if (rc == null) {
  54                         rc = "the value length must be between +minchar+ and +maxchar";
  55                     }
  56                 }


< prev index next >