src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java

Mon, 02 Oct 2017 14:20:23 +0100

author
aefimov
date
Mon, 02 Oct 2017 14:20:23 +0100
changeset 1518
d9877e4e1f2b
parent 1445
06086cb6c349
child 1546
dc8316632248
permissions
-rw-r--r--

8159240: XSOM parser incorrectly processes type names with whitespaces
Reviewed-by: coffeys

ohair@286 1 /*
aefimov@1445 2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
ohair@286 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@286 4 *
ohair@286 5 * This code is free software; you can redistribute it and/or modify it
ohair@286 6 * under the terms of the GNU General Public License version 2 only, as
ohair@286 7 * published by the Free Software Foundation. Oracle designates this
ohair@286 8 * particular file as subject to the "Classpath" exception as provided
ohair@286 9 * by Oracle in the LICENSE file that accompanied this code.
ohair@286 10 *
ohair@286 11 * This code is distributed in the hope that it will be useful, but WITHOUT
ohair@286 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@286 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@286 14 * version 2 for more details (a copy is included in the LICENSE file that
ohair@286 15 * accompanied this code).
ohair@286 16 *
ohair@286 17 * You should have received a copy of the GNU General Public License version
ohair@286 18 * 2 along with this work; if not, write to the Free Software Foundation,
ohair@286 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@286 20 *
ohair@286 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@286 22 * or visit www.oracle.com if you need additional information or have any
ohair@286 23 * questions.
ohair@286 24 */
ohair@286 25
ohair@286 26 /* this file is generated by RelaxNGCC */
ohair@286 27 package com.sun.xml.internal.xsom.impl.parser.state;
aefimov@1445 28 import com.sun.xml.internal.bind.WhiteSpaceProcessor;
aefimov@1445 29 import com.sun.xml.internal.xsom.impl.*;
aefimov@1445 30 import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
aefimov@1445 31 import com.sun.xml.internal.xsom.parser.*;
aefimov@1445 32
aefimov@1445 33 import org.xml.sax.Attributes;
aefimov@1445 34 import org.xml.sax.Locator;
ohair@286 35 import org.xml.sax.SAXException;
ohair@286 36
ohair@286 37 class attributeGroupDecl extends NGCCHandler {
ohair@286 38 private AnnotationImpl annotation;
ohair@286 39 private String name;
ohair@286 40 private ForeignAttributesImpl fa;
ohair@286 41 protected final NGCCRuntimeEx $runtime;
ohair@286 42 private int $_ngcc_current_state;
ohair@286 43 protected String $uri;
ohair@286 44 protected String $localName;
ohair@286 45 protected String $qname;
ohair@286 46
ohair@286 47 public final NGCCRuntime getRuntime() {
ohair@286 48 return($runtime);
ohair@286 49 }
ohair@286 50
ohair@286 51 public attributeGroupDecl(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
ohair@286 52 super(source, parent, cookie);
ohair@286 53 $runtime = runtime;
ohair@286 54 $_ngcc_current_state = 14;
ohair@286 55 }
ohair@286 56
ohair@286 57 public attributeGroupDecl(NGCCRuntimeEx runtime) {
ohair@286 58 this(null, runtime, runtime, -1);
ohair@286 59 }
ohair@286 60
ohair@286 61 private void action0()throws SAXException {
ohair@286 62
ohair@286 63 result = new AttGroupDeclImpl(
ohair@286 64 $runtime.document, annotation, locator, fa, name );
ohair@286 65
ohair@286 66 }
ohair@286 67
ohair@286 68 private void action1()throws SAXException {
ohair@286 69 locator=$runtime.copyLocator();
ohair@286 70 }
ohair@286 71
ohair@286 72 public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
ohair@286 73 int $ai;
ohair@286 74 $uri = $__uri;
ohair@286 75 $localName = $__local;
ohair@286 76 $qname = $__qname;
ohair@286 77 switch($_ngcc_current_state) {
mkos@397 78 case 6:
ohair@286 79 {
mkos@397 80 if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")))))) {
mkos@397 81 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 246, fa);
mkos@397 82 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
mkos@397 83 }
mkos@397 84 else {
mkos@397 85 unexpectedEnterElement($__qname);
mkos@397 86 }
ohair@286 87 }
ohair@286 88 break;
ohair@286 89 case 13:
ohair@286 90 {
ohair@286 91 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
ohair@286 92 $runtime.consumeAttribute($ai);
ohair@286 93 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 94 }
ohair@286 95 else {
ohair@286 96 unexpectedEnterElement($__qname);
ohair@286 97 }
ohair@286 98 }
ohair@286 99 break;
mkos@397 100 case 0:
ohair@286 101 {
mkos@397 102 revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 103 }
mkos@397 104 break;
mkos@397 105 case 7:
mkos@397 106 {
mkos@397 107 if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
mkos@397 108 $runtime.consumeAttribute($ai);
mkos@397 109 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 110 }
mkos@397 111 else {
mkos@397 112 $_ngcc_current_state = 6;
mkos@397 113 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 114 }
mkos@397 115 }
mkos@397 116 break;
mkos@397 117 case 3:
mkos@397 118 {
mkos@397 119 action0();
mkos@397 120 $_ngcc_current_state = 2;
mkos@397 121 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 122 }
mkos@397 123 break;
mkos@397 124 case 2:
mkos@397 125 {
mkos@397 126 if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
mkos@397 127 NGCCHandler h = new attributeUses(this, super._source, $runtime, 241, result);
ohair@286 128 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
ohair@286 129 }
ohair@286 130 else {
mkos@397 131 unexpectedEnterElement($__qname);
ohair@286 132 }
ohair@286 133 }
ohair@286 134 break;
ohair@286 135 case 14:
ohair@286 136 {
ohair@286 137 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
ohair@286 138 $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
ohair@286 139 action1();
ohair@286 140 $_ngcc_current_state = 13;
ohair@286 141 }
ohair@286 142 else {
ohair@286 143 unexpectedEnterElement($__qname);
ohair@286 144 }
ohair@286 145 }
ohair@286 146 break;
mkos@397 147 case 4:
ohair@286 148 {
mkos@397 149 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
mkos@397 150 NGCCHandler h = new annotation(this, super._source, $runtime, 244, null,AnnotationContext.ATTRIBUTE_GROUP);
ohair@286 151 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
ohair@286 152 }
ohair@286 153 else {
mkos@397 154 $_ngcc_current_state = 3;
mkos@397 155 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 156 }
ohair@286 157 }
ohair@286 158 break;
ohair@286 159 default:
ohair@286 160 {
ohair@286 161 unexpectedEnterElement($__qname);
ohair@286 162 }
ohair@286 163 break;
ohair@286 164 }
ohair@286 165 }
ohair@286 166
ohair@286 167 public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 168 int $ai;
ohair@286 169 $uri = $__uri;
ohair@286 170 $localName = $__local;
ohair@286 171 $qname = $__qname;
ohair@286 172 switch($_ngcc_current_state) {
mkos@397 173 case 6:
ohair@286 174 {
mkos@397 175 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
mkos@397 176 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 246, fa);
mkos@397 177 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
ohair@286 178 }
ohair@286 179 else {
ohair@286 180 unexpectedLeaveElement($__qname);
ohair@286 181 }
ohair@286 182 }
ohair@286 183 break;
ohair@286 184 case 1:
ohair@286 185 {
ohair@286 186 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
ohair@286 187 $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
ohair@286 188 $_ngcc_current_state = 0;
ohair@286 189 }
ohair@286 190 else {
ohair@286 191 unexpectedLeaveElement($__qname);
ohair@286 192 }
ohair@286 193 }
ohair@286 194 break;
mkos@397 195 case 13:
ohair@286 196 {
mkos@397 197 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
mkos@397 198 $runtime.consumeAttribute($ai);
mkos@397 199 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
mkos@397 200 }
mkos@397 201 else {
mkos@397 202 unexpectedLeaveElement($__qname);
mkos@397 203 }
mkos@397 204 }
mkos@397 205 break;
mkos@397 206 case 0:
mkos@397 207 {
mkos@397 208 revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
ohair@286 209 }
ohair@286 210 break;
ohair@286 211 case 7:
ohair@286 212 {
ohair@286 213 if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
ohair@286 214 $runtime.consumeAttribute($ai);
ohair@286 215 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 216 }
ohair@286 217 else {
ohair@286 218 $_ngcc_current_state = 6;
ohair@286 219 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 220 }
ohair@286 221 }
ohair@286 222 break;
mkos@397 223 case 3:
mkos@397 224 {
mkos@397 225 action0();
mkos@397 226 $_ngcc_current_state = 2;
mkos@397 227 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
mkos@397 228 }
mkos@397 229 break;
mkos@397 230 case 2:
ohair@286 231 {
ohair@286 232 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
mkos@397 233 NGCCHandler h = new attributeUses(this, super._source, $runtime, 241, result);
ohair@286 234 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
ohair@286 235 }
ohair@286 236 else {
ohair@286 237 unexpectedLeaveElement($__qname);
ohair@286 238 }
ohair@286 239 }
ohair@286 240 break;
mkos@397 241 case 4:
ohair@286 242 {
mkos@397 243 $_ngcc_current_state = 3;
mkos@397 244 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 245 }
ohair@286 246 break;
ohair@286 247 default:
ohair@286 248 {
ohair@286 249 unexpectedLeaveElement($__qname);
ohair@286 250 }
ohair@286 251 break;
ohair@286 252 }
ohair@286 253 }
ohair@286 254
ohair@286 255 public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 256 int $ai;
ohair@286 257 $uri = $__uri;
ohair@286 258 $localName = $__local;
ohair@286 259 $qname = $__qname;
ohair@286 260 switch($_ngcc_current_state) {
ohair@286 261 case 13:
ohair@286 262 {
ohair@286 263 if(($__uri.equals("") && $__local.equals("name"))) {
ohair@286 264 $_ngcc_current_state = 12;
ohair@286 265 }
ohair@286 266 else {
ohair@286 267 unexpectedEnterAttribute($__qname);
ohair@286 268 }
ohair@286 269 }
ohair@286 270 break;
mkos@397 271 case 0:
ohair@286 272 {
mkos@397 273 revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
ohair@286 274 }
ohair@286 275 break;
ohair@286 276 case 7:
ohair@286 277 {
ohair@286 278 if(($__uri.equals("") && $__local.equals("id"))) {
ohair@286 279 $_ngcc_current_state = 9;
ohair@286 280 }
ohair@286 281 else {
ohair@286 282 $_ngcc_current_state = 6;
ohair@286 283 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 284 }
ohair@286 285 }
ohair@286 286 break;
mkos@397 287 case 3:
ohair@286 288 {
mkos@397 289 action0();
mkos@397 290 $_ngcc_current_state = 2;
mkos@397 291 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
mkos@397 292 }
mkos@397 293 break;
mkos@397 294 case 4:
mkos@397 295 {
mkos@397 296 $_ngcc_current_state = 3;
mkos@397 297 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 298 }
ohair@286 299 break;
ohair@286 300 default:
ohair@286 301 {
ohair@286 302 unexpectedEnterAttribute($__qname);
ohair@286 303 }
ohair@286 304 break;
ohair@286 305 }
ohair@286 306 }
ohair@286 307
ohair@286 308 public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 309 int $ai;
ohair@286 310 $uri = $__uri;
ohair@286 311 $localName = $__local;
ohair@286 312 $qname = $__qname;
ohair@286 313 switch($_ngcc_current_state) {
mkos@397 314 case 0:
mkos@397 315 {
mkos@397 316 revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
mkos@397 317 }
mkos@397 318 break;
mkos@397 319 case 7:
mkos@397 320 {
mkos@397 321 $_ngcc_current_state = 6;
mkos@397 322 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
mkos@397 323 }
mkos@397 324 break;
mkos@397 325 case 3:
mkos@397 326 {
mkos@397 327 action0();
mkos@397 328 $_ngcc_current_state = 2;
mkos@397 329 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
mkos@397 330 }
mkos@397 331 break;
ohair@286 332 case 8:
ohair@286 333 {
ohair@286 334 if(($__uri.equals("") && $__local.equals("id"))) {
ohair@286 335 $_ngcc_current_state = 6;
ohair@286 336 }
ohair@286 337 else {
ohair@286 338 unexpectedLeaveAttribute($__qname);
ohair@286 339 }
ohair@286 340 }
ohair@286 341 break;
ohair@286 342 case 11:
ohair@286 343 {
ohair@286 344 if(($__uri.equals("") && $__local.equals("name"))) {
ohair@286 345 $_ngcc_current_state = 7;
ohair@286 346 }
ohair@286 347 else {
ohair@286 348 unexpectedLeaveAttribute($__qname);
ohair@286 349 }
ohair@286 350 }
ohair@286 351 break;
ohair@286 352 case 4:
ohair@286 353 {
ohair@286 354 $_ngcc_current_state = 3;
ohair@286 355 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 356 }
ohair@286 357 break;
ohair@286 358 default:
ohair@286 359 {
ohair@286 360 unexpectedLeaveAttribute($__qname);
ohair@286 361 }
ohair@286 362 break;
ohair@286 363 }
ohair@286 364 }
ohair@286 365
ohair@286 366 public void text(String $value) throws SAXException {
ohair@286 367 int $ai;
ohair@286 368 switch($_ngcc_current_state) {
ohair@286 369 case 13:
ohair@286 370 {
ohair@286 371 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
ohair@286 372 $runtime.consumeAttribute($ai);
ohair@286 373 $runtime.sendText(super._cookie, $value);
ohair@286 374 }
ohair@286 375 }
ohair@286 376 break;
mkos@397 377 case 0:
ohair@286 378 {
mkos@397 379 revertToParentFromText(result, super._cookie, $value);
ohair@286 380 }
ohair@286 381 break;
ohair@286 382 case 7:
ohair@286 383 {
ohair@286 384 if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
ohair@286 385 $runtime.consumeAttribute($ai);
ohair@286 386 $runtime.sendText(super._cookie, $value);
ohair@286 387 }
ohair@286 388 else {
ohair@286 389 $_ngcc_current_state = 6;
ohair@286 390 $runtime.sendText(super._cookie, $value);
ohair@286 391 }
ohair@286 392 }
ohair@286 393 break;
mkos@397 394 case 12:
ohair@286 395 {
aefimov@1445 396 name = WhiteSpaceProcessor.collapse($value);
mkos@397 397 $_ngcc_current_state = 11;
mkos@397 398 }
mkos@397 399 break;
mkos@397 400 case 9:
mkos@397 401 {
mkos@397 402 $_ngcc_current_state = 8;
mkos@397 403 }
mkos@397 404 break;
mkos@397 405 case 3:
mkos@397 406 {
mkos@397 407 action0();
mkos@397 408 $_ngcc_current_state = 2;
mkos@397 409 $runtime.sendText(super._cookie, $value);
mkos@397 410 }
mkos@397 411 break;
mkos@397 412 case 4:
mkos@397 413 {
mkos@397 414 $_ngcc_current_state = 3;
mkos@397 415 $runtime.sendText(super._cookie, $value);
ohair@286 416 }
ohair@286 417 break;
ohair@286 418 }
ohair@286 419 }
ohair@286 420
ohair@286 421 public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
ohair@286 422 switch($__cookie__) {
mkos@397 423 case 241:
ohair@286 424 {
mkos@397 425 $_ngcc_current_state = 1;
ohair@286 426 }
ohair@286 427 break;
mkos@397 428 case 246:
ohair@286 429 {
ohair@286 430 fa = ((ForeignAttributesImpl)$__result__);
ohair@286 431 $_ngcc_current_state = 4;
ohair@286 432 }
ohair@286 433 break;
mkos@397 434 case 244:
ohair@286 435 {
mkos@397 436 annotation = ((AnnotationImpl)$__result__);
mkos@397 437 $_ngcc_current_state = 3;
ohair@286 438 }
ohair@286 439 break;
ohair@286 440 }
ohair@286 441 }
ohair@286 442
ohair@286 443 public boolean accepted() {
ohair@286 444 return(($_ngcc_current_state == 0));
ohair@286 445 }
ohair@286 446
ohair@286 447
ohair@286 448 private AttGroupDeclImpl result;
ohair@286 449 private Locator locator;
ohair@286 450
ohair@286 451 }

mercurial