Exception squid:S2629 - not supported by GWT
198615
@SuppressWarnings({ "squid:S1166", "squid:S2221", "squid:S2629" })
    boolean isValidDropTarget(final UIDL configuration) {
        try {
            final String dropTarget = VDragAndDropManager.get().getCurrentDropHandler().getConnector().getWidget()
                    .getElement().getId();
            final int dropTargetCount = configuration.getIntAttribute(DROP_TARGET_COUNT);
            for (int dropTargetIndex = 0; dropTargetIndex < dropTargetCount; dropTargetIndex++) {
                final String dropTargetPrefix = configuration.getStringAttribute(DROP_TARGET + dropTargetIndex);
                LOGGER.log(Level.FINE, "Drop Target: " + dropTargetPrefix);
                if (dropTarget.startsWith(dropTargetPrefix)) {
                    return true;
                }
            }
        } catch (final Exception e) {
            // log and continue
            LOGGER.log(Level.SEVERE, "Error verifying drop target: " + e.getLocalizedMessage());
        }
        return false;
    }
1088290
private void register(WebSocketWireProtocol wireProtocolVersion, WsHandshakeValidator validator) {
        if ( wireProtocolVersion == null ) {
            throw new NullPointerException("wireProtocolVersion");
        }
        if ( validator == null ) {
            throw new NullPointerException("validator");
        }

        WsHandshakeValidator existingValidator =
                handshakeValidatorsByWireProtocolVersion.put(wireProtocolVersion, validator);

        logger.trace("Class "+validator.getClass().getName()+" registered to support websocket handshake for protocol "+wireProtocolVersion);
        if ( existingValidator != null ) {
            logger.trace("Multiple handshake validators have registered to support wire protocol "+wireProtocolVersion+". Using class "+this.getClass().getName()+'.');
        }
    }
1045703
private void doGetScope() throws PageException {
	String sessionType = AppListenerUtil.toSessionType(config.getSessionType(), "application");
	String localMode = AppListenerUtil.toLocalMode(config.getLocalMode(), "classic");

	Struct sct = new StructImpl();
	pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
	sct.set("allowImplicidQueryCall", Caster.toBoolean(config.allowImplicidQueryCall()));
	sct.set("mergeFormAndUrl", Caster.toBoolean(config.mergeFormAndURL()));

	sct.set("sessiontype", sessionType);
	sct.set("localmode", localMode);
	sct.set("sessionManagement", Caster.toBoolean(config.isSessionManagement()));
	sct.set("clientManagement", Caster.toBoolean(config.isClientManagement()));
	sct.set("domainCookies", Caster.toBoolean(config.isDomainCookies()));
	sct.set("clientCookies", Caster.toBoolean(config.isClientCookies()));
	sct.set("clientStorage", config.getClientStorage());
	sct.set("sessionStorage", config.getSessionStorage());
	sct.set("cgiReadonly", config.getCGIScopeReadonly());

	TimeSpan ts = config.getSessionTimeout();
	sct.set("sessionTimeout", ts);
	sct.set("sessionTimeout_day", Caster.toInteger(ts.getDay()));
	sct.set("sessionTimeout_hour", Caster.toInteger(ts.getHour()));
	sct.set("sessionTimeout_minute", Caster.toInteger(ts.getMinute()));
	sct.set("sessionTimeout_second", Caster.toInteger(ts.getSecond()));

	ts = config.getApplicationTimeout();
	sct.set("applicationTimeout", ts);
	sct.set("applicationTimeout_day", Caster.toInteger(ts.getDay()));
	sct.set("applicationTimeout_hour", Caster.toInteger(ts.getHour()));
	sct.set("applicationTimeout_minute", Caster.toInteger(ts.getMinute()));
	sct.set("applicationTimeout_second", Caster.toInteger(ts.getSecond()));

	ts = config.getClientTimeout();
	sct.set("clientTimeout", ts);
	sct.set("clientTimeout_day", Caster.toInteger(ts.getDay()));
	sct.set("clientTimeout_hour", Caster.toInteger(ts.getHour()));
	sct.set("clientTimeout_minute", Caster.toInteger(ts.getMinute()));
	sct.set("clientTimeout_second", Caster.toInteger(ts.getSecond()));

	// scope cascading type
	if (config.getScopeCascadingType() == Config.SCOPE_STRICT) sct.set("scopeCascadingType", "strict");
	else if (config.getScopeCascadingType() == Config.SCOPE_SMALL) sct.set("scopeCascadingType", "small");
	else if (config.getScopeCascadingType() == Config.SCOPE_STANDARD) sct.set("scopeCascadingType", "standard");
    }
1037053
@Test
    public void MPJwtNoMpJwtConfig_mpJwtInWebXML_notInApp() throws Exception {

        genericLoginConfigVariationTest(
                                        MpJwtFatConstants.LOGINCONFIG_MP_JWT_IN_WEB_XML_SERVLET_NOT_IN_APP_ROOT_CONTEXT,
                                        MpJwtFatConstants.LOGINCONFIG_MP_JWT_IN_WEB_XML_SERVLET_NOT_IN_APP,
                                        MpJwtFatConstants.MPJWT_APP_CLASS_LOGIN_CONFIG_MPJWTINWEBXML_NOTINAPP,
                                        ExpectedResult.BAD);

    }
1289399
@Test
    public void MPJwtNoMpJwtConfig_notInWebXML_basicInApp() throws Exception {

        genericLoginConfigVariationTest(
                                        MpJwtFatConstants.LOGINCONFIG_NOT_IN_WEB_XML_SERVLET_BASIC_IN_APP_ROOT_CONTEXT,
                                        MpJwtFatConstants.LOGINCONFIG_NOT_IN_WEB_XML_SERVLET_BASIC_IN_APP,
                                        MpJwtFatConstants.MPJWT_APP_CLASS_LOGIN_CONFIG_BASIC,
                                        ExpectedResult.BAD);

    }
584877
@Test
    public void MPJwtNoMpJwtConfig_notInWebXML_mpJwtInApp() throws Exception {

        genericLoginConfigVariationTest(
                                        MpJwtFatConstants.LOGINCONFIG_NOT_IN_WEB_XML_SERVLET_MP_JWT_IN_APP_ROOT_CONTEXT,
                                        MpJwtFatConstants.LOGINCONFIG_NOT_IN_WEB_XML_SERVLET_MP_JWT_IN_APP,
                                        MpJwtFatConstants.MPJWT_APP_CLASS_LOGIN_CONFIG_MP_JWT,
                                        ExpectedResult.BAD);

    }
748733
void pushReceivedException(EventChannelStruct event_channel_struct, EventCallBackStruct callback_struct, DevError error) {
        try {
            if (event_channel_struct != null) {
                if (event_channel_struct.consumer instanceof NotifdEventConsumer) {
                    if (!callback_struct.filter_ok) {
                        callback_struct.filter_id = NotifdEventConsumer.getInstance().add_filter_for_channel(
                                event_channel_struct, callback_struct.filter_constraint);
                        callback_struct.filter_ok = true;
                    }
                }
            } else
                return;

            int eventSource = (event_channel_struct.consumer instanceof NotifdEventConsumer)?
                    EventData.NOTIFD_EVENT : EventData.ZMQ_EVENT;
            DevError[] errors = {error};
            String domain_name = callback_struct.device.name();
            if (callback_struct.attr_name!=null)
                domain_name += "/" + callback_struct.attr_name.toLowerCase();
            EventData event_data =
                    new EventData(event_channel_struct.adm_device_proxy,
                            domain_name, callback_struct.event_name, callback_struct.event_type,
                            eventSource, null, null, null, null, null, errors);

            CallBack callback = callback_struct.callback;
            event_data.device = callback_struct.device;
            event_data.name = callback_struct.device.name();
            event_data.event = callback_struct.event_name;

            if (callback_struct.use_ev_queue) {
                EventQueue ev_queue = callback_struct.device.getEventQueue();
                ev_queue.insert_event(event_data);
            } else
                callback.push_event(event_data);

        } catch (DevFailed e) { /* */ }
    }
837261
public final void mWS() throws RecognitionException {
		try {
			int _type = WS;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// druidG.g:669:2: ( ( ' ' | '\\t' | NEWLINE )+ )
			// druidG.g:669:4: ( ' ' | '\\t' | NEWLINE )+
			{
			// druidG.g:669:4: ( ' ' | '\\t' | NEWLINE )+
			int cnt37=0;
			loop37:
			while (true) {
				int alt37=4;
				switch ( input.LA(1) ) {
				case ' ':
					{
					alt37=1;
					}
					break;
				case '\t':
					{
					alt37=2;
					}
					break;
				case '\n':
				case '\r':
					{
					alt37=3;
					}
					break;
				}
				switch (alt37) {
				case 1 :
					// druidG.g:669:5: ' '
					{
					match(' '); 
					}
					break;
				case 2 :
					// druidG.g:669:11: '\\t'
					{
					match('\t'); 
					}
					break;
				case 3 :
					// druidG.g:669:18: NEWLINE
					{
					mNEWLINE(); 

					}
					break;

				default :
					if ( cnt37 >= 1 ) break loop37;
					EarlyExitException eee = new EarlyExitException(37, input);
					throw eee;
				}
				cnt37++;
			}

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
136676
byte[] initSecContext(byte[] inputBuf, int offset, int len) throws GSSException {
        byte[] ret = null;
        if(len == 0){
            byte[] mechToken = context.initSecContext(inputBuf, offset, len);
            int contextFlags = 0;
            if (context.getCredDelegState()) {
                contextFlags |= NegTokenInit.DELEGATION;
            }
            if (context.getMutualAuthState()) {
                contextFlags |= NegTokenInit.MUTUAL_AUTHENTICATION;
            }
            if (context.getReplayDetState()) {
                contextFlags |= NegTokenInit.REPLAY_DETECTION;
            }
            if (context.getSequenceDetState()) {
                contextFlags |= NegTokenInit.SEQUENCE_CHECKING;
            }
            if (context.getAnonymityState()) {
                contextFlags |= NegTokenInit.ANONYMITY;
            }
            if (context.getConfState()) {
                contextFlags |= NegTokenInit.CONFIDENTIALITY;
            }
            if (context.getIntegState()) {
                contextFlags |= NegTokenInit.INTEGRITY;
            }
            ret = new NegTokenInit(new String[]{context.getMech().toString()}, contextFlags, mechToken, null).toByteArray();
        }else{
            SpnegoToken spToken = getToken(inputBuf, offset, len);
            byte[] mechToken = spToken.getMechanismToken();
            mechToken = context.initSecContext(
                    mechToken, 
                        0, mechToken.length);
            if(mechToken!=null){
                int result = NegTokenTarg.ACCEPT_INCOMPLETE;
                if(context.isEstablished()){
                    result = NegTokenTarg.ACCEPT_COMPLETED;
                }
                ret = new NegTokenTarg(result, context.getMech().toString(), mechToken, null).toByteArray();
            }
        }
        return ret;
    }
841667
protected void createServletWrappers() throws Exception {
        // NOTE: namespace preinvoke/postinvoke not necessary as the only
        // external
        // code being run is the servlet's init() and that is handled in the
        // ServletWrapper

        // check if an extensionFactory is present for *.jsp:
        // We do this by constructing an arbitrary mapping which
        // will only match the *.xxx extension pattern
        //
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
            logger.entering(CLASS_NAME, "createServletWrappers");

        WebExtensionProcessor jspProcessor = (WebExtensionProcessor) requestMapper.map("/dummyPath.jsp");

        if (jspProcessor == null) {
            // No extension processor present to handle this kind of
            // target. Hence warn, skip.
            // pk435011
            // LIBERTY: changing log level to debug as this is valid if there's no JSP support configured
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
                logger.logp(Level.FINE, CLASS_NAME, "createServletWrappers", "No Extension Processor found for handling JSPs");
            //logger.logp(Level.WARNING, CLASS_NAME, "createServletWrappers", "no.jsp.extension.handler.found");

        }

        Iterator<IServletConfig> sortedServletConfigIterator = sortNamesByStartUpWeight(config.getServletInfos());
        Map<String, List<String>> mappings = config.getServletMappings();
        String path = null;
        IServletConfig servletConfig;
        IServletWrapper wrapper = null;
        while (sortedServletConfigIterator.hasNext() && !com.ibm.ws.webcontainer.osgi.WebContainer.isServerStopping()) {
            wrapper = null; // 248871: reset wrapper to null
            servletConfig = sortedServletConfigIterator.next();
            String servletName = servletConfig.getServletName();
            List<String> mapList = mappings.get(servletConfig.getServletName());
            servletConfig.setServletContext(this.getFacade());

            // Begin 650884
            // WARNING!!! We shouldn't map by name only as there is
            // no way to configure a security constraint
            // for a dynamically added path.

            //Consolidate the code to setup a single entry map list when its mapped by name only
            // if (mapList==null){
            // //WARNING!!! We shouldn't map by name only as there is
            // //no way to configure a security constraint
            // //for a dynamically added path.
            // //Also, if there was nothing mapped to the servlet
//                              //in web.xml, we would have never called WebAppConfiguration.addServletMapping
//                              //which sets the mappings on sconfig. Adding the list directly to the hashMap short
//                              //circuits that logic so future calls to addMapping on the ServletConfig wouldn't work
            // //unless there was at least one mapping in web.xml
            //                  
            //                  
            // // hardcode the path, since it had no mappings
            // String byNamePath = BY_NAME_ONLY + servletName;
            //
            // // Add this to the config, because we will be looking at
            // // the mappings in order to get to the servlet through the
            // // mappings in the config.
            // mapList = new ArrayList<String>();
            // mapList.add(byNamePath);
            // mappings.put(servletName, mapList);
            // }
            // End 650884

            if (mapList == null || mapList.isEmpty()) {
                wrapper = jspAwareCreateServletWrapper(jspProcessor,
                                                       servletConfig, servletName);
            }
            else {
                for (String urlPattern : mapList) {
                    path = urlPattern;

                    if (path == null) {
                        // shouldn't happen since there is a mapping specified
                        // but too bad the user can never hit the servlet
                        // pk435011
                        // Begin 650884
                        logger.logp(Level.SEVERE, CLASS_NAME, "createServletWrappers", "illegal.servlet.mapping", servletName); // PK33511
                        // path = "/" + BY_NAME_ONLY + "/" + servletName;
                        // End 650884
                    } else if (path.equals("/")) {
                        path = "/*";
                    }

                    if (wrapper == null) { // 248871: Check to see if we've
                        // already found wrapper for
                        // servletName

                        wrapper = jspAwareCreateServletWrapper(jspProcessor,
                                                               servletConfig, servletName);

                        if (wrapper == null)
                            continue;
                    }
                    try {
                        // Begin:248871: Check to see if we found the wrapper
                        // before adding
                        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
                            logger.logp(Level.FINE, CLASS_NAME, "createServletWrappers"
                                        , "determine whether to add mapping for path[{0}] wrapper[{1}] isEnabled[{2}]"
                                        , new Object[] { path, wrapper, servletConfig.isEnabled() });
                        if (path != null && servletConfig.isEnabled()) {
                            requestMapper.addMapping(path, wrapper);
                        }
                        // End:248871
                    } catch (Exception e) {
                        //TODO: ???? extension processor used to call addMappingTarget after the wrappers had been added.
                        //Now it is done before, and you can get this exception here in the case they call addMappingTarget
                        //and add the mapping to the servletConfig because we'll try to add it again, but it will
                        //already be mapped. You could add a list of paths to ignore and not try to add again. So any
                        //path added via addMappingTarget will be recorded and addMapping can be skipped. It is preferrable
                        //to just have them not call addMappingTarget any more instead of adding the extra check.
                        // pk435011
                        logger.logp(Level.WARNING, CLASS_NAME, "createServletWrappers", "error.while.adding.servlet.mapping.for.path", new Object[] {
                                    path, wrapper, getApplicationName() });
                        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                            com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e, CLASS_NAME + ".createServletWrappers", "455", this);
                            // pk435011
                            logger.logp(Level.SEVERE, CLASS_NAME, "createServletWrappers", "error.adding.servlet.mapping.for.servlet", new Object[] {
                                        servletName, getApplicationName(), e }); // PK33511
                        }
                    }
                }
            }

            servletConfig.setServletWrapper(wrapper);

            this.initializeNonDDRepresentableAnnotation(servletConfig);
            // set the servlet wrapper on the
            // servlet config so
            // ServletConfig.addMapping
            // can put it in the
            // requestMapper

        }
    }
180072
@Override
    public final void init() throws Exception {
        FxToolkit.init();

        applicationInit();

        PlatformClient.getClientConfiguration().setUncaughtExceptionHandler((Thread thread, Throwable exception) -> {
            PlatformClient.getClientConfiguration().getUiExecutor().execute(() -> {
                Assert.requireNonNull(thread, "thread");
                Assert.requireNonNull(exception, "exception");

                if (connectInProgress.get()) {
                    runtimeExceptionsAtInitialization.add(new DolphinRuntimeException(thread, "Unhandled error in Dolphin Platform background thread", exception));
                } else {
                    onRuntimeError(primaryStage, new DolphinRuntimeException(thread, "Unhandled error in Dolphin Platform background thread", exception));
                }
            });
        });

        try {
            clientContext = createClientContext();
            Assert.requireNonNull(clientContext, "clientContext");

            connectInProgress.set(true);
            clientContext.connect().get(30_000, TimeUnit.MILLISECONDS);
        } catch (ClientInitializationException e) {
            initializationException = e;
        } catch (Exception e) {
            initializationException = new ClientInitializationException("Can not initialize Dolphin Platform Context", e);
        } finally {
            connectInProgress.set(false);
        }
    }
792579
public final void mWS() throws RecognitionException {
        try {
            int _type = WS;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // org/javaruntype/type/parser/Type.g:124:5: ( ( ' ' )+ )
            // org/javaruntype/type/parser/Type.g:124:7: ( ' ' )+
            {
            // org/javaruntype/type/parser/Type.g:124:7: ( ' ' )+
            int cnt2=0;
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( (LA2_0==' ') ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // org/javaruntype/type/parser/Type.g:124:8: ' '
            	    {
            	    match(' '); 

            	    }
            	    break;

            	default :
            	    if ( cnt2 >= 1 ) break loop2;
                        EarlyExitException eee =
                            new EarlyExitException(2, input);
                        throw eee;
                }
                cnt2++;
            } while (true);

            skip();

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
1045661
public void connect() throws Exception {		
		// Start up our MINA stuff 
		// Setup MINA codecs
		final IT100CodecFactory it100CodecFactory = new IT100CodecFactory();
		final ProtocolCodecFilter protocolCodecFilter = new ProtocolCodecFilter(it100CodecFactory);
		final CommandLogFilter loggingFilter = new CommandLogFilter(LOGGER, Level.DEBUG);
		final PollKeepAliveFilter pollKeepAliveFilter = new PollKeepAliveFilter(KeepAliveRequestTimeoutHandler.EXCEPTION);
		
		// Connect to system serial port.
		connector = configuration.getConnector();
		
		// Typical configuration
		connector.setConnectTimeoutMillis(configuration.getConnectTimeout());
		connector.getSessionConfig().setUseReadOperation(true);

		// Add IT100 codec to MINA filter chain to interpret messages.
		connector.getFilterChain().addLast("codec", protocolCodecFilter);
		connector.getFilterChain().addLast("logger", loggingFilter);   
	    connector.getFilterChain().addLast("keepalive", pollKeepAliveFilter);
	    
	    
	    if (configuration.getStatusPollingInterval() != -1) {
	    	connector.getFilterChain().addLast("statusrequest", new StatusRequestFilter(configuration.getStatusPollingInterval()));
	    }
	    
	    final DemuxingIoHandler demuxIoHandler = new DemuxingIoHandler();
	    
	    // Setup a read message handler
		// OnSubscribe will allow us to create an Observable to received messages.
		final ReadCommandOnSubscribe readCommandObservable = new ReadCommandOnSubscribe();
		demuxIoHandler.addReceivedMessageHandler(ReadCommand.class, readCommandObservable);
		demuxIoHandler.addExceptionHandler(Exception.class, readCommandObservable);
	    
	    // Handle Envisalink 505 request for password events
	    if (configuration.getEnvisalinkPassword() != null) {
	    	final EnvisalinkLoginHandler envisalinkLoginHandler = new EnvisalinkLoginHandler(configuration.getEnvisalinkPassword());
	    	demuxIoHandler.addReceivedMessageHandler(EnvisalinkLoginInteractionCommand.class, envisalinkLoginHandler);
	    }
	    
	    // We don't need to subscribe to the messages we sent.
		demuxIoHandler.addSentMessageHandler(Object.class, MessageHandler.NOOP);		

		connector.setHandler(demuxIoHandler);
		 
		// Connect now
		final ConnectFuture future = connector.connect(configuration.getAddress()); 
		future.awaitUninterruptibly();

		// Get a reference to the session
		session = future.getSession(); 
		
		// Create and return our Observable for received IT-100 commands.
		final ConnectableObservable<ReadCommand> connectableReadObservable = Observable.create(readCommandObservable).publish();
		connectableReadObservable.connect();
		readObservable = connectableReadObservable.share().asObservable();
		
		// Create a write observer.
		writeObservable = PublishSubject.create();
		writeObservable.subscribe(new Observer<WriteCommand>() {

			@Override
			public void onCompleted() {
			}

			@Override
			public void onError(Throwable e) {
			}

			@Override
			public void onNext(WriteCommand command) {
				session.write(command);
			}
		});
		
		
	}
1094270
public final void mWS() throws RecognitionException {
        try {
            int _type = WS;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // BELScript.g:301:4: ( ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' | '\\\\\\n' | '\\\\\\r\\n' )+ )
            // BELScript.g:301:6: ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' | '\\\\\\n' | '\\\\\\r\\n' )+
            {
            // BELScript.g:301:6: ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' | '\\\\\\n' | '\\\\\\r\\n' )+
            int cnt12=0;
            loop12:
            do {
                int alt12=8;
                alt12 = dfa12.predict(input);
                switch (alt12) {
            	case 1 :
            	    // BELScript.g:301:7: ' '
            	    {
            	    match(' '); 

            	    }
            	    break;
            	case 2 :
            	    // BELScript.g:301:13: '\\t'
            	    {
            	    match('\t'); 

            	    }
            	    break;
            	case 3 :
            	    // BELScript.g:301:20: '\\n'
            	    {
            	    match('\n'); 

            	    }
            	    break;
            	case 4 :
            	    // BELScript.g:301:27: '\\r'
            	    {
            	    match('\r'); 

            	    }
            	    break;
            	case 5 :
            	    // BELScript.g:301:33: '\\f'
            	    {
            	    match('\f'); 

            	    }
            	    break;
            	case 6 :
            	    // BELScript.g:301:40: '\\\\\\n'
            	    {
            	    match("\\\n"); 


            	    }
            	    break;
            	case 7 :
            	    // BELScript.g:301:49: '\\\\\\r\\n'
            	    {
            	    match("\\\r\n"); 


            	    }
            	    break;

            	default :
            	    if ( cnt12 >= 1 ) break loop12;
                        EarlyExitException eee =
                            new EarlyExitException(12, input);
                        throw eee;
                }
                cnt12++;
            } while (true);

            _channel = HIDDEN;

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
608265
private void writeMessageEmbeddedWebServerIpPort(Socket s) throws Exception {
    writeType(s, TYPE_EMBEDDED_WEB_SERVER_IP_PORT);
    writeString(s, _embeddedWebServerIp);
    writeInt(s, _embeddedWebServerPort);
  }
763782
private <T,S> void upgradeWebSocket(ServiceWebSocket<T,S> service)
  {
    /*
    try {
      _service.open((WebRequest) request);
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    }
    */
    TypeRef type = TypeRef.of(service.getClass()).to(ServiceWebSocket.class).param(0);

    ServiceRef selfRef = ServiceRef.current();

    service = selfRef.pin(service).as(ServiceWebSocket.class);

    Class<T> rawClass = (Class) type.rawClass();

    WebSocketBaratineImpl<T,S> ws
      = new WebSocketBaratineImpl<>(webApp().wsManager(),
                                    service, rawClass);

    try {
      if (! ws.handshake(this)) {
        throw new ServiceException("WebSocket handshake failed for " + this);
      }
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
      e.printStackTrace();

      fail(e);
    }
    //request.flush();
  }
849983
@Override
    public String verifyJarAndPrepareProcRunners(byte[] catalogBytes, String diffCommands,
            byte[] catalogBytesHash, byte[] deploymentBytes) {
        ImmutableMap.Builder<String, Class<?>> classesMap = ImmutableMap.<String, Class<?>>builder();
        InMemoryJarfile newCatalogJar;
        JarLoader jarLoader;
        String errorMsg;
        try {
            newCatalogJar = new InMemoryJarfile(catalogBytes);
            jarLoader = newCatalogJar.getLoader();
            for (String classname : jarLoader.getClassNames()) {
                try {
                    Class<?> procCls = CatalogContext.classForProcedureOrUDF(classname, jarLoader);
                    classesMap.put(classname, procCls);
                }
                // LinkageError catches most of the various class loading errors we'd
                // care about here.
                catch (UnsupportedClassVersionError e) {
                    errorMsg = "Cannot load classes compiled with a higher version of Java than currently" +
                                 " in use. Class " + classname + " was compiled with ";

                    Integer major = 0;
                    // update the matcher pattern for various jdk
                    Pattern pattern = Pattern.compile("version\\s(\\d+).(\\d+)");
                    Matcher matcher = pattern.matcher(e.getMessage());
                    if (matcher.find()) {
                        major = Integer.parseInt(matcher.group(1));
                    } else {
                        hostLog.info("Unable to parse compile version number from UnsupportedClassVersionError.");
                    }

                    if (VerifyCatalogAndWriteJar.SupportedJavaVersionMap.containsKey(major)) {
                        errorMsg = errorMsg.concat(VerifyCatalogAndWriteJar.SupportedJavaVersionMap.get(major) + ", current runtime version is " +
                                         System.getProperty("java.version") + ".");
                    } else {
                        errorMsg = errorMsg.concat("an incompatible Java version.");
                    }
                    hostLog.info(errorMsg);
                    return errorMsg;
                }
                catch (LinkageError | ClassNotFoundException e) {
                    String cause = e.getMessage();
                    if (cause == null && e.getCause() != null) {
                        cause = e.getCause().getMessage();
                    }
                    errorMsg = "Error loading class \'" + classname + "\': " +
                        e.getClass().getCanonicalName() + " for " + cause;
                    hostLog.info(errorMsg);
                    return errorMsg;
                }
            }
        } catch (Exception e) {
            // catch all exceptions, anything may fail now can be safely rolled back
            return e.getMessage();
        }

        CatalogContext ctx = VoltDB.instance().getCatalogContext();
        Catalog newCatalog = ctx.getNewCatalog(diffCommands);

        Database db = newCatalog.getClusters().get("cluster").getDatabases().get("database");
        CatalogMap<Procedure> catalogProcedures = db.getProcedures();

        int siteCount = m_nodeSettings.getLocalSitesCount() + 1; // + MPI site

        ctx.m_preparedCatalogInfo = new CatalogContext.CatalogInfo(catalogBytes, catalogBytesHash, deploymentBytes);
        ctx.m_preparedCatalogInfo.m_catalog = newCatalog;
        ctx.m_preparedCatalogInfo.m_preparedProcRunners = new ConcurrentLinkedQueue<>();

        for (long i = 0; i < siteCount; i++) {
            try {
                ImmutableMap<String, ProcedureRunner> userProcRunner =
                    LoadedProcedureSet.loadUserProcedureRunners(catalogProcedures, null,
                                                                classesMap.build(), null);

                ctx.m_preparedCatalogInfo.m_preparedProcRunners.offer(userProcRunner);
            } catch (Exception e) {
                String msg = "error setting up user procedure runners using NT-procedure pattern: "
                            + e.getMessage();
                hostLog.info(msg);
                return msg;
            }
        }

        return null;
    }