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

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

author
aefimov
date
Mon, 02 Oct 2017 14:20:23 +0100
changeset 1445
06086cb6c349
parent 397
b99d7e355d4b
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
aefimov@1445 29 import com.sun.xml.internal.bind.WhiteSpaceProcessor;
aefimov@1445 30 import com.sun.xml.internal.xsom.*;
aefimov@1445 31 import com.sun.xml.internal.xsom.impl.*;
aefimov@1445 32 import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
aefimov@1445 33 import com.sun.xml.internal.xsom.parser.*;
aefimov@1445 34
aefimov@1445 35 import org.xml.sax.Attributes;
aefimov@1445 36 import org.xml.sax.Locator;
ohair@286 37 import org.xml.sax.SAXException;
ohair@286 38
ohair@286 39 class notation extends NGCCHandler {
ohair@286 40 private String name;
ohair@286 41 private String pub;
ohair@286 42 private ForeignAttributesImpl fa;
ohair@286 43 private String sys;
ohair@286 44 private AnnotationImpl ann;
ohair@286 45 protected final NGCCRuntimeEx $runtime;
ohair@286 46 private int $_ngcc_current_state;
ohair@286 47 protected String $uri;
ohair@286 48 protected String $localName;
ohair@286 49 protected String $qname;
ohair@286 50
ohair@286 51 public final NGCCRuntime getRuntime() {
ohair@286 52 return($runtime);
ohair@286 53 }
ohair@286 54
ohair@286 55 public notation(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
ohair@286 56 super(source, parent, cookie);
ohair@286 57 $runtime = runtime;
ohair@286 58 $_ngcc_current_state = 16;
ohair@286 59 }
ohair@286 60
ohair@286 61 public notation(NGCCRuntimeEx runtime) {
ohair@286 62 this(null, runtime, runtime, -1);
ohair@286 63 }
ohair@286 64
ohair@286 65 private void action0()throws SAXException {
ohair@286 66 loc = $runtime.copyLocator();
ohair@286 67 }
ohair@286 68
ohair@286 69 public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
ohair@286 70 int $ai;
ohair@286 71 $uri = $__uri;
ohair@286 72 $localName = $__local;
ohair@286 73 $qname = $__qname;
ohair@286 74 switch($_ngcc_current_state) {
ohair@286 75 case 2:
ohair@286 76 {
ohair@286 77 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
mkos@397 78 NGCCHandler h = new annotation(this, super._source, $runtime, 209, null,AnnotationContext.NOTATION);
ohair@286 79 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
ohair@286 80 }
ohair@286 81 else {
ohair@286 82 $_ngcc_current_state = 1;
ohair@286 83 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 84 }
ohair@286 85 }
ohair@286 86 break;
ohair@286 87 case 16:
ohair@286 88 {
ohair@286 89 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
ohair@286 90 $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
ohair@286 91 action0();
ohair@286 92 $_ngcc_current_state = 15;
ohair@286 93 }
ohair@286 94 else {
ohair@286 95 unexpectedEnterElement($__qname);
ohair@286 96 }
ohair@286 97 }
ohair@286 98 break;
mkos@397 99 case 14:
mkos@397 100 {
mkos@397 101 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
mkos@397 102 $runtime.consumeAttribute($ai);
mkos@397 103 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 104 }
mkos@397 105 else {
mkos@397 106 unexpectedEnterElement($__qname);
mkos@397 107 }
mkos@397 108 }
mkos@397 109 break;
mkos@397 110 case 15:
mkos@397 111 {
mkos@397 112 if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
mkos@397 113 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 224, null);
mkos@397 114 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
mkos@397 115 }
mkos@397 116 else {
mkos@397 117 unexpectedEnterElement($__qname);
mkos@397 118 }
mkos@397 119 }
mkos@397 120 break;
mkos@397 121 case 4:
mkos@397 122 {
mkos@397 123 if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
mkos@397 124 $runtime.consumeAttribute($ai);
mkos@397 125 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 126 }
mkos@397 127 else {
mkos@397 128 $_ngcc_current_state = 2;
mkos@397 129 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 130 }
mkos@397 131 }
mkos@397 132 break;
mkos@397 133 case 8:
mkos@397 134 {
mkos@397 135 if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
mkos@397 136 $runtime.consumeAttribute($ai);
mkos@397 137 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 138 }
mkos@397 139 else {
mkos@397 140 $_ngcc_current_state = 4;
mkos@397 141 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 142 }
mkos@397 143 }
mkos@397 144 break;
mkos@397 145 case 0:
mkos@397 146 {
mkos@397 147 revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 148 }
mkos@397 149 break;
ohair@286 150 default:
ohair@286 151 {
ohair@286 152 unexpectedEnterElement($__qname);
ohair@286 153 }
ohair@286 154 break;
ohair@286 155 }
ohair@286 156 }
ohair@286 157
ohair@286 158 public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 159 int $ai;
ohair@286 160 $uri = $__uri;
ohair@286 161 $localName = $__local;
ohair@286 162 $qname = $__qname;
ohair@286 163 switch($_ngcc_current_state) {
mkos@397 164 case 2:
ohair@286 165 {
mkos@397 166 $_ngcc_current_state = 1;
mkos@397 167 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 168 }
ohair@286 169 break;
mkos@397 170 case 14:
ohair@286 171 {
mkos@397 172 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
mkos@397 173 $runtime.consumeAttribute($ai);
mkos@397 174 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 175 }
ohair@286 176 else {
ohair@286 177 unexpectedLeaveElement($__qname);
ohair@286 178 }
ohair@286 179 }
ohair@286 180 break;
ohair@286 181 case 15:
ohair@286 182 {
ohair@286 183 if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation")))) {
mkos@397 184 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 224, null);
ohair@286 185 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
ohair@286 186 }
ohair@286 187 else {
ohair@286 188 unexpectedLeaveElement($__qname);
ohair@286 189 }
ohair@286 190 }
ohair@286 191 break;
ohair@286 192 case 4:
ohair@286 193 {
ohair@286 194 if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
ohair@286 195 $runtime.consumeAttribute($ai);
ohair@286 196 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 197 }
ohair@286 198 else {
ohair@286 199 $_ngcc_current_state = 2;
ohair@286 200 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 201 }
ohair@286 202 }
ohair@286 203 break;
mkos@397 204 case 1:
ohair@286 205 {
mkos@397 206 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
mkos@397 207 $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
mkos@397 208 $_ngcc_current_state = 0;
ohair@286 209 }
ohair@286 210 else {
ohair@286 211 unexpectedLeaveElement($__qname);
ohair@286 212 }
ohair@286 213 }
ohair@286 214 break;
ohair@286 215 case 8:
ohair@286 216 {
ohair@286 217 if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
ohair@286 218 $runtime.consumeAttribute($ai);
ohair@286 219 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 220 }
ohair@286 221 else {
ohair@286 222 $_ngcc_current_state = 4;
ohair@286 223 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 224 }
ohair@286 225 }
ohair@286 226 break;
mkos@397 227 case 0:
mkos@397 228 {
mkos@397 229 revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
mkos@397 230 }
mkos@397 231 break;
ohair@286 232 default:
ohair@286 233 {
ohair@286 234 unexpectedLeaveElement($__qname);
ohair@286 235 }
ohair@286 236 break;
ohair@286 237 }
ohair@286 238 }
ohair@286 239
ohair@286 240 public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 241 int $ai;
ohair@286 242 $uri = $__uri;
ohair@286 243 $localName = $__local;
ohair@286 244 $qname = $__qname;
ohair@286 245 switch($_ngcc_current_state) {
mkos@397 246 case 2:
ohair@286 247 {
mkos@397 248 $_ngcc_current_state = 1;
mkos@397 249 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 250 }
ohair@286 251 break;
mkos@397 252 case 14:
ohair@286 253 {
ohair@286 254 if(($__uri.equals("") && $__local.equals("name"))) {
mkos@397 255 $_ngcc_current_state = 13;
ohair@286 256 }
ohair@286 257 else {
ohair@286 258 unexpectedEnterAttribute($__qname);
ohair@286 259 }
ohair@286 260 }
ohair@286 261 break;
mkos@397 262 case 15:
ohair@286 263 {
mkos@397 264 if(($__uri.equals("") && $__local.equals("name"))) {
mkos@397 265 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 224, null);
mkos@397 266 spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
mkos@397 267 }
mkos@397 268 else {
mkos@397 269 unexpectedEnterAttribute($__qname);
mkos@397 270 }
ohair@286 271 }
ohair@286 272 break;
ohair@286 273 case 4:
ohair@286 274 {
ohair@286 275 if(($__uri.equals("") && $__local.equals("system"))) {
ohair@286 276 $_ngcc_current_state = 6;
ohair@286 277 }
ohair@286 278 else {
ohair@286 279 $_ngcc_current_state = 2;
ohair@286 280 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 281 }
ohair@286 282 }
ohair@286 283 break;
ohair@286 284 case 8:
ohair@286 285 {
ohair@286 286 if(($__uri.equals("") && $__local.equals("public"))) {
ohair@286 287 $_ngcc_current_state = 10;
ohair@286 288 }
ohair@286 289 else {
ohair@286 290 $_ngcc_current_state = 4;
ohair@286 291 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 292 }
ohair@286 293 }
ohair@286 294 break;
mkos@397 295 case 0:
mkos@397 296 {
mkos@397 297 revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
mkos@397 298 }
mkos@397 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) {
ohair@286 314 case 2:
ohair@286 315 {
ohair@286 316 $_ngcc_current_state = 1;
ohair@286 317 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 318 }
ohair@286 319 break;
ohair@286 320 case 9:
ohair@286 321 {
ohair@286 322 if(($__uri.equals("") && $__local.equals("public"))) {
ohair@286 323 $_ngcc_current_state = 4;
ohair@286 324 }
ohair@286 325 else {
ohair@286 326 unexpectedLeaveAttribute($__qname);
ohair@286 327 }
ohair@286 328 }
ohair@286 329 break;
ohair@286 330 case 12:
ohair@286 331 {
ohair@286 332 if(($__uri.equals("") && $__local.equals("name"))) {
ohair@286 333 $_ngcc_current_state = 8;
ohair@286 334 }
ohair@286 335 else {
ohair@286 336 unexpectedLeaveAttribute($__qname);
ohair@286 337 }
ohair@286 338 }
ohair@286 339 break;
mkos@397 340 case 5:
mkos@397 341 {
mkos@397 342 if(($__uri.equals("") && $__local.equals("system"))) {
mkos@397 343 $_ngcc_current_state = 2;
mkos@397 344 }
mkos@397 345 else {
mkos@397 346 unexpectedLeaveAttribute($__qname);
mkos@397 347 }
mkos@397 348 }
mkos@397 349 break;
mkos@397 350 case 4:
mkos@397 351 {
mkos@397 352 $_ngcc_current_state = 2;
mkos@397 353 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
mkos@397 354 }
mkos@397 355 break;
mkos@397 356 case 8:
mkos@397 357 {
mkos@397 358 $_ngcc_current_state = 4;
mkos@397 359 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
mkos@397 360 }
mkos@397 361 break;
mkos@397 362 case 0:
mkos@397 363 {
mkos@397 364 revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
mkos@397 365 }
mkos@397 366 break;
ohair@286 367 default:
ohair@286 368 {
ohair@286 369 unexpectedLeaveAttribute($__qname);
ohair@286 370 }
ohair@286 371 break;
ohair@286 372 }
ohair@286 373 }
ohair@286 374
ohair@286 375 public void text(String $value) throws SAXException {
ohair@286 376 int $ai;
ohair@286 377 switch($_ngcc_current_state) {
mkos@397 378 case 2:
ohair@286 379 {
mkos@397 380 $_ngcc_current_state = 1;
mkos@397 381 $runtime.sendText(super._cookie, $value);
ohair@286 382 }
ohair@286 383 break;
ohair@286 384 case 10:
ohair@286 385 {
ohair@286 386 pub = $value;
ohair@286 387 $_ngcc_current_state = 9;
ohair@286 388 }
ohair@286 389 break;
mkos@397 390 case 14:
mkos@397 391 {
mkos@397 392 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
mkos@397 393 $runtime.consumeAttribute($ai);
mkos@397 394 $runtime.sendText(super._cookie, $value);
mkos@397 395 }
mkos@397 396 }
mkos@397 397 break;
ohair@286 398 case 15:
ohair@286 399 {
ohair@286 400 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
mkos@397 401 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 224, null);
ohair@286 402 spawnChildFromText(h, $value);
ohair@286 403 }
ohair@286 404 }
ohair@286 405 break;
ohair@286 406 case 4:
ohair@286 407 {
ohair@286 408 if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
ohair@286 409 $runtime.consumeAttribute($ai);
ohair@286 410 $runtime.sendText(super._cookie, $value);
ohair@286 411 }
ohair@286 412 else {
ohair@286 413 $_ngcc_current_state = 2;
ohair@286 414 $runtime.sendText(super._cookie, $value);
ohair@286 415 }
ohair@286 416 }
ohair@286 417 break;
ohair@286 418 case 8:
ohair@286 419 {
ohair@286 420 if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
ohair@286 421 $runtime.consumeAttribute($ai);
ohair@286 422 $runtime.sendText(super._cookie, $value);
ohair@286 423 }
ohair@286 424 else {
ohair@286 425 $_ngcc_current_state = 4;
ohair@286 426 $runtime.sendText(super._cookie, $value);
ohair@286 427 }
ohair@286 428 }
ohair@286 429 break;
mkos@397 430 case 13:
mkos@397 431 {
aefimov@1445 432 name = WhiteSpaceProcessor.collapse($value);
mkos@397 433 $_ngcc_current_state = 12;
mkos@397 434 }
mkos@397 435 break;
mkos@397 436 case 6:
mkos@397 437 {
mkos@397 438 sys = $value;
mkos@397 439 $_ngcc_current_state = 5;
mkos@397 440 }
mkos@397 441 break;
mkos@397 442 case 0:
mkos@397 443 {
mkos@397 444 revertToParentFromText(makeResult(), super._cookie, $value);
mkos@397 445 }
mkos@397 446 break;
ohair@286 447 }
ohair@286 448 }
ohair@286 449
ohair@286 450 public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
ohair@286 451 switch($__cookie__) {
mkos@397 452 case 209:
mkos@397 453 {
mkos@397 454 ann = ((AnnotationImpl)$__result__);
mkos@397 455 $_ngcc_current_state = 1;
mkos@397 456 }
mkos@397 457 break;
mkos@397 458 case 224:
ohair@286 459 {
ohair@286 460 fa = ((ForeignAttributesImpl)$__result__);
ohair@286 461 $_ngcc_current_state = 14;
ohair@286 462 }
ohair@286 463 break;
ohair@286 464 }
ohair@286 465 }
ohair@286 466
ohair@286 467 public boolean accepted() {
ohair@286 468 return(($_ngcc_current_state == 0));
ohair@286 469 }
ohair@286 470
ohair@286 471
ohair@286 472 private Locator loc;
ohair@286 473 private XSNotation makeResult() {
ohair@286 474 return new NotationImpl( $runtime.document,ann,loc,fa,name,pub,sys);
ohair@286 475 }
ohair@286 476
ohair@286 477 }

mercurial