,source,target 0,"public void init ( CamelContext camelContext ) { if ( ! camelContext . hasService ( this ) ) { try { camelContext . addService ( this , true , true ) ; } catch ( Exception e ) { throw RuntimeCamelException . wrapRuntimeCamelException ( e ) ; } } } ","public void init ( CamelContext camelContext ) { if ( ! camelContext . hasService ( this ) ) { try { LOG . debug ( ""Initializing XRay tracer"" ) ; camelContext . addService ( this , true , true ) ; } catch ( Exception e ) { throw RuntimeCamelException . wrapRuntimeCamelException ( e ) ; } } } " 1,"protected Iterator < SimpleFeature > openIterator ( ) { try { return openIterator ( getQueryConstraints ( ) ) ; } catch ( TransformException | FactoryException e ) { } return featureCursor ; } ","protected Iterator < SimpleFeature > openIterator ( ) { try { return openIterator ( getQueryConstraints ( ) ) ; } catch ( TransformException | FactoryException e ) { LOGGER . warn ( ""Unable to transform geometry"" , e ) ; } return featureCursor ; } " 2,"protected void handleRemoteDisconnect ( final ProtonConnection con ) { con . disconnect ( ) ; publishConnectionClosedEvent ( con ) ; } ","protected void handleRemoteDisconnect ( final ProtonConnection con ) { log . debug ( ""client [container: {}] disconnected"" , con . getRemoteContainer ( ) ) ; con . disconnect ( ) ; publishConnectionClosedEvent ( con ) ; } " 3,"public Map < K , ICacheElement < K , V > > getMultiple ( final Set < K > keys ) { return getMultipleSetupMap . get ( keys ) ; } ","public Map < K , ICacheElement < K , V > > getMultiple ( final Set < K > keys ) { log . info ( ""get ["" + keys + ""]"" ) ; return getMultipleSetupMap . get ( keys ) ; } " 4,"private static Function2 < String , Resource > resourceFromLocation ( ApplicationContext applicationContext , boolean throwErrorIfNotReadable ) { return location -> { String resolvedLocation = applicationContext . getEnvironment ( ) . resolveRequiredPlaceholders ( location ) ; if ( applicationContext . getResource ( resolvedLocation ) . isReadable ( ) ) { return applicationContext . getResource ( resolvedLocation ) ; } else if ( throwErrorIfNotReadable ) { throw new IllegalStateException ( String . format ( ""Configuration %s does not exist or is not readable"" , location ) ) ; } else { LOGGER . warn ( ""Configuration {} not readable; ignored"" , location ) ; return null ; } } ; } ","private static Function2 < String , Resource > resourceFromLocation ( ApplicationContext applicationContext , boolean throwErrorIfNotReadable ) { return location -> { String resolvedLocation = applicationContext . getEnvironment ( ) . resolveRequiredPlaceholders ( location ) ; if ( applicationContext . getResource ( resolvedLocation ) . isReadable ( ) ) { LOGGER . debug ( ""Configuration {} detected and added"" , location ) ; return applicationContext . getResource ( resolvedLocation ) ; } else if ( throwErrorIfNotReadable ) { throw new IllegalStateException ( String . format ( ""Configuration %s does not exist or is not readable"" , location ) ) ; } else { LOGGER . warn ( ""Configuration {} not readable; ignored"" , location ) ; return null ; } } ; } " 5,"private static Function2 < String , Resource > resourceFromLocation ( ApplicationContext applicationContext , boolean throwErrorIfNotReadable ) { return location -> { String resolvedLocation = applicationContext . getEnvironment ( ) . resolveRequiredPlaceholders ( location ) ; if ( applicationContext . getResource ( resolvedLocation ) . isReadable ( ) ) { LOGGER . debug ( ""Configuration {} detected and added"" , location ) ; return applicationContext . getResource ( resolvedLocation ) ; } else if ( throwErrorIfNotReadable ) { throw new IllegalStateException ( String . format ( ""Configuration %s does not exist or is not readable"" , location ) ) ; } else { return null ; } } ; } ","private static Function2 < String , Resource > resourceFromLocation ( ApplicationContext applicationContext , boolean throwErrorIfNotReadable ) { return location -> { String resolvedLocation = applicationContext . getEnvironment ( ) . resolveRequiredPlaceholders ( location ) ; if ( applicationContext . getResource ( resolvedLocation ) . isReadable ( ) ) { LOGGER . debug ( ""Configuration {} detected and added"" , location ) ; return applicationContext . getResource ( resolvedLocation ) ; } else if ( throwErrorIfNotReadable ) { throw new IllegalStateException ( String . format ( ""Configuration %s does not exist or is not readable"" , location ) ) ; } else { LOGGER . warn ( ""Configuration {} not readable; ignored"" , location ) ; return null ; } } ; } " 6,"protected void processInput ( CharBuffer oldCharBuffer , Writer writer ) throws Exception { int length = KMPSearch . search ( oldCharBuffer , _MARKER_INPUT_OPEN . length + 1 , _MARKER_INPUT_CLOSE , _MARKER_INPUT_CLOSE_NEXTS ) ; if ( length == - 1 ) { if ( _log . isWarnEnabled ( ) ) { } outputOpenTag ( oldCharBuffer , writer , _MARKER_INPUT_OPEN ) ; return ; } length += _MARKER_INPUT_CLOSE . length ( ) ; String content = extractContent ( oldCharBuffer , length ) ; writer . write ( content ) ; skipWhiteSpace ( oldCharBuffer , writer , true ) ; } ","protected void processInput ( CharBuffer oldCharBuffer , Writer writer ) throws Exception { int length = KMPSearch . search ( oldCharBuffer , _MARKER_INPUT_OPEN . length + 1 , _MARKER_INPUT_CLOSE , _MARKER_INPUT_CLOSE_NEXTS ) ; if ( length == - 1 ) { if ( _log . isWarnEnabled ( ) ) { _log . warn ( ""Missing />"" ) ; } outputOpenTag ( oldCharBuffer , writer , _MARKER_INPUT_OPEN ) ; return ; } length += _MARKER_INPUT_CLOSE . length ( ) ; String content = extractContent ( oldCharBuffer , length ) ; writer . write ( content ) ; skipWhiteSpace ( oldCharBuffer , writer , true ) ; } " 7,"public void testForMemoryLeaks ( ) throws Exception { final long differenceMemoryCache = thrashCache ( ) ; assertTrue ( differenceMemoryCache < 500000 ) ; } ","public void testForMemoryLeaks ( ) throws Exception { final long differenceMemoryCache = thrashCache ( ) ; LOG . info ( ""Memory Difference is: "" + differenceMemoryCache ) ; assertTrue ( differenceMemoryCache < 500000 ) ; } " 8,"@ SuppressWarnings ( ""unchecked"" ) private Map < String , String > login ( String authKey , String endpoint ) { String [ ] credentials = authKey . split ( "":"" ) ; if ( credentials . length != 2 ) { return Collections . emptyMap ( ) ; } PostMethod post = new PostMethod ( endpoint ) ; post . addRequestHeader ( ""Origin"" , ""http://localhost"" ) ; post . addParameter ( new NameValuePair ( ""userName"" , credentials [ 0 ] ) ) ; post . addParameter ( new NameValuePair ( ""password"" , credentials [ 1 ] ) ) ; try { int code = client . executeMethod ( post ) ; if ( code == HttpStatus . SC_OK ) { String content = post . getResponseBodyAsString ( ) ; Map < String , Object > resp = gson . fromJson ( content , new TypeToken < Map < String , Object > > ( ) { } . getType ( ) ) ; return ( Map < String , String > ) resp . get ( ""body"" ) ; } else { LOG . error ( ""Failed Zeppelin login {}, status code {}"" , endpoint , code ) ; return Collections . emptyMap ( ) ; } } catch ( IOException e ) { LOG . error ( ""Cannot login into Zeppelin"" , e ) ; return Collections . emptyMap ( ) ; } } ","@ SuppressWarnings ( ""unchecked"" ) private Map < String , String > login ( String authKey , String endpoint ) { String [ ] credentials = authKey . split ( "":"" ) ; if ( credentials . length != 2 ) { return Collections . emptyMap ( ) ; } PostMethod post = new PostMethod ( endpoint ) ; post . addRequestHeader ( ""Origin"" , ""http://localhost"" ) ; post . addParameter ( new NameValuePair ( ""userName"" , credentials [ 0 ] ) ) ; post . addParameter ( new NameValuePair ( ""password"" , credentials [ 1 ] ) ) ; try { int code = client . executeMethod ( post ) ; if ( code == HttpStatus . SC_OK ) { String content = post . getResponseBodyAsString ( ) ; Map < String , Object > resp = gson . fromJson ( content , new TypeToken < Map < String , Object > > ( ) { } . getType ( ) ) ; LOG . info ( ""Received from Zeppelin LoginRestApi : "" + content ) ; return ( Map < String , String > ) resp . get ( ""body"" ) ; } else { LOG . error ( ""Failed Zeppelin login {}, status code {}"" , endpoint , code ) ; return Collections . emptyMap ( ) ; } } catch ( IOException e ) { LOG . error ( ""Cannot login into Zeppelin"" , e ) ; return Collections . emptyMap ( ) ; } } " 9,"@ SuppressWarnings ( ""unchecked"" ) private Map < String , String > login ( String authKey , String endpoint ) { String [ ] credentials = authKey . split ( "":"" ) ; if ( credentials . length != 2 ) { return Collections . emptyMap ( ) ; } PostMethod post = new PostMethod ( endpoint ) ; post . addRequestHeader ( ""Origin"" , ""http://localhost"" ) ; post . addParameter ( new NameValuePair ( ""userName"" , credentials [ 0 ] ) ) ; post . addParameter ( new NameValuePair ( ""password"" , credentials [ 1 ] ) ) ; try { int code = client . executeMethod ( post ) ; if ( code == HttpStatus . SC_OK ) { String content = post . getResponseBodyAsString ( ) ; Map < String , Object > resp = gson . fromJson ( content , new TypeToken < Map < String , Object > > ( ) { } . getType ( ) ) ; LOG . info ( ""Received from Zeppelin LoginRestApi : "" + content ) ; return ( Map < String , String > ) resp . get ( ""body"" ) ; } else { return Collections . emptyMap ( ) ; } } catch ( IOException e ) { LOG . error ( ""Cannot login into Zeppelin"" , e ) ; return Collections . emptyMap ( ) ; } } ","@ SuppressWarnings ( ""unchecked"" ) private Map < String , String > login ( String authKey , String endpoint ) { String [ ] credentials = authKey . split ( "":"" ) ; if ( credentials . length != 2 ) { return Collections . emptyMap ( ) ; } PostMethod post = new PostMethod ( endpoint ) ; post . addRequestHeader ( ""Origin"" , ""http://localhost"" ) ; post . addParameter ( new NameValuePair ( ""userName"" , credentials [ 0 ] ) ) ; post . addParameter ( new NameValuePair ( ""password"" , credentials [ 1 ] ) ) ; try { int code = client . executeMethod ( post ) ; if ( code == HttpStatus . SC_OK ) { String content = post . getResponseBodyAsString ( ) ; Map < String , Object > resp = gson . fromJson ( content , new TypeToken < Map < String , Object > > ( ) { } . getType ( ) ) ; LOG . info ( ""Received from Zeppelin LoginRestApi : "" + content ) ; return ( Map < String , String > ) resp . get ( ""body"" ) ; } else { LOG . error ( ""Failed Zeppelin login {}, status code {}"" , endpoint , code ) ; return Collections . emptyMap ( ) ; } } catch ( IOException e ) { LOG . error ( ""Cannot login into Zeppelin"" , e ) ; return Collections . emptyMap ( ) ; } } " 10,"@ SuppressWarnings ( ""unchecked"" ) private Map < String , String > login ( String authKey , String endpoint ) { String [ ] credentials = authKey . split ( "":"" ) ; if ( credentials . length != 2 ) { return Collections . emptyMap ( ) ; } PostMethod post = new PostMethod ( endpoint ) ; post . addRequestHeader ( ""Origin"" , ""http://localhost"" ) ; post . addParameter ( new NameValuePair ( ""userName"" , credentials [ 0 ] ) ) ; post . addParameter ( new NameValuePair ( ""password"" , credentials [ 1 ] ) ) ; try { int code = client . executeMethod ( post ) ; if ( code == HttpStatus . SC_OK ) { String content = post . getResponseBodyAsString ( ) ; Map < String , Object > resp = gson . fromJson ( content , new TypeToken < Map < String , Object > > ( ) { } . getType ( ) ) ; LOG . info ( ""Received from Zeppelin LoginRestApi : "" + content ) ; return ( Map < String , String > ) resp . get ( ""body"" ) ; } else { LOG . error ( ""Failed Zeppelin login {}, status code {}"" , endpoint , code ) ; return Collections . emptyMap ( ) ; } } catch ( IOException e ) { return Collections . emptyMap ( ) ; } } ","@ SuppressWarnings ( ""unchecked"" ) private Map < String , String > login ( String authKey , String endpoint ) { String [ ] credentials = authKey . split ( "":"" ) ; if ( credentials . length != 2 ) { return Collections . emptyMap ( ) ; } PostMethod post = new PostMethod ( endpoint ) ; post . addRequestHeader ( ""Origin"" , ""http://localhost"" ) ; post . addParameter ( new NameValuePair ( ""userName"" , credentials [ 0 ] ) ) ; post . addParameter ( new NameValuePair ( ""password"" , credentials [ 1 ] ) ) ; try { int code = client . executeMethod ( post ) ; if ( code == HttpStatus . SC_OK ) { String content = post . getResponseBodyAsString ( ) ; Map < String , Object > resp = gson . fromJson ( content , new TypeToken < Map < String , Object > > ( ) { } . getType ( ) ) ; LOG . info ( ""Received from Zeppelin LoginRestApi : "" + content ) ; return ( Map < String , String > ) resp . get ( ""body"" ) ; } else { LOG . error ( ""Failed Zeppelin login {}, status code {}"" , endpoint , code ) ; return Collections . emptyMap ( ) ; } } catch ( IOException e ) { LOG . error ( ""Cannot login into Zeppelin"" , e ) ; return Collections . emptyMap ( ) ; } } " 11,"@ Test ( timeout = 60000 ) public void testPresettledReceiverReadsAllMessages ( ) throws Exception { final int MSG_COUNT = 100 ; sendMessages ( getQueueName ( ) , MSG_COUNT ) ; AmqpClient client = createAmqpClient ( ) ; AmqpConnection connection = addConnection ( client . connect ( ) ) ; AmqpSession session = connection . createSession ( ) ; AmqpReceiver receiver = session . createReceiver ( getQueueName ( ) , null , false , true ) ; final Queue queueView = getProxyToQueue ( getQueueName ( ) ) ; assertEquals ( MSG_COUNT , queueView . getMessageCount ( ) ) ; receiver . flow ( MSG_COUNT ) ; for ( int i = 0 ; i < MSG_COUNT ; ++ i ) { assertNotNull ( receiver . receive ( 5 , TimeUnit . SECONDS ) ) ; } receiver . close ( ) ; receiver = session . createReceiver ( getQueueName ( ) ) ; receiver . flow ( 1 ) ; AmqpMessage received = receiver . receive ( 5 , TimeUnit . SECONDS ) ; if ( received != null ) { instanceLog . debug ( ""Message read: "" + received . getMessageId ( ) ) ; } assertNull ( received ) ; assertEquals ( 0 , queueView . getMessageCount ( ) ) ; connection . close ( ) ; } ","@ Test ( timeout = 60000 ) public void testPresettledReceiverReadsAllMessages ( ) throws Exception { final int MSG_COUNT = 100 ; sendMessages ( getQueueName ( ) , MSG_COUNT ) ; AmqpClient client = createAmqpClient ( ) ; AmqpConnection connection = addConnection ( client . connect ( ) ) ; AmqpSession session = connection . createSession ( ) ; AmqpReceiver receiver = session . createReceiver ( getQueueName ( ) , null , false , true ) ; final Queue queueView = getProxyToQueue ( getQueueName ( ) ) ; assertEquals ( MSG_COUNT , queueView . getMessageCount ( ) ) ; receiver . flow ( MSG_COUNT ) ; for ( int i = 0 ; i < MSG_COUNT ; ++ i ) { assertNotNull ( receiver . receive ( 5 , TimeUnit . SECONDS ) ) ; } receiver . close ( ) ; instanceLog . debug ( ""Message Count after all consumed: "" + queueView . getMessageCount ( ) ) ; receiver = session . createReceiver ( getQueueName ( ) ) ; receiver . flow ( 1 ) ; AmqpMessage received = receiver . receive ( 5 , TimeUnit . SECONDS ) ; if ( received != null ) { instanceLog . debug ( ""Message read: "" + received . getMessageId ( ) ) ; } assertNull ( received ) ; assertEquals ( 0 , queueView . getMessageCount ( ) ) ; connection . close ( ) ; } " 12,"@ Test ( timeout = 60000 ) public void testPresettledReceiverReadsAllMessages ( ) throws Exception { final int MSG_COUNT = 100 ; sendMessages ( getQueueName ( ) , MSG_COUNT ) ; AmqpClient client = createAmqpClient ( ) ; AmqpConnection connection = addConnection ( client . connect ( ) ) ; AmqpSession session = connection . createSession ( ) ; AmqpReceiver receiver = session . createReceiver ( getQueueName ( ) , null , false , true ) ; final Queue queueView = getProxyToQueue ( getQueueName ( ) ) ; assertEquals ( MSG_COUNT , queueView . getMessageCount ( ) ) ; receiver . flow ( MSG_COUNT ) ; for ( int i = 0 ; i < MSG_COUNT ; ++ i ) { assertNotNull ( receiver . receive ( 5 , TimeUnit . SECONDS ) ) ; } receiver . close ( ) ; instanceLog . debug ( ""Message Count after all consumed: "" + queueView . getMessageCount ( ) ) ; receiver = session . createReceiver ( getQueueName ( ) ) ; receiver . flow ( 1 ) ; AmqpMessage received = receiver . receive ( 5 , TimeUnit . SECONDS ) ; if ( received != null ) { } assertNull ( received ) ; assertEquals ( 0 , queueView . getMessageCount ( ) ) ; connection . close ( ) ; } ","@ Test ( timeout = 60000 ) public void testPresettledReceiverReadsAllMessages ( ) throws Exception { final int MSG_COUNT = 100 ; sendMessages ( getQueueName ( ) , MSG_COUNT ) ; AmqpClient client = createAmqpClient ( ) ; AmqpConnection connection = addConnection ( client . connect ( ) ) ; AmqpSession session = connection . createSession ( ) ; AmqpReceiver receiver = session . createReceiver ( getQueueName ( ) , null , false , true ) ; final Queue queueView = getProxyToQueue ( getQueueName ( ) ) ; assertEquals ( MSG_COUNT , queueView . getMessageCount ( ) ) ; receiver . flow ( MSG_COUNT ) ; for ( int i = 0 ; i < MSG_COUNT ; ++ i ) { assertNotNull ( receiver . receive ( 5 , TimeUnit . SECONDS ) ) ; } receiver . close ( ) ; instanceLog . debug ( ""Message Count after all consumed: "" + queueView . getMessageCount ( ) ) ; receiver = session . createReceiver ( getQueueName ( ) ) ; receiver . flow ( 1 ) ; AmqpMessage received = receiver . receive ( 5 , TimeUnit . SECONDS ) ; if ( received != null ) { instanceLog . debug ( ""Message read: "" + received . getMessageId ( ) ) ; } assertNull ( received ) ; assertEquals ( 0 , queueView . getMessageCount ( ) ) ; connection . close ( ) ; } " 13,"protected URL findResource ( final String name , final ModuleClassLoader requestor , Set < String > seenModules ) { if ( log . isTraceEnabled ( ) && name != null && name . contains ( ""starter"" ) ) { if ( seenModules != null ) { } log . trace ( ""name: "" + name ) ; for ( URL url : getURLs ( ) ) { log . trace ( ""url: "" + url ) ; } } if ( ( seenModules != null ) && seenModules . contains ( getModule ( ) . getModuleId ( ) ) ) { return null ; } URL result = super . findResource ( name ) ; if ( result != null ) { if ( isResourceVisible ( name , result , requestor ) ) { return result ; } log . debug ( ""Resource is not visible"" ) ; return null ; } if ( seenModules == null ) { seenModules = new HashSet < String > ( ) ; } seenModules . add ( getModule ( ) . getModuleId ( ) ) ; if ( requiredModules != null ) { for ( Module publicImport : requiredModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) continue ; ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } } for ( Module publicImport : awareOfModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) { continue ; } ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } return result ; } ","protected URL findResource ( final String name , final ModuleClassLoader requestor , Set < String > seenModules ) { if ( log . isTraceEnabled ( ) && name != null && name . contains ( ""starter"" ) ) { if ( seenModules != null ) { log . trace ( ""seenModules.size: "" + seenModules . size ( ) ) ; } log . trace ( ""name: "" + name ) ; for ( URL url : getURLs ( ) ) { log . trace ( ""url: "" + url ) ; } } if ( ( seenModules != null ) && seenModules . contains ( getModule ( ) . getModuleId ( ) ) ) { return null ; } URL result = super . findResource ( name ) ; if ( result != null ) { if ( isResourceVisible ( name , result , requestor ) ) { return result ; } log . debug ( ""Resource is not visible"" ) ; return null ; } if ( seenModules == null ) { seenModules = new HashSet < String > ( ) ; } seenModules . add ( getModule ( ) . getModuleId ( ) ) ; if ( requiredModules != null ) { for ( Module publicImport : requiredModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) continue ; ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } } for ( Module publicImport : awareOfModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) { continue ; } ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } return result ; } " 14,"protected URL findResource ( final String name , final ModuleClassLoader requestor , Set < String > seenModules ) { if ( log . isTraceEnabled ( ) && name != null && name . contains ( ""starter"" ) ) { if ( seenModules != null ) { log . trace ( ""seenModules.size: "" + seenModules . size ( ) ) ; } for ( URL url : getURLs ( ) ) { log . trace ( ""url: "" + url ) ; } } if ( ( seenModules != null ) && seenModules . contains ( getModule ( ) . getModuleId ( ) ) ) { return null ; } URL result = super . findResource ( name ) ; if ( result != null ) { if ( isResourceVisible ( name , result , requestor ) ) { return result ; } log . debug ( ""Resource is not visible"" ) ; return null ; } if ( seenModules == null ) { seenModules = new HashSet < String > ( ) ; } seenModules . add ( getModule ( ) . getModuleId ( ) ) ; if ( requiredModules != null ) { for ( Module publicImport : requiredModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) continue ; ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } } for ( Module publicImport : awareOfModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) { continue ; } ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } return result ; } ","protected URL findResource ( final String name , final ModuleClassLoader requestor , Set < String > seenModules ) { if ( log . isTraceEnabled ( ) && name != null && name . contains ( ""starter"" ) ) { if ( seenModules != null ) { log . trace ( ""seenModules.size: "" + seenModules . size ( ) ) ; } log . trace ( ""name: "" + name ) ; for ( URL url : getURLs ( ) ) { log . trace ( ""url: "" + url ) ; } } if ( ( seenModules != null ) && seenModules . contains ( getModule ( ) . getModuleId ( ) ) ) { return null ; } URL result = super . findResource ( name ) ; if ( result != null ) { if ( isResourceVisible ( name , result , requestor ) ) { return result ; } log . debug ( ""Resource is not visible"" ) ; return null ; } if ( seenModules == null ) { seenModules = new HashSet < String > ( ) ; } seenModules . add ( getModule ( ) . getModuleId ( ) ) ; if ( requiredModules != null ) { for ( Module publicImport : requiredModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) continue ; ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } } for ( Module publicImport : awareOfModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) { continue ; } ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } return result ; } " 15,"protected URL findResource ( final String name , final ModuleClassLoader requestor , Set < String > seenModules ) { if ( log . isTraceEnabled ( ) && name != null && name . contains ( ""starter"" ) ) { if ( seenModules != null ) { log . trace ( ""seenModules.size: "" + seenModules . size ( ) ) ; } log . trace ( ""name: "" + name ) ; for ( URL url : getURLs ( ) ) { } } if ( ( seenModules != null ) && seenModules . contains ( getModule ( ) . getModuleId ( ) ) ) { return null ; } URL result = super . findResource ( name ) ; if ( result != null ) { if ( isResourceVisible ( name , result , requestor ) ) { return result ; } log . debug ( ""Resource is not visible"" ) ; return null ; } if ( seenModules == null ) { seenModules = new HashSet < String > ( ) ; } seenModules . add ( getModule ( ) . getModuleId ( ) ) ; if ( requiredModules != null ) { for ( Module publicImport : requiredModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) continue ; ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } } for ( Module publicImport : awareOfModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) { continue ; } ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } return result ; } ","protected URL findResource ( final String name , final ModuleClassLoader requestor , Set < String > seenModules ) { if ( log . isTraceEnabled ( ) && name != null && name . contains ( ""starter"" ) ) { if ( seenModules != null ) { log . trace ( ""seenModules.size: "" + seenModules . size ( ) ) ; } log . trace ( ""name: "" + name ) ; for ( URL url : getURLs ( ) ) { log . trace ( ""url: "" + url ) ; } } if ( ( seenModules != null ) && seenModules . contains ( getModule ( ) . getModuleId ( ) ) ) { return null ; } URL result = super . findResource ( name ) ; if ( result != null ) { if ( isResourceVisible ( name , result , requestor ) ) { return result ; } log . debug ( ""Resource is not visible"" ) ; return null ; } if ( seenModules == null ) { seenModules = new HashSet < String > ( ) ; } seenModules . add ( getModule ( ) . getModuleId ( ) ) ; if ( requiredModules != null ) { for ( Module publicImport : requiredModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) continue ; ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } } for ( Module publicImport : awareOfModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) { continue ; } ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } return result ; } " 16,"protected URL findResource ( final String name , final ModuleClassLoader requestor , Set < String > seenModules ) { if ( log . isTraceEnabled ( ) && name != null && name . contains ( ""starter"" ) ) { if ( seenModules != null ) { log . trace ( ""seenModules.size: "" + seenModules . size ( ) ) ; } log . trace ( ""name: "" + name ) ; for ( URL url : getURLs ( ) ) { log . trace ( ""url: "" + url ) ; } } if ( ( seenModules != null ) && seenModules . contains ( getModule ( ) . getModuleId ( ) ) ) { return null ; } URL result = super . findResource ( name ) ; if ( result != null ) { if ( isResourceVisible ( name , result , requestor ) ) { return result ; } return null ; } if ( seenModules == null ) { seenModules = new HashSet < String > ( ) ; } seenModules . add ( getModule ( ) . getModuleId ( ) ) ; if ( requiredModules != null ) { for ( Module publicImport : requiredModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) continue ; ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } } for ( Module publicImport : awareOfModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) { continue ; } ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } return result ; } ","protected URL findResource ( final String name , final ModuleClassLoader requestor , Set < String > seenModules ) { if ( log . isTraceEnabled ( ) && name != null && name . contains ( ""starter"" ) ) { if ( seenModules != null ) { log . trace ( ""seenModules.size: "" + seenModules . size ( ) ) ; } log . trace ( ""name: "" + name ) ; for ( URL url : getURLs ( ) ) { log . trace ( ""url: "" + url ) ; } } if ( ( seenModules != null ) && seenModules . contains ( getModule ( ) . getModuleId ( ) ) ) { return null ; } URL result = super . findResource ( name ) ; if ( result != null ) { if ( isResourceVisible ( name , result , requestor ) ) { return result ; } log . debug ( ""Resource is not visible"" ) ; return null ; } if ( seenModules == null ) { seenModules = new HashSet < String > ( ) ; } seenModules . add ( getModule ( ) . getModuleId ( ) ) ; if ( requiredModules != null ) { for ( Module publicImport : requiredModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) continue ; ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } } for ( Module publicImport : awareOfModules ) { if ( seenModules . contains ( publicImport . getModuleId ( ) ) ) { continue ; } ModuleClassLoader mcl = ModuleFactory . getModuleClassLoader ( publicImport ) ; if ( mcl != null ) { result = mcl . findResource ( name , requestor , seenModules ) ; } if ( result != null ) { return result ; } } return result ; } " 17,"public Boolean apply ( Object param ) { counter ++ ; if ( counter == 2 ) return success ; jobCtx . holdcc ( 4000 ) ; try { jobCtx . holdcc ( ) ; } catch ( IllegalStateException ignored ) { success = true ; } finally { new Timer ( ) . schedule ( new TimerTask ( ) { @ Override public void run ( ) { jobCtx . callcc ( ) ; } } , 1000 ) ; } return false ; } ","public Boolean apply ( Object param ) { counter ++ ; if ( counter == 2 ) return success ; jobCtx . holdcc ( 4000 ) ; try { jobCtx . holdcc ( ) ; } catch ( IllegalStateException ignored ) { success = true ; log . info ( ""Second holdcc() threw IllegalStateException as expected."" ) ; } finally { new Timer ( ) . schedule ( new TimerTask ( ) { @ Override public void run ( ) { jobCtx . callcc ( ) ; } } , 1000 ) ; } return false ; } " 18,"public static void cleanup ( Log log , java . io . Closeable ... closeables ) { for ( java . io . Closeable c : closeables ) { if ( c != null ) { try { c . close ( ) ; } catch ( IOException e ) { if ( log != null && log . isDebugEnabled ( ) ) { } } } } } ","public static void cleanup ( Log log , java . io . Closeable ... closeables ) { for ( java . io . Closeable c : closeables ) { if ( c != null ) { try { c . close ( ) ; } catch ( IOException e ) { if ( log != null && log . isDebugEnabled ( ) ) { log . debug ( ""Exception in closing "" + c , e ) ; } } } } } " 19,"public static void updateFileEntryType ( HttpPrincipal httpPrincipal , long fileEntryTypeId , java . util . Map < java . util . Locale , String > nameMap , java . util . Map < java . util . Locale , String > descriptionMap , long [ ] ddmStructureIds , com . liferay . portal . kernel . service . ServiceContext serviceContext ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( DLFileEntryTypeServiceUtil . class , ""updateFileEntryType"" , _updateFileEntryTypeParameterTypes16 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , fileEntryTypeId , nameMap , descriptionMap , ddmStructureIds , serviceContext ) ; try { TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { throw systemException ; } } ","public static void updateFileEntryType ( HttpPrincipal httpPrincipal , long fileEntryTypeId , java . util . Map < java . util . Locale , String > nameMap , java . util . Map < java . util . Locale , String > descriptionMap , long [ ] ddmStructureIds , com . liferay . portal . kernel . service . ServiceContext serviceContext ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( DLFileEntryTypeServiceUtil . class , ""updateFileEntryType"" , _updateFileEntryTypeParameterTypes16 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , fileEntryTypeId , nameMap , descriptionMap , ddmStructureIds , serviceContext ) ; try { TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { _log . error ( systemException , systemException ) ; throw systemException ; } } " 20,"public void analyseAnnotationConstant ( List < ModifierContext > modifierList , TypeTypeContext typeType , VariableDeclaratorsContext variableDeclarators ) { try { this . isLocalVariable = false ; this . visibility = VisibilitySet . PUBLIC . toString ( ) ; this . isFinal = true ; this . hasClassScope = true ; dispatchAnnotationsOfMember ( modifierList , belongsToClass ) ; this . declareType = determineTypeOfTypeType ( typeType , belongsToClass ) ; determine_name ( variableDeclarators ) ; } catch ( Exception e ) { } } ","public void analyseAnnotationConstant ( List < ModifierContext > modifierList , TypeTypeContext typeType , VariableDeclaratorsContext variableDeclarators ) { try { this . isLocalVariable = false ; this . visibility = VisibilitySet . PUBLIC . toString ( ) ; this . isFinal = true ; this . hasClassScope = true ; dispatchAnnotationsOfMember ( modifierList , belongsToClass ) ; this . declareType = determineTypeOfTypeType ( typeType , belongsToClass ) ; determine_name ( variableDeclarators ) ; } catch ( Exception e ) { logger . warn ( "" Exception while processing: "" + belongsToClass + "" Line: "" + typeType . start . getLine ( ) + "" "" + e . getMessage ( ) ) ; } } " 21,"private void infolog ( String msg ) { processingLog += msg + "".\n"" ; } ","private void infolog ( String msg ) { logger . info ( msg ) ; processingLog += msg + "".\n"" ; } " 22,"public RestTemplate getRestTemplate ( String requesterWebID ) { RestTemplate restTemplate ; try { restTemplate = getRestTemplateForReadingLinkedData ( requesterWebID ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } return restTemplate ; } ","public RestTemplate getRestTemplate ( String requesterWebID ) { RestTemplate restTemplate ; try { restTemplate = getRestTemplateForReadingLinkedData ( requesterWebID ) ; } catch ( Exception e ) { logger . error ( ""Failed to create ssl tofu rest template"" , e ) ; throw new RuntimeException ( e ) ; } return restTemplate ; } " 23,"public void load ( ) { mimeTypesMap = new HashMap < > ( ) ; try { JsonNode jsonNode = MAPPER . readTree ( IOUtils . toString ( getClass ( ) . getResourceAsStream ( ""/MIMETypes.json"" ) ) ) ; for ( JsonNode node : jsonNode ) { JsonNode type = node . path ( ""name"" ) ; JsonNode ext = node . path ( ""extension"" ) ; if ( ! type . isMissingNode ( ) ) { mimeTypesMap . put ( type . asText ( ) , ext . isMissingNode ( ) ? """" : ext . asText ( ) ) ; } } mimeTypesMap = Collections . unmodifiableMap ( mimeTypesMap ) ; mimeTypes = new ArrayList < > ( mimeTypesMap . keySet ( ) ) ; Collections . sort ( mimeTypes ) ; mimeTypes = Collections . unmodifiableList ( mimeTypes ) ; } catch ( Exception e ) { LOG . error ( ""Error reading file MIMETypes from resources"" , e ) ; } } ","public void load ( ) { mimeTypesMap = new HashMap < > ( ) ; try { JsonNode jsonNode = MAPPER . readTree ( IOUtils . toString ( getClass ( ) . getResourceAsStream ( ""/MIMETypes.json"" ) ) ) ; for ( JsonNode node : jsonNode ) { JsonNode type = node . path ( ""name"" ) ; JsonNode ext = node . path ( ""extension"" ) ; if ( ! type . isMissingNode ( ) ) { mimeTypesMap . put ( type . asText ( ) , ext . isMissingNode ( ) ? """" : ext . asText ( ) ) ; } } mimeTypesMap = Collections . unmodifiableMap ( mimeTypesMap ) ; LOG . debug ( ""MIME types loaded: {}"" , mimeTypesMap ) ; mimeTypes = new ArrayList < > ( mimeTypesMap . keySet ( ) ) ; Collections . sort ( mimeTypes ) ; mimeTypes = Collections . unmodifiableList ( mimeTypes ) ; } catch ( Exception e ) { LOG . error ( ""Error reading file MIMETypes from resources"" , e ) ; } } " 24,"public void load ( ) { mimeTypesMap = new HashMap < > ( ) ; try { JsonNode jsonNode = MAPPER . readTree ( IOUtils . toString ( getClass ( ) . getResourceAsStream ( ""/MIMETypes.json"" ) ) ) ; for ( JsonNode node : jsonNode ) { JsonNode type = node . path ( ""name"" ) ; JsonNode ext = node . path ( ""extension"" ) ; if ( ! type . isMissingNode ( ) ) { mimeTypesMap . put ( type . asText ( ) , ext . isMissingNode ( ) ? """" : ext . asText ( ) ) ; } } mimeTypesMap = Collections . unmodifiableMap ( mimeTypesMap ) ; LOG . debug ( ""MIME types loaded: {}"" , mimeTypesMap ) ; mimeTypes = new ArrayList < > ( mimeTypesMap . keySet ( ) ) ; Collections . sort ( mimeTypes ) ; mimeTypes = Collections . unmodifiableList ( mimeTypes ) ; } catch ( Exception e ) { } } ","public void load ( ) { mimeTypesMap = new HashMap < > ( ) ; try { JsonNode jsonNode = MAPPER . readTree ( IOUtils . toString ( getClass ( ) . getResourceAsStream ( ""/MIMETypes.json"" ) ) ) ; for ( JsonNode node : jsonNode ) { JsonNode type = node . path ( ""name"" ) ; JsonNode ext = node . path ( ""extension"" ) ; if ( ! type . isMissingNode ( ) ) { mimeTypesMap . put ( type . asText ( ) , ext . isMissingNode ( ) ? """" : ext . asText ( ) ) ; } } mimeTypesMap = Collections . unmodifiableMap ( mimeTypesMap ) ; LOG . debug ( ""MIME types loaded: {}"" , mimeTypesMap ) ; mimeTypes = new ArrayList < > ( mimeTypesMap . keySet ( ) ) ; Collections . sort ( mimeTypes ) ; mimeTypes = Collections . unmodifiableList ( mimeTypes ) ; } catch ( Exception e ) { LOG . error ( ""Error reading file MIMETypes from resources"" , e ) ; } } " 25,"private boolean finalizeParentTemplate ( DatadiskTO dataDiskTemplate , VMTemplateVO templateVO , TemplateInfo parentTemplate , DataStore imageStore , int diskCount ) throws ExecutionException , InterruptedException , CloudRuntimeException { TemplateInfo templateInfo = imageFactory . getTemplate ( templateVO . getId ( ) , imageStore ) ; AsyncCallFuture < TemplateApiResult > templateFuture = createDatadiskTemplateAsync ( parentTemplate , templateInfo , dataDiskTemplate . getPath ( ) , dataDiskTemplate . getDiskId ( ) , dataDiskTemplate . getFileSize ( ) , dataDiskTemplate . isBootable ( ) ) ; TemplateApiResult result = null ; result = templateFuture . get ( ) ; if ( ! result . isSuccess ( ) ) { cleanupDatadiskTemplates ( templateInfo ) ; } return result . isSuccess ( ) ; } ","private boolean finalizeParentTemplate ( DatadiskTO dataDiskTemplate , VMTemplateVO templateVO , TemplateInfo parentTemplate , DataStore imageStore , int diskCount ) throws ExecutionException , InterruptedException , CloudRuntimeException { TemplateInfo templateInfo = imageFactory . getTemplate ( templateVO . getId ( ) , imageStore ) ; AsyncCallFuture < TemplateApiResult > templateFuture = createDatadiskTemplateAsync ( parentTemplate , templateInfo , dataDiskTemplate . getPath ( ) , dataDiskTemplate . getDiskId ( ) , dataDiskTemplate . getFileSize ( ) , dataDiskTemplate . isBootable ( ) ) ; TemplateApiResult result = null ; result = templateFuture . get ( ) ; if ( ! result . isSuccess ( ) ) { s_logger . debug ( ""Since creation of parent template: "" + templateInfo . getId ( ) + "" failed, delete Datadisk templates that were created as part of parent"" + "" template download"" ) ; cleanupDatadiskTemplates ( templateInfo ) ; } return result . isSuccess ( ) ; } " 26,"public static com . liferay . fragment . model . FragmentComposition deleteFragmentComposition ( HttpPrincipal httpPrincipal , long fragmentCompositionId ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( FragmentCompositionServiceUtil . class , ""deleteFragmentComposition"" , _deleteFragmentCompositionParameterTypes1 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , fragmentCompositionId ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( com . liferay . fragment . model . FragmentComposition ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { throw systemException ; } } ","public static com . liferay . fragment . model . FragmentComposition deleteFragmentComposition ( HttpPrincipal httpPrincipal , long fragmentCompositionId ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( FragmentCompositionServiceUtil . class , ""deleteFragmentComposition"" , _deleteFragmentCompositionParameterTypes1 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , fragmentCompositionId ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( com . liferay . fragment . model . FragmentComposition ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { _log . error ( systemException , systemException ) ; throw systemException ; } } " 27,"public int runAll ( ) { int retVal = EXIT_SUCCESS ; for ( WorkflowConfiguration config : m_workflows ) { int rv = runOne ( config ) ; if ( rv != EXIT_SUCCESS ) { LOGGER . info ( ""========= Workflow did not execute sucessfully ============"" ) ; retVal = rv ; if ( m_stopOnError ) { break ; } } else { LOGGER . info ( ""============= Workflow executed sucessfully ==============="" ) ; } } return retVal ; } ","public int runAll ( ) { int retVal = EXIT_SUCCESS ; for ( WorkflowConfiguration config : m_workflows ) { LOGGER . info ( ""===== Executing workflow "" + config . inputWorkflow + "" ====="" ) ; int rv = runOne ( config ) ; if ( rv != EXIT_SUCCESS ) { LOGGER . info ( ""========= Workflow did not execute sucessfully ============"" ) ; retVal = rv ; if ( m_stopOnError ) { break ; } } else { LOGGER . info ( ""============= Workflow executed sucessfully ==============="" ) ; } } return retVal ; } " 28,"public int runAll ( ) { int retVal = EXIT_SUCCESS ; for ( WorkflowConfiguration config : m_workflows ) { LOGGER . info ( ""===== Executing workflow "" + config . inputWorkflow + "" ====="" ) ; int rv = runOne ( config ) ; if ( rv != EXIT_SUCCESS ) { retVal = rv ; if ( m_stopOnError ) { break ; } } else { LOGGER . info ( ""============= Workflow executed sucessfully ==============="" ) ; } } return retVal ; } ","public int runAll ( ) { int retVal = EXIT_SUCCESS ; for ( WorkflowConfiguration config : m_workflows ) { LOGGER . info ( ""===== Executing workflow "" + config . inputWorkflow + "" ====="" ) ; int rv = runOne ( config ) ; if ( rv != EXIT_SUCCESS ) { LOGGER . info ( ""========= Workflow did not execute sucessfully ============"" ) ; retVal = rv ; if ( m_stopOnError ) { break ; } } else { LOGGER . info ( ""============= Workflow executed sucessfully ==============="" ) ; } } return retVal ; } " 29,"public int runAll ( ) { int retVal = EXIT_SUCCESS ; for ( WorkflowConfiguration config : m_workflows ) { LOGGER . info ( ""===== Executing workflow "" + config . inputWorkflow + "" ====="" ) ; int rv = runOne ( config ) ; if ( rv != EXIT_SUCCESS ) { LOGGER . info ( ""========= Workflow did not execute sucessfully ============"" ) ; retVal = rv ; if ( m_stopOnError ) { break ; } } else { } } return retVal ; } ","public int runAll ( ) { int retVal = EXIT_SUCCESS ; for ( WorkflowConfiguration config : m_workflows ) { LOGGER . info ( ""===== Executing workflow "" + config . inputWorkflow + "" ====="" ) ; int rv = runOne ( config ) ; if ( rv != EXIT_SUCCESS ) { LOGGER . info ( ""========= Workflow did not execute sucessfully ============"" ) ; retVal = rv ; if ( m_stopOnError ) { break ; } } else { LOGGER . info ( ""============= Workflow executed sucessfully ==============="" ) ; } } return retVal ; } " 30,"private CloseableIteration < ? extends BindingSet , QueryEvaluationException > evaluateInternal ( TupleExpr tupleExpr , Dataset dataset , BindingSet bindings , boolean includeInferred ) throws SailException { tupleExpr = tupleExpr . clone ( ) ; if ( ! ( tupleExpr instanceof QueryRoot ) ) { tupleExpr = new QueryRoot ( tupleExpr ) ; } new BindingAssigner ( ) . optimize ( tupleExpr , dataset , bindings ) ; List < SearchQueryEvaluator > queries = new ArrayList < > ( ) ; for ( SearchQueryInterpreter interpreter : sail . getSearchQueryInterpreters ( ) ) { interpreter . process ( tupleExpr , bindings , queries ) ; } if ( ! queries . isEmpty ( ) ) { evaluateLuceneQueries ( queries ) ; } if ( sail . getEvaluationMode ( ) == TupleFunctionEvaluationMode . TRIPLE_SOURCE ) { ValueFactory vf = sail . getValueFactory ( ) ; EvaluationStrategy strategy = new TupleFunctionEvaluationStrategy ( new SailTripleSource ( this , includeInferred , vf ) , dataset , sail . getFederatedServiceResolver ( ) , sail . getTupleFunctionRegistry ( ) ) ; new BindingAssigner ( ) . optimize ( tupleExpr , dataset , bindings ) ; new ConstantOptimizer ( strategy ) . optimize ( tupleExpr , dataset , bindings ) ; new CompareOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new ConjunctiveConstraintSplitter ( ) . optimize ( tupleExpr , dataset , bindings ) ; new DisjunctiveConstraintOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new SameTermFilterOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new QueryModelNormalizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new QueryJoinOptimizer ( new TupleFunctionEvaluationStatistics ( ) ) . optimize ( tupleExpr , dataset , bindings ) ; new IterativeEvaluationOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new FilterOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new OrderLimitOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; try { return strategy . evaluate ( tupleExpr , bindings ) ; } catch ( QueryEvaluationException e ) { throw new SailException ( e ) ; } } else { return super . evaluate ( tupleExpr , dataset , bindings , includeInferred ) ; } } ","private CloseableIteration < ? extends BindingSet , QueryEvaluationException > evaluateInternal ( TupleExpr tupleExpr , Dataset dataset , BindingSet bindings , boolean includeInferred ) throws SailException { tupleExpr = tupleExpr . clone ( ) ; if ( ! ( tupleExpr instanceof QueryRoot ) ) { tupleExpr = new QueryRoot ( tupleExpr ) ; } new BindingAssigner ( ) . optimize ( tupleExpr , dataset , bindings ) ; List < SearchQueryEvaluator > queries = new ArrayList < > ( ) ; for ( SearchQueryInterpreter interpreter : sail . getSearchQueryInterpreters ( ) ) { interpreter . process ( tupleExpr , bindings , queries ) ; } if ( ! queries . isEmpty ( ) ) { evaluateLuceneQueries ( queries ) ; } if ( sail . getEvaluationMode ( ) == TupleFunctionEvaluationMode . TRIPLE_SOURCE ) { ValueFactory vf = sail . getValueFactory ( ) ; EvaluationStrategy strategy = new TupleFunctionEvaluationStrategy ( new SailTripleSource ( this , includeInferred , vf ) , dataset , sail . getFederatedServiceResolver ( ) , sail . getTupleFunctionRegistry ( ) ) ; new BindingAssigner ( ) . optimize ( tupleExpr , dataset , bindings ) ; new ConstantOptimizer ( strategy ) . optimize ( tupleExpr , dataset , bindings ) ; new CompareOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new ConjunctiveConstraintSplitter ( ) . optimize ( tupleExpr , dataset , bindings ) ; new DisjunctiveConstraintOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new SameTermFilterOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new QueryModelNormalizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new QueryJoinOptimizer ( new TupleFunctionEvaluationStatistics ( ) ) . optimize ( tupleExpr , dataset , bindings ) ; new IterativeEvaluationOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new FilterOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; new OrderLimitOptimizer ( ) . optimize ( tupleExpr , dataset , bindings ) ; logger . trace ( ""Optimized query model:\n{}"" , tupleExpr ) ; try { return strategy . evaluate ( tupleExpr , bindings ) ; } catch ( QueryEvaluationException e ) { throw new SailException ( e ) ; } } else { return super . evaluate ( tupleExpr , dataset , bindings , includeInferred ) ; } } " 31,"private void complete ( Session session ) { assert head == tail ; reset ( session ) ; if ( onCompletion != null ) { onCompletion . run ( session ) ; } } ","private void complete ( Session session ) { assert head == tail ; log . trace ( ""#{} queue {} completed"" , session . uniqueId ( ) , var ) ; reset ( session ) ; if ( onCompletion != null ) { onCompletion . run ( session ) ; } } " 32,"public void process ( final FilterChain chain , final Request request , final Response response ) { long tm = System . currentTimeMillis ( ) ; try { Session s = sessionManager . open ( ) ; chain . process ( request , response ) ; } finally { sessionManager . close ( ) ; } tm = System . currentTimeMillis ( ) - tm ; } ","public void process ( final FilterChain chain , final Request request , final Response response ) { long tm = System . currentTimeMillis ( ) ; try { Session s = sessionManager . open ( ) ; chain . process ( request , response ) ; } finally { sessionManager . close ( ) ; } tm = System . currentTimeMillis ( ) - tm ; log . info ( ""Finished request: "" + tm + ""ms for "" + request . getAbsolutePath ( ) + "" method="" + request . getMethod ( ) ) ; } " 33,"public void doStopSelfTest ( final OslpEnvelope oslpRequest , final DeviceRequest deviceRequest , final DeviceResponseHandler deviceResponseHandler , final String ipAddress ) throws IOException { this . saveOslpRequestLogEntry ( deviceRequest , oslpRequest ) ; final OslpResponseHandler oslpResponseHandler = new OslpResponseHandler ( ) { @ Override public void handleResponse ( final OslpEnvelope response ) { OslpDeviceService . this . handleOslpResponseStopSelfTest ( deviceRequest , response , deviceResponseHandler ) ; } @ Override public void handleException ( final Throwable t ) { OslpDeviceService . this . handleException ( t , deviceRequest , deviceResponseHandler ) ; } } ; this . sendMessage ( ipAddress , oslpRequest , oslpResponseHandler , deviceRequest ) ; } ","public void doStopSelfTest ( final OslpEnvelope oslpRequest , final DeviceRequest deviceRequest , final DeviceResponseHandler deviceResponseHandler , final String ipAddress ) throws IOException { LOGGER . info ( ""doStopSelfTest() for device: {}."" , deviceRequest . getDeviceIdentification ( ) ) ; this . saveOslpRequestLogEntry ( deviceRequest , oslpRequest ) ; final OslpResponseHandler oslpResponseHandler = new OslpResponseHandler ( ) { @ Override public void handleResponse ( final OslpEnvelope response ) { OslpDeviceService . this . handleOslpResponseStopSelfTest ( deviceRequest , response , deviceResponseHandler ) ; } @ Override public void handleException ( final Throwable t ) { OslpDeviceService . this . handleException ( t , deviceRequest , deviceResponseHandler ) ; } } ; this . sendMessage ( ipAddress , oslpRequest , oslpResponseHandler , deviceRequest ) ; } " 34,"public static void generateUDTAtRuntime ( final Session session , AbstractUDTClassProperty < ? > udtClassProperty ) { if ( LOGGER . isDebugEnabled ( ) ) { } udtClassProperty . componentsProperty . stream ( ) . flatMap ( x -> x . getUDTClassProperties ( ) . stream ( ) ) . forEach ( x -> generateUDTAtRuntime ( session , x ) ) ; final String udtKeyspace = udtClassProperty . staticKeyspace . orElseGet ( session :: getLoggedKeyspace ) ; final SchemaContext schemaContext = new SchemaContext ( udtKeyspace , true , true ) ; final String udtSchema = udtClassProperty . generateSchema ( schemaContext ) ; if ( ACHILLES_DML_LOGGER . isDebugEnabled ( ) ) { ACHILLES_DML_LOGGER . debug ( udtSchema + ""\n"" ) ; } final ResultSet resultSet = session . execute ( udtSchema ) ; resultSet . getExecutionInfo ( ) . isSchemaInAgreement ( ) ; } ","public static void generateUDTAtRuntime ( final Session session , AbstractUDTClassProperty < ? > udtClassProperty ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( format ( ""Generating schema for udt of type %s"" , udtClassProperty . udtClass . getCanonicalName ( ) ) ) ; } udtClassProperty . componentsProperty . stream ( ) . flatMap ( x -> x . getUDTClassProperties ( ) . stream ( ) ) . forEach ( x -> generateUDTAtRuntime ( session , x ) ) ; final String udtKeyspace = udtClassProperty . staticKeyspace . orElseGet ( session :: getLoggedKeyspace ) ; final SchemaContext schemaContext = new SchemaContext ( udtKeyspace , true , true ) ; final String udtSchema = udtClassProperty . generateSchema ( schemaContext ) ; if ( ACHILLES_DML_LOGGER . isDebugEnabled ( ) ) { ACHILLES_DML_LOGGER . debug ( udtSchema + ""\n"" ) ; } final ResultSet resultSet = session . execute ( udtSchema ) ; resultSet . getExecutionInfo ( ) . isSchemaInAgreement ( ) ; } " 35,"public static void generateUDTAtRuntime ( final Session session , AbstractUDTClassProperty < ? > udtClassProperty ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( format ( ""Generating schema for udt of type %s"" , udtClassProperty . udtClass . getCanonicalName ( ) ) ) ; } udtClassProperty . componentsProperty . stream ( ) . flatMap ( x -> x . getUDTClassProperties ( ) . stream ( ) ) . forEach ( x -> generateUDTAtRuntime ( session , x ) ) ; final String udtKeyspace = udtClassProperty . staticKeyspace . orElseGet ( session :: getLoggedKeyspace ) ; final SchemaContext schemaContext = new SchemaContext ( udtKeyspace , true , true ) ; final String udtSchema = udtClassProperty . generateSchema ( schemaContext ) ; if ( ACHILLES_DML_LOGGER . isDebugEnabled ( ) ) { } final ResultSet resultSet = session . execute ( udtSchema ) ; resultSet . getExecutionInfo ( ) . isSchemaInAgreement ( ) ; } ","public static void generateUDTAtRuntime ( final Session session , AbstractUDTClassProperty < ? > udtClassProperty ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( format ( ""Generating schema for udt of type %s"" , udtClassProperty . udtClass . getCanonicalName ( ) ) ) ; } udtClassProperty . componentsProperty . stream ( ) . flatMap ( x -> x . getUDTClassProperties ( ) . stream ( ) ) . forEach ( x -> generateUDTAtRuntime ( session , x ) ) ; final String udtKeyspace = udtClassProperty . staticKeyspace . orElseGet ( session :: getLoggedKeyspace ) ; final SchemaContext schemaContext = new SchemaContext ( udtKeyspace , true , true ) ; final String udtSchema = udtClassProperty . generateSchema ( schemaContext ) ; if ( ACHILLES_DML_LOGGER . isDebugEnabled ( ) ) { ACHILLES_DML_LOGGER . debug ( udtSchema + ""\n"" ) ; } final ResultSet resultSet = session . execute ( udtSchema ) ; resultSet . getExecutionInfo ( ) . isSchemaInAgreement ( ) ; } " 36,"public FragmentEntryLink findByUUID_G ( String uuid , long groupId ) throws NoSuchEntryLinkException { FragmentEntryLink fragmentEntryLink = fetchByUUID_G ( uuid , groupId ) ; if ( fragmentEntryLink == null ) { StringBundler sb = new StringBundler ( 6 ) ; sb . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; sb . append ( ""uuid="" ) ; sb . append ( uuid ) ; sb . append ( "", groupId="" ) ; sb . append ( groupId ) ; sb . append ( ""}"" ) ; if ( _log . isDebugEnabled ( ) ) { } throw new NoSuchEntryLinkException ( sb . toString ( ) ) ; } return fragmentEntryLink ; } ","public FragmentEntryLink findByUUID_G ( String uuid , long groupId ) throws NoSuchEntryLinkException { FragmentEntryLink fragmentEntryLink = fetchByUUID_G ( uuid , groupId ) ; if ( fragmentEntryLink == null ) { StringBundler sb = new StringBundler ( 6 ) ; sb . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; sb . append ( ""uuid="" ) ; sb . append ( uuid ) ; sb . append ( "", groupId="" ) ; sb . append ( groupId ) ; sb . append ( ""}"" ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( sb . toString ( ) ) ; } throw new NoSuchEntryLinkException ( sb . toString ( ) ) ; } return fragmentEntryLink ; } " 37,"private MessageCheckpoint loadMessageCheckpoint ( ) { final Snapshot < MessageCheckpoint > snapshot = messageCheckpointStore . latestSnapshot ( ) ; if ( snapshot == null ) { return new MessageCheckpoint ( - 1 , new HashMap < > ( ) ) ; } else { return snapshot . getData ( ) ; } } ","private MessageCheckpoint loadMessageCheckpoint ( ) { final Snapshot < MessageCheckpoint > snapshot = messageCheckpointStore . latestSnapshot ( ) ; if ( snapshot == null ) { LOG . info ( ""no message log replay snapshot, return empty state."" ) ; return new MessageCheckpoint ( - 1 , new HashMap < > ( ) ) ; } else { return snapshot . getData ( ) ; } } " 38,"public ProjectVersion getVersion ( ) { String historyVersion = getHistoryVersion ( ) ; if ( historyVersion == null ) { if ( designFolderName != null ) { try { return createProjectVersion ( designRepository . check ( designFolderName ) ) ; } catch ( IOException e ) { } } return null ; } return super . getVersion ( ) ; } ","public ProjectVersion getVersion ( ) { String historyVersion = getHistoryVersion ( ) ; if ( historyVersion == null ) { if ( designFolderName != null ) { try { return createProjectVersion ( designRepository . check ( designFolderName ) ) ; } catch ( IOException e ) { log . error ( e . getMessage ( ) , e ) ; } } return null ; } return super . getVersion ( ) ; } " 39,"private void writeMessageLength ( SSL2ServerHelloMessage message ) { if ( message . getPaddingLength ( ) . getValue ( ) != 0 ) { throw new UnsupportedOperationException ( ""Long record headers are not supported"" ) ; } appendInt ( message . getMessageLength ( ) . getValue ( ) , SSL2ByteLength . LENGTH ) ; } ","private void writeMessageLength ( SSL2ServerHelloMessage message ) { if ( message . getPaddingLength ( ) . getValue ( ) != 0 ) { throw new UnsupportedOperationException ( ""Long record headers are not supported"" ) ; } appendInt ( message . getMessageLength ( ) . getValue ( ) , SSL2ByteLength . LENGTH ) ; LOGGER . debug ( ""MessageLength: "" + message . getMessageLength ( ) . getValue ( ) ) ; } " 40,"public void runRepeatedly ( int numIterations ) { RebalanceStrategy strategy = new AutoRebalanceStrategy ( RESOURCE_NAME , _partitions , _states , _maxPerNode ) ; ZNRecord initialResult = strategy . computePartitionAssignment ( _allNodes , _liveNodes , _currentMapping , null ) ; _currentMapping = getMapping ( initialResult . getListFields ( ) ) ; logger . info ( _currentMapping . toString ( ) ) ; getRunResult ( _currentMapping , initialResult . getListFields ( ) ) ; for ( int i = 0 ; i < numIterations ; i ++ ) { logger . info ( ""~~~~ Iteration "" + i + "" ~~~~~"" ) ; ZNRecord znRecord = runOnceRandomly ( ) ; if ( znRecord != null ) { final Map < String , List < String > > listResult = znRecord . getListFields ( ) ; final Map < String , Map < String , String > > mapResult = getMapping ( listResult ) ; logger . info ( mapResult . toString ( ) ) ; logger . info ( listResult . toString ( ) ) ; getRunResult ( mapResult , listResult ) ; _currentMapping = mapResult ; } } } ","public void runRepeatedly ( int numIterations ) { logger . info ( ""~~~~ Initial State ~~~~~"" ) ; RebalanceStrategy strategy = new AutoRebalanceStrategy ( RESOURCE_NAME , _partitions , _states , _maxPerNode ) ; ZNRecord initialResult = strategy . computePartitionAssignment ( _allNodes , _liveNodes , _currentMapping , null ) ; _currentMapping = getMapping ( initialResult . getListFields ( ) ) ; logger . info ( _currentMapping . toString ( ) ) ; getRunResult ( _currentMapping , initialResult . getListFields ( ) ) ; for ( int i = 0 ; i < numIterations ; i ++ ) { logger . info ( ""~~~~ Iteration "" + i + "" ~~~~~"" ) ; ZNRecord znRecord = runOnceRandomly ( ) ; if ( znRecord != null ) { final Map < String , List < String > > listResult = znRecord . getListFields ( ) ; final Map < String , Map < String , String > > mapResult = getMapping ( listResult ) ; logger . info ( mapResult . toString ( ) ) ; logger . info ( listResult . toString ( ) ) ; getRunResult ( mapResult , listResult ) ; _currentMapping = mapResult ; } } } " 41,"public void runRepeatedly ( int numIterations ) { logger . info ( ""~~~~ Initial State ~~~~~"" ) ; RebalanceStrategy strategy = new AutoRebalanceStrategy ( RESOURCE_NAME , _partitions , _states , _maxPerNode ) ; ZNRecord initialResult = strategy . computePartitionAssignment ( _allNodes , _liveNodes , _currentMapping , null ) ; _currentMapping = getMapping ( initialResult . getListFields ( ) ) ; getRunResult ( _currentMapping , initialResult . getListFields ( ) ) ; for ( int i = 0 ; i < numIterations ; i ++ ) { logger . info ( ""~~~~ Iteration "" + i + "" ~~~~~"" ) ; ZNRecord znRecord = runOnceRandomly ( ) ; if ( znRecord != null ) { final Map < String , List < String > > listResult = znRecord . getListFields ( ) ; final Map < String , Map < String , String > > mapResult = getMapping ( listResult ) ; logger . info ( mapResult . toString ( ) ) ; logger . info ( listResult . toString ( ) ) ; getRunResult ( mapResult , listResult ) ; _currentMapping = mapResult ; } } } ","public void runRepeatedly ( int numIterations ) { logger . info ( ""~~~~ Initial State ~~~~~"" ) ; RebalanceStrategy strategy = new AutoRebalanceStrategy ( RESOURCE_NAME , _partitions , _states , _maxPerNode ) ; ZNRecord initialResult = strategy . computePartitionAssignment ( _allNodes , _liveNodes , _currentMapping , null ) ; _currentMapping = getMapping ( initialResult . getListFields ( ) ) ; logger . info ( _currentMapping . toString ( ) ) ; getRunResult ( _currentMapping , initialResult . getListFields ( ) ) ; for ( int i = 0 ; i < numIterations ; i ++ ) { logger . info ( ""~~~~ Iteration "" + i + "" ~~~~~"" ) ; ZNRecord znRecord = runOnceRandomly ( ) ; if ( znRecord != null ) { final Map < String , List < String > > listResult = znRecord . getListFields ( ) ; final Map < String , Map < String , String > > mapResult = getMapping ( listResult ) ; logger . info ( mapResult . toString ( ) ) ; logger . info ( listResult . toString ( ) ) ; getRunResult ( mapResult , listResult ) ; _currentMapping = mapResult ; } } } " 42,"public void runRepeatedly ( int numIterations ) { logger . info ( ""~~~~ Initial State ~~~~~"" ) ; RebalanceStrategy strategy = new AutoRebalanceStrategy ( RESOURCE_NAME , _partitions , _states , _maxPerNode ) ; ZNRecord initialResult = strategy . computePartitionAssignment ( _allNodes , _liveNodes , _currentMapping , null ) ; _currentMapping = getMapping ( initialResult . getListFields ( ) ) ; logger . info ( _currentMapping . toString ( ) ) ; getRunResult ( _currentMapping , initialResult . getListFields ( ) ) ; for ( int i = 0 ; i < numIterations ; i ++ ) { ZNRecord znRecord = runOnceRandomly ( ) ; if ( znRecord != null ) { final Map < String , List < String > > listResult = znRecord . getListFields ( ) ; final Map < String , Map < String , String > > mapResult = getMapping ( listResult ) ; logger . info ( mapResult . toString ( ) ) ; logger . info ( listResult . toString ( ) ) ; getRunResult ( mapResult , listResult ) ; _currentMapping = mapResult ; } } } ","public void runRepeatedly ( int numIterations ) { logger . info ( ""~~~~ Initial State ~~~~~"" ) ; RebalanceStrategy strategy = new AutoRebalanceStrategy ( RESOURCE_NAME , _partitions , _states , _maxPerNode ) ; ZNRecord initialResult = strategy . computePartitionAssignment ( _allNodes , _liveNodes , _currentMapping , null ) ; _currentMapping = getMapping ( initialResult . getListFields ( ) ) ; logger . info ( _currentMapping . toString ( ) ) ; getRunResult ( _currentMapping , initialResult . getListFields ( ) ) ; for ( int i = 0 ; i < numIterations ; i ++ ) { logger . info ( ""~~~~ Iteration "" + i + "" ~~~~~"" ) ; ZNRecord znRecord = runOnceRandomly ( ) ; if ( znRecord != null ) { final Map < String , List < String > > listResult = znRecord . getListFields ( ) ; final Map < String , Map < String , String > > mapResult = getMapping ( listResult ) ; logger . info ( mapResult . toString ( ) ) ; logger . info ( listResult . toString ( ) ) ; getRunResult ( mapResult , listResult ) ; _currentMapping = mapResult ; } } } " 43,"public void runRepeatedly ( int numIterations ) { logger . info ( ""~~~~ Initial State ~~~~~"" ) ; RebalanceStrategy strategy = new AutoRebalanceStrategy ( RESOURCE_NAME , _partitions , _states , _maxPerNode ) ; ZNRecord initialResult = strategy . computePartitionAssignment ( _allNodes , _liveNodes , _currentMapping , null ) ; _currentMapping = getMapping ( initialResult . getListFields ( ) ) ; logger . info ( _currentMapping . toString ( ) ) ; getRunResult ( _currentMapping , initialResult . getListFields ( ) ) ; for ( int i = 0 ; i < numIterations ; i ++ ) { logger . info ( ""~~~~ Iteration "" + i + "" ~~~~~"" ) ; ZNRecord znRecord = runOnceRandomly ( ) ; if ( znRecord != null ) { final Map < String , List < String > > listResult = znRecord . getListFields ( ) ; final Map < String , Map < String , String > > mapResult = getMapping ( listResult ) ; logger . info ( listResult . toString ( ) ) ; getRunResult ( mapResult , listResult ) ; _currentMapping = mapResult ; } } } ","public void runRepeatedly ( int numIterations ) { logger . info ( ""~~~~ Initial State ~~~~~"" ) ; RebalanceStrategy strategy = new AutoRebalanceStrategy ( RESOURCE_NAME , _partitions , _states , _maxPerNode ) ; ZNRecord initialResult = strategy . computePartitionAssignment ( _allNodes , _liveNodes , _currentMapping , null ) ; _currentMapping = getMapping ( initialResult . getListFields ( ) ) ; logger . info ( _currentMapping . toString ( ) ) ; getRunResult ( _currentMapping , initialResult . getListFields ( ) ) ; for ( int i = 0 ; i < numIterations ; i ++ ) { logger . info ( ""~~~~ Iteration "" + i + "" ~~~~~"" ) ; ZNRecord znRecord = runOnceRandomly ( ) ; if ( znRecord != null ) { final Map < String , List < String > > listResult = znRecord . getListFields ( ) ; final Map < String , Map < String , String > > mapResult = getMapping ( listResult ) ; logger . info ( mapResult . toString ( ) ) ; logger . info ( listResult . toString ( ) ) ; getRunResult ( mapResult , listResult ) ; _currentMapping = mapResult ; } } } " 44,"public void runRepeatedly ( int numIterations ) { logger . info ( ""~~~~ Initial State ~~~~~"" ) ; RebalanceStrategy strategy = new AutoRebalanceStrategy ( RESOURCE_NAME , _partitions , _states , _maxPerNode ) ; ZNRecord initialResult = strategy . computePartitionAssignment ( _allNodes , _liveNodes , _currentMapping , null ) ; _currentMapping = getMapping ( initialResult . getListFields ( ) ) ; logger . info ( _currentMapping . toString ( ) ) ; getRunResult ( _currentMapping , initialResult . getListFields ( ) ) ; for ( int i = 0 ; i < numIterations ; i ++ ) { logger . info ( ""~~~~ Iteration "" + i + "" ~~~~~"" ) ; ZNRecord znRecord = runOnceRandomly ( ) ; if ( znRecord != null ) { final Map < String , List < String > > listResult = znRecord . getListFields ( ) ; final Map < String , Map < String , String > > mapResult = getMapping ( listResult ) ; logger . info ( mapResult . toString ( ) ) ; getRunResult ( mapResult , listResult ) ; _currentMapping = mapResult ; } } } ","public void runRepeatedly ( int numIterations ) { logger . info ( ""~~~~ Initial State ~~~~~"" ) ; RebalanceStrategy strategy = new AutoRebalanceStrategy ( RESOURCE_NAME , _partitions , _states , _maxPerNode ) ; ZNRecord initialResult = strategy . computePartitionAssignment ( _allNodes , _liveNodes , _currentMapping , null ) ; _currentMapping = getMapping ( initialResult . getListFields ( ) ) ; logger . info ( _currentMapping . toString ( ) ) ; getRunResult ( _currentMapping , initialResult . getListFields ( ) ) ; for ( int i = 0 ; i < numIterations ; i ++ ) { logger . info ( ""~~~~ Iteration "" + i + "" ~~~~~"" ) ; ZNRecord znRecord = runOnceRandomly ( ) ; if ( znRecord != null ) { final Map < String , List < String > > listResult = znRecord . getListFields ( ) ; final Map < String , Map < String , String > > mapResult = getMapping ( listResult ) ; logger . info ( mapResult . toString ( ) ) ; logger . info ( listResult . toString ( ) ) ; getRunResult ( mapResult , listResult ) ; _currentMapping = mapResult ; } } } " 45,"public List < Asset > findAll ( Long repositoryId , String path , Boolean deleted , Boolean virtual , Long branchId ) { Specification < Asset > assetSpecifications = distinct ( ifParamNotNull ( repositoryIdEquals ( repositoryId ) ) ) . and ( ifParamNotNull ( pathEquals ( path ) ) ) . and ( ifParamNotNull ( deletedEquals ( deleted ) ) ) . and ( ifParamNotNull ( virtualEquals ( virtual ) ) ) . and ( ifParamNotNull ( branchId ( branchId , deleted ) ) ) ; List < Asset > all = assetRepository . findAll ( assetSpecifications ) ; return all ; } ","public List < Asset > findAll ( Long repositoryId , String path , Boolean deleted , Boolean virtual , Long branchId ) { logger . debug ( ""Find all assets for repositoryId: {}, path: {}, deleted: {}, virtual: {}, branchId: {}"" , repositoryId , path , deleted , virtual , branchId ) ; Specification < Asset > assetSpecifications = distinct ( ifParamNotNull ( repositoryIdEquals ( repositoryId ) ) ) . and ( ifParamNotNull ( pathEquals ( path ) ) ) . and ( ifParamNotNull ( deletedEquals ( deleted ) ) ) . and ( ifParamNotNull ( virtualEquals ( virtual ) ) ) . and ( ifParamNotNull ( branchId ( branchId , deleted ) ) ) ; List < Asset > all = assetRepository . findAll ( assetSpecifications ) ; return all ; } " 46,"@ WebMethod @ POST @ Path ( ""/hash"" ) public ServiceResult getRoomHash ( @ WebParam ( name = ""sid"" ) @ QueryParam ( ""sid"" ) String sid , @ WebParam ( name = ""user"" ) @ FormParam ( ""user"" ) ExternalUserDTO user , @ WebParam ( name = ""options"" ) @ FormParam ( ""options"" ) RoomOptionsDTO options ) throws ServiceException { return performCall ( sid , User . Right . SOAP , sd -> { if ( Strings . isEmpty ( user . getExternalId ( ) ) || Strings . isEmpty ( user . getExternalType ( ) ) ) { return new ServiceResult ( ""externalId and/or externalType are not set"" , Type . ERROR ) ; } RemoteSessionObject remoteSessionObject = new RemoteSessionObject ( user ) ; String xmlString = remoteSessionObject . toString ( ) ; log . debug ( ""jsonString {}"" , xmlString ) ; String hash = soapDao . addSOAPLogin ( sid , options ) ; if ( hash != null ) { if ( options . isAllowSameURLMultipleTimes ( ) ) { sd . setPermanent ( true ) ; } sd . setXml ( xmlString ) ; sd = sessionDao . update ( sd ) ; return new ServiceResult ( hash , Type . SUCCESS ) ; } return UNKNOWN ; } ) ; } ","@ WebMethod @ POST @ Path ( ""/hash"" ) public ServiceResult getRoomHash ( @ WebParam ( name = ""sid"" ) @ QueryParam ( ""sid"" ) String sid , @ WebParam ( name = ""user"" ) @ FormParam ( ""user"" ) ExternalUserDTO user , @ WebParam ( name = ""options"" ) @ FormParam ( ""options"" ) RoomOptionsDTO options ) throws ServiceException { return performCall ( sid , User . Right . SOAP , sd -> { if ( Strings . isEmpty ( user . getExternalId ( ) ) || Strings . isEmpty ( user . getExternalType ( ) ) ) { return new ServiceResult ( ""externalId and/or externalType are not set"" , Type . ERROR ) ; } RemoteSessionObject remoteSessionObject = new RemoteSessionObject ( user ) ; log . debug ( remoteSessionObject . toString ( ) ) ; String xmlString = remoteSessionObject . toString ( ) ; log . debug ( ""jsonString {}"" , xmlString ) ; String hash = soapDao . addSOAPLogin ( sid , options ) ; if ( hash != null ) { if ( options . isAllowSameURLMultipleTimes ( ) ) { sd . setPermanent ( true ) ; } sd . setXml ( xmlString ) ; sd = sessionDao . update ( sd ) ; return new ServiceResult ( hash , Type . SUCCESS ) ; } return UNKNOWN ; } ) ; } " 47,"@ WebMethod @ POST @ Path ( ""/hash"" ) public ServiceResult getRoomHash ( @ WebParam ( name = ""sid"" ) @ QueryParam ( ""sid"" ) String sid , @ WebParam ( name = ""user"" ) @ FormParam ( ""user"" ) ExternalUserDTO user , @ WebParam ( name = ""options"" ) @ FormParam ( ""options"" ) RoomOptionsDTO options ) throws ServiceException { return performCall ( sid , User . Right . SOAP , sd -> { if ( Strings . isEmpty ( user . getExternalId ( ) ) || Strings . isEmpty ( user . getExternalType ( ) ) ) { return new ServiceResult ( ""externalId and/or externalType are not set"" , Type . ERROR ) ; } RemoteSessionObject remoteSessionObject = new RemoteSessionObject ( user ) ; log . debug ( remoteSessionObject . toString ( ) ) ; String xmlString = remoteSessionObject . toString ( ) ; String hash = soapDao . addSOAPLogin ( sid , options ) ; if ( hash != null ) { if ( options . isAllowSameURLMultipleTimes ( ) ) { sd . setPermanent ( true ) ; } sd . setXml ( xmlString ) ; sd = sessionDao . update ( sd ) ; return new ServiceResult ( hash , Type . SUCCESS ) ; } return UNKNOWN ; } ) ; } ","@ WebMethod @ POST @ Path ( ""/hash"" ) public ServiceResult getRoomHash ( @ WebParam ( name = ""sid"" ) @ QueryParam ( ""sid"" ) String sid , @ WebParam ( name = ""user"" ) @ FormParam ( ""user"" ) ExternalUserDTO user , @ WebParam ( name = ""options"" ) @ FormParam ( ""options"" ) RoomOptionsDTO options ) throws ServiceException { return performCall ( sid , User . Right . SOAP , sd -> { if ( Strings . isEmpty ( user . getExternalId ( ) ) || Strings . isEmpty ( user . getExternalType ( ) ) ) { return new ServiceResult ( ""externalId and/or externalType are not set"" , Type . ERROR ) ; } RemoteSessionObject remoteSessionObject = new RemoteSessionObject ( user ) ; log . debug ( remoteSessionObject . toString ( ) ) ; String xmlString = remoteSessionObject . toString ( ) ; log . debug ( ""jsonString {}"" , xmlString ) ; String hash = soapDao . addSOAPLogin ( sid , options ) ; if ( hash != null ) { if ( options . isAllowSameURLMultipleTimes ( ) ) { sd . setPermanent ( true ) ; } sd . setXml ( xmlString ) ; sd = sessionDao . update ( sd ) ; return new ServiceResult ( hash , Type . SUCCESS ) ; } return UNKNOWN ; } ) ; } " 48,"private void acquireLockAndWait ( ) { if ( context . getLock ( ) == null ) { Map < String , Pair < String , String > > exclusiveLocks = getExclusiveLocks ( ) ; if ( exclusiveLocks != null ) { EngineLock lock = new EngineLock ( exclusiveLocks , null ) ; lockManager . acquireLockWait ( lock ) ; context . withLock ( lock ) ; log . info ( ""Lock-wait acquired to object '{}'"" , lock ) ; } } } ","private void acquireLockAndWait ( ) { if ( context . getLock ( ) == null ) { Map < String , Pair < String , String > > exclusiveLocks = getExclusiveLocks ( ) ; if ( exclusiveLocks != null ) { EngineLock lock = new EngineLock ( exclusiveLocks , null ) ; log . info ( ""Before acquiring and wait lock '{}'"" , lock ) ; lockManager . acquireLockWait ( lock ) ; context . withLock ( lock ) ; log . info ( ""Lock-wait acquired to object '{}'"" , lock ) ; } } } " 49,"private void acquireLockAndWait ( ) { if ( context . getLock ( ) == null ) { Map < String , Pair < String , String > > exclusiveLocks = getExclusiveLocks ( ) ; if ( exclusiveLocks != null ) { EngineLock lock = new EngineLock ( exclusiveLocks , null ) ; log . info ( ""Before acquiring and wait lock '{}'"" , lock ) ; lockManager . acquireLockWait ( lock ) ; context . withLock ( lock ) ; } } } ","private void acquireLockAndWait ( ) { if ( context . getLock ( ) == null ) { Map < String , Pair < String , String > > exclusiveLocks = getExclusiveLocks ( ) ; if ( exclusiveLocks != null ) { EngineLock lock = new EngineLock ( exclusiveLocks , null ) ; log . info ( ""Before acquiring and wait lock '{}'"" , lock ) ; lockManager . acquireLockWait ( lock ) ; context . withLock ( lock ) ; log . info ( ""Lock-wait acquired to object '{}'"" , lock ) ; } } } " 50,"public RequestResponse updateManagementContract ( VitamContext vitamContext , String id , JsonNode queryDsl ) throws AccessExternalClientException { VitamRequestBuilder request = put ( ) . withPath ( UPDATE_MANAGEMENT_CONTRACT + id ) . withHeaders ( vitamContext . getHeaders ( ) ) . withBody ( queryDsl ) . withJson ( ) ; try ( Response response = make ( request ) ) { check ( response ) ; return RequestResponse . parseFromResponse ( response ) ; } catch ( VitamClientInternalException e ) { throw new AccessExternalClientException ( e ) ; } catch ( AdminExternalClientException e ) { return e . getVitamError ( ) ; } } ","public RequestResponse updateManagementContract ( VitamContext vitamContext , String id , JsonNode queryDsl ) throws AccessExternalClientException { VitamRequestBuilder request = put ( ) . withPath ( UPDATE_MANAGEMENT_CONTRACT + id ) . withHeaders ( vitamContext . getHeaders ( ) ) . withBody ( queryDsl ) . withJson ( ) ; try ( Response response = make ( request ) ) { check ( response ) ; return RequestResponse . parseFromResponse ( response ) ; } catch ( VitamClientInternalException e ) { throw new AccessExternalClientException ( e ) ; } catch ( AdminExternalClientException e ) { LOGGER . error ( e ) ; return e . getVitamError ( ) ; } } " 51,"public void run ( ) { try { for ( LatencyAwareHClientPool pool : allPools ) { pool . clear ( ) ; } } catch ( Exception e ) { } } ","public void run ( ) { try { for ( LatencyAwareHClientPool pool : allPools ) { pool . clear ( ) ; } } catch ( Exception e ) { log . info ( ""exceotuib reseting stats"" , e ) ; } } " 52,"private void writeExtensions ( CertificatePair pair ) { appendBytes ( pair . getExtensions ( ) . getValue ( ) ) ; } ","private void writeExtensions ( CertificatePair pair ) { appendBytes ( pair . getExtensions ( ) . getValue ( ) ) ; LOGGER . debug ( ""Extensions: "" + ArrayConverter . bytesToHexString ( pair . getExtensions ( ) . getValue ( ) ) ) ; } " 53,"public void deactivateVfModule ( BuildingBlockExecution execution ) { try { GeneralBuildingBlock gBBInput = execution . getGeneralBuildingBlock ( ) ; RequestContext requestContext = gBBInput . getRequestContext ( ) ; ServiceInstance serviceInstance = extractPojosForBB . extractByKey ( execution , ResourceKey . SERVICE_INSTANCE_ID ) ; GenericVnf vnf = extractPojosForBB . extractByKey ( execution , ResourceKey . GENERIC_VNF_ID ) ; VfModule vfModule = extractPojosForBB . extractByKey ( execution , ResourceKey . VF_MODULE_ID ) ; Customer customer = gBBInput . getCustomer ( ) ; CloudRegion cloudRegion = gBBInput . getCloudRegion ( ) ; SDNCRequest sdncRequest = new SDNCRequest ( ) ; GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources . deactivateVfModule ( vfModule , vnf , serviceInstance , customer , cloudRegion , requestContext , buildCallbackURI ( sdncRequest ) ) ; sdncRequest . setSDNCPayload ( req ) ; sdncRequest . setTopology ( SDNCTopology . VFMODULE ) ; execution . setVariable ( SDNC_REQUEST , sdncRequest ) ; } catch ( Exception ex ) { exceptionUtil . buildAndThrowWorkflowException ( execution , 7000 , ex ) ; } } ","public void deactivateVfModule ( BuildingBlockExecution execution ) { try { GeneralBuildingBlock gBBInput = execution . getGeneralBuildingBlock ( ) ; RequestContext requestContext = gBBInput . getRequestContext ( ) ; ServiceInstance serviceInstance = extractPojosForBB . extractByKey ( execution , ResourceKey . SERVICE_INSTANCE_ID ) ; GenericVnf vnf = extractPojosForBB . extractByKey ( execution , ResourceKey . GENERIC_VNF_ID ) ; VfModule vfModule = extractPojosForBB . extractByKey ( execution , ResourceKey . VF_MODULE_ID ) ; Customer customer = gBBInput . getCustomer ( ) ; CloudRegion cloudRegion = gBBInput . getCloudRegion ( ) ; SDNCRequest sdncRequest = new SDNCRequest ( ) ; GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources . deactivateVfModule ( vfModule , vnf , serviceInstance , customer , cloudRegion , requestContext , buildCallbackURI ( sdncRequest ) ) ; sdncRequest . setSDNCPayload ( req ) ; sdncRequest . setTopology ( SDNCTopology . VFMODULE ) ; execution . setVariable ( SDNC_REQUEST , sdncRequest ) ; } catch ( Exception ex ) { logger . error ( ""Exception occurred in SDNCDeactivateTasks deactivateVfModule"" , ex ) ; exceptionUtil . buildAndThrowWorkflowException ( execution , 7000 , ex ) ; } } " 54,"void reorderPolicyEvaluators ( ) { if ( LOG . isDebugEnabled ( ) ) { } if ( policyResourceTrie == null ) { policyEvaluators = getReorderedPolicyEvaluators ( policyEvaluators ) ; } if ( dataMaskResourceTrie == null ) { dataMaskPolicyEvaluators = getReorderedPolicyEvaluators ( dataMaskPolicyEvaluators ) ; } if ( rowFilterResourceTrie == null ) { rowFilterPolicyEvaluators = getReorderedPolicyEvaluators ( rowFilterPolicyEvaluators ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""<== reorderEvaluators()"" ) ; } } ","void reorderPolicyEvaluators ( ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""==> reorderEvaluators()"" ) ; } if ( policyResourceTrie == null ) { policyEvaluators = getReorderedPolicyEvaluators ( policyEvaluators ) ; } if ( dataMaskResourceTrie == null ) { dataMaskPolicyEvaluators = getReorderedPolicyEvaluators ( dataMaskPolicyEvaluators ) ; } if ( rowFilterResourceTrie == null ) { rowFilterPolicyEvaluators = getReorderedPolicyEvaluators ( rowFilterPolicyEvaluators ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""<== reorderEvaluators()"" ) ; } } " 55,"void reorderPolicyEvaluators ( ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""==> reorderEvaluators()"" ) ; } if ( policyResourceTrie == null ) { policyEvaluators = getReorderedPolicyEvaluators ( policyEvaluators ) ; } if ( dataMaskResourceTrie == null ) { dataMaskPolicyEvaluators = getReorderedPolicyEvaluators ( dataMaskPolicyEvaluators ) ; } if ( rowFilterResourceTrie == null ) { rowFilterPolicyEvaluators = getReorderedPolicyEvaluators ( rowFilterPolicyEvaluators ) ; } if ( LOG . isDebugEnabled ( ) ) { } } ","void reorderPolicyEvaluators ( ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""==> reorderEvaluators()"" ) ; } if ( policyResourceTrie == null ) { policyEvaluators = getReorderedPolicyEvaluators ( policyEvaluators ) ; } if ( dataMaskResourceTrie == null ) { dataMaskPolicyEvaluators = getReorderedPolicyEvaluators ( dataMaskPolicyEvaluators ) ; } if ( rowFilterResourceTrie == null ) { rowFilterPolicyEvaluators = getReorderedPolicyEvaluators ( rowFilterPolicyEvaluators ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""<== reorderEvaluators()"" ) ; } } " 56,"public static < K , V > ICacheElement < K , V > getDeSerializedCacheElement ( final ICacheElementSerialized < K , V > serialized , final IElementSerializer elementSerializer ) throws IOException , ClassNotFoundException { if ( serialized == null ) { return null ; } V deSerializedValue = null ; if ( elementSerializer == null ) { throw new IOException ( ""Could not de-serialize object. The ElementSerializer is null."" ) ; } try { deSerializedValue = elementSerializer . deSerialize ( serialized . getSerializedValue ( ) , null ) ; } catch ( final ClassNotFoundException | IOException e ) { throw e ; } final ICacheElement < K , V > deSerialized = new CacheElement < > ( serialized . getCacheName ( ) , serialized . getKey ( ) , deSerializedValue ) ; deSerialized . setElementAttributes ( serialized . getElementAttributes ( ) ) ; return deSerialized ; } ","public static < K , V > ICacheElement < K , V > getDeSerializedCacheElement ( final ICacheElementSerialized < K , V > serialized , final IElementSerializer elementSerializer ) throws IOException , ClassNotFoundException { if ( serialized == null ) { return null ; } V deSerializedValue = null ; if ( elementSerializer == null ) { throw new IOException ( ""Could not de-serialize object. The ElementSerializer is null."" ) ; } try { deSerializedValue = elementSerializer . deSerialize ( serialized . getSerializedValue ( ) , null ) ; } catch ( final ClassNotFoundException | IOException e ) { log . error ( ""Problem de-serializing object."" , e ) ; throw e ; } final ICacheElement < K , V > deSerialized = new CacheElement < > ( serialized . getCacheName ( ) , serialized . getKey ( ) , deSerializedValue ) ; deSerialized . setElementAttributes ( serialized . getElementAttributes ( ) ) ; return deSerialized ; } " 57,"public void entryModified ( ModifyOperationContext modifyContext ) { List < Modification > mods = modifyContext . getModItems ( ) ; synchronized ( this ) { for ( Modification m : mods ) { try { Attribute at = m . getAttribute ( ) ; if ( at . isInstanceOf ( replLogMaxIdleAT ) ) { ReplicaEventLog log = getEventLog ( modifyContext ) ; if ( log != null ) { int maxIdlePeriod = Integer . parseInt ( m . getAttribute ( ) . getString ( ) ) ; log . setMaxIdlePeriod ( maxIdlePeriod ) ; } } else if ( at . isInstanceOf ( replLogPurgeThresholdCountAT ) ) { ReplicaEventLog log = getEventLog ( modifyContext ) ; if ( log != null ) { int purgeThreshold = Integer . parseInt ( m . getAttribute ( ) . getString ( ) ) ; log . setPurgeThresholdCount ( purgeThreshold ) ; } } } catch ( LdapInvalidAttributeValueException e ) { } } } } ","public void entryModified ( ModifyOperationContext modifyContext ) { List < Modification > mods = modifyContext . getModItems ( ) ; synchronized ( this ) { for ( Modification m : mods ) { try { Attribute at = m . getAttribute ( ) ; if ( at . isInstanceOf ( replLogMaxIdleAT ) ) { ReplicaEventLog log = getEventLog ( modifyContext ) ; if ( log != null ) { int maxIdlePeriod = Integer . parseInt ( m . getAttribute ( ) . getString ( ) ) ; log . setMaxIdlePeriod ( maxIdlePeriod ) ; } } else if ( at . isInstanceOf ( replLogPurgeThresholdCountAT ) ) { ReplicaEventLog log = getEventLog ( modifyContext ) ; if ( log != null ) { int purgeThreshold = Integer . parseInt ( m . getAttribute ( ) . getString ( ) ) ; log . setPurgeThresholdCount ( purgeThreshold ) ; } } } catch ( LdapInvalidAttributeValueException e ) { PROVIDER_LOG . warn ( ""Invalid attribute type"" , e ) ; } } } } " 58,"public void close ( ) { running . set ( false ) ; receiver . interrupt ( ) ; connection . close ( ) ; } ","public void close ( ) { LOG . debug ( ""thread {}: connection stop"" , Thread . currentThread ( ) . getId ( ) ) ; running . set ( false ) ; receiver . interrupt ( ) ; connection . close ( ) ; } " 59,"@ Test public void testDb2TableCreation ( ) { FhirSchemaGenerator gen = new FhirSchemaGenerator ( ADMIN_SCHEMA_NAME , SCHEMA_NAME , false ) ; PhysicalDataModel model = new PhysicalDataModel ( ) ; gen . buildSchema ( model ) ; PrintTarget tgt = new PrintTarget ( null , logger . isLoggable ( Level . FINE ) ) ; Db2Adapter adapter = new Db2Adapter ( tgt ) ; model . apply ( adapter ) ; } ","@ Test public void testDb2TableCreation ( ) { logger . info ( ""Testing DB2 schema creation"" ) ; FhirSchemaGenerator gen = new FhirSchemaGenerator ( ADMIN_SCHEMA_NAME , SCHEMA_NAME , false ) ; PhysicalDataModel model = new PhysicalDataModel ( ) ; gen . buildSchema ( model ) ; PrintTarget tgt = new PrintTarget ( null , logger . isLoggable ( Level . FINE ) ) ; Db2Adapter adapter = new Db2Adapter ( tgt ) ; model . apply ( adapter ) ; } " 60,"public void startApplication ( String applicationName ) { delegate . startApplication ( applicationName ) ; } ","public void startApplication ( String applicationName ) { logger . debug ( Messages . STARTING_APPLICATION_0 , applicationName ) ; delegate . startApplication ( applicationName ) ; } " 61,"@ Path ( ""/getAllShouldSucceed"" ) @ POST public void getAllShouldSucceed ( ) { String uri = String . format ( URI_FORMAT , OpenstackConstants . GET_ALL ) ; Network [ ] networks = template . requestBody ( uri , null , Network [ ] . class ) ; assertNotNull ( networks ) ; assertEquals ( 1 , networks . length ) ; assertEquals ( NETWORK_NAME , networks [ 0 ] . getName ( ) ) ; assertNotNull ( networks [ 0 ] . getSubnets ( ) ) ; assertEquals ( 1 , networks [ 0 ] . getSubnets ( ) . size ( ) ) ; assertEquals ( ""0c4faf33-8c23-4dc9-8bf5-30dd1ab452f9"" , networks [ 0 ] . getSubnets ( ) . get ( 0 ) ) ; assertEquals ( ""73f6f1ac-5e58-4801-88c3-7e12c6ddfb39"" , networks [ 0 ] . getId ( ) ) ; assertEquals ( NetworkType . VXLAN , networks [ 0 ] . getNetworkType ( ) ) ; } ","@ Path ( ""/getAllShouldSucceed"" ) @ POST public void getAllShouldSucceed ( ) { LOG . debug ( ""Calling OpenstackNeutronNetworkResource.getAllShouldSucceed()"" ) ; String uri = String . format ( URI_FORMAT , OpenstackConstants . GET_ALL ) ; Network [ ] networks = template . requestBody ( uri , null , Network [ ] . class ) ; assertNotNull ( networks ) ; assertEquals ( 1 , networks . length ) ; assertEquals ( NETWORK_NAME , networks [ 0 ] . getName ( ) ) ; assertNotNull ( networks [ 0 ] . getSubnets ( ) ) ; assertEquals ( 1 , networks [ 0 ] . getSubnets ( ) . size ( ) ) ; assertEquals ( ""0c4faf33-8c23-4dc9-8bf5-30dd1ab452f9"" , networks [ 0 ] . getSubnets ( ) . get ( 0 ) ) ; assertEquals ( ""73f6f1ac-5e58-4801-88c3-7e12c6ddfb39"" , networks [ 0 ] . getId ( ) ) ; assertEquals ( NetworkType . VXLAN , networks [ 0 ] . getNetworkType ( ) ) ; } " 62,"@ SuppressFBWarnings ( ""DM_EXIT"" ) public static void main ( String [ ] args ) { final SplashScreen splash = SplashScreen . getSplashScreen ( ) ; if ( splash != null ) { splash . createGraphics ( ) ; splash . update ( ) ; } int code ; long lastLaunch = 0L ; do { code = new Launch ( ) . run ( ) ; if ( System . currentTimeMillis ( ) - lastLaunch < RELAUNCH_EXCLUSION_WINDOW_MILLIS ) { break ; } else if ( code == 2 ) { LOGGER . info ( ""User requested restart."" ) ; } else { if ( code != 0 ) { logErrorFile ( ) ; } if ( code != 0 && ourRestart ) { LOGGER . info ( ""Unexpected exit. Restarting..."" ) ; } else { LOGGER . info ( ""Exiting with status "" + code ) ; break ; } } lastLaunch = System . currentTimeMillis ( ) ; } while ( true ) ; System . exit ( code ) ; } ","@ SuppressFBWarnings ( ""DM_EXIT"" ) public static void main ( String [ ] args ) { final SplashScreen splash = SplashScreen . getSplashScreen ( ) ; if ( splash != null ) { splash . createGraphics ( ) ; splash . update ( ) ; } int code ; long lastLaunch = 0L ; do { code = new Launch ( ) . run ( ) ; if ( System . currentTimeMillis ( ) - lastLaunch < RELAUNCH_EXCLUSION_WINDOW_MILLIS ) { LOGGER . info ( ""Encountered a subsequent failure. Giving up."" ) ; break ; } else if ( code == 2 ) { LOGGER . info ( ""User requested restart."" ) ; } else { if ( code != 0 ) { logErrorFile ( ) ; } if ( code != 0 && ourRestart ) { LOGGER . info ( ""Unexpected exit. Restarting..."" ) ; } else { LOGGER . info ( ""Exiting with status "" + code ) ; break ; } } lastLaunch = System . currentTimeMillis ( ) ; } while ( true ) ; System . exit ( code ) ; } " 63,"@ SuppressFBWarnings ( ""DM_EXIT"" ) public static void main ( String [ ] args ) { final SplashScreen splash = SplashScreen . getSplashScreen ( ) ; if ( splash != null ) { splash . createGraphics ( ) ; splash . update ( ) ; } int code ; long lastLaunch = 0L ; do { code = new Launch ( ) . run ( ) ; if ( System . currentTimeMillis ( ) - lastLaunch < RELAUNCH_EXCLUSION_WINDOW_MILLIS ) { LOGGER . info ( ""Encountered a subsequent failure. Giving up."" ) ; break ; } else if ( code == 2 ) { } else { if ( code != 0 ) { logErrorFile ( ) ; } if ( code != 0 && ourRestart ) { LOGGER . info ( ""Unexpected exit. Restarting..."" ) ; } else { LOGGER . info ( ""Exiting with status "" + code ) ; break ; } } lastLaunch = System . currentTimeMillis ( ) ; } while ( true ) ; System . exit ( code ) ; } ","@ SuppressFBWarnings ( ""DM_EXIT"" ) public static void main ( String [ ] args ) { final SplashScreen splash = SplashScreen . getSplashScreen ( ) ; if ( splash != null ) { splash . createGraphics ( ) ; splash . update ( ) ; } int code ; long lastLaunch = 0L ; do { code = new Launch ( ) . run ( ) ; if ( System . currentTimeMillis ( ) - lastLaunch < RELAUNCH_EXCLUSION_WINDOW_MILLIS ) { LOGGER . info ( ""Encountered a subsequent failure. Giving up."" ) ; break ; } else if ( code == 2 ) { LOGGER . info ( ""User requested restart."" ) ; } else { if ( code != 0 ) { logErrorFile ( ) ; } if ( code != 0 && ourRestart ) { LOGGER . info ( ""Unexpected exit. Restarting..."" ) ; } else { LOGGER . info ( ""Exiting with status "" + code ) ; break ; } } lastLaunch = System . currentTimeMillis ( ) ; } while ( true ) ; System . exit ( code ) ; } " 64,"@ SuppressFBWarnings ( ""DM_EXIT"" ) public static void main ( String [ ] args ) { final SplashScreen splash = SplashScreen . getSplashScreen ( ) ; if ( splash != null ) { splash . createGraphics ( ) ; splash . update ( ) ; } int code ; long lastLaunch = 0L ; do { code = new Launch ( ) . run ( ) ; if ( System . currentTimeMillis ( ) - lastLaunch < RELAUNCH_EXCLUSION_WINDOW_MILLIS ) { LOGGER . info ( ""Encountered a subsequent failure. Giving up."" ) ; break ; } else if ( code == 2 ) { LOGGER . info ( ""User requested restart."" ) ; } else { if ( code != 0 ) { logErrorFile ( ) ; } if ( code != 0 && ourRestart ) { } else { LOGGER . info ( ""Exiting with status "" + code ) ; break ; } } lastLaunch = System . currentTimeMillis ( ) ; } while ( true ) ; System . exit ( code ) ; } ","@ SuppressFBWarnings ( ""DM_EXIT"" ) public static void main ( String [ ] args ) { final SplashScreen splash = SplashScreen . getSplashScreen ( ) ; if ( splash != null ) { splash . createGraphics ( ) ; splash . update ( ) ; } int code ; long lastLaunch = 0L ; do { code = new Launch ( ) . run ( ) ; if ( System . currentTimeMillis ( ) - lastLaunch < RELAUNCH_EXCLUSION_WINDOW_MILLIS ) { LOGGER . info ( ""Encountered a subsequent failure. Giving up."" ) ; break ; } else if ( code == 2 ) { LOGGER . info ( ""User requested restart."" ) ; } else { if ( code != 0 ) { logErrorFile ( ) ; } if ( code != 0 && ourRestart ) { LOGGER . info ( ""Unexpected exit. Restarting..."" ) ; } else { LOGGER . info ( ""Exiting with status "" + code ) ; break ; } } lastLaunch = System . currentTimeMillis ( ) ; } while ( true ) ; System . exit ( code ) ; } " 65,"@ SuppressFBWarnings ( ""DM_EXIT"" ) public static void main ( String [ ] args ) { final SplashScreen splash = SplashScreen . getSplashScreen ( ) ; if ( splash != null ) { splash . createGraphics ( ) ; splash . update ( ) ; } int code ; long lastLaunch = 0L ; do { code = new Launch ( ) . run ( ) ; if ( System . currentTimeMillis ( ) - lastLaunch < RELAUNCH_EXCLUSION_WINDOW_MILLIS ) { LOGGER . info ( ""Encountered a subsequent failure. Giving up."" ) ; break ; } else if ( code == 2 ) { LOGGER . info ( ""User requested restart."" ) ; } else { if ( code != 0 ) { logErrorFile ( ) ; } if ( code != 0 && ourRestart ) { LOGGER . info ( ""Unexpected exit. Restarting..."" ) ; } else { break ; } } lastLaunch = System . currentTimeMillis ( ) ; } while ( true ) ; System . exit ( code ) ; } ","@ SuppressFBWarnings ( ""DM_EXIT"" ) public static void main ( String [ ] args ) { final SplashScreen splash = SplashScreen . getSplashScreen ( ) ; if ( splash != null ) { splash . createGraphics ( ) ; splash . update ( ) ; } int code ; long lastLaunch = 0L ; do { code = new Launch ( ) . run ( ) ; if ( System . currentTimeMillis ( ) - lastLaunch < RELAUNCH_EXCLUSION_WINDOW_MILLIS ) { LOGGER . info ( ""Encountered a subsequent failure. Giving up."" ) ; break ; } else if ( code == 2 ) { LOGGER . info ( ""User requested restart."" ) ; } else { if ( code != 0 ) { logErrorFile ( ) ; } if ( code != 0 && ourRestart ) { LOGGER . info ( ""Unexpected exit. Restarting..."" ) ; } else { LOGGER . info ( ""Exiting with status "" + code ) ; break ; } } lastLaunch = System . currentTimeMillis ( ) ; } while ( true ) ; System . exit ( code ) ; } " 66,"public JainMgcpResponseEvent decodeResponse ( byte [ ] data , SplitDetails [ ] msg , Integer txID , ReturnCode returnCode ) throws ParseException { response = new NotificationRequestResponse ( source != null ? source : stack , returnCode ) ; response . setTransactionHandle ( txID ) ; try { ( new ResponseContentHandle ( ) ) . parse ( data , msg ) ; } catch ( IOException e ) { } return response ; } ","public JainMgcpResponseEvent decodeResponse ( byte [ ] data , SplitDetails [ ] msg , Integer txID , ReturnCode returnCode ) throws ParseException { response = new NotificationRequestResponse ( source != null ? source : stack , returnCode ) ; response . setTransactionHandle ( txID ) ; try { ( new ResponseContentHandle ( ) ) . parse ( data , msg ) ; } catch ( IOException e ) { logger . error ( ""Decode RQNT Response failed"" , e ) ; } return response ; } " 67,"public void kinit ( String user ) throws Exception { UserGroupInformation . loginUserFromKeytab ( user , KEYTAB_LOCATION + ""/"" + user + "".keytab"" ) ; } ","public void kinit ( String user ) throws Exception { UserGroupInformation . loginUserFromKeytab ( user , KEYTAB_LOCATION + ""/"" + user + "".keytab"" ) ; LOGGER . info ( ""Kinited user: "" + user + "" keytab: "" + KEYTAB_LOCATION + ""/"" + user + "".keytab"" ) ; } " 68,"public void onError ( SubscriptionException error ) { subscribeBroadcastWithSingleStructParameterCallbackResult = false ; subscribeBroadcastWithSingleStructParameterCallbackDone = true ; } ","public void onError ( SubscriptionException error ) { logger . info ( name . getMethodName ( ) + "" - callback - error"" ) ; subscribeBroadcastWithSingleStructParameterCallbackResult = false ; subscribeBroadcastWithSingleStructParameterCallbackDone = true ; } " 69,"private void changeTrackPosition ( long positionOffsetInMs ) throws SpeakerException { long currentPosition = speaker . getPlayState ( ) . getPositionInMs ( ) ; speaker . setPosition ( currentPosition + positionOffsetInMs ) ; } ","private void changeTrackPosition ( long positionOffsetInMs ) throws SpeakerException { long currentPosition = speaker . getPlayState ( ) . getPositionInMs ( ) ; logger . debug ( ""Jumping from old track position {} ms to new position {} ms"" , currentPosition , currentPosition + positionOffsetInMs ) ; speaker . setPosition ( currentPosition + positionOffsetInMs ) ; } " 70,"private void createUnusedTextFieldMaster ( HashSet < String > usedFunctions ) { UnoDictionary < XComponent > masters = UnoDictionary . create ( UNO . XTextFieldsSupplier ( model . doc ) . getTextFieldMasters ( ) , XComponent . class ) ; String prefix = ""com.sun.star.text.FieldMaster.User."" ; for ( Entry < String , XComponent > master : masters . entrySet ( ) ) { if ( master == null || ! master . getKey ( ) . startsWith ( prefix ) ) { continue ; } String varName = master . getKey ( ) . substring ( prefix . length ( ) ) ; String trafoName = TextDocumentModel . getFunctionNameForUserFieldName ( varName ) ; if ( trafoName != null && ! usedFunctions . contains ( trafoName ) ) { try { master . getValue ( ) . dispose ( ) ; } catch ( java . lang . Exception e ) { } } } } ","private void createUnusedTextFieldMaster ( HashSet < String > usedFunctions ) { UnoDictionary < XComponent > masters = UnoDictionary . create ( UNO . XTextFieldsSupplier ( model . doc ) . getTextFieldMasters ( ) , XComponent . class ) ; String prefix = ""com.sun.star.text.FieldMaster.User."" ; for ( Entry < String , XComponent > master : masters . entrySet ( ) ) { if ( master == null || ! master . getKey ( ) . startsWith ( prefix ) ) { continue ; } String varName = master . getKey ( ) . substring ( prefix . length ( ) ) ; String trafoName = TextDocumentModel . getFunctionNameForUserFieldName ( varName ) ; if ( trafoName != null && ! usedFunctions . contains ( trafoName ) ) { try { master . getValue ( ) . dispose ( ) ; } catch ( java . lang . Exception e ) { LOGGER . error ( """" , e ) ; } } } } " 71,"private RegistryConfig readRegConfig ( String parentAppName , String artifactName ) { RegistryConfig regConfig = null ; try { CarbonAppPersistenceManager capm = new CarbonAppPersistenceManager ( getAxisConfig ( ) ) ; regConfig = capm . loadRegistryConfig ( AppDeployerConstants . APPLICATIONS + parentAppName + AppDeployerConstants . APP_DEPENDENCIES + artifactName ) ; } catch ( Exception e ) { } return regConfig ; } ","private RegistryConfig readRegConfig ( String parentAppName , String artifactName ) { RegistryConfig regConfig = null ; try { CarbonAppPersistenceManager capm = new CarbonAppPersistenceManager ( getAxisConfig ( ) ) ; regConfig = capm . loadRegistryConfig ( AppDeployerConstants . APPLICATIONS + parentAppName + AppDeployerConstants . APP_DEPENDENCIES + artifactName ) ; } catch ( Exception e ) { log . error ( ""Error while trying to load registry config for C-App : "" + parentAppName + "" artifact : "" + artifactName , e ) ; } return regConfig ; } " 72,"protected CheckSshAnswer execute ( CheckSshCommand cmd ) { String vmName = cmd . getName ( ) ; String privateIp = cmd . getIp ( ) ; int cmdPort = cmd . getPort ( ) ; if ( s_logger . isDebugEnabled ( ) ) { } try { String result = connect ( cmd . getName ( ) , privateIp , cmdPort ) ; if ( result != null ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; return new CheckSshAnswer ( cmd , ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; } } catch ( Exception e ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to exception"" ) ; return new CheckSshAnswer ( cmd , e ) ; } if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port succeeded for vm "" + vmName ) ; } if ( VirtualMachineName . isValidRouterName ( vmName ) ) { if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Execute network usage setup command on "" + vmName ) ; } networkUsage ( privateIp , ""create"" , null ) ; } return new CheckSshAnswer ( cmd ) ; } ","protected CheckSshAnswer execute ( CheckSshCommand cmd ) { String vmName = cmd . getName ( ) ; String privateIp = cmd . getIp ( ) ; int cmdPort = cmd . getPort ( ) ; if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port, "" + privateIp + "":"" + cmdPort ) ; } try { String result = connect ( cmd . getName ( ) , privateIp , cmdPort ) ; if ( result != null ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; return new CheckSshAnswer ( cmd , ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; } } catch ( Exception e ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to exception"" ) ; return new CheckSshAnswer ( cmd , e ) ; } if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port succeeded for vm "" + vmName ) ; } if ( VirtualMachineName . isValidRouterName ( vmName ) ) { if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Execute network usage setup command on "" + vmName ) ; } networkUsage ( privateIp , ""create"" , null ) ; } return new CheckSshAnswer ( cmd ) ; } " 73,"protected CheckSshAnswer execute ( CheckSshCommand cmd ) { String vmName = cmd . getName ( ) ; String privateIp = cmd . getIp ( ) ; int cmdPort = cmd . getPort ( ) ; if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port, "" + privateIp + "":"" + cmdPort ) ; } try { String result = connect ( cmd . getName ( ) , privateIp , cmdPort ) ; if ( result != null ) { return new CheckSshAnswer ( cmd , ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; } } catch ( Exception e ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to exception"" ) ; return new CheckSshAnswer ( cmd , e ) ; } if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port succeeded for vm "" + vmName ) ; } if ( VirtualMachineName . isValidRouterName ( vmName ) ) { if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Execute network usage setup command on "" + vmName ) ; } networkUsage ( privateIp , ""create"" , null ) ; } return new CheckSshAnswer ( cmd ) ; } ","protected CheckSshAnswer execute ( CheckSshCommand cmd ) { String vmName = cmd . getName ( ) ; String privateIp = cmd . getIp ( ) ; int cmdPort = cmd . getPort ( ) ; if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port, "" + privateIp + "":"" + cmdPort ) ; } try { String result = connect ( cmd . getName ( ) , privateIp , cmdPort ) ; if ( result != null ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; return new CheckSshAnswer ( cmd , ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; } } catch ( Exception e ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to exception"" ) ; return new CheckSshAnswer ( cmd , e ) ; } if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port succeeded for vm "" + vmName ) ; } if ( VirtualMachineName . isValidRouterName ( vmName ) ) { if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Execute network usage setup command on "" + vmName ) ; } networkUsage ( privateIp , ""create"" , null ) ; } return new CheckSshAnswer ( cmd ) ; } " 74,"protected CheckSshAnswer execute ( CheckSshCommand cmd ) { String vmName = cmd . getName ( ) ; String privateIp = cmd . getIp ( ) ; int cmdPort = cmd . getPort ( ) ; if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port, "" + privateIp + "":"" + cmdPort ) ; } try { String result = connect ( cmd . getName ( ) , privateIp , cmdPort ) ; if ( result != null ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; return new CheckSshAnswer ( cmd , ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; } } catch ( Exception e ) { return new CheckSshAnswer ( cmd , e ) ; } if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port succeeded for vm "" + vmName ) ; } if ( VirtualMachineName . isValidRouterName ( vmName ) ) { if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Execute network usage setup command on "" + vmName ) ; } networkUsage ( privateIp , ""create"" , null ) ; } return new CheckSshAnswer ( cmd ) ; } ","protected CheckSshAnswer execute ( CheckSshCommand cmd ) { String vmName = cmd . getName ( ) ; String privateIp = cmd . getIp ( ) ; int cmdPort = cmd . getPort ( ) ; if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port, "" + privateIp + "":"" + cmdPort ) ; } try { String result = connect ( cmd . getName ( ) , privateIp , cmdPort ) ; if ( result != null ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; return new CheckSshAnswer ( cmd , ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; } } catch ( Exception e ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to exception"" ) ; return new CheckSshAnswer ( cmd , e ) ; } if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port succeeded for vm "" + vmName ) ; } if ( VirtualMachineName . isValidRouterName ( vmName ) ) { if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Execute network usage setup command on "" + vmName ) ; } networkUsage ( privateIp , ""create"" , null ) ; } return new CheckSshAnswer ( cmd ) ; } " 75,"protected CheckSshAnswer execute ( CheckSshCommand cmd ) { String vmName = cmd . getName ( ) ; String privateIp = cmd . getIp ( ) ; int cmdPort = cmd . getPort ( ) ; if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port, "" + privateIp + "":"" + cmdPort ) ; } try { String result = connect ( cmd . getName ( ) , privateIp , cmdPort ) ; if ( result != null ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; return new CheckSshAnswer ( cmd , ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; } } catch ( Exception e ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to exception"" ) ; return new CheckSshAnswer ( cmd , e ) ; } if ( s_logger . isDebugEnabled ( ) ) { } if ( VirtualMachineName . isValidRouterName ( vmName ) ) { if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Execute network usage setup command on "" + vmName ) ; } networkUsage ( privateIp , ""create"" , null ) ; } return new CheckSshAnswer ( cmd ) ; } ","protected CheckSshAnswer execute ( CheckSshCommand cmd ) { String vmName = cmd . getName ( ) ; String privateIp = cmd . getIp ( ) ; int cmdPort = cmd . getPort ( ) ; if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port, "" + privateIp + "":"" + cmdPort ) ; } try { String result = connect ( cmd . getName ( ) , privateIp , cmdPort ) ; if ( result != null ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; return new CheckSshAnswer ( cmd , ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; } } catch ( Exception e ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to exception"" ) ; return new CheckSshAnswer ( cmd , e ) ; } if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port succeeded for vm "" + vmName ) ; } if ( VirtualMachineName . isValidRouterName ( vmName ) ) { if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Execute network usage setup command on "" + vmName ) ; } networkUsage ( privateIp , ""create"" , null ) ; } return new CheckSshAnswer ( cmd ) ; } " 76,"protected CheckSshAnswer execute ( CheckSshCommand cmd ) { String vmName = cmd . getName ( ) ; String privateIp = cmd . getIp ( ) ; int cmdPort = cmd . getPort ( ) ; if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port, "" + privateIp + "":"" + cmdPort ) ; } try { String result = connect ( cmd . getName ( ) , privateIp , cmdPort ) ; if ( result != null ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; return new CheckSshAnswer ( cmd , ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; } } catch ( Exception e ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to exception"" ) ; return new CheckSshAnswer ( cmd , e ) ; } if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port succeeded for vm "" + vmName ) ; } if ( VirtualMachineName . isValidRouterName ( vmName ) ) { if ( s_logger . isDebugEnabled ( ) ) { } networkUsage ( privateIp , ""create"" , null ) ; } return new CheckSshAnswer ( cmd ) ; } ","protected CheckSshAnswer execute ( CheckSshCommand cmd ) { String vmName = cmd . getName ( ) ; String privateIp = cmd . getIp ( ) ; int cmdPort = cmd . getPort ( ) ; if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port, "" + privateIp + "":"" + cmdPort ) ; } try { String result = connect ( cmd . getName ( ) , privateIp , cmdPort ) ; if ( result != null ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; return new CheckSshAnswer ( cmd , ""Can not ping System vm "" + vmName + ""due to:"" + result ) ; } } catch ( Exception e ) { s_logger . error ( ""Can not ping System vm "" + vmName + ""due to exception"" ) ; return new CheckSshAnswer ( cmd , e ) ; } if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Ping command port succeeded for vm "" + vmName ) ; } if ( VirtualMachineName . isValidRouterName ( vmName ) ) { if ( s_logger . isDebugEnabled ( ) ) { s_logger . debug ( ""Execute network usage setup command on "" + vmName ) ; } networkUsage ( privateIp , ""create"" , null ) ; } return new CheckSshAnswer ( cmd ) ; } " 77,"public void actionPerformed ( ActionEvent event ) { Object o = event . getSource ( ) ; OpenCVFilterSURF sf = ( OpenCVFilterSURF ) boundFilter . filter ; if ( o == objectFilename ) { String val = ( ( JTextField ) o ) . getText ( ) ; sf . loadObjectImageFilename ( val ) ; } else { } } ","public void actionPerformed ( ActionEvent event ) { Object o = event . getSource ( ) ; OpenCVFilterSURF sf = ( OpenCVFilterSURF ) boundFilter . filter ; if ( o == objectFilename ) { String val = ( ( JTextField ) o ) . getText ( ) ; sf . loadObjectImageFilename ( val ) ; } else { log . warn ( ""Inknown object invoked in surf filter ui"" ) ; } } " 78,"public void close ( ) { try { data . close ( ) ; } catch ( Exception e ) { } try { writeTask . cancel ( true ) ; } catch ( Exception e ) { LOG . error ( ""cancelling write task failed"" , e ) ; } } ","public void close ( ) { try { data . close ( ) ; } catch ( Exception e ) { LOG . error ( ""closing piped input stream failed"" , e ) ; } try { writeTask . cancel ( true ) ; } catch ( Exception e ) { LOG . error ( ""cancelling write task failed"" , e ) ; } } " 79,"public void close ( ) { try { data . close ( ) ; } catch ( Exception e ) { LOG . error ( ""closing piped input stream failed"" , e ) ; } try { writeTask . cancel ( true ) ; } catch ( Exception e ) { } } ","public void close ( ) { try { data . close ( ) ; } catch ( Exception e ) { LOG . error ( ""closing piped input stream failed"" , e ) ; } try { writeTask . cancel ( true ) ; } catch ( Exception e ) { LOG . error ( ""cancelling write task failed"" , e ) ; } } " 80,"public void run ( ) { try { resetSnapshotStats ( ) ; lastFlushTime = Time . currentElapsedTime ( ) ; while ( true ) { ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_SIZE . add ( queuedRequests . size ( ) ) ; long pollTime = Math . min ( zks . getMaxWriteQueuePollTime ( ) , getRemainingDelay ( ) ) ; Request si = queuedRequests . poll ( pollTime , TimeUnit . MILLISECONDS ) ; if ( si == null ) { flush ( ) ; si = queuedRequests . take ( ) ; } if ( si == REQUEST_OF_DEATH ) { break ; } long startProcessTime = Time . currentElapsedTime ( ) ; ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_TIME . add ( startProcessTime - si . syncQueueStartTime ) ; if ( ! si . isThrottled ( ) && zks . getZKDatabase ( ) . append ( si ) ) { if ( shouldSnapshot ( ) ) { resetSnapshotStats ( ) ; zks . getZKDatabase ( ) . rollLog ( ) ; if ( ! snapThreadMutex . tryAcquire ( ) ) { } else { new ZooKeeperThread ( ""Snapshot Thread"" ) { public void run ( ) { try { zks . takeSnapshot ( ) ; } catch ( Exception e ) { LOG . warn ( ""Unexpected exception"" , e ) ; } finally { snapThreadMutex . release ( ) ; } } } . start ( ) ; } } } else if ( toFlush . isEmpty ( ) ) { if ( nextProcessor != null ) { nextProcessor . processRequest ( si ) ; if ( nextProcessor instanceof Flushable ) { ( ( Flushable ) nextProcessor ) . flush ( ) ; } } continue ; } toFlush . add ( si ) ; if ( shouldFlush ( ) ) { flush ( ) ; } ServerMetrics . getMetrics ( ) . SYNC_PROCESS_TIME . add ( Time . currentElapsedTime ( ) - startProcessTime ) ; } } catch ( Throwable t ) { handleException ( this . getName ( ) , t ) ; } LOG . info ( ""SyncRequestProcessor exited!"" ) ; } ","public void run ( ) { try { resetSnapshotStats ( ) ; lastFlushTime = Time . currentElapsedTime ( ) ; while ( true ) { ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_SIZE . add ( queuedRequests . size ( ) ) ; long pollTime = Math . min ( zks . getMaxWriteQueuePollTime ( ) , getRemainingDelay ( ) ) ; Request si = queuedRequests . poll ( pollTime , TimeUnit . MILLISECONDS ) ; if ( si == null ) { flush ( ) ; si = queuedRequests . take ( ) ; } if ( si == REQUEST_OF_DEATH ) { break ; } long startProcessTime = Time . currentElapsedTime ( ) ; ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_TIME . add ( startProcessTime - si . syncQueueStartTime ) ; if ( ! si . isThrottled ( ) && zks . getZKDatabase ( ) . append ( si ) ) { if ( shouldSnapshot ( ) ) { resetSnapshotStats ( ) ; zks . getZKDatabase ( ) . rollLog ( ) ; if ( ! snapThreadMutex . tryAcquire ( ) ) { LOG . warn ( ""Too busy to snap, skipping"" ) ; } else { new ZooKeeperThread ( ""Snapshot Thread"" ) { public void run ( ) { try { zks . takeSnapshot ( ) ; } catch ( Exception e ) { LOG . warn ( ""Unexpected exception"" , e ) ; } finally { snapThreadMutex . release ( ) ; } } } . start ( ) ; } } } else if ( toFlush . isEmpty ( ) ) { if ( nextProcessor != null ) { nextProcessor . processRequest ( si ) ; if ( nextProcessor instanceof Flushable ) { ( ( Flushable ) nextProcessor ) . flush ( ) ; } } continue ; } toFlush . add ( si ) ; if ( shouldFlush ( ) ) { flush ( ) ; } ServerMetrics . getMetrics ( ) . SYNC_PROCESS_TIME . add ( Time . currentElapsedTime ( ) - startProcessTime ) ; } } catch ( Throwable t ) { handleException ( this . getName ( ) , t ) ; } LOG . info ( ""SyncRequestProcessor exited!"" ) ; } " 81,"public void run ( ) { try { resetSnapshotStats ( ) ; lastFlushTime = Time . currentElapsedTime ( ) ; while ( true ) { ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_SIZE . add ( queuedRequests . size ( ) ) ; long pollTime = Math . min ( zks . getMaxWriteQueuePollTime ( ) , getRemainingDelay ( ) ) ; Request si = queuedRequests . poll ( pollTime , TimeUnit . MILLISECONDS ) ; if ( si == null ) { flush ( ) ; si = queuedRequests . take ( ) ; } if ( si == REQUEST_OF_DEATH ) { break ; } long startProcessTime = Time . currentElapsedTime ( ) ; ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_TIME . add ( startProcessTime - si . syncQueueStartTime ) ; if ( ! si . isThrottled ( ) && zks . getZKDatabase ( ) . append ( si ) ) { if ( shouldSnapshot ( ) ) { resetSnapshotStats ( ) ; zks . getZKDatabase ( ) . rollLog ( ) ; if ( ! snapThreadMutex . tryAcquire ( ) ) { LOG . warn ( ""Too busy to snap, skipping"" ) ; } else { new ZooKeeperThread ( ""Snapshot Thread"" ) { public void run ( ) { try { zks . takeSnapshot ( ) ; } catch ( Exception e ) { } finally { snapThreadMutex . release ( ) ; } } } . start ( ) ; } } } else if ( toFlush . isEmpty ( ) ) { if ( nextProcessor != null ) { nextProcessor . processRequest ( si ) ; if ( nextProcessor instanceof Flushable ) { ( ( Flushable ) nextProcessor ) . flush ( ) ; } } continue ; } toFlush . add ( si ) ; if ( shouldFlush ( ) ) { flush ( ) ; } ServerMetrics . getMetrics ( ) . SYNC_PROCESS_TIME . add ( Time . currentElapsedTime ( ) - startProcessTime ) ; } } catch ( Throwable t ) { handleException ( this . getName ( ) , t ) ; } LOG . info ( ""SyncRequestProcessor exited!"" ) ; } ","public void run ( ) { try { resetSnapshotStats ( ) ; lastFlushTime = Time . currentElapsedTime ( ) ; while ( true ) { ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_SIZE . add ( queuedRequests . size ( ) ) ; long pollTime = Math . min ( zks . getMaxWriteQueuePollTime ( ) , getRemainingDelay ( ) ) ; Request si = queuedRequests . poll ( pollTime , TimeUnit . MILLISECONDS ) ; if ( si == null ) { flush ( ) ; si = queuedRequests . take ( ) ; } if ( si == REQUEST_OF_DEATH ) { break ; } long startProcessTime = Time . currentElapsedTime ( ) ; ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_TIME . add ( startProcessTime - si . syncQueueStartTime ) ; if ( ! si . isThrottled ( ) && zks . getZKDatabase ( ) . append ( si ) ) { if ( shouldSnapshot ( ) ) { resetSnapshotStats ( ) ; zks . getZKDatabase ( ) . rollLog ( ) ; if ( ! snapThreadMutex . tryAcquire ( ) ) { LOG . warn ( ""Too busy to snap, skipping"" ) ; } else { new ZooKeeperThread ( ""Snapshot Thread"" ) { public void run ( ) { try { zks . takeSnapshot ( ) ; } catch ( Exception e ) { LOG . warn ( ""Unexpected exception"" , e ) ; } finally { snapThreadMutex . release ( ) ; } } } . start ( ) ; } } } else if ( toFlush . isEmpty ( ) ) { if ( nextProcessor != null ) { nextProcessor . processRequest ( si ) ; if ( nextProcessor instanceof Flushable ) { ( ( Flushable ) nextProcessor ) . flush ( ) ; } } continue ; } toFlush . add ( si ) ; if ( shouldFlush ( ) ) { flush ( ) ; } ServerMetrics . getMetrics ( ) . SYNC_PROCESS_TIME . add ( Time . currentElapsedTime ( ) - startProcessTime ) ; } } catch ( Throwable t ) { handleException ( this . getName ( ) , t ) ; } LOG . info ( ""SyncRequestProcessor exited!"" ) ; } " 82,"public void run ( ) { try { resetSnapshotStats ( ) ; lastFlushTime = Time . currentElapsedTime ( ) ; while ( true ) { ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_SIZE . add ( queuedRequests . size ( ) ) ; long pollTime = Math . min ( zks . getMaxWriteQueuePollTime ( ) , getRemainingDelay ( ) ) ; Request si = queuedRequests . poll ( pollTime , TimeUnit . MILLISECONDS ) ; if ( si == null ) { flush ( ) ; si = queuedRequests . take ( ) ; } if ( si == REQUEST_OF_DEATH ) { break ; } long startProcessTime = Time . currentElapsedTime ( ) ; ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_TIME . add ( startProcessTime - si . syncQueueStartTime ) ; if ( ! si . isThrottled ( ) && zks . getZKDatabase ( ) . append ( si ) ) { if ( shouldSnapshot ( ) ) { resetSnapshotStats ( ) ; zks . getZKDatabase ( ) . rollLog ( ) ; if ( ! snapThreadMutex . tryAcquire ( ) ) { LOG . warn ( ""Too busy to snap, skipping"" ) ; } else { new ZooKeeperThread ( ""Snapshot Thread"" ) { public void run ( ) { try { zks . takeSnapshot ( ) ; } catch ( Exception e ) { LOG . warn ( ""Unexpected exception"" , e ) ; } finally { snapThreadMutex . release ( ) ; } } } . start ( ) ; } } } else if ( toFlush . isEmpty ( ) ) { if ( nextProcessor != null ) { nextProcessor . processRequest ( si ) ; if ( nextProcessor instanceof Flushable ) { ( ( Flushable ) nextProcessor ) . flush ( ) ; } } continue ; } toFlush . add ( si ) ; if ( shouldFlush ( ) ) { flush ( ) ; } ServerMetrics . getMetrics ( ) . SYNC_PROCESS_TIME . add ( Time . currentElapsedTime ( ) - startProcessTime ) ; } } catch ( Throwable t ) { handleException ( this . getName ( ) , t ) ; } } ","public void run ( ) { try { resetSnapshotStats ( ) ; lastFlushTime = Time . currentElapsedTime ( ) ; while ( true ) { ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_SIZE . add ( queuedRequests . size ( ) ) ; long pollTime = Math . min ( zks . getMaxWriteQueuePollTime ( ) , getRemainingDelay ( ) ) ; Request si = queuedRequests . poll ( pollTime , TimeUnit . MILLISECONDS ) ; if ( si == null ) { flush ( ) ; si = queuedRequests . take ( ) ; } if ( si == REQUEST_OF_DEATH ) { break ; } long startProcessTime = Time . currentElapsedTime ( ) ; ServerMetrics . getMetrics ( ) . SYNC_PROCESSOR_QUEUE_TIME . add ( startProcessTime - si . syncQueueStartTime ) ; if ( ! si . isThrottled ( ) && zks . getZKDatabase ( ) . append ( si ) ) { if ( shouldSnapshot ( ) ) { resetSnapshotStats ( ) ; zks . getZKDatabase ( ) . rollLog ( ) ; if ( ! snapThreadMutex . tryAcquire ( ) ) { LOG . warn ( ""Too busy to snap, skipping"" ) ; } else { new ZooKeeperThread ( ""Snapshot Thread"" ) { public void run ( ) { try { zks . takeSnapshot ( ) ; } catch ( Exception e ) { LOG . warn ( ""Unexpected exception"" , e ) ; } finally { snapThreadMutex . release ( ) ; } } } . start ( ) ; } } } else if ( toFlush . isEmpty ( ) ) { if ( nextProcessor != null ) { nextProcessor . processRequest ( si ) ; if ( nextProcessor instanceof Flushable ) { ( ( Flushable ) nextProcessor ) . flush ( ) ; } } continue ; } toFlush . add ( si ) ; if ( shouldFlush ( ) ) { flush ( ) ; } ServerMetrics . getMetrics ( ) . SYNC_PROCESS_TIME . add ( Time . currentElapsedTime ( ) - startProcessTime ) ; } } catch ( Throwable t ) { handleException ( this . getName ( ) , t ) ; } LOG . info ( ""SyncRequestProcessor exited!"" ) ; } " 83,"public void action ( AuthenticatorContainer authenticatorContainer ) throws DecoderException { TLV tlv = authenticatorContainer . getCurrentTLV ( ) ; if ( tlv . getLength ( ) == 0 ) { throw new DecoderException ( I18n . err ( I18n . ERR_01309_EMPTY_TLV ) ) ; } Authenticator authenticator = new Authenticator ( ) ; authenticatorContainer . setAuthenticator ( authenticator ) ; if ( IS_DEBUG ) { LOG . debug ( ""Authenticator created"" ) ; } } ","public void action ( AuthenticatorContainer authenticatorContainer ) throws DecoderException { TLV tlv = authenticatorContainer . getCurrentTLV ( ) ; if ( tlv . getLength ( ) == 0 ) { LOG . error ( I18n . err ( I18n . ERR_01308_ZERO_LENGTH_TLV ) ) ; throw new DecoderException ( I18n . err ( I18n . ERR_01309_EMPTY_TLV ) ) ; } Authenticator authenticator = new Authenticator ( ) ; authenticatorContainer . setAuthenticator ( authenticator ) ; if ( IS_DEBUG ) { LOG . debug ( ""Authenticator created"" ) ; } } " 84,"public void action ( AuthenticatorContainer authenticatorContainer ) throws DecoderException { TLV tlv = authenticatorContainer . getCurrentTLV ( ) ; if ( tlv . getLength ( ) == 0 ) { LOG . error ( I18n . err ( I18n . ERR_01308_ZERO_LENGTH_TLV ) ) ; throw new DecoderException ( I18n . err ( I18n . ERR_01309_EMPTY_TLV ) ) ; } Authenticator authenticator = new Authenticator ( ) ; authenticatorContainer . setAuthenticator ( authenticator ) ; if ( IS_DEBUG ) { } } ","public void action ( AuthenticatorContainer authenticatorContainer ) throws DecoderException { TLV tlv = authenticatorContainer . getCurrentTLV ( ) ; if ( tlv . getLength ( ) == 0 ) { LOG . error ( I18n . err ( I18n . ERR_01308_ZERO_LENGTH_TLV ) ) ; throw new DecoderException ( I18n . err ( I18n . ERR_01309_EMPTY_TLV ) ) ; } Authenticator authenticator = new Authenticator ( ) ; authenticatorContainer . setAuthenticator ( authenticator ) ; if ( IS_DEBUG ) { LOG . debug ( ""Authenticator created"" ) ; } } " 85,"public void execute ( ) throws IOException , HomematicClientException { VirtualDatapointHandler virtualDatapointHandler = ignoreVirtualDatapoints ? null : getVirtualDatapointHandler ( dp , newValue ) ; if ( virtualDatapointHandler != null ) { virtualDatapointHandler . handleCommand ( gateway , dp , dpConfig , newValue ) ; } else if ( dp . isScript ( ) ) { if ( MiscUtils . isTrueValue ( newValue ) ) { logger . debug ( ""Executing script '{}' on gateway with id '{}'"" , dp . getInfo ( ) , id ) ; executeScript ( dp ) ; } } else if ( dp . isVariable ( ) ) { logger . debug ( ""Sending variable '{}' with value '{}' to gateway with id '{}'"" , dp . getInfo ( ) , newValue , id ) ; setVariable ( dp , newValue ) ; } else { logger . debug ( ""Sending datapoint '{}' with value '{}' to gateway with id '{}' using rxMode '{}'"" , dpInfo , newValue , id , rxMode == null ? ""DEFAULT"" : rxMode ) ; getRpcClient ( dp . getChannel ( ) . getDevice ( ) . getHmInterface ( ) ) . setDatapointValue ( dp , newValue , rxMode ) ; } dp . setValue ( newValue ) ; if ( MiscUtils . isTrueValue ( newValue ) && ( dp . isPressDatapoint ( ) || dp . isScript ( ) || dp . isActionType ( ) ) ) { disableDatapoint ( dp , DEFAULT_DISABLE_DELAY ) ; } } ","public void execute ( ) throws IOException , HomematicClientException { VirtualDatapointHandler virtualDatapointHandler = ignoreVirtualDatapoints ? null : getVirtualDatapointHandler ( dp , newValue ) ; if ( virtualDatapointHandler != null ) { logger . debug ( ""Handling virtual datapoint '{}' on gateway with id '{}'"" , dp . getName ( ) , id ) ; virtualDatapointHandler . handleCommand ( gateway , dp , dpConfig , newValue ) ; } else if ( dp . isScript ( ) ) { if ( MiscUtils . isTrueValue ( newValue ) ) { logger . debug ( ""Executing script '{}' on gateway with id '{}'"" , dp . getInfo ( ) , id ) ; executeScript ( dp ) ; } } else if ( dp . isVariable ( ) ) { logger . debug ( ""Sending variable '{}' with value '{}' to gateway with id '{}'"" , dp . getInfo ( ) , newValue , id ) ; setVariable ( dp , newValue ) ; } else { logger . debug ( ""Sending datapoint '{}' with value '{}' to gateway with id '{}' using rxMode '{}'"" , dpInfo , newValue , id , rxMode == null ? ""DEFAULT"" : rxMode ) ; getRpcClient ( dp . getChannel ( ) . getDevice ( ) . getHmInterface ( ) ) . setDatapointValue ( dp , newValue , rxMode ) ; } dp . setValue ( newValue ) ; if ( MiscUtils . isTrueValue ( newValue ) && ( dp . isPressDatapoint ( ) || dp . isScript ( ) || dp . isActionType ( ) ) ) { disableDatapoint ( dp , DEFAULT_DISABLE_DELAY ) ; } } " 86,"public void execute ( ) throws IOException , HomematicClientException { VirtualDatapointHandler virtualDatapointHandler = ignoreVirtualDatapoints ? null : getVirtualDatapointHandler ( dp , newValue ) ; if ( virtualDatapointHandler != null ) { logger . debug ( ""Handling virtual datapoint '{}' on gateway with id '{}'"" , dp . getName ( ) , id ) ; virtualDatapointHandler . handleCommand ( gateway , dp , dpConfig , newValue ) ; } else if ( dp . isScript ( ) ) { if ( MiscUtils . isTrueValue ( newValue ) ) { executeScript ( dp ) ; } } else if ( dp . isVariable ( ) ) { logger . debug ( ""Sending variable '{}' with value '{}' to gateway with id '{}'"" , dp . getInfo ( ) , newValue , id ) ; setVariable ( dp , newValue ) ; } else { logger . debug ( ""Sending datapoint '{}' with value '{}' to gateway with id '{}' using rxMode '{}'"" , dpInfo , newValue , id , rxMode == null ? ""DEFAULT"" : rxMode ) ; getRpcClient ( dp . getChannel ( ) . getDevice ( ) . getHmInterface ( ) ) . setDatapointValue ( dp , newValue , rxMode ) ; } dp . setValue ( newValue ) ; if ( MiscUtils . isTrueValue ( newValue ) && ( dp . isPressDatapoint ( ) || dp . isScript ( ) || dp . isActionType ( ) ) ) { disableDatapoint ( dp , DEFAULT_DISABLE_DELAY ) ; } } ","public void execute ( ) throws IOException , HomematicClientException { VirtualDatapointHandler virtualDatapointHandler = ignoreVirtualDatapoints ? null : getVirtualDatapointHandler ( dp , newValue ) ; if ( virtualDatapointHandler != null ) { logger . debug ( ""Handling virtual datapoint '{}' on gateway with id '{}'"" , dp . getName ( ) , id ) ; virtualDatapointHandler . handleCommand ( gateway , dp , dpConfig , newValue ) ; } else if ( dp . isScript ( ) ) { if ( MiscUtils . isTrueValue ( newValue ) ) { logger . debug ( ""Executing script '{}' on gateway with id '{}'"" , dp . getInfo ( ) , id ) ; executeScript ( dp ) ; } } else if ( dp . isVariable ( ) ) { logger . debug ( ""Sending variable '{}' with value '{}' to gateway with id '{}'"" , dp . getInfo ( ) , newValue , id ) ; setVariable ( dp , newValue ) ; } else { logger . debug ( ""Sending datapoint '{}' with value '{}' to gateway with id '{}' using rxMode '{}'"" , dpInfo , newValue , id , rxMode == null ? ""DEFAULT"" : rxMode ) ; getRpcClient ( dp . getChannel ( ) . getDevice ( ) . getHmInterface ( ) ) . setDatapointValue ( dp , newValue , rxMode ) ; } dp . setValue ( newValue ) ; if ( MiscUtils . isTrueValue ( newValue ) && ( dp . isPressDatapoint ( ) || dp . isScript ( ) || dp . isActionType ( ) ) ) { disableDatapoint ( dp , DEFAULT_DISABLE_DELAY ) ; } } " 87,"public void execute ( ) throws IOException , HomematicClientException { VirtualDatapointHandler virtualDatapointHandler = ignoreVirtualDatapoints ? null : getVirtualDatapointHandler ( dp , newValue ) ; if ( virtualDatapointHandler != null ) { logger . debug ( ""Handling virtual datapoint '{}' on gateway with id '{}'"" , dp . getName ( ) , id ) ; virtualDatapointHandler . handleCommand ( gateway , dp , dpConfig , newValue ) ; } else if ( dp . isScript ( ) ) { if ( MiscUtils . isTrueValue ( newValue ) ) { logger . debug ( ""Executing script '{}' on gateway with id '{}'"" , dp . getInfo ( ) , id ) ; executeScript ( dp ) ; } } else if ( dp . isVariable ( ) ) { setVariable ( dp , newValue ) ; } else { logger . debug ( ""Sending datapoint '{}' with value '{}' to gateway with id '{}' using rxMode '{}'"" , dpInfo , newValue , id , rxMode == null ? ""DEFAULT"" : rxMode ) ; getRpcClient ( dp . getChannel ( ) . getDevice ( ) . getHmInterface ( ) ) . setDatapointValue ( dp , newValue , rxMode ) ; } dp . setValue ( newValue ) ; if ( MiscUtils . isTrueValue ( newValue ) && ( dp . isPressDatapoint ( ) || dp . isScript ( ) || dp . isActionType ( ) ) ) { disableDatapoint ( dp , DEFAULT_DISABLE_DELAY ) ; } } ","public void execute ( ) throws IOException , HomematicClientException { VirtualDatapointHandler virtualDatapointHandler = ignoreVirtualDatapoints ? null : getVirtualDatapointHandler ( dp , newValue ) ; if ( virtualDatapointHandler != null ) { logger . debug ( ""Handling virtual datapoint '{}' on gateway with id '{}'"" , dp . getName ( ) , id ) ; virtualDatapointHandler . handleCommand ( gateway , dp , dpConfig , newValue ) ; } else if ( dp . isScript ( ) ) { if ( MiscUtils . isTrueValue ( newValue ) ) { logger . debug ( ""Executing script '{}' on gateway with id '{}'"" , dp . getInfo ( ) , id ) ; executeScript ( dp ) ; } } else if ( dp . isVariable ( ) ) { logger . debug ( ""Sending variable '{}' with value '{}' to gateway with id '{}'"" , dp . getInfo ( ) , newValue , id ) ; setVariable ( dp , newValue ) ; } else { logger . debug ( ""Sending datapoint '{}' with value '{}' to gateway with id '{}' using rxMode '{}'"" , dpInfo , newValue , id , rxMode == null ? ""DEFAULT"" : rxMode ) ; getRpcClient ( dp . getChannel ( ) . getDevice ( ) . getHmInterface ( ) ) . setDatapointValue ( dp , newValue , rxMode ) ; } dp . setValue ( newValue ) ; if ( MiscUtils . isTrueValue ( newValue ) && ( dp . isPressDatapoint ( ) || dp . isScript ( ) || dp . isActionType ( ) ) ) { disableDatapoint ( dp , DEFAULT_DISABLE_DELAY ) ; } } " 88,"public void execute ( ) throws IOException , HomematicClientException { VirtualDatapointHandler virtualDatapointHandler = ignoreVirtualDatapoints ? null : getVirtualDatapointHandler ( dp , newValue ) ; if ( virtualDatapointHandler != null ) { logger . debug ( ""Handling virtual datapoint '{}' on gateway with id '{}'"" , dp . getName ( ) , id ) ; virtualDatapointHandler . handleCommand ( gateway , dp , dpConfig , newValue ) ; } else if ( dp . isScript ( ) ) { if ( MiscUtils . isTrueValue ( newValue ) ) { logger . debug ( ""Executing script '{}' on gateway with id '{}'"" , dp . getInfo ( ) , id ) ; executeScript ( dp ) ; } } else if ( dp . isVariable ( ) ) { logger . debug ( ""Sending variable '{}' with value '{}' to gateway with id '{}'"" , dp . getInfo ( ) , newValue , id ) ; setVariable ( dp , newValue ) ; } else { getRpcClient ( dp . getChannel ( ) . getDevice ( ) . getHmInterface ( ) ) . setDatapointValue ( dp , newValue , rxMode ) ; } dp . setValue ( newValue ) ; if ( MiscUtils . isTrueValue ( newValue ) && ( dp . isPressDatapoint ( ) || dp . isScript ( ) || dp . isActionType ( ) ) ) { disableDatapoint ( dp , DEFAULT_DISABLE_DELAY ) ; } } ","public void execute ( ) throws IOException , HomematicClientException { VirtualDatapointHandler virtualDatapointHandler = ignoreVirtualDatapoints ? null : getVirtualDatapointHandler ( dp , newValue ) ; if ( virtualDatapointHandler != null ) { logger . debug ( ""Handling virtual datapoint '{}' on gateway with id '{}'"" , dp . getName ( ) , id ) ; virtualDatapointHandler . handleCommand ( gateway , dp , dpConfig , newValue ) ; } else if ( dp . isScript ( ) ) { if ( MiscUtils . isTrueValue ( newValue ) ) { logger . debug ( ""Executing script '{}' on gateway with id '{}'"" , dp . getInfo ( ) , id ) ; executeScript ( dp ) ; } } else if ( dp . isVariable ( ) ) { logger . debug ( ""Sending variable '{}' with value '{}' to gateway with id '{}'"" , dp . getInfo ( ) , newValue , id ) ; setVariable ( dp , newValue ) ; } else { logger . debug ( ""Sending datapoint '{}' with value '{}' to gateway with id '{}' using rxMode '{}'"" , dpInfo , newValue , id , rxMode == null ? ""DEFAULT"" : rxMode ) ; getRpcClient ( dp . getChannel ( ) . getDevice ( ) . getHmInterface ( ) ) . setDatapointValue ( dp , newValue , rxMode ) ; } dp . setValue ( newValue ) ; if ( MiscUtils . isTrueValue ( newValue ) && ( dp . isPressDatapoint ( ) || dp . isScript ( ) || dp . isActionType ( ) ) ) { disableDatapoint ( dp , DEFAULT_DISABLE_DELAY ) ; } } " 89,"@ Test public void testOKPKOnFact ( ) throws Exception { context . checking ( new Expectations ( ) { { one ( conn ) . getMetaData ( ) ; will ( returnValue ( meta ) ) ; allowing ( meta ) . getPrimaryKeys ( null , null , ""sales_fact_1997"" ) ; will ( returnValue ( rsSalesFact1997PrimaryKeys ) ) ; one ( rsSalesFact1997PrimaryKeys ) . next ( ) ; will ( returnValue ( false ) ) ; allowing ( meta ) . getPrimaryKeys ( with ( any ( String . class ) ) , with ( any ( String . class ) ) , with ( any ( String . class ) ) ) ; } } ) ; List < ValidationMessage > messages = bean . validateCube ( schema , getCubeByName ( ""Sales"" ) , conn ) ; assertTrue ( isMessagePresent ( messages , ERROR , ""sales_fact_1997"" , ""primary key"" ) ) ; if ( logger . isDebugEnabled ( ) ) { } } ","@ Test public void testOKPKOnFact ( ) throws Exception { context . checking ( new Expectations ( ) { { one ( conn ) . getMetaData ( ) ; will ( returnValue ( meta ) ) ; allowing ( meta ) . getPrimaryKeys ( null , null , ""sales_fact_1997"" ) ; will ( returnValue ( rsSalesFact1997PrimaryKeys ) ) ; one ( rsSalesFact1997PrimaryKeys ) . next ( ) ; will ( returnValue ( false ) ) ; allowing ( meta ) . getPrimaryKeys ( with ( any ( String . class ) ) , with ( any ( String . class ) ) , with ( any ( String . class ) ) ) ; } } ) ; List < ValidationMessage > messages = bean . validateCube ( schema , getCubeByName ( ""Sales"" ) , conn ) ; assertTrue ( isMessagePresent ( messages , ERROR , ""sales_fact_1997"" , ""primary key"" ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""got "" + messages . size ( ) + "" message(s): "" + messages ) ; } } " 90,"public boolean execute ( Context context ) throws Exception { boolean result = ERROR ; Monitor monitor = MonitorFactory . start ( COMMAND ) ; ActionReporter reporter = ActionReporter . Factory . getInstance ( ) ; try { SharedData shared = ( SharedData ) context . get ( SHARED_DATA ) ; if ( shared == null ) { return ERROR ; } saveData ( context ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . CONNECTION_LINK , ""connection links"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . ACCESS_POINT , ""access points"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . STOP_AREA , ""stop areas"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . CONNECTION_LINK , OBJECT_TYPE . CONNECTION_LINK , shared . connectionLinks . getItems ( ) . size ( ) ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . ACCESS_POINT , OBJECT_TYPE . ACCESS_POINT , shared . accessPoints . getItems ( ) . size ( ) ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . STOP_AREA , OBJECT_TYPE . STOP_AREA , shared . physicalStops . getItems ( ) . size ( ) + shared . commercialStops . getItems ( ) . size ( ) + shared . getStopPlaces ( ) . getItems ( ) . size ( ) ) ; result = SUCCESS ; } catch ( Exception e ) { } finally { log . info ( Color . MAGENTA + monitor . stop ( ) + Color . NORMAL ) ; } return result ; } ","public boolean execute ( Context context ) throws Exception { boolean result = ERROR ; Monitor monitor = MonitorFactory . start ( COMMAND ) ; ActionReporter reporter = ActionReporter . Factory . getInstance ( ) ; try { SharedData shared = ( SharedData ) context . get ( SHARED_DATA ) ; if ( shared == null ) { return ERROR ; } saveData ( context ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . CONNECTION_LINK , ""connection links"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . ACCESS_POINT , ""access points"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . STOP_AREA , ""stop areas"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . CONNECTION_LINK , OBJECT_TYPE . CONNECTION_LINK , shared . connectionLinks . getItems ( ) . size ( ) ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . ACCESS_POINT , OBJECT_TYPE . ACCESS_POINT , shared . accessPoints . getItems ( ) . size ( ) ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . STOP_AREA , OBJECT_TYPE . STOP_AREA , shared . physicalStops . getItems ( ) . size ( ) + shared . commercialStops . getItems ( ) . size ( ) + shared . getStopPlaces ( ) . getItems ( ) . size ( ) ) ; result = SUCCESS ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } finally { log . info ( Color . MAGENTA + monitor . stop ( ) + Color . NORMAL ) ; } return result ; } " 91,"public boolean execute ( Context context ) throws Exception { boolean result = ERROR ; Monitor monitor = MonitorFactory . start ( COMMAND ) ; ActionReporter reporter = ActionReporter . Factory . getInstance ( ) ; try { SharedData shared = ( SharedData ) context . get ( SHARED_DATA ) ; if ( shared == null ) { return ERROR ; } saveData ( context ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . CONNECTION_LINK , ""connection links"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . ACCESS_POINT , ""access points"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . STOP_AREA , ""stop areas"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . CONNECTION_LINK , OBJECT_TYPE . CONNECTION_LINK , shared . connectionLinks . getItems ( ) . size ( ) ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . ACCESS_POINT , OBJECT_TYPE . ACCESS_POINT , shared . accessPoints . getItems ( ) . size ( ) ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . STOP_AREA , OBJECT_TYPE . STOP_AREA , shared . physicalStops . getItems ( ) . size ( ) + shared . commercialStops . getItems ( ) . size ( ) + shared . getStopPlaces ( ) . getItems ( ) . size ( ) ) ; result = SUCCESS ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } finally { } return result ; } ","public boolean execute ( Context context ) throws Exception { boolean result = ERROR ; Monitor monitor = MonitorFactory . start ( COMMAND ) ; ActionReporter reporter = ActionReporter . Factory . getInstance ( ) ; try { SharedData shared = ( SharedData ) context . get ( SHARED_DATA ) ; if ( shared == null ) { return ERROR ; } saveData ( context ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . CONNECTION_LINK , ""connection links"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . ACCESS_POINT , ""access points"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . addObjectReport ( context , ""merged"" , OBJECT_TYPE . STOP_AREA , ""stop areas"" , OBJECT_STATE . OK , IO_TYPE . OUTPUT ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . CONNECTION_LINK , OBJECT_TYPE . CONNECTION_LINK , shared . connectionLinks . getItems ( ) . size ( ) ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . ACCESS_POINT , OBJECT_TYPE . ACCESS_POINT , shared . accessPoints . getItems ( ) . size ( ) ) ; reporter . setStatToObjectReport ( context , ""merged"" , OBJECT_TYPE . STOP_AREA , OBJECT_TYPE . STOP_AREA , shared . physicalStops . getItems ( ) . size ( ) + shared . commercialStops . getItems ( ) . size ( ) + shared . getStopPlaces ( ) . getItems ( ) . size ( ) ) ; result = SUCCESS ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } finally { log . info ( Color . MAGENTA + monitor . stop ( ) + Color . NORMAL ) ; } return result ; } " 92,"public List < HintApplication > getHints ( ) { List < HintApplication > hints = new ArrayList < > ( ) ; if ( mn . visibleAnnotations != null ) { for ( AnnotationNode an : mn . visibleAnnotations ) { Type annotationType = typeSystem . Lresolve ( an . desc , true ) ; if ( annotationType == null ) { } else { Stack < Type > s = new Stack < > ( ) ; annotationType . collectHints ( an , hints , new HashSet < > ( ) , s ) ; } } } return hints . size ( ) == 0 ? Collections . emptyList ( ) : hints ; } ","public List < HintApplication > getHints ( ) { List < HintApplication > hints = new ArrayList < > ( ) ; if ( mn . visibleAnnotations != null ) { for ( AnnotationNode an : mn . visibleAnnotations ) { Type annotationType = typeSystem . Lresolve ( an . desc , true ) ; if ( annotationType == null ) { logger . debug ( ""Couldn't resolve "" + an . desc + "" annotation type whilst searching for hints on "" + getName ( ) ) ; } else { Stack < Type > s = new Stack < > ( ) ; annotationType . collectHints ( an , hints , new HashSet < > ( ) , s ) ; } } } return hints . size ( ) == 0 ? Collections . emptyList ( ) : hints ; } " 93,"public static void main ( String [ ] args ) { SpringApplication . run ( SpringLoggerApplication . class , args ) ; logger . debug ( ""Starting my application in debug with {} arguments"" , args . length ) ; logger . info ( ""Starting my application with {} arguments."" , args . length ) ; } ","public static void main ( String [ ] args ) { logger . info ( ""Before Starting application"" ) ; SpringApplication . run ( SpringLoggerApplication . class , args ) ; logger . debug ( ""Starting my application in debug with {} arguments"" , args . length ) ; logger . info ( ""Starting my application with {} arguments."" , args . length ) ; } " 94,"public static void main ( String [ ] args ) { logger . info ( ""Before Starting application"" ) ; SpringApplication . run ( SpringLoggerApplication . class , args ) ; logger . info ( ""Starting my application with {} arguments."" , args . length ) ; } ","public static void main ( String [ ] args ) { logger . info ( ""Before Starting application"" ) ; SpringApplication . run ( SpringLoggerApplication . class , args ) ; logger . debug ( ""Starting my application in debug with {} arguments"" , args . length ) ; logger . info ( ""Starting my application with {} arguments."" , args . length ) ; } " 95,"public static void main ( String [ ] args ) { logger . info ( ""Before Starting application"" ) ; SpringApplication . run ( SpringLoggerApplication . class , args ) ; logger . debug ( ""Starting my application in debug with {} arguments"" , args . length ) ; } ","public static void main ( String [ ] args ) { logger . info ( ""Before Starting application"" ) ; SpringApplication . run ( SpringLoggerApplication . class , args ) ; logger . debug ( ""Starting my application in debug with {} arguments"" , args . length ) ; logger . info ( ""Starting my application with {} arguments."" , args . length ) ; } " 96,"public int ignite ( String host , int port , SslStores sslStores , int maxThreads , int minThreads , int threadIdleTimeoutMillis ) throws ContainerInitializationException { Timer . start ( ""SPARK_EMBEDDED_IGNITE"" ) ; if ( sparkFilter == null ) { sparkFilter = new MatcherFilter ( applicationRoutes , staticFilesConfiguration , exceptionMapper , true , hasMultipleHandler ) ; } sparkFilter . init ( null ) ; Timer . stop ( ""SPARK_EMBEDDED_IGNITE"" ) ; return port ; } ","public int ignite ( String host , int port , SslStores sslStores , int maxThreads , int minThreads , int threadIdleTimeoutMillis ) throws ContainerInitializationException { Timer . start ( ""SPARK_EMBEDDED_IGNITE"" ) ; log . info ( ""Starting Spark server, ignoring port and host"" ) ; if ( sparkFilter == null ) { sparkFilter = new MatcherFilter ( applicationRoutes , staticFilesConfiguration , exceptionMapper , true , hasMultipleHandler ) ; } sparkFilter . init ( null ) ; Timer . stop ( ""SPARK_EMBEDDED_IGNITE"" ) ; return port ; } " 97,"public static com . liferay . commerce . price . list . model . CommercePriceListSoap fetchCatalogBaseCommercePriceListByType ( long groupId , String type ) throws RemoteException { try { com . liferay . commerce . price . list . model . CommercePriceList returnValue = CommercePriceListServiceUtil . fetchCatalogBaseCommercePriceListByType ( groupId , type ) ; return com . liferay . commerce . price . list . model . CommercePriceListSoap . toSoapModel ( returnValue ) ; } catch ( Exception exception ) { throw new RemoteException ( exception . getMessage ( ) ) ; } } ","public static com . liferay . commerce . price . list . model . CommercePriceListSoap fetchCatalogBaseCommercePriceListByType ( long groupId , String type ) throws RemoteException { try { com . liferay . commerce . price . list . model . CommercePriceList returnValue = CommercePriceListServiceUtil . fetchCatalogBaseCommercePriceListByType ( groupId , type ) ; return com . liferay . commerce . price . list . model . CommercePriceListSoap . toSoapModel ( returnValue ) ; } catch ( Exception exception ) { _log . error ( exception , exception ) ; throw new RemoteException ( exception . getMessage ( ) ) ; } } " 98,"public Object visit ( Before filter , Object data ) { buildTemporalSearch ( filter , data , literal -> { final Date date = extractDate ( literal ) ; if ( date != null ) { Date start = new Date ( 0L ) ; return new DateRange ( start , date ) ; } else { LOGGER . debug ( ""Unable to extract date from Before filter {}. Ignoring filter."" , literal ) ; return null ; } } ) ; LOGGER . trace ( ""EXITING: Before filter"" ) ; return super . visit ( filter , data ) ; } ","public Object visit ( Before filter , Object data ) { LOGGER . trace ( ""ENTERING: Before filter"" ) ; buildTemporalSearch ( filter , data , literal -> { final Date date = extractDate ( literal ) ; if ( date != null ) { Date start = new Date ( 0L ) ; return new DateRange ( start , date ) ; } else { LOGGER . debug ( ""Unable to extract date from Before filter {}. Ignoring filter."" , literal ) ; return null ; } } ) ; LOGGER . trace ( ""EXITING: Before filter"" ) ; return super . visit ( filter , data ) ; } " 99,"public Object visit ( Before filter , Object data ) { LOGGER . trace ( ""ENTERING: Before filter"" ) ; buildTemporalSearch ( filter , data , literal -> { final Date date = extractDate ( literal ) ; if ( date != null ) { Date start = new Date ( 0L ) ; return new DateRange ( start , date ) ; } else { return null ; } } ) ; LOGGER . trace ( ""EXITING: Before filter"" ) ; return super . visit ( filter , data ) ; } ","public Object visit ( Before filter , Object data ) { LOGGER . trace ( ""ENTERING: Before filter"" ) ; buildTemporalSearch ( filter , data , literal -> { final Date date = extractDate ( literal ) ; if ( date != null ) { Date start = new Date ( 0L ) ; return new DateRange ( start , date ) ; } else { LOGGER . debug ( ""Unable to extract date from Before filter {}. Ignoring filter."" , literal ) ; return null ; } } ) ; LOGGER . trace ( ""EXITING: Before filter"" ) ; return super . visit ( filter , data ) ; } " 100,"public Object visit ( Before filter , Object data ) { LOGGER . trace ( ""ENTERING: Before filter"" ) ; buildTemporalSearch ( filter , data , literal -> { final Date date = extractDate ( literal ) ; if ( date != null ) { Date start = new Date ( 0L ) ; return new DateRange ( start , date ) ; } else { LOGGER . debug ( ""Unable to extract date from Before filter {}. Ignoring filter."" , literal ) ; return null ; } } ) ; return super . visit ( filter , data ) ; } ","public Object visit ( Before filter , Object data ) { LOGGER . trace ( ""ENTERING: Before filter"" ) ; buildTemporalSearch ( filter , data , literal -> { final Date date = extractDate ( literal ) ; if ( date != null ) { Date start = new Date ( 0L ) ; return new DateRange ( start , date ) ; } else { LOGGER . debug ( ""Unable to extract date from Before filter {}. Ignoring filter."" , literal ) ; return null ; } } ) ; LOGGER . trace ( ""EXITING: Before filter"" ) ; return super . visit ( filter , data ) ; } " 101,"protected void setup ( ) throws IOException { configuration = HBaseConfiguration . create ( ) ; String connectionClass = System . getProperty ( ""google.bigtable.connection.impl"" ) ; if ( connectionClass != null ) { configuration . set ( ""hbase.client.connection.impl"" , connectionClass ) ; } String asyncConnectionClass = System . getProperty ( ""google.bigtable.async.connection.impl"" ) ; if ( asyncConnectionClass != null ) { configuration . set ( ""hbase.client.async.connection.impl"" , asyncConnectionClass ) ; } String registryClass = System . getProperty ( ""google.bigtable.registry.impl"" ) ; if ( registryClass != null ) { configuration . set ( ""hbase.client.registry.impl"" , registryClass ) ; } for ( Entry < Object , Object > entry : System . getProperties ( ) . entrySet ( ) ) { if ( KEYS . contains ( entry . getKey ( ) ) ) { configuration . set ( entry . getKey ( ) . toString ( ) , entry . getValue ( ) . toString ( ) ) ; } } configuration . setIfUnset ( ""google.bigtable.snapshot.default.ttl.secs"" , String . valueOf ( TimeUnit . HOURS . toSeconds ( 6 ) + 1 ) ) ; ListeningExecutorService executor = MoreExecutors . listeningDecorator ( getExecutor ( ) ) ; try ( Connection connection = ConnectionFactory . createConnection ( configuration ) ; Admin admin = connection . getAdmin ( ) ) { List < ListenableFuture < ? > > futures = new ArrayList < > ( ) ; String stalePrefix = SharedTestEnvRule . newTimePrefix ( TimeUnit . MILLISECONDS . toSeconds ( System . currentTimeMillis ( ) ) - TimeUnit . HOURS . toSeconds ( 6 ) ) ; for ( final TableName tableName : admin . listTableNames ( Pattern . compile ( SharedTestEnvRule . PREFIX + "".*"" ) ) ) { if ( tableName . getNameAsString ( ) . compareTo ( stalePrefix ) > 0 ) { continue ; } futures . add ( executor . submit ( new Runnable ( ) { @ Override public void run ( ) { try { admin . deleteTable ( tableName ) ; LOG . info ( ""Test-setup deleting table: %s"" , tableName . getNameAsString ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } ) ) ; } Futures . allAsList ( futures ) . get ( 2 , TimeUnit . MINUTES ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new IOException ( ""Interrupted while deleting tables"" , e ) ; } catch ( ExecutionException | TimeoutException e ) { throw new IOException ( ""Exception while deleting tables"" , e ) ; } } ","protected void setup ( ) throws IOException { configuration = HBaseConfiguration . create ( ) ; String connectionClass = System . getProperty ( ""google.bigtable.connection.impl"" ) ; if ( connectionClass != null ) { configuration . set ( ""hbase.client.connection.impl"" , connectionClass ) ; } String asyncConnectionClass = System . getProperty ( ""google.bigtable.async.connection.impl"" ) ; if ( asyncConnectionClass != null ) { configuration . set ( ""hbase.client.async.connection.impl"" , asyncConnectionClass ) ; } String registryClass = System . getProperty ( ""google.bigtable.registry.impl"" ) ; if ( registryClass != null ) { configuration . set ( ""hbase.client.registry.impl"" , registryClass ) ; } for ( Entry < Object , Object > entry : System . getProperties ( ) . entrySet ( ) ) { if ( KEYS . contains ( entry . getKey ( ) ) ) { configuration . set ( entry . getKey ( ) . toString ( ) , entry . getValue ( ) . toString ( ) ) ; } } configuration . setIfUnset ( ""google.bigtable.snapshot.default.ttl.secs"" , String . valueOf ( TimeUnit . HOURS . toSeconds ( 6 ) + 1 ) ) ; ListeningExecutorService executor = MoreExecutors . listeningDecorator ( getExecutor ( ) ) ; try ( Connection connection = ConnectionFactory . createConnection ( configuration ) ; Admin admin = connection . getAdmin ( ) ) { List < ListenableFuture < ? > > futures = new ArrayList < > ( ) ; String stalePrefix = SharedTestEnvRule . newTimePrefix ( TimeUnit . MILLISECONDS . toSeconds ( System . currentTimeMillis ( ) ) - TimeUnit . HOURS . toSeconds ( 6 ) ) ; for ( final TableName tableName : admin . listTableNames ( Pattern . compile ( SharedTestEnvRule . PREFIX + "".*"" ) ) ) { if ( tableName . getNameAsString ( ) . compareTo ( stalePrefix ) > 0 ) { LOG . info ( ""Found fresh table, ignoring: "" + tableName ) ; continue ; } futures . add ( executor . submit ( new Runnable ( ) { @ Override public void run ( ) { try { admin . deleteTable ( tableName ) ; LOG . info ( ""Test-setup deleting table: %s"" , tableName . getNameAsString ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } ) ) ; } Futures . allAsList ( futures ) . get ( 2 , TimeUnit . MINUTES ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new IOException ( ""Interrupted while deleting tables"" , e ) ; } catch ( ExecutionException | TimeoutException e ) { throw new IOException ( ""Exception while deleting tables"" , e ) ; } } " 102,"protected void setup ( ) throws IOException { configuration = HBaseConfiguration . create ( ) ; String connectionClass = System . getProperty ( ""google.bigtable.connection.impl"" ) ; if ( connectionClass != null ) { configuration . set ( ""hbase.client.connection.impl"" , connectionClass ) ; } String asyncConnectionClass = System . getProperty ( ""google.bigtable.async.connection.impl"" ) ; if ( asyncConnectionClass != null ) { configuration . set ( ""hbase.client.async.connection.impl"" , asyncConnectionClass ) ; } String registryClass = System . getProperty ( ""google.bigtable.registry.impl"" ) ; if ( registryClass != null ) { configuration . set ( ""hbase.client.registry.impl"" , registryClass ) ; } for ( Entry < Object , Object > entry : System . getProperties ( ) . entrySet ( ) ) { if ( KEYS . contains ( entry . getKey ( ) ) ) { configuration . set ( entry . getKey ( ) . toString ( ) , entry . getValue ( ) . toString ( ) ) ; } } configuration . setIfUnset ( ""google.bigtable.snapshot.default.ttl.secs"" , String . valueOf ( TimeUnit . HOURS . toSeconds ( 6 ) + 1 ) ) ; ListeningExecutorService executor = MoreExecutors . listeningDecorator ( getExecutor ( ) ) ; try ( Connection connection = ConnectionFactory . createConnection ( configuration ) ; Admin admin = connection . getAdmin ( ) ) { List < ListenableFuture < ? > > futures = new ArrayList < > ( ) ; String stalePrefix = SharedTestEnvRule . newTimePrefix ( TimeUnit . MILLISECONDS . toSeconds ( System . currentTimeMillis ( ) ) - TimeUnit . HOURS . toSeconds ( 6 ) ) ; for ( final TableName tableName : admin . listTableNames ( Pattern . compile ( SharedTestEnvRule . PREFIX + "".*"" ) ) ) { if ( tableName . getNameAsString ( ) . compareTo ( stalePrefix ) > 0 ) { LOG . info ( ""Found fresh table, ignoring: "" + tableName ) ; continue ; } futures . add ( executor . submit ( new Runnable ( ) { @ Override public void run ( ) { try { admin . deleteTable ( tableName ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } ) ) ; } Futures . allAsList ( futures ) . get ( 2 , TimeUnit . MINUTES ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new IOException ( ""Interrupted while deleting tables"" , e ) ; } catch ( ExecutionException | TimeoutException e ) { throw new IOException ( ""Exception while deleting tables"" , e ) ; } } ","protected void setup ( ) throws IOException { configuration = HBaseConfiguration . create ( ) ; String connectionClass = System . getProperty ( ""google.bigtable.connection.impl"" ) ; if ( connectionClass != null ) { configuration . set ( ""hbase.client.connection.impl"" , connectionClass ) ; } String asyncConnectionClass = System . getProperty ( ""google.bigtable.async.connection.impl"" ) ; if ( asyncConnectionClass != null ) { configuration . set ( ""hbase.client.async.connection.impl"" , asyncConnectionClass ) ; } String registryClass = System . getProperty ( ""google.bigtable.registry.impl"" ) ; if ( registryClass != null ) { configuration . set ( ""hbase.client.registry.impl"" , registryClass ) ; } for ( Entry < Object , Object > entry : System . getProperties ( ) . entrySet ( ) ) { if ( KEYS . contains ( entry . getKey ( ) ) ) { configuration . set ( entry . getKey ( ) . toString ( ) , entry . getValue ( ) . toString ( ) ) ; } } configuration . setIfUnset ( ""google.bigtable.snapshot.default.ttl.secs"" , String . valueOf ( TimeUnit . HOURS . toSeconds ( 6 ) + 1 ) ) ; ListeningExecutorService executor = MoreExecutors . listeningDecorator ( getExecutor ( ) ) ; try ( Connection connection = ConnectionFactory . createConnection ( configuration ) ; Admin admin = connection . getAdmin ( ) ) { List < ListenableFuture < ? > > futures = new ArrayList < > ( ) ; String stalePrefix = SharedTestEnvRule . newTimePrefix ( TimeUnit . MILLISECONDS . toSeconds ( System . currentTimeMillis ( ) ) - TimeUnit . HOURS . toSeconds ( 6 ) ) ; for ( final TableName tableName : admin . listTableNames ( Pattern . compile ( SharedTestEnvRule . PREFIX + "".*"" ) ) ) { if ( tableName . getNameAsString ( ) . compareTo ( stalePrefix ) > 0 ) { LOG . info ( ""Found fresh table, ignoring: "" + tableName ) ; continue ; } futures . add ( executor . submit ( new Runnable ( ) { @ Override public void run ( ) { try { admin . deleteTable ( tableName ) ; LOG . info ( ""Test-setup deleting table: %s"" , tableName . getNameAsString ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } ) ) ; } Futures . allAsList ( futures ) . get ( 2 , TimeUnit . MINUTES ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new IOException ( ""Interrupted while deleting tables"" , e ) ; } catch ( ExecutionException | TimeoutException e ) { throw new IOException ( ""Exception while deleting tables"" , e ) ; } } " 103,"private Document getXMLStatusFile ( Board board ) { DocumentBuilderFactory dbFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder dBuilder = null ; try { dBuilder = dbFactory . newDocumentBuilder ( ) ; } catch ( ParserConfigurationException ex ) { } Document doc = null ; String statusFileURL = null ; try { statusFileURL = ""http://"" + board . getIpAddress ( ) + "":"" + Integer . toString ( board . getPort ( ) ) + ""/"" + GET_SENSORS_URL ; LOG . info ( ""Zibase gets relay status from file "" + statusFileURL ) ; doc = dBuilder . parse ( new URL ( statusFileURL ) . openStream ( ) ) ; doc . getDocumentElement ( ) . normalize ( ) ; } catch ( ConnectException connEx ) { disconnect ( ) ; this . stop ( ) ; this . setDescription ( ""Connection timed out, no reply from the board at "" + statusFileURL ) ; } catch ( SAXException ex ) { disconnect ( ) ; this . stop ( ) ; LOG . error ( Freedomotic . getStackTraceInfo ( ex ) ) ; } catch ( Exception ex ) { disconnect ( ) ; this . stop ( ) ; setDescription ( ""Unable to connect to "" + statusFileURL ) ; LOG . error ( Freedomotic . getStackTraceInfo ( ex ) ) ; } return doc ; } ","private Document getXMLStatusFile ( Board board ) { DocumentBuilderFactory dbFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder dBuilder = null ; try { dBuilder = dbFactory . newDocumentBuilder ( ) ; } catch ( ParserConfigurationException ex ) { LOG . error ( ex . getLocalizedMessage ( ) ) ; } Document doc = null ; String statusFileURL = null ; try { statusFileURL = ""http://"" + board . getIpAddress ( ) + "":"" + Integer . toString ( board . getPort ( ) ) + ""/"" + GET_SENSORS_URL ; LOG . info ( ""Zibase gets relay status from file "" + statusFileURL ) ; doc = dBuilder . parse ( new URL ( statusFileURL ) . openStream ( ) ) ; doc . getDocumentElement ( ) . normalize ( ) ; } catch ( ConnectException connEx ) { disconnect ( ) ; this . stop ( ) ; this . setDescription ( ""Connection timed out, no reply from the board at "" + statusFileURL ) ; } catch ( SAXException ex ) { disconnect ( ) ; this . stop ( ) ; LOG . error ( Freedomotic . getStackTraceInfo ( ex ) ) ; } catch ( Exception ex ) { disconnect ( ) ; this . stop ( ) ; setDescription ( ""Unable to connect to "" + statusFileURL ) ; LOG . error ( Freedomotic . getStackTraceInfo ( ex ) ) ; } return doc ; } " 104,"private Document getXMLStatusFile ( Board board ) { DocumentBuilderFactory dbFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder dBuilder = null ; try { dBuilder = dbFactory . newDocumentBuilder ( ) ; } catch ( ParserConfigurationException ex ) { LOG . error ( ex . getLocalizedMessage ( ) ) ; } Document doc = null ; String statusFileURL = null ; try { statusFileURL = ""http://"" + board . getIpAddress ( ) + "":"" + Integer . toString ( board . getPort ( ) ) + ""/"" + GET_SENSORS_URL ; doc = dBuilder . parse ( new URL ( statusFileURL ) . openStream ( ) ) ; doc . getDocumentElement ( ) . normalize ( ) ; } catch ( ConnectException connEx ) { disconnect ( ) ; this . stop ( ) ; this . setDescription ( ""Connection timed out, no reply from the board at "" + statusFileURL ) ; } catch ( SAXException ex ) { disconnect ( ) ; this . stop ( ) ; LOG . error ( Freedomotic . getStackTraceInfo ( ex ) ) ; } catch ( Exception ex ) { disconnect ( ) ; this . stop ( ) ; setDescription ( ""Unable to connect to "" + statusFileURL ) ; LOG . error ( Freedomotic . getStackTraceInfo ( ex ) ) ; } return doc ; } ","private Document getXMLStatusFile ( Board board ) { DocumentBuilderFactory dbFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder dBuilder = null ; try { dBuilder = dbFactory . newDocumentBuilder ( ) ; } catch ( ParserConfigurationException ex ) { LOG . error ( ex . getLocalizedMessage ( ) ) ; } Document doc = null ; String statusFileURL = null ; try { statusFileURL = ""http://"" + board . getIpAddress ( ) + "":"" + Integer . toString ( board . getPort ( ) ) + ""/"" + GET_SENSORS_URL ; LOG . info ( ""Zibase gets relay status from file "" + statusFileURL ) ; doc = dBuilder . parse ( new URL ( statusFileURL ) . openStream ( ) ) ; doc . getDocumentElement ( ) . normalize ( ) ; } catch ( ConnectException connEx ) { disconnect ( ) ; this . stop ( ) ; this . setDescription ( ""Connection timed out, no reply from the board at "" + statusFileURL ) ; } catch ( SAXException ex ) { disconnect ( ) ; this . stop ( ) ; LOG . error ( Freedomotic . getStackTraceInfo ( ex ) ) ; } catch ( Exception ex ) { disconnect ( ) ; this . stop ( ) ; setDescription ( ""Unable to connect to "" + statusFileURL ) ; LOG . error ( Freedomotic . getStackTraceInfo ( ex ) ) ; } return doc ; } " 105,"public void flush ( ) { release ( true ) ; resetHitCounter ( ) ; } ","public void flush ( ) { release ( true ) ; resetHitCounter ( ) ; log . debug ( this . getName ( ) + "" flushed."" ) ; } " 106,"private List < Iterator < DataRow > > mergePartitions ( final List < AbstractTableSorter > columnPartitions , final ExecutionMonitor exec , final int chunkCount ) throws CanceledExecutionException { final List < Iterator < DataRow > > partitionRowIterators = new ArrayList < > ( ) ; final int numberOfNecessaryContainers = chunkCount * m_sortDescriptions . length ; final Iterator < AbstractTableSorter > i = columnPartitions . iterator ( ) ; if ( numberOfNecessaryContainers > m_maxOpenContainers && chunkCount > 1 ) { int tmp = numberOfNecessaryContainers ; final int numExcessContainers = numberOfNecessaryContainers - m_maxOpenContainers ; final double numExcessPartitions = numExcessContainers / chunkCount ; final double numPartitionsToMergeSeparately = numExcessPartitions + Math . ceil ( numExcessPartitions / ( chunkCount - 1 ) ) ; int index = 0 ; while ( tmp > m_maxOpenContainers && i . hasNext ( ) ) { partitionRowIterators . add ( i . next ( ) . mergeChunks ( exec . createSubProgress ( index / numPartitionsToMergeSeparately ) , true ) ) ; index ++ ; tmp = tmp - chunkCount + 1 ; } } exec . setProgress ( 1 , ""Merging Done."" ) ; while ( i . hasNext ( ) ) { partitionRowIterators . add ( i . next ( ) . mergeChunks ( exec . createSubProgress ( 0 ) , false ) ) ; } return partitionRowIterators ; } ","private List < Iterator < DataRow > > mergePartitions ( final List < AbstractTableSorter > columnPartitions , final ExecutionMonitor exec , final int chunkCount ) throws CanceledExecutionException { LOGGER . debug ( ""Merging tables"" ) ; final List < Iterator < DataRow > > partitionRowIterators = new ArrayList < > ( ) ; final int numberOfNecessaryContainers = chunkCount * m_sortDescriptions . length ; final Iterator < AbstractTableSorter > i = columnPartitions . iterator ( ) ; if ( numberOfNecessaryContainers > m_maxOpenContainers && chunkCount > 1 ) { int tmp = numberOfNecessaryContainers ; final int numExcessContainers = numberOfNecessaryContainers - m_maxOpenContainers ; final double numExcessPartitions = numExcessContainers / chunkCount ; final double numPartitionsToMergeSeparately = numExcessPartitions + Math . ceil ( numExcessPartitions / ( chunkCount - 1 ) ) ; int index = 0 ; while ( tmp > m_maxOpenContainers && i . hasNext ( ) ) { partitionRowIterators . add ( i . next ( ) . mergeChunks ( exec . createSubProgress ( index / numPartitionsToMergeSeparately ) , true ) ) ; index ++ ; tmp = tmp - chunkCount + 1 ; } } exec . setProgress ( 1 , ""Merging Done."" ) ; while ( i . hasNext ( ) ) { partitionRowIterators . add ( i . next ( ) . mergeChunks ( exec . createSubProgress ( 0 ) , false ) ) ; } return partitionRowIterators ; } " 107,"public void onEvent ( SdpPortManagerEvent event ) { if ( event . getEventType ( ) . equals ( SdpPortManagerEvent . ANSWER_GENERATED ) ) { if ( event . isSuccessful ( ) ) { final byte [ ] sdp = event . getMediaServerSdp ( ) ; try { ( ( ApplicationContextImpl ) _remoteParticipant . getApplicationContext ( ) ) . getRemoteCommunication ( ) . joinAnswer ( _remoteParticipant . getId ( ) , _localParticipant . getRemoteAddress ( ) , sdp ) ; } catch ( final Exception e ) { notifyRemote = false ; done ( Cause . ERROR , e ) ; } } else { Exception ex = new NegotiateException ( event ) ; notifyRemote = true ; done ( Cause . ERROR , ex ) ; } } else { Exception ex = new NegotiateException ( event ) ; notifyRemote = true ; done ( Cause . ERROR , ex ) ; } } ","public void onEvent ( SdpPortManagerEvent event ) { if ( event . getEventType ( ) . equals ( SdpPortManagerEvent . ANSWER_GENERATED ) ) { if ( event . isSuccessful ( ) ) { final byte [ ] sdp = event . getMediaServerSdp ( ) ; try { ( ( ApplicationContextImpl ) _remoteParticipant . getApplicationContext ( ) ) . getRemoteCommunication ( ) . joinAnswer ( _remoteParticipant . getId ( ) , _localParticipant . getRemoteAddress ( ) , sdp ) ; } catch ( final Exception e ) { LOG . error ( """" , e ) ; notifyRemote = false ; done ( Cause . ERROR , e ) ; } } else { Exception ex = new NegotiateException ( event ) ; notifyRemote = true ; done ( Cause . ERROR , ex ) ; } } else { Exception ex = new NegotiateException ( event ) ; notifyRemote = true ; done ( Cause . ERROR , ex ) ; } } " 108,"public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } ","public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } " 109,"public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } ","public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } " 110,"public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } ","public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } " 111,"public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } ","public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } " 112,"public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } ","public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } " 113,"public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } ","public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } " 114,"public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { } } } ","public Integer decommission ( ) throws IOException { final Logger logger = cmdLogger ; final Integer port = getCurrentPort ( logger ) ; if ( port == null ) { logger . info ( ""Apache NiFi is not currently running"" ) ; return 15 ; } final File lockFile = getLockFile ( logger ) ; if ( ! lockFile . exists ( ) ) { lockFile . createNewFile ( ) ; } final Properties nifiProps = loadProperties ( logger ) ; final String secretKey = nifiProps . getProperty ( ""secret.key"" ) ; final String pid = nifiProps . getProperty ( PID_KEY ) ; final File statusFile = getStatusFile ( logger ) ; final File pidFile = getPidFile ( logger ) ; try ( final Socket socket = new Socket ( ) ) { logger . debug ( ""Connecting to NiFi instance"" ) ; socket . setSoTimeout ( 10000 ) ; socket . connect ( new InetSocketAddress ( ""localhost"" , port ) ) ; logger . debug ( ""Established connection to NiFi instance."" ) ; socket . setSoTimeout ( 0 ) ; logger . debug ( ""Sending DECOMMISSION Command to port {}"" , port ) ; final OutputStream out = socket . getOutputStream ( ) ; out . write ( ( DECOMMISSION_CMD + "" "" + secretKey + ""\n"" ) . getBytes ( StandardCharsets . UTF_8 ) ) ; out . flush ( ) ; socket . shutdownOutput ( ) ; final String response = readResponse ( socket . getInputStream ( ) ) ; if ( DECOMMISSION_CMD . equals ( response ) ) { logger . debug ( ""Received response to DECOMMISSION command: {}"" , response ) ; if ( pid != null ) { waitForShutdown ( pid , logger , statusFile , pidFile ) ; } return null ; } else { logger . error ( ""When sending DECOMMISSION command to NiFi, got unexpected response {}"" , response ) ; return 18 ; } } finally { if ( lockFile . exists ( ) && ! lockFile . delete ( ) ) { logger . error ( ""Failed to delete lock file {}; this file should be cleaned up manually"" , lockFile ) ; } } } " 115,"public List < ReceiptDetail > reconstructReceiptDetail ( final String billReferenceNumber , final BigDecimal actualAmountPaid , final List < ReceiptDetail > receiptDetailList ) { final Long billID = Long . valueOf ( billReferenceNumber ) ; final List < EgBillDetails > billDetails = new ArrayList < > ( 0 ) ; final EgBill bill = applicationBpaBillService . updateBillWithLatest ( billID ) ; final CollectionApportioner apportioner = new CollectionApportioner ( ) ; billDetails . addAll ( bill . getEgBillDetails ( ) ) ; return apportioner . reConstruct ( actualAmountPaid , billDetails , functionDAO , chartOfAccountsDAO ) ; } ","public List < ReceiptDetail > reconstructReceiptDetail ( final String billReferenceNumber , final BigDecimal actualAmountPaid , final List < ReceiptDetail > receiptDetailList ) { final Long billID = Long . valueOf ( billReferenceNumber ) ; final List < EgBillDetails > billDetails = new ArrayList < > ( 0 ) ; final EgBill bill = applicationBpaBillService . updateBillWithLatest ( billID ) ; LOGGER . debug ( ""Reconstruct consumer code :"" + bill . getConsumerId ( ) + "", with bill reference number: "" + billReferenceNumber + "", for Amount Paid :"" + actualAmountPaid ) ; final CollectionApportioner apportioner = new CollectionApportioner ( ) ; billDetails . addAll ( bill . getEgBillDetails ( ) ) ; return apportioner . reConstruct ( actualAmountPaid , billDetails , functionDAO , chartOfAccountsDAO ) ; } " 116,"protected void logOrgExtChanges ( OrgExt orgExt , EditOrgDetailsFormBean formBean , MultipartFile logo ) { AdminLogType type = AdminLogType . ORG_ATTRIBUTE_CHANGED ; String id = orgExt . getId ( ) ; try { if ( logo != null && orgExt . getLogo ( ) != null && ! orgExt . getLogo ( ) . equals ( transformLogoFileToBase64 ( logo ) ) ) { logUtils . createAndLogDetails ( id , Org . JSON_LOGO , null , null , type ) ; } } catch ( IOException e ) { } if ( ! orgExt . getDescription ( ) . equals ( formBean . getDescription ( ) ) ) { logUtils . createAndLogDetails ( id , Org . JSON_DESCRIPTION , orgExt . getDescription ( ) , formBean . getDescription ( ) , type ) ; } if ( ! orgExt . getUrl ( ) . equals ( formBean . getUrl ( ) ) ) { logUtils . createAndLogDetails ( id , Org . JSON_URL , orgExt . getUrl ( ) , formBean . getUrl ( ) , type ) ; } if ( ! orgExt . getAddress ( ) . equals ( formBean . getAddress ( ) ) ) { logUtils . createAndLogDetails ( id , OrgExt . JSON_ADDRESS , orgExt . getAddress ( ) , formBean . getAddress ( ) , type ) ; } } ","protected void logOrgExtChanges ( OrgExt orgExt , EditOrgDetailsFormBean formBean , MultipartFile logo ) { AdminLogType type = AdminLogType . ORG_ATTRIBUTE_CHANGED ; String id = orgExt . getId ( ) ; try { if ( logo != null && orgExt . getLogo ( ) != null && ! orgExt . getLogo ( ) . equals ( transformLogoFileToBase64 ( logo ) ) ) { logUtils . createAndLogDetails ( id , Org . JSON_LOGO , null , null , type ) ; } } catch ( IOException e ) { LOG . info ( ""Can't create admin log and detail for logo replacement."" , e ) ; } if ( ! orgExt . getDescription ( ) . equals ( formBean . getDescription ( ) ) ) { logUtils . createAndLogDetails ( id , Org . JSON_DESCRIPTION , orgExt . getDescription ( ) , formBean . getDescription ( ) , type ) ; } if ( ! orgExt . getUrl ( ) . equals ( formBean . getUrl ( ) ) ) { logUtils . createAndLogDetails ( id , Org . JSON_URL , orgExt . getUrl ( ) , formBean . getUrl ( ) , type ) ; } if ( ! orgExt . getAddress ( ) . equals ( formBean . getAddress ( ) ) ) { logUtils . createAndLogDetails ( id , OrgExt . JSON_ADDRESS , orgExt . getAddress ( ) , formBean . getAddress ( ) , type ) ; } } " 117,"private void computeConfigLoadStatus ( String sourceName , Throwable throwable ) { int status = throwable != null ? 1 : 0 ; Integer status0 = configSourceStatusMap . put ( sourceName , status ) ; if ( status0 == null || ( status0 ^ status ) == 1 ) { if ( status == 1 ) { } else { LOGGER . debug ( ""[loadConfig][{}] Loaded config properties"" , sourceName ) ; } } } ","private void computeConfigLoadStatus ( String sourceName , Throwable throwable ) { int status = throwable != null ? 1 : 0 ; Integer status0 = configSourceStatusMap . put ( sourceName , status ) ; if ( status0 == null || ( status0 ^ status ) == 1 ) { if ( status == 1 ) { LOGGER . error ( ""[loadConfig][{}] Exception occurred, cause: {}"" , sourceName , throwable . toString ( ) ) ; } else { LOGGER . debug ( ""[loadConfig][{}] Loaded config properties"" , sourceName ) ; } } } " 118,"private void computeConfigLoadStatus ( String sourceName , Throwable throwable ) { int status = throwable != null ? 1 : 0 ; Integer status0 = configSourceStatusMap . put ( sourceName , status ) ; if ( status0 == null || ( status0 ^ status ) == 1 ) { if ( status == 1 ) { LOGGER . error ( ""[loadConfig][{}] Exception occurred, cause: {}"" , sourceName , throwable . toString ( ) ) ; } else { } } } ","private void computeConfigLoadStatus ( String sourceName , Throwable throwable ) { int status = throwable != null ? 1 : 0 ; Integer status0 = configSourceStatusMap . put ( sourceName , status ) ; if ( status0 == null || ( status0 ^ status ) == 1 ) { if ( status == 1 ) { LOGGER . error ( ""[loadConfig][{}] Exception occurred, cause: {}"" , sourceName , throwable . toString ( ) ) ; } else { LOGGER . debug ( ""[loadConfig][{}] Loaded config properties"" , sourceName ) ; } } } " 119,"public DialPlanExtension buildDialPlanExtension ( final String extension ) { DialPlanExtension dialPlan = null ; try { dialPlan = new DialPlanExtension ( extension ) ; } catch ( final IllegalArgumentException e ) { } return dialPlan ; } ","public DialPlanExtension buildDialPlanExtension ( final String extension ) { DialPlanExtension dialPlan = null ; try { dialPlan = new DialPlanExtension ( extension ) ; } catch ( final IllegalArgumentException e ) { logger . error ( e , e ) ; } return dialPlan ; } " 120,"public static Network copy ( Network network , NetworkFactory networkFactory , ExecutorService executor ) { Objects . requireNonNull ( network ) ; Objects . requireNonNull ( networkFactory ) ; Objects . requireNonNull ( executor ) ; PipedOutputStream pos = new PipedOutputStream ( ) ; try ( InputStream is = new PipedInputStream ( pos ) ) { executor . execute ( ( ) -> { try { write ( network , pos ) ; } catch ( Exception t ) { } finally { try { pos . close ( ) ; } catch ( IOException e ) { LOGGER . error ( e . toString ( ) , e ) ; } } } ) ; return read ( is , new ImportOptions ( ) , null , networkFactory ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } } ","public static Network copy ( Network network , NetworkFactory networkFactory , ExecutorService executor ) { Objects . requireNonNull ( network ) ; Objects . requireNonNull ( networkFactory ) ; Objects . requireNonNull ( executor ) ; PipedOutputStream pos = new PipedOutputStream ( ) ; try ( InputStream is = new PipedInputStream ( pos ) ) { executor . execute ( ( ) -> { try { write ( network , pos ) ; } catch ( Exception t ) { LOGGER . error ( t . toString ( ) , t ) ; } finally { try { pos . close ( ) ; } catch ( IOException e ) { LOGGER . error ( e . toString ( ) , e ) ; } } } ) ; return read ( is , new ImportOptions ( ) , null , networkFactory ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } } " 121,"public static Network copy ( Network network , NetworkFactory networkFactory , ExecutorService executor ) { Objects . requireNonNull ( network ) ; Objects . requireNonNull ( networkFactory ) ; Objects . requireNonNull ( executor ) ; PipedOutputStream pos = new PipedOutputStream ( ) ; try ( InputStream is = new PipedInputStream ( pos ) ) { executor . execute ( ( ) -> { try { write ( network , pos ) ; } catch ( Exception t ) { LOGGER . error ( t . toString ( ) , t ) ; } finally { try { pos . close ( ) ; } catch ( IOException e ) { } } } ) ; return read ( is , new ImportOptions ( ) , null , networkFactory ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } } ","public static Network copy ( Network network , NetworkFactory networkFactory , ExecutorService executor ) { Objects . requireNonNull ( network ) ; Objects . requireNonNull ( networkFactory ) ; Objects . requireNonNull ( executor ) ; PipedOutputStream pos = new PipedOutputStream ( ) ; try ( InputStream is = new PipedInputStream ( pos ) ) { executor . execute ( ( ) -> { try { write ( network , pos ) ; } catch ( Exception t ) { LOGGER . error ( t . toString ( ) , t ) ; } finally { try { pos . close ( ) ; } catch ( IOException e ) { LOGGER . error ( e . toString ( ) , e ) ; } } } ) ; return read ( is , new ImportOptions ( ) , null , networkFactory ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } } " 122,"public boolean clientExists ( Integer demographicNo ) { boolean exists = getHibernateTemplate ( ) . get ( Demographic . class , demographicNo ) != null ; return exists ; } ","public boolean clientExists ( Integer demographicNo ) { boolean exists = getHibernateTemplate ( ) . get ( Demographic . class , demographicNo ) != null ; log . debug ( ""exists: "" + exists ) ; return exists ; } " 123,"protected void onPageBiggerThanMaxSize ( String urlStr , long pageSize ) { } ","protected void onPageBiggerThanMaxSize ( String urlStr , long pageSize ) { logger . warn ( ""Skipping a URL: {} which was bigger ( {} ) than max allowed size"" , urlStr , pageSize ) ; } " 124,"public void checkExpectedGeneratedResources ( ) { try { if ( shouldOverrideExpectedTestFiles ( ) ) { try { FileUtils . deleteDirectory ( getExpectedResourcesTestDir ( ) ) ; FileUtils . copyDirectory ( targetTestDir , getExpectedResourcesTestDir ( ) ) ; } catch ( IOException io ) { throw new RuntimeException ( io ) ; } } checkDirectoriesContainSameContent ( getExpectedResourcesTestDir ( ) , targetTestDir ) ; } catch ( DifferentDirectoryContentException e ) { String msg = ""Generated resources do not match the expected resource (Use -DoverrideExpectedTestFiles=true "" + ""to run test and override expected test files instead of doing this check)"" ; logger . debug ( msg , e ) ; Assert . fail ( msg + ""\n"" + e . getMessage ( ) ) ; } } ","public void checkExpectedGeneratedResources ( ) { try { if ( shouldOverrideExpectedTestFiles ( ) ) { logger . info ( ""Override expected test files (instead of checking)"" ) ; try { FileUtils . deleteDirectory ( getExpectedResourcesTestDir ( ) ) ; FileUtils . copyDirectory ( targetTestDir , getExpectedResourcesTestDir ( ) ) ; } catch ( IOException io ) { throw new RuntimeException ( io ) ; } } checkDirectoriesContainSameContent ( getExpectedResourcesTestDir ( ) , targetTestDir ) ; } catch ( DifferentDirectoryContentException e ) { String msg = ""Generated resources do not match the expected resource (Use -DoverrideExpectedTestFiles=true "" + ""to run test and override expected test files instead of doing this check)"" ; logger . debug ( msg , e ) ; Assert . fail ( msg + ""\n"" + e . getMessage ( ) ) ; } } " 125,"public void checkExpectedGeneratedResources ( ) { try { if ( shouldOverrideExpectedTestFiles ( ) ) { logger . info ( ""Override expected test files (instead of checking)"" ) ; try { FileUtils . deleteDirectory ( getExpectedResourcesTestDir ( ) ) ; FileUtils . copyDirectory ( targetTestDir , getExpectedResourcesTestDir ( ) ) ; } catch ( IOException io ) { throw new RuntimeException ( io ) ; } } checkDirectoriesContainSameContent ( getExpectedResourcesTestDir ( ) , targetTestDir ) ; } catch ( DifferentDirectoryContentException e ) { String msg = ""Generated resources do not match the expected resource (Use -DoverrideExpectedTestFiles=true "" + ""to run test and override expected test files instead of doing this check)"" ; Assert . fail ( msg + ""\n"" + e . getMessage ( ) ) ; } } ","public void checkExpectedGeneratedResources ( ) { try { if ( shouldOverrideExpectedTestFiles ( ) ) { logger . info ( ""Override expected test files (instead of checking)"" ) ; try { FileUtils . deleteDirectory ( getExpectedResourcesTestDir ( ) ) ; FileUtils . copyDirectory ( targetTestDir , getExpectedResourcesTestDir ( ) ) ; } catch ( IOException io ) { throw new RuntimeException ( io ) ; } } checkDirectoriesContainSameContent ( getExpectedResourcesTestDir ( ) , targetTestDir ) ; } catch ( DifferentDirectoryContentException e ) { String msg = ""Generated resources do not match the expected resource (Use -DoverrideExpectedTestFiles=true "" + ""to run test and override expected test files instead of doing this check)"" ; logger . debug ( msg , e ) ; Assert . fail ( msg + ""\n"" + e . getMessage ( ) ) ; } } " 126,"private FutureCallback < ResultSet > getSyncCallback ( RequestContext context ) { return new FutureCallback < ResultSet > ( ) { @ Override public void onSuccess ( ResultSet result ) { Map < String , String > columnMap = CassandraUtil . fetchColumnsMapping ( result ) ; try { Iterator < Row > resultIterator = result . iterator ( ) ; while ( resultIterator . hasNext ( ) ) { Row row = resultIterator . next ( ) ; Map < String , Object > doc = syncDataForEachRow ( row , columnMap ) ; ShadowUser singleShadowUser = mapper . convertValue ( doc , ShadowUser . class ) ; processSingleShadowUser ( singleShadowUser , context ) ; } logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY MIGRATED ALL Shadow user"" ) ; } catch ( Exception e ) { logger . error ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , e ) ; } } @ Override public void onFailure ( Throwable t ) { logger . error ( ""ShadowUserProcessor:getSyncCallback:FAILURE:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , t ) ; } } ; } ","private FutureCallback < ResultSet > getSyncCallback ( RequestContext context ) { return new FutureCallback < ResultSet > ( ) { @ Override public void onSuccess ( ResultSet result ) { Map < String , String > columnMap = CassandraUtil . fetchColumnsMapping ( result ) ; try { Iterator < Row > resultIterator = result . iterator ( ) ; while ( resultIterator . hasNext ( ) ) { Row row = resultIterator . next ( ) ; Map < String , Object > doc = syncDataForEachRow ( row , columnMap ) ; ShadowUser singleShadowUser = mapper . convertValue ( doc , ShadowUser . class ) ; processSingleShadowUser ( singleShadowUser , context ) ; logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY PROCESSED for Shadow user: "" + singleShadowUser . toString ( ) ) ; } logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY MIGRATED ALL Shadow user"" ) ; } catch ( Exception e ) { logger . error ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , e ) ; } } @ Override public void onFailure ( Throwable t ) { logger . error ( ""ShadowUserProcessor:getSyncCallback:FAILURE:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , t ) ; } } ; } " 127,"private FutureCallback < ResultSet > getSyncCallback ( RequestContext context ) { return new FutureCallback < ResultSet > ( ) { @ Override public void onSuccess ( ResultSet result ) { Map < String , String > columnMap = CassandraUtil . fetchColumnsMapping ( result ) ; try { Iterator < Row > resultIterator = result . iterator ( ) ; while ( resultIterator . hasNext ( ) ) { Row row = resultIterator . next ( ) ; Map < String , Object > doc = syncDataForEachRow ( row , columnMap ) ; ShadowUser singleShadowUser = mapper . convertValue ( doc , ShadowUser . class ) ; processSingleShadowUser ( singleShadowUser , context ) ; logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY PROCESSED for Shadow user: "" + singleShadowUser . toString ( ) ) ; } } catch ( Exception e ) { logger . error ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , e ) ; } } @ Override public void onFailure ( Throwable t ) { logger . error ( ""ShadowUserProcessor:getSyncCallback:FAILURE:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , t ) ; } } ; } ","private FutureCallback < ResultSet > getSyncCallback ( RequestContext context ) { return new FutureCallback < ResultSet > ( ) { @ Override public void onSuccess ( ResultSet result ) { Map < String , String > columnMap = CassandraUtil . fetchColumnsMapping ( result ) ; try { Iterator < Row > resultIterator = result . iterator ( ) ; while ( resultIterator . hasNext ( ) ) { Row row = resultIterator . next ( ) ; Map < String , Object > doc = syncDataForEachRow ( row , columnMap ) ; ShadowUser singleShadowUser = mapper . convertValue ( doc , ShadowUser . class ) ; processSingleShadowUser ( singleShadowUser , context ) ; logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY PROCESSED for Shadow user: "" + singleShadowUser . toString ( ) ) ; } logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY MIGRATED ALL Shadow user"" ) ; } catch ( Exception e ) { logger . error ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , e ) ; } } @ Override public void onFailure ( Throwable t ) { logger . error ( ""ShadowUserProcessor:getSyncCallback:FAILURE:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , t ) ; } } ; } " 128,"private FutureCallback < ResultSet > getSyncCallback ( RequestContext context ) { return new FutureCallback < ResultSet > ( ) { @ Override public void onSuccess ( ResultSet result ) { Map < String , String > columnMap = CassandraUtil . fetchColumnsMapping ( result ) ; try { Iterator < Row > resultIterator = result . iterator ( ) ; while ( resultIterator . hasNext ( ) ) { Row row = resultIterator . next ( ) ; Map < String , Object > doc = syncDataForEachRow ( row , columnMap ) ; ShadowUser singleShadowUser = mapper . convertValue ( doc , ShadowUser . class ) ; processSingleShadowUser ( singleShadowUser , context ) ; logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY PROCESSED for Shadow user: "" + singleShadowUser . toString ( ) ) ; } logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY MIGRATED ALL Shadow user"" ) ; } catch ( Exception e ) { } } @ Override public void onFailure ( Throwable t ) { logger . error ( ""ShadowUserProcessor:getSyncCallback:FAILURE:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , t ) ; } } ; } ","private FutureCallback < ResultSet > getSyncCallback ( RequestContext context ) { return new FutureCallback < ResultSet > ( ) { @ Override public void onSuccess ( ResultSet result ) { Map < String , String > columnMap = CassandraUtil . fetchColumnsMapping ( result ) ; try { Iterator < Row > resultIterator = result . iterator ( ) ; while ( resultIterator . hasNext ( ) ) { Row row = resultIterator . next ( ) ; Map < String , Object > doc = syncDataForEachRow ( row , columnMap ) ; ShadowUser singleShadowUser = mapper . convertValue ( doc , ShadowUser . class ) ; processSingleShadowUser ( singleShadowUser , context ) ; logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY PROCESSED for Shadow user: "" + singleShadowUser . toString ( ) ) ; } logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY MIGRATED ALL Shadow user"" ) ; } catch ( Exception e ) { logger . error ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , e ) ; } } @ Override public void onFailure ( Throwable t ) { logger . error ( ""ShadowUserProcessor:getSyncCallback:FAILURE:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , t ) ; } } ; } " 129,"private FutureCallback < ResultSet > getSyncCallback ( RequestContext context ) { return new FutureCallback < ResultSet > ( ) { @ Override public void onSuccess ( ResultSet result ) { Map < String , String > columnMap = CassandraUtil . fetchColumnsMapping ( result ) ; try { Iterator < Row > resultIterator = result . iterator ( ) ; while ( resultIterator . hasNext ( ) ) { Row row = resultIterator . next ( ) ; Map < String , Object > doc = syncDataForEachRow ( row , columnMap ) ; ShadowUser singleShadowUser = mapper . convertValue ( doc , ShadowUser . class ) ; processSingleShadowUser ( singleShadowUser , context ) ; logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY PROCESSED for Shadow user: "" + singleShadowUser . toString ( ) ) ; } logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY MIGRATED ALL Shadow user"" ) ; } catch ( Exception e ) { logger . error ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , e ) ; } } @ Override public void onFailure ( Throwable t ) { } } ; } ","private FutureCallback < ResultSet > getSyncCallback ( RequestContext context ) { return new FutureCallback < ResultSet > ( ) { @ Override public void onSuccess ( ResultSet result ) { Map < String , String > columnMap = CassandraUtil . fetchColumnsMapping ( result ) ; try { Iterator < Row > resultIterator = result . iterator ( ) ; while ( resultIterator . hasNext ( ) ) { Row row = resultIterator . next ( ) ; Map < String , Object > doc = syncDataForEachRow ( row , columnMap ) ; ShadowUser singleShadowUser = mapper . convertValue ( doc , ShadowUser . class ) ; processSingleShadowUser ( singleShadowUser , context ) ; logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY PROCESSED for Shadow user: "" + singleShadowUser . toString ( ) ) ; } logger . info ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:SYNC CALLBACK SUCCESSFULLY MIGRATED ALL Shadow user"" ) ; } catch ( Exception e ) { logger . error ( context , ""ShadowUserProcessor:getSyncCallback:SUCCESS:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , e ) ; } } @ Override public void onFailure ( Throwable t ) { logger . error ( ""ShadowUserProcessor:getSyncCallback:FAILURE:ERROR OCCURRED WHILE GETTING SYNC CALLBACKS"" , t ) ; } } ; } " 130,"public void beginWindow ( long windowId ) { currentWindowId = windowId ; store . beginTransaction ( ) ; } ","public void beginWindow ( long windowId ) { currentWindowId = windowId ; store . beginTransaction ( ) ; logger . debug ( ""Transaction started for window {}"" , windowId ) ; } " 131,"protected void loadMethods ( ) { methods = new ConcurrentHashMap < Method , Method > ( ) ; Method [ ] methods = getClass ( ) . getMethods ( ) ; for ( Method method : methods ) { if ( method . getAnnotation ( MethodWrapper . class ) != null ) { try { Method m = wrapee . getMethod ( method . getName ( ) , method . getParameterTypes ( ) ) ; this . methods . put ( m , method ) ; } catch ( NoSuchMethodException e ) { } } } } ","protected void loadMethods ( ) { methods = new ConcurrentHashMap < Method , Method > ( ) ; Method [ ] methods = getClass ( ) . getMethods ( ) ; for ( Method method : methods ) { if ( method . getAnnotation ( MethodWrapper . class ) != null ) { try { Method m = wrapee . getMethod ( method . getName ( ) , method . getParameterTypes ( ) ) ; this . methods . put ( m , method ) ; } catch ( NoSuchMethodException e ) { log . error ( e , e ) ; } } } } " 132,"@ Path ( ""/entity/{entityId}/groups"" ) @ GET public String getGroups ( @ PathParam ( ""entityId"" ) String entityId , @ QueryParam ( ""identityType"" ) String idType ) throws EngineException , JsonProcessingException { Map < String , GroupMembership > groups = identitiesMan . getGroups ( getEP ( entityId , idType ) ) ; return mapper . writeValueAsString ( groups . keySet ( ) ) ; } ","@ Path ( ""/entity/{entityId}/groups"" ) @ GET public String getGroups ( @ PathParam ( ""entityId"" ) String entityId , @ QueryParam ( ""identityType"" ) String idType ) throws EngineException , JsonProcessingException { log . debug ( ""getGroups query for "" + entityId ) ; Map < String , GroupMembership > groups = identitiesMan . getGroups ( getEP ( entityId , idType ) ) ; return mapper . writeValueAsString ( groups . keySet ( ) ) ; } " 133,"public void deregisterStreamConsumer ( final String stream ) throws InterruptedException , ExecutionException { int attempt = 1 ; String streamConsumerArn = getStreamConsumerArn ( stream ) ; deregistrationBackoff ( configuration , backoff , attempt ++ ) ; Optional < DescribeStreamConsumerResponse > response = describeStreamConsumer ( streamConsumerArn ) ; if ( response . isPresent ( ) && response . get ( ) . consumerDescription ( ) . consumerStatus ( ) != DELETING ) { invokeIgnoringResourceInUse ( ( ) -> kinesisProxyV2Interface . deregisterStreamConsumer ( streamConsumerArn ) ) ; } waitForConsumerToDeregister ( response . orElse ( null ) , streamConsumerArn , attempt ) ; LOG . debug ( ""Deregistered stream consumer - {}"" , streamConsumerArn ) ; } ","public void deregisterStreamConsumer ( final String stream ) throws InterruptedException , ExecutionException { LOG . debug ( ""Deregistering stream consumer - {}"" , stream ) ; int attempt = 1 ; String streamConsumerArn = getStreamConsumerArn ( stream ) ; deregistrationBackoff ( configuration , backoff , attempt ++ ) ; Optional < DescribeStreamConsumerResponse > response = describeStreamConsumer ( streamConsumerArn ) ; if ( response . isPresent ( ) && response . get ( ) . consumerDescription ( ) . consumerStatus ( ) != DELETING ) { invokeIgnoringResourceInUse ( ( ) -> kinesisProxyV2Interface . deregisterStreamConsumer ( streamConsumerArn ) ) ; } waitForConsumerToDeregister ( response . orElse ( null ) , streamConsumerArn , attempt ) ; LOG . debug ( ""Deregistered stream consumer - {}"" , streamConsumerArn ) ; } " 134,"public void deregisterStreamConsumer ( final String stream ) throws InterruptedException , ExecutionException { LOG . debug ( ""Deregistering stream consumer - {}"" , stream ) ; int attempt = 1 ; String streamConsumerArn = getStreamConsumerArn ( stream ) ; deregistrationBackoff ( configuration , backoff , attempt ++ ) ; Optional < DescribeStreamConsumerResponse > response = describeStreamConsumer ( streamConsumerArn ) ; if ( response . isPresent ( ) && response . get ( ) . consumerDescription ( ) . consumerStatus ( ) != DELETING ) { invokeIgnoringResourceInUse ( ( ) -> kinesisProxyV2Interface . deregisterStreamConsumer ( streamConsumerArn ) ) ; } waitForConsumerToDeregister ( response . orElse ( null ) , streamConsumerArn , attempt ) ; } ","public void deregisterStreamConsumer ( final String stream ) throws InterruptedException , ExecutionException { LOG . debug ( ""Deregistering stream consumer - {}"" , stream ) ; int attempt = 1 ; String streamConsumerArn = getStreamConsumerArn ( stream ) ; deregistrationBackoff ( configuration , backoff , attempt ++ ) ; Optional < DescribeStreamConsumerResponse > response = describeStreamConsumer ( streamConsumerArn ) ; if ( response . isPresent ( ) && response . get ( ) . consumerDescription ( ) . consumerStatus ( ) != DELETING ) { invokeIgnoringResourceInUse ( ( ) -> kinesisProxyV2Interface . deregisterStreamConsumer ( streamConsumerArn ) ) ; } waitForConsumerToDeregister ( response . orElse ( null ) , streamConsumerArn , attempt ) ; LOG . debug ( ""Deregistered stream consumer - {}"" , streamConsumerArn ) ; } " 135,"public List < PartitionGroup > findPartitionGroupLeaderBroker ( String topic , String namespace ) { try { List < TopicPartitionGroup > topicPartitionGroups = partitionGroupServerService . findByTopic ( topic , namespace ) ; if ( null == topicPartitionGroups ) { throw new IllegalArgumentException ( ""topic partition group is null"" ) ; } if ( topicPartitionGroups . isEmpty ( ) ) { return Collections . EMPTY_LIST ; } return findPartitionGroupLeaderBroker ( topicPartitionGroups ) ; } catch ( Exception e ) { throw new ServiceException ( ServiceException . INTERNAL_SERVER_ERROR , e . getMessage ( ) , e ) ; } } ","public List < PartitionGroup > findPartitionGroupLeaderBroker ( String topic , String namespace ) { try { List < TopicPartitionGroup > topicPartitionGroups = partitionGroupServerService . findByTopic ( topic , namespace ) ; if ( null == topicPartitionGroups ) { throw new IllegalArgumentException ( ""topic partition group is null"" ) ; } if ( topicPartitionGroups . isEmpty ( ) ) { return Collections . EMPTY_LIST ; } return findPartitionGroupLeaderBroker ( topicPartitionGroups ) ; } catch ( Exception e ) { logger . error ( """" , e ) ; throw new ServiceException ( ServiceException . INTERNAL_SERVER_ERROR , e . getMessage ( ) , e ) ; } } " 136,"public final void failedJob ( Job < ? > job , JobEndStatus endStatus ) { this . profile . end ( ) ; removeJobTempData ( ) ; if ( this . task . getStatus ( ) == TaskState . CANCELED ) { } else { if ( this . isCancelling ( ) ) { JOB_LOGGER . debug ( ""Received a notification for cancelled job "" + job . getJobId ( ) ) ; doOutputTransfers ( job ) ; notifyError ( ) ; } else { int jobId = job . getJobId ( ) ; JOB_LOGGER . error ( ""Received a notification for job "" + jobId + "" with state FAILED"" ) ; JOB_LOGGER . error ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ErrorManager . warn ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ++ this . executionErrors ; if ( this . transferErrors + this . executionErrors < SUBMISSION_CHANCES && this . task . getOnFailure ( ) == OnFailure . RETRY ) { JOB_LOGGER . error ( ""Resubmitting job to the same worker."" ) ; ErrorManager . warn ( ""Resubmitting job to the same worker."" ) ; job . setHistory ( JobHistory . RESUBMITTED ) ; this . profile . start ( ) ; JobDispatcher . dispatch ( job ) ; } else { if ( this . task . getOnFailure ( ) == OnFailure . IGNORE ) { ErrorManager . warn ( ""Ignoring failure."" ) ; doOutputTransfers ( job ) ; } notifyError ( ) ; } } } } ","public final void failedJob ( Job < ? > job , JobEndStatus endStatus ) { this . profile . end ( ) ; removeJobTempData ( ) ; if ( this . task . getStatus ( ) == TaskState . CANCELED ) { JOB_LOGGER . debug ( ""Ignoring notification for cancelled job "" + job . getJobId ( ) ) ; } else { if ( this . isCancelling ( ) ) { JOB_LOGGER . debug ( ""Received a notification for cancelled job "" + job . getJobId ( ) ) ; doOutputTransfers ( job ) ; notifyError ( ) ; } else { int jobId = job . getJobId ( ) ; JOB_LOGGER . error ( ""Received a notification for job "" + jobId + "" with state FAILED"" ) ; JOB_LOGGER . error ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ErrorManager . warn ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ++ this . executionErrors ; if ( this . transferErrors + this . executionErrors < SUBMISSION_CHANCES && this . task . getOnFailure ( ) == OnFailure . RETRY ) { JOB_LOGGER . error ( ""Resubmitting job to the same worker."" ) ; ErrorManager . warn ( ""Resubmitting job to the same worker."" ) ; job . setHistory ( JobHistory . RESUBMITTED ) ; this . profile . start ( ) ; JobDispatcher . dispatch ( job ) ; } else { if ( this . task . getOnFailure ( ) == OnFailure . IGNORE ) { ErrorManager . warn ( ""Ignoring failure."" ) ; doOutputTransfers ( job ) ; } notifyError ( ) ; } } } } " 137,"public final void failedJob ( Job < ? > job , JobEndStatus endStatus ) { this . profile . end ( ) ; removeJobTempData ( ) ; if ( this . task . getStatus ( ) == TaskState . CANCELED ) { JOB_LOGGER . debug ( ""Ignoring notification for cancelled job "" + job . getJobId ( ) ) ; } else { if ( this . isCancelling ( ) ) { doOutputTransfers ( job ) ; notifyError ( ) ; } else { int jobId = job . getJobId ( ) ; JOB_LOGGER . error ( ""Received a notification for job "" + jobId + "" with state FAILED"" ) ; JOB_LOGGER . error ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ErrorManager . warn ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ++ this . executionErrors ; if ( this . transferErrors + this . executionErrors < SUBMISSION_CHANCES && this . task . getOnFailure ( ) == OnFailure . RETRY ) { JOB_LOGGER . error ( ""Resubmitting job to the same worker."" ) ; ErrorManager . warn ( ""Resubmitting job to the same worker."" ) ; job . setHistory ( JobHistory . RESUBMITTED ) ; this . profile . start ( ) ; JobDispatcher . dispatch ( job ) ; } else { if ( this . task . getOnFailure ( ) == OnFailure . IGNORE ) { ErrorManager . warn ( ""Ignoring failure."" ) ; doOutputTransfers ( job ) ; } notifyError ( ) ; } } } } ","public final void failedJob ( Job < ? > job , JobEndStatus endStatus ) { this . profile . end ( ) ; removeJobTempData ( ) ; if ( this . task . getStatus ( ) == TaskState . CANCELED ) { JOB_LOGGER . debug ( ""Ignoring notification for cancelled job "" + job . getJobId ( ) ) ; } else { if ( this . isCancelling ( ) ) { JOB_LOGGER . debug ( ""Received a notification for cancelled job "" + job . getJobId ( ) ) ; doOutputTransfers ( job ) ; notifyError ( ) ; } else { int jobId = job . getJobId ( ) ; JOB_LOGGER . error ( ""Received a notification for job "" + jobId + "" with state FAILED"" ) ; JOB_LOGGER . error ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ErrorManager . warn ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ++ this . executionErrors ; if ( this . transferErrors + this . executionErrors < SUBMISSION_CHANCES && this . task . getOnFailure ( ) == OnFailure . RETRY ) { JOB_LOGGER . error ( ""Resubmitting job to the same worker."" ) ; ErrorManager . warn ( ""Resubmitting job to the same worker."" ) ; job . setHistory ( JobHistory . RESUBMITTED ) ; this . profile . start ( ) ; JobDispatcher . dispatch ( job ) ; } else { if ( this . task . getOnFailure ( ) == OnFailure . IGNORE ) { ErrorManager . warn ( ""Ignoring failure."" ) ; doOutputTransfers ( job ) ; } notifyError ( ) ; } } } } " 138,"public final void failedJob ( Job < ? > job , JobEndStatus endStatus ) { this . profile . end ( ) ; removeJobTempData ( ) ; if ( this . task . getStatus ( ) == TaskState . CANCELED ) { JOB_LOGGER . debug ( ""Ignoring notification for cancelled job "" + job . getJobId ( ) ) ; } else { if ( this . isCancelling ( ) ) { JOB_LOGGER . debug ( ""Received a notification for cancelled job "" + job . getJobId ( ) ) ; doOutputTransfers ( job ) ; notifyError ( ) ; } else { int jobId = job . getJobId ( ) ; JOB_LOGGER . error ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ErrorManager . warn ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ++ this . executionErrors ; if ( this . transferErrors + this . executionErrors < SUBMISSION_CHANCES && this . task . getOnFailure ( ) == OnFailure . RETRY ) { JOB_LOGGER . error ( ""Resubmitting job to the same worker."" ) ; ErrorManager . warn ( ""Resubmitting job to the same worker."" ) ; job . setHistory ( JobHistory . RESUBMITTED ) ; this . profile . start ( ) ; JobDispatcher . dispatch ( job ) ; } else { if ( this . task . getOnFailure ( ) == OnFailure . IGNORE ) { ErrorManager . warn ( ""Ignoring failure."" ) ; doOutputTransfers ( job ) ; } notifyError ( ) ; } } } } ","public final void failedJob ( Job < ? > job , JobEndStatus endStatus ) { this . profile . end ( ) ; removeJobTempData ( ) ; if ( this . task . getStatus ( ) == TaskState . CANCELED ) { JOB_LOGGER . debug ( ""Ignoring notification for cancelled job "" + job . getJobId ( ) ) ; } else { if ( this . isCancelling ( ) ) { JOB_LOGGER . debug ( ""Received a notification for cancelled job "" + job . getJobId ( ) ) ; doOutputTransfers ( job ) ; notifyError ( ) ; } else { int jobId = job . getJobId ( ) ; JOB_LOGGER . error ( ""Received a notification for job "" + jobId + "" with state FAILED"" ) ; JOB_LOGGER . error ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ErrorManager . warn ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ++ this . executionErrors ; if ( this . transferErrors + this . executionErrors < SUBMISSION_CHANCES && this . task . getOnFailure ( ) == OnFailure . RETRY ) { JOB_LOGGER . error ( ""Resubmitting job to the same worker."" ) ; ErrorManager . warn ( ""Resubmitting job to the same worker."" ) ; job . setHistory ( JobHistory . RESUBMITTED ) ; this . profile . start ( ) ; JobDispatcher . dispatch ( job ) ; } else { if ( this . task . getOnFailure ( ) == OnFailure . IGNORE ) { ErrorManager . warn ( ""Ignoring failure."" ) ; doOutputTransfers ( job ) ; } notifyError ( ) ; } } } } " 139,"public final void failedJob ( Job < ? > job , JobEndStatus endStatus ) { this . profile . end ( ) ; removeJobTempData ( ) ; if ( this . task . getStatus ( ) == TaskState . CANCELED ) { JOB_LOGGER . debug ( ""Ignoring notification for cancelled job "" + job . getJobId ( ) ) ; } else { if ( this . isCancelling ( ) ) { JOB_LOGGER . debug ( ""Received a notification for cancelled job "" + job . getJobId ( ) ) ; doOutputTransfers ( job ) ; notifyError ( ) ; } else { int jobId = job . getJobId ( ) ; JOB_LOGGER . error ( ""Received a notification for job "" + jobId + "" with state FAILED"" ) ; ErrorManager . warn ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ++ this . executionErrors ; if ( this . transferErrors + this . executionErrors < SUBMISSION_CHANCES && this . task . getOnFailure ( ) == OnFailure . RETRY ) { JOB_LOGGER . error ( ""Resubmitting job to the same worker."" ) ; ErrorManager . warn ( ""Resubmitting job to the same worker."" ) ; job . setHistory ( JobHistory . RESUBMITTED ) ; this . profile . start ( ) ; JobDispatcher . dispatch ( job ) ; } else { if ( this . task . getOnFailure ( ) == OnFailure . IGNORE ) { ErrorManager . warn ( ""Ignoring failure."" ) ; doOutputTransfers ( job ) ; } notifyError ( ) ; } } } } ","public final void failedJob ( Job < ? > job , JobEndStatus endStatus ) { this . profile . end ( ) ; removeJobTempData ( ) ; if ( this . task . getStatus ( ) == TaskState . CANCELED ) { JOB_LOGGER . debug ( ""Ignoring notification for cancelled job "" + job . getJobId ( ) ) ; } else { if ( this . isCancelling ( ) ) { JOB_LOGGER . debug ( ""Received a notification for cancelled job "" + job . getJobId ( ) ) ; doOutputTransfers ( job ) ; notifyError ( ) ; } else { int jobId = job . getJobId ( ) ; JOB_LOGGER . error ( ""Received a notification for job "" + jobId + "" with state FAILED"" ) ; JOB_LOGGER . error ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ErrorManager . warn ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ++ this . executionErrors ; if ( this . transferErrors + this . executionErrors < SUBMISSION_CHANCES && this . task . getOnFailure ( ) == OnFailure . RETRY ) { JOB_LOGGER . error ( ""Resubmitting job to the same worker."" ) ; ErrorManager . warn ( ""Resubmitting job to the same worker."" ) ; job . setHistory ( JobHistory . RESUBMITTED ) ; this . profile . start ( ) ; JobDispatcher . dispatch ( job ) ; } else { if ( this . task . getOnFailure ( ) == OnFailure . IGNORE ) { ErrorManager . warn ( ""Ignoring failure."" ) ; doOutputTransfers ( job ) ; } notifyError ( ) ; } } } } " 140,"public final void failedJob ( Job < ? > job , JobEndStatus endStatus ) { this . profile . end ( ) ; removeJobTempData ( ) ; if ( this . task . getStatus ( ) == TaskState . CANCELED ) { JOB_LOGGER . debug ( ""Ignoring notification for cancelled job "" + job . getJobId ( ) ) ; } else { if ( this . isCancelling ( ) ) { JOB_LOGGER . debug ( ""Received a notification for cancelled job "" + job . getJobId ( ) ) ; doOutputTransfers ( job ) ; notifyError ( ) ; } else { int jobId = job . getJobId ( ) ; JOB_LOGGER . error ( ""Received a notification for job "" + jobId + "" with state FAILED"" ) ; JOB_LOGGER . error ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ErrorManager . warn ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ++ this . executionErrors ; if ( this . transferErrors + this . executionErrors < SUBMISSION_CHANCES && this . task . getOnFailure ( ) == OnFailure . RETRY ) { ErrorManager . warn ( ""Resubmitting job to the same worker."" ) ; job . setHistory ( JobHistory . RESUBMITTED ) ; this . profile . start ( ) ; JobDispatcher . dispatch ( job ) ; } else { if ( this . task . getOnFailure ( ) == OnFailure . IGNORE ) { ErrorManager . warn ( ""Ignoring failure."" ) ; doOutputTransfers ( job ) ; } notifyError ( ) ; } } } } ","public final void failedJob ( Job < ? > job , JobEndStatus endStatus ) { this . profile . end ( ) ; removeJobTempData ( ) ; if ( this . task . getStatus ( ) == TaskState . CANCELED ) { JOB_LOGGER . debug ( ""Ignoring notification for cancelled job "" + job . getJobId ( ) ) ; } else { if ( this . isCancelling ( ) ) { JOB_LOGGER . debug ( ""Received a notification for cancelled job "" + job . getJobId ( ) ) ; doOutputTransfers ( job ) ; notifyError ( ) ; } else { int jobId = job . getJobId ( ) ; JOB_LOGGER . error ( ""Received a notification for job "" + jobId + "" with state FAILED"" ) ; JOB_LOGGER . error ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ErrorManager . warn ( ""Job "" + job . getJobId ( ) + "", running Task "" + this . task . getId ( ) + "" on worker "" + this . getAssignedResource ( ) . getName ( ) + "", has failed."" ) ; ++ this . executionErrors ; if ( this . transferErrors + this . executionErrors < SUBMISSION_CHANCES && this . task . getOnFailure ( ) == OnFailure . RETRY ) { JOB_LOGGER . error ( ""Resubmitting job to the same worker."" ) ; ErrorManager . warn ( ""Resubmitting job to the same worker."" ) ; job . setHistory ( JobHistory . RESUBMITTED ) ; this . profile . start ( ) ; JobDispatcher . dispatch ( job ) ; } else { if ( this . task . getOnFailure ( ) == OnFailure . IGNORE ) { ErrorManager . warn ( ""Ignoring failure."" ) ; doOutputTransfers ( job ) ; } notifyError ( ) ; } } } } " 141,"public ExpirationConfiguration loadExpirationConfiguration ( ) { ExpirationConfiguration result ; final String propertyDir = PropertyAccessor . getInstance ( ) . getPropertyFileLocation ( ) ; LOG . debug ( ""Property Directory: "" + propertyDir ) ; result = loadExpirationConfiguration ( propertyDir , FTA_CONFIG_FILE ) ; return result ; } ","public ExpirationConfiguration loadExpirationConfiguration ( ) { ExpirationConfiguration result ; LOG . debug ( ""begin loadExpirationConfiguration()"" ) ; final String propertyDir = PropertyAccessor . getInstance ( ) . getPropertyFileLocation ( ) ; LOG . debug ( ""Property Directory: "" + propertyDir ) ; result = loadExpirationConfiguration ( propertyDir , FTA_CONFIG_FILE ) ; return result ; } " 142,"public ExpirationConfiguration loadExpirationConfiguration ( ) { ExpirationConfiguration result ; LOG . debug ( ""begin loadExpirationConfiguration()"" ) ; final String propertyDir = PropertyAccessor . getInstance ( ) . getPropertyFileLocation ( ) ; result = loadExpirationConfiguration ( propertyDir , FTA_CONFIG_FILE ) ; return result ; } ","public ExpirationConfiguration loadExpirationConfiguration ( ) { ExpirationConfiguration result ; LOG . debug ( ""begin loadExpirationConfiguration()"" ) ; final String propertyDir = PropertyAccessor . getInstance ( ) . getPropertyFileLocation ( ) ; LOG . debug ( ""Property Directory: "" + propertyDir ) ; result = loadExpirationConfiguration ( propertyDir , FTA_CONFIG_FILE ) ; return result ; } " 143,"protected void registerQueue ( UpnpEntryQueue queue ) { if ( currentQueue . equals ( queue ) ) { return ; } registeredQueue = true ; currentQueue = queue ; currentQueue . setRepeat ( repeat ) ; currentQueue . setShuffle ( shuffle ) ; if ( playingQueue ) { nextEntry = currentQueue . get ( currentQueue . nextIndex ( ) ) ; UpnpEntry next = nextEntry ; if ( ( next != null ) && ! onlyplayone ) { logger . trace ( ""Renderer {} still playing, set new queue as next entry"" , thing . getLabel ( ) ) ; setNextURI ( next . getRes ( ) , UpnpXMLParser . compileMetadataString ( next ) ) ; } } else { resetToStartQueue ( ) ; } } ","protected void registerQueue ( UpnpEntryQueue queue ) { if ( currentQueue . equals ( queue ) ) { return ; } logger . debug ( ""Registering queue on renderer {}"" , thing . getLabel ( ) ) ; registeredQueue = true ; currentQueue = queue ; currentQueue . setRepeat ( repeat ) ; currentQueue . setShuffle ( shuffle ) ; if ( playingQueue ) { nextEntry = currentQueue . get ( currentQueue . nextIndex ( ) ) ; UpnpEntry next = nextEntry ; if ( ( next != null ) && ! onlyplayone ) { logger . trace ( ""Renderer {} still playing, set new queue as next entry"" , thing . getLabel ( ) ) ; setNextURI ( next . getRes ( ) , UpnpXMLParser . compileMetadataString ( next ) ) ; } } else { resetToStartQueue ( ) ; } } " 144,"protected void registerQueue ( UpnpEntryQueue queue ) { if ( currentQueue . equals ( queue ) ) { return ; } logger . debug ( ""Registering queue on renderer {}"" , thing . getLabel ( ) ) ; registeredQueue = true ; currentQueue = queue ; currentQueue . setRepeat ( repeat ) ; currentQueue . setShuffle ( shuffle ) ; if ( playingQueue ) { nextEntry = currentQueue . get ( currentQueue . nextIndex ( ) ) ; UpnpEntry next = nextEntry ; if ( ( next != null ) && ! onlyplayone ) { setNextURI ( next . getRes ( ) , UpnpXMLParser . compileMetadataString ( next ) ) ; } } else { resetToStartQueue ( ) ; } } ","protected void registerQueue ( UpnpEntryQueue queue ) { if ( currentQueue . equals ( queue ) ) { return ; } logger . debug ( ""Registering queue on renderer {}"" , thing . getLabel ( ) ) ; registeredQueue = true ; currentQueue = queue ; currentQueue . setRepeat ( repeat ) ; currentQueue . setShuffle ( shuffle ) ; if ( playingQueue ) { nextEntry = currentQueue . get ( currentQueue . nextIndex ( ) ) ; UpnpEntry next = nextEntry ; if ( ( next != null ) && ! onlyplayone ) { logger . trace ( ""Renderer {} still playing, set new queue as next entry"" , thing . getLabel ( ) ) ; setNextURI ( next . getRes ( ) , UpnpXMLParser . compileMetadataString ( next ) ) ; } } else { resetToStartQueue ( ) ; } } " 145,"public static String print ( Node n , String encoding ) { if ( n == null ) { return null ; } try { Document document = null ; if ( n instanceof Document ) { document = ( Document ) n ; } else { document = n . getOwnerDocument ( ) ; } StringWriter stringOut = new StringWriter ( ) ; DOMImplementationLS domImpl = ( DOMImplementationLS ) document . getImplementation ( ) ; LSSerializer lsSerializer = domImpl . createLSSerializer ( ) ; lsSerializer . getDomConfig ( ) . setParameter ( XML_DECLARATION , false ) ; LSOutput lsout = domImpl . createLSOutput ( ) ; lsout . setEncoding ( encoding ) ; lsout . setCharacterStream ( stringOut ) ; if ( n . getNodeType ( ) == Node . ATTRIBUTE_NODE && n . hasChildNodes ( ) ) { n = n . getFirstChild ( ) ; } lsSerializer . write ( n , lsout ) ; return stringOut . toString ( ) ; } catch ( DOMException | LSException e ) { } return null ; } ","public static String print ( Node n , String encoding ) { if ( n == null ) { return null ; } try { Document document = null ; if ( n instanceof Document ) { document = ( Document ) n ; } else { document = n . getOwnerDocument ( ) ; } StringWriter stringOut = new StringWriter ( ) ; DOMImplementationLS domImpl = ( DOMImplementationLS ) document . getImplementation ( ) ; LSSerializer lsSerializer = domImpl . createLSSerializer ( ) ; lsSerializer . getDomConfig ( ) . setParameter ( XML_DECLARATION , false ) ; LSOutput lsout = domImpl . createLSOutput ( ) ; lsout . setEncoding ( encoding ) ; lsout . setCharacterStream ( stringOut ) ; if ( n . getNodeType ( ) == Node . ATTRIBUTE_NODE && n . hasChildNodes ( ) ) { n = n . getFirstChild ( ) ; } lsSerializer . write ( n , lsout ) ; return stringOut . toString ( ) ; } catch ( DOMException | LSException e ) { LOGGER . debug ( e . getMessage ( ) , e ) ; } return null ; } " 146,"@ Test public void testCreateGRETunnelTemplate ( ) { template = ""/VM_files/createTunnel.vm"" ; String message = callGRETunnelVelocity ( template , newParamsGRETunnelService ( ) ) ; Assert . assertNotNull ( message ) ; } ","@ Test public void testCreateGRETunnelTemplate ( ) { template = ""/VM_files/createTunnel.vm"" ; String message = callGRETunnelVelocity ( template , newParamsGRETunnelService ( ) ) ; Assert . assertNotNull ( message ) ; log . info ( message ) ; } " 147,"public void sendFeatureList ( List < Feature > featureList , String action ) throws ArcgisException { Map < String , String > params = new LinkedHashMap < String , String > ( ) ; params . put ( OUT_SPATIAL_REFERENCE_PARAM , DEFAULT_SPATIAL_REFERENCE ) ; if ( getCredential ( ) != null && ! """" . equals ( getCredential ( ) . getToken ( ) ) ) { params . put ( TOKEN_PARAM , getCredential ( ) . getToken ( ) ) ; } params . put ( ROLLBACK_ON_FAILURE_PARAM , ""true"" ) ; Map < String , String > bodyParams = new LinkedHashMap < String , String > ( ) ; bodyParams . put ( FEATURES_PARAM , featureListToStrArray ( featureList ) ) ; bodyParams . put ( OUTPUT_FORMAT_PARAM , DEFAULT_OUTPUT_FORMAT ) ; String fullUrl = serviceUrl . toString ( ) ; if ( ! fullUrl . endsWith ( ""/"" + action ) ) { fullUrl += ""/"" + action ; } HttpResponse response = httpPost ( fullUrl , params , bodyParams ) ; LOGGER . debug ( ""Response code: "" + response . getResponseCode ( ) + ""\n\t"" + response . getBody ( ) ) ; checkResponse ( response ) ; } ","public void sendFeatureList ( List < Feature > featureList , String action ) throws ArcgisException { LOGGER . debug ( action + "" feature list("" + featureList . size ( ) + ""), into Feature table: "" + serviceUrl ) ; Map < String , String > params = new LinkedHashMap < String , String > ( ) ; params . put ( OUT_SPATIAL_REFERENCE_PARAM , DEFAULT_SPATIAL_REFERENCE ) ; if ( getCredential ( ) != null && ! """" . equals ( getCredential ( ) . getToken ( ) ) ) { params . put ( TOKEN_PARAM , getCredential ( ) . getToken ( ) ) ; } params . put ( ROLLBACK_ON_FAILURE_PARAM , ""true"" ) ; Map < String , String > bodyParams = new LinkedHashMap < String , String > ( ) ; bodyParams . put ( FEATURES_PARAM , featureListToStrArray ( featureList ) ) ; bodyParams . put ( OUTPUT_FORMAT_PARAM , DEFAULT_OUTPUT_FORMAT ) ; String fullUrl = serviceUrl . toString ( ) ; if ( ! fullUrl . endsWith ( ""/"" + action ) ) { fullUrl += ""/"" + action ; } HttpResponse response = httpPost ( fullUrl , params , bodyParams ) ; LOGGER . debug ( ""Response code: "" + response . getResponseCode ( ) + ""\n\t"" + response . getBody ( ) ) ; checkResponse ( response ) ; } " 148,"public void sendFeatureList ( List < Feature > featureList , String action ) throws ArcgisException { LOGGER . debug ( action + "" feature list("" + featureList . size ( ) + ""), into Feature table: "" + serviceUrl ) ; Map < String , String > params = new LinkedHashMap < String , String > ( ) ; params . put ( OUT_SPATIAL_REFERENCE_PARAM , DEFAULT_SPATIAL_REFERENCE ) ; if ( getCredential ( ) != null && ! """" . equals ( getCredential ( ) . getToken ( ) ) ) { params . put ( TOKEN_PARAM , getCredential ( ) . getToken ( ) ) ; } params . put ( ROLLBACK_ON_FAILURE_PARAM , ""true"" ) ; Map < String , String > bodyParams = new LinkedHashMap < String , String > ( ) ; bodyParams . put ( FEATURES_PARAM , featureListToStrArray ( featureList ) ) ; bodyParams . put ( OUTPUT_FORMAT_PARAM , DEFAULT_OUTPUT_FORMAT ) ; String fullUrl = serviceUrl . toString ( ) ; if ( ! fullUrl . endsWith ( ""/"" + action ) ) { fullUrl += ""/"" + action ; } HttpResponse response = httpPost ( fullUrl , params , bodyParams ) ; checkResponse ( response ) ; } ","public void sendFeatureList ( List < Feature > featureList , String action ) throws ArcgisException { LOGGER . debug ( action + "" feature list("" + featureList . size ( ) + ""), into Feature table: "" + serviceUrl ) ; Map < String , String > params = new LinkedHashMap < String , String > ( ) ; params . put ( OUT_SPATIAL_REFERENCE_PARAM , DEFAULT_SPATIAL_REFERENCE ) ; if ( getCredential ( ) != null && ! """" . equals ( getCredential ( ) . getToken ( ) ) ) { params . put ( TOKEN_PARAM , getCredential ( ) . getToken ( ) ) ; } params . put ( ROLLBACK_ON_FAILURE_PARAM , ""true"" ) ; Map < String , String > bodyParams = new LinkedHashMap < String , String > ( ) ; bodyParams . put ( FEATURES_PARAM , featureListToStrArray ( featureList ) ) ; bodyParams . put ( OUTPUT_FORMAT_PARAM , DEFAULT_OUTPUT_FORMAT ) ; String fullUrl = serviceUrl . toString ( ) ; if ( ! fullUrl . endsWith ( ""/"" + action ) ) { fullUrl += ""/"" + action ; } HttpResponse response = httpPost ( fullUrl , params , bodyParams ) ; LOGGER . debug ( ""Response code: "" + response . getResponseCode ( ) + ""\n\t"" + response . getBody ( ) ) ; checkResponse ( response ) ; } " 149,"public Object getValueAt ( int rowIndex , int columnIndex ) { SRU sru = sruManager . getSRUsAsList ( ) [ rowIndex ] ; switch ( columnIndex ) { case 0 : return Formatter . formatString ( sru . getName ( ) ) ; case 1 : return sru . getType ( ) ; case 2 : return calculate . get ( rowIndex ) ; default : return new String ( """" ) ; } } ","public Object getValueAt ( int rowIndex , int columnIndex ) { SRU sru = sruManager . getSRUsAsList ( ) [ rowIndex ] ; switch ( columnIndex ) { case 0 : return Formatter . formatString ( sru . getName ( ) ) ; case 1 : return sru . getType ( ) ; case 2 : return calculate . get ( rowIndex ) ; default : LOG . error ( ""Unknown column "" + columnIndex ) ; return new String ( """" ) ; } } " 150,"public void onSuccess ( RetryContext context ) { if ( logger . isDebugEnabled ( ) ) { } fireConnectNotification ( CONNECTION_CONNECTED , context . getDescription ( ) , context ) ; } ","public void onSuccess ( RetryContext context ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Successfully connected to "" + context . getDescription ( ) ) ; } fireConnectNotification ( CONNECTION_CONNECTED , context . getDescription ( ) , context ) ; } " 151,"public void run ( ) { try { produceMessage ( session , destination ) ; } catch ( JMSException e ) { LOG . info ( ""got send exception: "" , e ) ; } sendDoneLatch . countDown ( ) ; LOG . info ( ""done async send"" ) ; } ","public void run ( ) { LOG . info ( ""doing async send..."" ) ; try { produceMessage ( session , destination ) ; } catch ( JMSException e ) { LOG . info ( ""got send exception: "" , e ) ; } sendDoneLatch . countDown ( ) ; LOG . info ( ""done async send"" ) ; } " 152,"public void run ( ) { LOG . info ( ""doing async send..."" ) ; try { produceMessage ( session , destination ) ; } catch ( JMSException e ) { } sendDoneLatch . countDown ( ) ; LOG . info ( ""done async send"" ) ; } ","public void run ( ) { LOG . info ( ""doing async send..."" ) ; try { produceMessage ( session , destination ) ; } catch ( JMSException e ) { LOG . info ( ""got send exception: "" , e ) ; } sendDoneLatch . countDown ( ) ; LOG . info ( ""done async send"" ) ; } " 153,"public void run ( ) { LOG . info ( ""doing async send..."" ) ; try { produceMessage ( session , destination ) ; } catch ( JMSException e ) { LOG . info ( ""got send exception: "" , e ) ; } sendDoneLatch . countDown ( ) ; } ","public void run ( ) { LOG . info ( ""doing async send..."" ) ; try { produceMessage ( session , destination ) ; } catch ( JMSException e ) { LOG . info ( ""got send exception: "" , e ) ; } sendDoneLatch . countDown ( ) ; LOG . info ( ""done async send"" ) ; } " 154,"public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } ","public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } " 155,"public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } ","public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } " 156,"public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } ","public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } " 157,"public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } ","public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } " 158,"public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } ","public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } " 159,"public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } ","public User login ( String userOrEmail , String userpass ) throws OmException { List < User > users = em . createNamedQuery ( ""getUserByLoginOrEmail"" , User . class ) . setParameter ( ""userOrEmail"" , userOrEmail ) . setParameter ( ""type"" , Type . USER ) . getResultList ( ) ; log . debug ( ""login:: {} users were found"" , users . size ( ) ) ; if ( users . isEmpty ( ) ) { log . debug ( ""No users was found: {}"" , userOrEmail ) ; return null ; } User u = users . get ( 0 ) ; if ( ! verifyPassword ( u . getId ( ) , userpass ) ) { log . debug ( ""Password does not match: {}"" , u ) ; return null ; } if ( ! AuthLevelUtil . hasLoginLevel ( u . getRights ( ) ) ) { log . debug ( ""Not activated: {}"" , u ) ; throw new OmException ( ""error.notactivated"" ) ; } log . debug ( ""login user groups {}"" , u . getGroupUsers ( ) ) ; if ( u . getGroupUsers ( ) . isEmpty ( ) ) { log . debug ( ""No Group assigned: {}"" , u ) ; throw new OmException ( ""error.nogroup"" ) ; } u . setLastlogin ( new Date ( ) ) ; return update ( u , u . getId ( ) ) ; } " 160,"protected static String getResourceBaseName ( Resource resource ) { try { File resourceFile = resource . getFile ( ) ; if ( ( resourceFile != null ) && ( resource instanceof JarFileResource ) ) { resourceFile = ( ( JarFileResource ) resource ) . getJarFile ( ) ; } if ( resourceFile != null ) { return resourceFile . getName ( ) ; } } catch ( IOException e ) { if ( LOG . isDebugEnabled ( ) ) { } } URI uri = resource . getURI ( ) ; if ( uri == null ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Resource has no URI reference: {}"" , resource ) ; } return """" ; } return URIUtil . getUriLastPathSegment ( uri ) ; } ","protected static String getResourceBaseName ( Resource resource ) { try { File resourceFile = resource . getFile ( ) ; if ( ( resourceFile != null ) && ( resource instanceof JarFileResource ) ) { resourceFile = ( ( JarFileResource ) resource ) . getJarFile ( ) ; } if ( resourceFile != null ) { return resourceFile . getName ( ) ; } } catch ( IOException e ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Resource has no File reference: {}"" , resource ) ; } } URI uri = resource . getURI ( ) ; if ( uri == null ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Resource has no URI reference: {}"" , resource ) ; } return """" ; } return URIUtil . getUriLastPathSegment ( uri ) ; } " 161,"protected static String getResourceBaseName ( Resource resource ) { try { File resourceFile = resource . getFile ( ) ; if ( ( resourceFile != null ) && ( resource instanceof JarFileResource ) ) { resourceFile = ( ( JarFileResource ) resource ) . getJarFile ( ) ; } if ( resourceFile != null ) { return resourceFile . getName ( ) ; } } catch ( IOException e ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Resource has no File reference: {}"" , resource ) ; } } URI uri = resource . getURI ( ) ; if ( uri == null ) { if ( LOG . isDebugEnabled ( ) ) { } return """" ; } return URIUtil . getUriLastPathSegment ( uri ) ; } ","protected static String getResourceBaseName ( Resource resource ) { try { File resourceFile = resource . getFile ( ) ; if ( ( resourceFile != null ) && ( resource instanceof JarFileResource ) ) { resourceFile = ( ( JarFileResource ) resource ) . getJarFile ( ) ; } if ( resourceFile != null ) { return resourceFile . getName ( ) ; } } catch ( IOException e ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Resource has no File reference: {}"" , resource ) ; } } URI uri = resource . getURI ( ) ; if ( uri == null ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Resource has no URI reference: {}"" , resource ) ; } return """" ; } return URIUtil . getUriLastPathSegment ( uri ) ; } " 162,"private void createTestRole ( String user , String roleName ) throws Exception { Connection conn = context . createConnection ( user ) ; Statement stmt = conn . createStatement ( ) ; try { exec ( stmt , ""DROP ROLE "" + roleName ) ; } catch ( Exception ex ) { } finally { exec ( stmt , ""CREATE ROLE "" + roleName ) ; } if ( stmt != null ) { stmt . close ( ) ; } if ( conn != null ) { conn . close ( ) ; } } ","private void createTestRole ( String user , String roleName ) throws Exception { Connection conn = context . createConnection ( user ) ; Statement stmt = conn . createStatement ( ) ; try { exec ( stmt , ""DROP ROLE "" + roleName ) ; } catch ( Exception ex ) { LOGGER . info ( ""test role doesn't exist, but it's ok"" ) ; } finally { exec ( stmt , ""CREATE ROLE "" + roleName ) ; } if ( stmt != null ) { stmt . close ( ) ; } if ( conn != null ) { conn . close ( ) ; } } " 163,"@ SuppressWarnings ( ""ThrowableResultOfMethodCallIgnored"" ) @ Override public void exceptionCaught ( ChannelHandlerContext ctx , Throwable cause ) { if ( cause instanceof ClosedChannelException ) { return ; } LOG . warn ( ""Unexpected exception. Closing channel {}"" , ctx . channel ( ) , cause ) ; ctx . channel ( ) . close ( ) ; } ","@ SuppressWarnings ( ""ThrowableResultOfMethodCallIgnored"" ) @ Override public void exceptionCaught ( ChannelHandlerContext ctx , Throwable cause ) { if ( cause instanceof ClosedChannelException ) { LOG . warn ( ""ClosedChannelException caught. Cause: "" , cause ) ; return ; } LOG . warn ( ""Unexpected exception. Closing channel {}"" , ctx . channel ( ) , cause ) ; ctx . channel ( ) . close ( ) ; } " 164,"@ SuppressWarnings ( ""ThrowableResultOfMethodCallIgnored"" ) @ Override public void exceptionCaught ( ChannelHandlerContext ctx , Throwable cause ) { if ( cause instanceof ClosedChannelException ) { LOG . warn ( ""ClosedChannelException caught. Cause: "" , cause ) ; return ; } ctx . channel ( ) . close ( ) ; } ","@ SuppressWarnings ( ""ThrowableResultOfMethodCallIgnored"" ) @ Override public void exceptionCaught ( ChannelHandlerContext ctx , Throwable cause ) { if ( cause instanceof ClosedChannelException ) { LOG . warn ( ""ClosedChannelException caught. Cause: "" , cause ) ; return ; } LOG . warn ( ""Unexpected exception. Closing channel {}"" , ctx . channel ( ) , cause ) ; ctx . channel ( ) . close ( ) ; } " 165,"public void splitPathListAndApplyPolicy ( String allPathForAclCreation , Configuration conf , FileSystem fileSystem , String groupList , String hdfs_permission ) throws IOException { String [ ] allKyloIntermediatePath = allPathForAclCreation . split ( "","" ) ; for ( int pathCounter = 0 ; pathCounter < allKyloIntermediatePath . length ; pathCounter ++ ) { try { individualIntermediatePathApplyPolicy ( conf , fileSystem , allKyloIntermediatePath [ pathCounter ] , groupList , hdfs_permission ) ; } catch ( IOException e ) { throw new IOException ( e ) ; } } } ","public void splitPathListAndApplyPolicy ( String allPathForAclCreation , Configuration conf , FileSystem fileSystem , String groupList , String hdfs_permission ) throws IOException { String [ ] allKyloIntermediatePath = allPathForAclCreation . split ( "","" ) ; for ( int pathCounter = 0 ; pathCounter < allKyloIntermediatePath . length ; pathCounter ++ ) { try { individualIntermediatePathApplyPolicy ( conf , fileSystem , allKyloIntermediatePath [ pathCounter ] , groupList , hdfs_permission ) ; } catch ( IOException e ) { log . error ( ""Unable to iterate on HDFS directories "" + e . getMessage ( ) ) ; throw new IOException ( e ) ; } } } " 166,"private void determineRecordResources ( final GDMModel gdmModel , final org . dswarm . graph . json . Model realModel , final DataModel finalDataModel ) { if ( finalDataModel . getSchema ( ) != null ) { if ( finalDataModel . getSchema ( ) . getRecordClass ( ) != null ) { gdmModel . setRecordURIs ( realModel . getResourceURIs ( ) ) ; } } LOG . debug ( ""determined record resources for data model '{}'"" , finalDataModel . getUuid ( ) ) ; } ","private void determineRecordResources ( final GDMModel gdmModel , final org . dswarm . graph . json . Model realModel , final DataModel finalDataModel ) { LOG . debug ( ""determine record resources for data model '{}'"" , finalDataModel . getUuid ( ) ) ; if ( finalDataModel . getSchema ( ) != null ) { if ( finalDataModel . getSchema ( ) . getRecordClass ( ) != null ) { gdmModel . setRecordURIs ( realModel . getResourceURIs ( ) ) ; } } LOG . debug ( ""determined record resources for data model '{}'"" , finalDataModel . getUuid ( ) ) ; } " 167,"private void determineRecordResources ( final GDMModel gdmModel , final org . dswarm . graph . json . Model realModel , final DataModel finalDataModel ) { LOG . debug ( ""determine record resources for data model '{}'"" , finalDataModel . getUuid ( ) ) ; if ( finalDataModel . getSchema ( ) != null ) { if ( finalDataModel . getSchema ( ) . getRecordClass ( ) != null ) { gdmModel . setRecordURIs ( realModel . getResourceURIs ( ) ) ; } } } ","private void determineRecordResources ( final GDMModel gdmModel , final org . dswarm . graph . json . Model realModel , final DataModel finalDataModel ) { LOG . debug ( ""determine record resources for data model '{}'"" , finalDataModel . getUuid ( ) ) ; if ( finalDataModel . getSchema ( ) != null ) { if ( finalDataModel . getSchema ( ) . getRecordClass ( ) != null ) { gdmModel . setRecordURIs ( realModel . getResourceURIs ( ) ) ; } } LOG . debug ( ""determined record resources for data model '{}'"" , finalDataModel . getUuid ( ) ) ; } " 168,"private JsonObject fetchYarnAuditJson ( Dependency dependency , boolean skipDevDependencies ) throws AnalysisException { final File folder = dependency . getActualFile ( ) . getParentFile ( ) ; if ( ! folder . isDirectory ( ) ) { throw new AnalysisException ( String . format ( ""%s should have been a directory."" , folder . getAbsolutePath ( ) ) ) ; } try { final List < String > args = new ArrayList < > ( ) ; args . add ( getYarn ( ) ) ; args . add ( ""audit"" ) ; args . add ( ""--offline"" ) ; if ( skipDevDependencies ) { args . add ( ""--groups"" ) ; args . add ( ""dependencies"" ) ; } args . add ( ""--json"" ) ; args . add ( ""--verbose"" ) ; final ProcessBuilder builder = new ProcessBuilder ( args ) ; builder . directory ( folder ) ; final Process process = builder . start ( ) ; try ( ProcessReader processReader = new ProcessReader ( process ) ) { processReader . readAll ( ) ; final String errOutput = processReader . getError ( ) ; if ( ! StringUtils . isBlank ( errOutput ) && ! EXPECTED_ERROR . equals ( errOutput ) ) { LOGGER . debug ( ""Process Error Out: {}"" , errOutput ) ; LOGGER . debug ( ""Process Out: {}"" , processReader . getOutput ( ) ) ; } final String verboseJson = Arrays . stream ( processReader . getOutput ( ) . split ( ""\n"" ) ) . filter ( line -> line . contains ( ""Audit Request"" ) ) . findFirst ( ) . get ( ) ; String auditRequest ; try ( JsonReader reader = Json . createReader ( IOUtils . toInputStream ( verboseJson , StandardCharsets . UTF_8 ) ) ) { final JsonObject jsonObject = reader . readObject ( ) ; auditRequest = jsonObject . getString ( ""data"" ) ; auditRequest = auditRequest . substring ( 15 ) ; } LOGGER . debug ( ""Audit Request: {}"" , auditRequest ) ; return Json . createReader ( IOUtils . toInputStream ( auditRequest , StandardCharsets . UTF_8 ) ) . readObject ( ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; throw new AnalysisException ( ""Yarn audit process was interrupted."" , ex ) ; } } catch ( IOException ioe ) { throw new AnalysisException ( ""yarn audit failure; this error can be ignored if you are not analyzing projects with a yarn lockfile."" , ioe ) ; } } ","private JsonObject fetchYarnAuditJson ( Dependency dependency , boolean skipDevDependencies ) throws AnalysisException { final File folder = dependency . getActualFile ( ) . getParentFile ( ) ; if ( ! folder . isDirectory ( ) ) { throw new AnalysisException ( String . format ( ""%s should have been a directory."" , folder . getAbsolutePath ( ) ) ) ; } try { final List < String > args = new ArrayList < > ( ) ; args . add ( getYarn ( ) ) ; args . add ( ""audit"" ) ; args . add ( ""--offline"" ) ; if ( skipDevDependencies ) { args . add ( ""--groups"" ) ; args . add ( ""dependencies"" ) ; } args . add ( ""--json"" ) ; args . add ( ""--verbose"" ) ; final ProcessBuilder builder = new ProcessBuilder ( args ) ; builder . directory ( folder ) ; LOGGER . debug ( ""Launching: {}"" , args ) ; final Process process = builder . start ( ) ; try ( ProcessReader processReader = new ProcessReader ( process ) ) { processReader . readAll ( ) ; final String errOutput = processReader . getError ( ) ; if ( ! StringUtils . isBlank ( errOutput ) && ! EXPECTED_ERROR . equals ( errOutput ) ) { LOGGER . debug ( ""Process Error Out: {}"" , errOutput ) ; LOGGER . debug ( ""Process Out: {}"" , processReader . getOutput ( ) ) ; } final String verboseJson = Arrays . stream ( processReader . getOutput ( ) . split ( ""\n"" ) ) . filter ( line -> line . contains ( ""Audit Request"" ) ) . findFirst ( ) . get ( ) ; String auditRequest ; try ( JsonReader reader = Json . createReader ( IOUtils . toInputStream ( verboseJson , StandardCharsets . UTF_8 ) ) ) { final JsonObject jsonObject = reader . readObject ( ) ; auditRequest = jsonObject . getString ( ""data"" ) ; auditRequest = auditRequest . substring ( 15 ) ; } LOGGER . debug ( ""Audit Request: {}"" , auditRequest ) ; return Json . createReader ( IOUtils . toInputStream ( auditRequest , StandardCharsets . UTF_8 ) ) . readObject ( ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; throw new AnalysisException ( ""Yarn audit process was interrupted."" , ex ) ; } } catch ( IOException ioe ) { throw new AnalysisException ( ""yarn audit failure; this error can be ignored if you are not analyzing projects with a yarn lockfile."" , ioe ) ; } } " 169,"private JsonObject fetchYarnAuditJson ( Dependency dependency , boolean skipDevDependencies ) throws AnalysisException { final File folder = dependency . getActualFile ( ) . getParentFile ( ) ; if ( ! folder . isDirectory ( ) ) { throw new AnalysisException ( String . format ( ""%s should have been a directory."" , folder . getAbsolutePath ( ) ) ) ; } try { final List < String > args = new ArrayList < > ( ) ; args . add ( getYarn ( ) ) ; args . add ( ""audit"" ) ; args . add ( ""--offline"" ) ; if ( skipDevDependencies ) { args . add ( ""--groups"" ) ; args . add ( ""dependencies"" ) ; } args . add ( ""--json"" ) ; args . add ( ""--verbose"" ) ; final ProcessBuilder builder = new ProcessBuilder ( args ) ; builder . directory ( folder ) ; LOGGER . debug ( ""Launching: {}"" , args ) ; final Process process = builder . start ( ) ; try ( ProcessReader processReader = new ProcessReader ( process ) ) { processReader . readAll ( ) ; final String errOutput = processReader . getError ( ) ; if ( ! StringUtils . isBlank ( errOutput ) && ! EXPECTED_ERROR . equals ( errOutput ) ) { LOGGER . debug ( ""Process Out: {}"" , processReader . getOutput ( ) ) ; } final String verboseJson = Arrays . stream ( processReader . getOutput ( ) . split ( ""\n"" ) ) . filter ( line -> line . contains ( ""Audit Request"" ) ) . findFirst ( ) . get ( ) ; String auditRequest ; try ( JsonReader reader = Json . createReader ( IOUtils . toInputStream ( verboseJson , StandardCharsets . UTF_8 ) ) ) { final JsonObject jsonObject = reader . readObject ( ) ; auditRequest = jsonObject . getString ( ""data"" ) ; auditRequest = auditRequest . substring ( 15 ) ; } LOGGER . debug ( ""Audit Request: {}"" , auditRequest ) ; return Json . createReader ( IOUtils . toInputStream ( auditRequest , StandardCharsets . UTF_8 ) ) . readObject ( ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; throw new AnalysisException ( ""Yarn audit process was interrupted."" , ex ) ; } } catch ( IOException ioe ) { throw new AnalysisException ( ""yarn audit failure; this error can be ignored if you are not analyzing projects with a yarn lockfile."" , ioe ) ; } } ","private JsonObject fetchYarnAuditJson ( Dependency dependency , boolean skipDevDependencies ) throws AnalysisException { final File folder = dependency . getActualFile ( ) . getParentFile ( ) ; if ( ! folder . isDirectory ( ) ) { throw new AnalysisException ( String . format ( ""%s should have been a directory."" , folder . getAbsolutePath ( ) ) ) ; } try { final List < String > args = new ArrayList < > ( ) ; args . add ( getYarn ( ) ) ; args . add ( ""audit"" ) ; args . add ( ""--offline"" ) ; if ( skipDevDependencies ) { args . add ( ""--groups"" ) ; args . add ( ""dependencies"" ) ; } args . add ( ""--json"" ) ; args . add ( ""--verbose"" ) ; final ProcessBuilder builder = new ProcessBuilder ( args ) ; builder . directory ( folder ) ; LOGGER . debug ( ""Launching: {}"" , args ) ; final Process process = builder . start ( ) ; try ( ProcessReader processReader = new ProcessReader ( process ) ) { processReader . readAll ( ) ; final String errOutput = processReader . getError ( ) ; if ( ! StringUtils . isBlank ( errOutput ) && ! EXPECTED_ERROR . equals ( errOutput ) ) { LOGGER . debug ( ""Process Error Out: {}"" , errOutput ) ; LOGGER . debug ( ""Process Out: {}"" , processReader . getOutput ( ) ) ; } final String verboseJson = Arrays . stream ( processReader . getOutput ( ) . split ( ""\n"" ) ) . filter ( line -> line . contains ( ""Audit Request"" ) ) . findFirst ( ) . get ( ) ; String auditRequest ; try ( JsonReader reader = Json . createReader ( IOUtils . toInputStream ( verboseJson , StandardCharsets . UTF_8 ) ) ) { final JsonObject jsonObject = reader . readObject ( ) ; auditRequest = jsonObject . getString ( ""data"" ) ; auditRequest = auditRequest . substring ( 15 ) ; } LOGGER . debug ( ""Audit Request: {}"" , auditRequest ) ; return Json . createReader ( IOUtils . toInputStream ( auditRequest , StandardCharsets . UTF_8 ) ) . readObject ( ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; throw new AnalysisException ( ""Yarn audit process was interrupted."" , ex ) ; } } catch ( IOException ioe ) { throw new AnalysisException ( ""yarn audit failure; this error can be ignored if you are not analyzing projects with a yarn lockfile."" , ioe ) ; } } " 170,"private JsonObject fetchYarnAuditJson ( Dependency dependency , boolean skipDevDependencies ) throws AnalysisException { final File folder = dependency . getActualFile ( ) . getParentFile ( ) ; if ( ! folder . isDirectory ( ) ) { throw new AnalysisException ( String . format ( ""%s should have been a directory."" , folder . getAbsolutePath ( ) ) ) ; } try { final List < String > args = new ArrayList < > ( ) ; args . add ( getYarn ( ) ) ; args . add ( ""audit"" ) ; args . add ( ""--offline"" ) ; if ( skipDevDependencies ) { args . add ( ""--groups"" ) ; args . add ( ""dependencies"" ) ; } args . add ( ""--json"" ) ; args . add ( ""--verbose"" ) ; final ProcessBuilder builder = new ProcessBuilder ( args ) ; builder . directory ( folder ) ; LOGGER . debug ( ""Launching: {}"" , args ) ; final Process process = builder . start ( ) ; try ( ProcessReader processReader = new ProcessReader ( process ) ) { processReader . readAll ( ) ; final String errOutput = processReader . getError ( ) ; if ( ! StringUtils . isBlank ( errOutput ) && ! EXPECTED_ERROR . equals ( errOutput ) ) { LOGGER . debug ( ""Process Error Out: {}"" , errOutput ) ; } final String verboseJson = Arrays . stream ( processReader . getOutput ( ) . split ( ""\n"" ) ) . filter ( line -> line . contains ( ""Audit Request"" ) ) . findFirst ( ) . get ( ) ; String auditRequest ; try ( JsonReader reader = Json . createReader ( IOUtils . toInputStream ( verboseJson , StandardCharsets . UTF_8 ) ) ) { final JsonObject jsonObject = reader . readObject ( ) ; auditRequest = jsonObject . getString ( ""data"" ) ; auditRequest = auditRequest . substring ( 15 ) ; } LOGGER . debug ( ""Audit Request: {}"" , auditRequest ) ; return Json . createReader ( IOUtils . toInputStream ( auditRequest , StandardCharsets . UTF_8 ) ) . readObject ( ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; throw new AnalysisException ( ""Yarn audit process was interrupted."" , ex ) ; } } catch ( IOException ioe ) { throw new AnalysisException ( ""yarn audit failure; this error can be ignored if you are not analyzing projects with a yarn lockfile."" , ioe ) ; } } ","private JsonObject fetchYarnAuditJson ( Dependency dependency , boolean skipDevDependencies ) throws AnalysisException { final File folder = dependency . getActualFile ( ) . getParentFile ( ) ; if ( ! folder . isDirectory ( ) ) { throw new AnalysisException ( String . format ( ""%s should have been a directory."" , folder . getAbsolutePath ( ) ) ) ; } try { final List < String > args = new ArrayList < > ( ) ; args . add ( getYarn ( ) ) ; args . add ( ""audit"" ) ; args . add ( ""--offline"" ) ; if ( skipDevDependencies ) { args . add ( ""--groups"" ) ; args . add ( ""dependencies"" ) ; } args . add ( ""--json"" ) ; args . add ( ""--verbose"" ) ; final ProcessBuilder builder = new ProcessBuilder ( args ) ; builder . directory ( folder ) ; LOGGER . debug ( ""Launching: {}"" , args ) ; final Process process = builder . start ( ) ; try ( ProcessReader processReader = new ProcessReader ( process ) ) { processReader . readAll ( ) ; final String errOutput = processReader . getError ( ) ; if ( ! StringUtils . isBlank ( errOutput ) && ! EXPECTED_ERROR . equals ( errOutput ) ) { LOGGER . debug ( ""Process Error Out: {}"" , errOutput ) ; LOGGER . debug ( ""Process Out: {}"" , processReader . getOutput ( ) ) ; } final String verboseJson = Arrays . stream ( processReader . getOutput ( ) . split ( ""\n"" ) ) . filter ( line -> line . contains ( ""Audit Request"" ) ) . findFirst ( ) . get ( ) ; String auditRequest ; try ( JsonReader reader = Json . createReader ( IOUtils . toInputStream ( verboseJson , StandardCharsets . UTF_8 ) ) ) { final JsonObject jsonObject = reader . readObject ( ) ; auditRequest = jsonObject . getString ( ""data"" ) ; auditRequest = auditRequest . substring ( 15 ) ; } LOGGER . debug ( ""Audit Request: {}"" , auditRequest ) ; return Json . createReader ( IOUtils . toInputStream ( auditRequest , StandardCharsets . UTF_8 ) ) . readObject ( ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; throw new AnalysisException ( ""Yarn audit process was interrupted."" , ex ) ; } } catch ( IOException ioe ) { throw new AnalysisException ( ""yarn audit failure; this error can be ignored if you are not analyzing projects with a yarn lockfile."" , ioe ) ; } } " 171,"private JsonObject fetchYarnAuditJson ( Dependency dependency , boolean skipDevDependencies ) throws AnalysisException { final File folder = dependency . getActualFile ( ) . getParentFile ( ) ; if ( ! folder . isDirectory ( ) ) { throw new AnalysisException ( String . format ( ""%s should have been a directory."" , folder . getAbsolutePath ( ) ) ) ; } try { final List < String > args = new ArrayList < > ( ) ; args . add ( getYarn ( ) ) ; args . add ( ""audit"" ) ; args . add ( ""--offline"" ) ; if ( skipDevDependencies ) { args . add ( ""--groups"" ) ; args . add ( ""dependencies"" ) ; } args . add ( ""--json"" ) ; args . add ( ""--verbose"" ) ; final ProcessBuilder builder = new ProcessBuilder ( args ) ; builder . directory ( folder ) ; LOGGER . debug ( ""Launching: {}"" , args ) ; final Process process = builder . start ( ) ; try ( ProcessReader processReader = new ProcessReader ( process ) ) { processReader . readAll ( ) ; final String errOutput = processReader . getError ( ) ; if ( ! StringUtils . isBlank ( errOutput ) && ! EXPECTED_ERROR . equals ( errOutput ) ) { LOGGER . debug ( ""Process Error Out: {}"" , errOutput ) ; LOGGER . debug ( ""Process Out: {}"" , processReader . getOutput ( ) ) ; } final String verboseJson = Arrays . stream ( processReader . getOutput ( ) . split ( ""\n"" ) ) . filter ( line -> line . contains ( ""Audit Request"" ) ) . findFirst ( ) . get ( ) ; String auditRequest ; try ( JsonReader reader = Json . createReader ( IOUtils . toInputStream ( verboseJson , StandardCharsets . UTF_8 ) ) ) { final JsonObject jsonObject = reader . readObject ( ) ; auditRequest = jsonObject . getString ( ""data"" ) ; auditRequest = auditRequest . substring ( 15 ) ; } return Json . createReader ( IOUtils . toInputStream ( auditRequest , StandardCharsets . UTF_8 ) ) . readObject ( ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; throw new AnalysisException ( ""Yarn audit process was interrupted."" , ex ) ; } } catch ( IOException ioe ) { throw new AnalysisException ( ""yarn audit failure; this error can be ignored if you are not analyzing projects with a yarn lockfile."" , ioe ) ; } } ","private JsonObject fetchYarnAuditJson ( Dependency dependency , boolean skipDevDependencies ) throws AnalysisException { final File folder = dependency . getActualFile ( ) . getParentFile ( ) ; if ( ! folder . isDirectory ( ) ) { throw new AnalysisException ( String . format ( ""%s should have been a directory."" , folder . getAbsolutePath ( ) ) ) ; } try { final List < String > args = new ArrayList < > ( ) ; args . add ( getYarn ( ) ) ; args . add ( ""audit"" ) ; args . add ( ""--offline"" ) ; if ( skipDevDependencies ) { args . add ( ""--groups"" ) ; args . add ( ""dependencies"" ) ; } args . add ( ""--json"" ) ; args . add ( ""--verbose"" ) ; final ProcessBuilder builder = new ProcessBuilder ( args ) ; builder . directory ( folder ) ; LOGGER . debug ( ""Launching: {}"" , args ) ; final Process process = builder . start ( ) ; try ( ProcessReader processReader = new ProcessReader ( process ) ) { processReader . readAll ( ) ; final String errOutput = processReader . getError ( ) ; if ( ! StringUtils . isBlank ( errOutput ) && ! EXPECTED_ERROR . equals ( errOutput ) ) { LOGGER . debug ( ""Process Error Out: {}"" , errOutput ) ; LOGGER . debug ( ""Process Out: {}"" , processReader . getOutput ( ) ) ; } final String verboseJson = Arrays . stream ( processReader . getOutput ( ) . split ( ""\n"" ) ) . filter ( line -> line . contains ( ""Audit Request"" ) ) . findFirst ( ) . get ( ) ; String auditRequest ; try ( JsonReader reader = Json . createReader ( IOUtils . toInputStream ( verboseJson , StandardCharsets . UTF_8 ) ) ) { final JsonObject jsonObject = reader . readObject ( ) ; auditRequest = jsonObject . getString ( ""data"" ) ; auditRequest = auditRequest . substring ( 15 ) ; } LOGGER . debug ( ""Audit Request: {}"" , auditRequest ) ; return Json . createReader ( IOUtils . toInputStream ( auditRequest , StandardCharsets . UTF_8 ) ) . readObject ( ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; throw new AnalysisException ( ""Yarn audit process was interrupted."" , ex ) ; } } catch ( IOException ioe ) { throw new AnalysisException ( ""yarn audit failure; this error can be ignored if you are not analyzing projects with a yarn lockfile."" , ioe ) ; } } " 172,"private Boolean setEFSTag ( final String resourceId , final Map < String , Object > clientMap , Map < String , String > pacTag ) { com . amazonaws . services . elasticfilesystem . model . Tag tag = new com . amazonaws . services . elasticfilesystem . model . Tag ( ) ; for ( Map . Entry < String , String > tags : pacTag . entrySet ( ) ) { tag . setKey ( tags . getKey ( ) ) ; tag . setValue ( tags . getValue ( ) ) ; } AmazonElasticFileSystem fileSystem = ( AmazonElasticFileSystem ) clientMap . get ( ""client"" ) ; com . amazonaws . services . elasticfilesystem . model . CreateTagsRequest createTagsRequest = new com . amazonaws . services . elasticfilesystem . model . CreateTagsRequest ( ) ; createTagsRequest . setFileSystemId ( resourceId ) ; createTagsRequest . setTags ( Arrays . asList ( tag ) ) ; try { fileSystem . createTags ( createTagsRequest ) ; return Boolean . TRUE ; } catch ( AmazonServiceException ase ) { throw ase ; } } ","private Boolean setEFSTag ( final String resourceId , final Map < String , Object > clientMap , Map < String , String > pacTag ) { com . amazonaws . services . elasticfilesystem . model . Tag tag = new com . amazonaws . services . elasticfilesystem . model . Tag ( ) ; for ( Map . Entry < String , String > tags : pacTag . entrySet ( ) ) { tag . setKey ( tags . getKey ( ) ) ; tag . setValue ( tags . getValue ( ) ) ; } AmazonElasticFileSystem fileSystem = ( AmazonElasticFileSystem ) clientMap . get ( ""client"" ) ; com . amazonaws . services . elasticfilesystem . model . CreateTagsRequest createTagsRequest = new com . amazonaws . services . elasticfilesystem . model . CreateTagsRequest ( ) ; createTagsRequest . setFileSystemId ( resourceId ) ; createTagsRequest . setTags ( Arrays . asList ( tag ) ) ; try { fileSystem . createTags ( createTagsRequest ) ; return Boolean . TRUE ; } catch ( AmazonServiceException ase ) { logger . error ( ""error tagging efs - > "" + resourceId , ase ) ; throw ase ; } } " 173,"public void uploadListener ( FileUploadEvent event ) { try { ProjectFile file = new ProjectFile ( event . getUploadedFile ( ) ) ; uploadedFiles . add ( file ) ; String fileName = file . getName ( ) ; setFileName ( fileName ) ; if ( fileName . contains ( ""."" ) ) { if ( ! FileTypeHelper . isPossibleOpenAPIFile ( fileName ) ) { setProjectName ( fileName . substring ( 0 , fileName . lastIndexOf ( '.' ) ) ) ; } else { setProjectName ( """" ) ; } if ( FileTypeHelper . isZipFile ( fileName ) ) { Charset charset = zipCharsetDetector . detectCharset ( new ZipFromProjectFile ( file ) ) ; if ( charset == null ) { charset = StandardCharsets . UTF_8 ; } ProjectDescriptor projectDescriptor = ZipProjectDescriptorExtractor . getProjectDescriptorOrNull ( file , zipFilter , charset ) ; if ( projectDescriptor != null ) { setProjectName ( projectDescriptor . getName ( ) ) ; } setCreateProjectComment ( getDesignRepoComments ( ) . createProject ( getProjectName ( ) ) ) ; } } else { setProjectName ( fileName ) ; } } catch ( IOException e ) { log . error ( e . getMessage ( ) , e ) ; WebStudioUtils . addErrorMessage ( ""Error occurred during uploading file."" , e . getMessage ( ) ) ; } } ","public void uploadListener ( FileUploadEvent event ) { try { ProjectFile file = new ProjectFile ( event . getUploadedFile ( ) ) ; uploadedFiles . add ( file ) ; String fileName = file . getName ( ) ; setFileName ( fileName ) ; if ( fileName . contains ( ""."" ) ) { if ( ! FileTypeHelper . isPossibleOpenAPIFile ( fileName ) ) { setProjectName ( fileName . substring ( 0 , fileName . lastIndexOf ( '.' ) ) ) ; } else { setProjectName ( """" ) ; } if ( FileTypeHelper . isZipFile ( fileName ) ) { Charset charset = zipCharsetDetector . detectCharset ( new ZipFromProjectFile ( file ) ) ; if ( charset == null ) { log . warn ( ""Cannot detect a charset for the zip file"" ) ; charset = StandardCharsets . UTF_8 ; } ProjectDescriptor projectDescriptor = ZipProjectDescriptorExtractor . getProjectDescriptorOrNull ( file , zipFilter , charset ) ; if ( projectDescriptor != null ) { setProjectName ( projectDescriptor . getName ( ) ) ; } setCreateProjectComment ( getDesignRepoComments ( ) . createProject ( getProjectName ( ) ) ) ; } } else { setProjectName ( fileName ) ; } } catch ( IOException e ) { log . error ( e . getMessage ( ) , e ) ; WebStudioUtils . addErrorMessage ( ""Error occurred during uploading file."" , e . getMessage ( ) ) ; } } " 174,"public void uploadListener ( FileUploadEvent event ) { try { ProjectFile file = new ProjectFile ( event . getUploadedFile ( ) ) ; uploadedFiles . add ( file ) ; String fileName = file . getName ( ) ; setFileName ( fileName ) ; if ( fileName . contains ( ""."" ) ) { if ( ! FileTypeHelper . isPossibleOpenAPIFile ( fileName ) ) { setProjectName ( fileName . substring ( 0 , fileName . lastIndexOf ( '.' ) ) ) ; } else { setProjectName ( """" ) ; } if ( FileTypeHelper . isZipFile ( fileName ) ) { Charset charset = zipCharsetDetector . detectCharset ( new ZipFromProjectFile ( file ) ) ; if ( charset == null ) { log . warn ( ""Cannot detect a charset for the zip file"" ) ; charset = StandardCharsets . UTF_8 ; } ProjectDescriptor projectDescriptor = ZipProjectDescriptorExtractor . getProjectDescriptorOrNull ( file , zipFilter , charset ) ; if ( projectDescriptor != null ) { setProjectName ( projectDescriptor . getName ( ) ) ; } setCreateProjectComment ( getDesignRepoComments ( ) . createProject ( getProjectName ( ) ) ) ; } } else { setProjectName ( fileName ) ; } } catch ( IOException e ) { WebStudioUtils . addErrorMessage ( ""Error occurred during uploading file."" , e . getMessage ( ) ) ; } } ","public void uploadListener ( FileUploadEvent event ) { try { ProjectFile file = new ProjectFile ( event . getUploadedFile ( ) ) ; uploadedFiles . add ( file ) ; String fileName = file . getName ( ) ; setFileName ( fileName ) ; if ( fileName . contains ( ""."" ) ) { if ( ! FileTypeHelper . isPossibleOpenAPIFile ( fileName ) ) { setProjectName ( fileName . substring ( 0 , fileName . lastIndexOf ( '.' ) ) ) ; } else { setProjectName ( """" ) ; } if ( FileTypeHelper . isZipFile ( fileName ) ) { Charset charset = zipCharsetDetector . detectCharset ( new ZipFromProjectFile ( file ) ) ; if ( charset == null ) { log . warn ( ""Cannot detect a charset for the zip file"" ) ; charset = StandardCharsets . UTF_8 ; } ProjectDescriptor projectDescriptor = ZipProjectDescriptorExtractor . getProjectDescriptorOrNull ( file , zipFilter , charset ) ; if ( projectDescriptor != null ) { setProjectName ( projectDescriptor . getName ( ) ) ; } setCreateProjectComment ( getDesignRepoComments ( ) . createProject ( getProjectName ( ) ) ) ; } } else { setProjectName ( fileName ) ; } } catch ( IOException e ) { log . error ( e . getMessage ( ) , e ) ; WebStudioUtils . addErrorMessage ( ""Error occurred during uploading file."" , e . getMessage ( ) ) ; } } " 175,"public void start ( String ip , int port , String keyspace , int dataTableDaysTimeArea , int slotSecondsTimeArea ) throws Exception { if ( this . started ) { throw new Exception ( ""DBOperations already started"" ) ; } this . dataTableDaysTimeArea = dataTableDaysTimeArea ; this . slotSecondsTimeArea = slotSecondsTimeArea ; Builder builder = Cluster . builder ( ) ; builder . withPort ( port ) ; builder . addContactPoint ( ip ) ; this . cluster = builder . build ( ) ; Metadata metadata = cluster . getMetadata ( ) ; for ( Host host : metadata . getAllHosts ( ) ) { logger . info ( String . format ( ""Datacenter: %s; Host: %s; Rack: %s\n"" , host . getDatacenter ( ) , host . getAddress ( ) , host . getRack ( ) ) ) ; } session = cluster . connect ( ) ; session . execute ( ""USE \"""" + keyspace + ""\"""" ) ; this . started = true ; } ","public void start ( String ip , int port , String keyspace , int dataTableDaysTimeArea , int slotSecondsTimeArea ) throws Exception { if ( this . started ) { throw new Exception ( ""DBOperations already started"" ) ; } this . dataTableDaysTimeArea = dataTableDaysTimeArea ; this . slotSecondsTimeArea = slotSecondsTimeArea ; Builder builder = Cluster . builder ( ) ; builder . withPort ( port ) ; builder . addContactPoint ( ip ) ; this . cluster = builder . build ( ) ; Metadata metadata = cluster . getMetadata ( ) ; logger . info ( String . format ( ""Connected to cluster: %s\n"" , metadata . getClusterName ( ) ) ) ; for ( Host host : metadata . getAllHosts ( ) ) { logger . info ( String . format ( ""Datacenter: %s; Host: %s; Rack: %s\n"" , host . getDatacenter ( ) , host . getAddress ( ) , host . getRack ( ) ) ) ; } session = cluster . connect ( ) ; session . execute ( ""USE \"""" + keyspace + ""\"""" ) ; this . started = true ; } " 176,"public void start ( String ip , int port , String keyspace , int dataTableDaysTimeArea , int slotSecondsTimeArea ) throws Exception { if ( this . started ) { throw new Exception ( ""DBOperations already started"" ) ; } this . dataTableDaysTimeArea = dataTableDaysTimeArea ; this . slotSecondsTimeArea = slotSecondsTimeArea ; Builder builder = Cluster . builder ( ) ; builder . withPort ( port ) ; builder . addContactPoint ( ip ) ; this . cluster = builder . build ( ) ; Metadata metadata = cluster . getMetadata ( ) ; logger . info ( String . format ( ""Connected to cluster: %s\n"" , metadata . getClusterName ( ) ) ) ; for ( Host host : metadata . getAllHosts ( ) ) { } session = cluster . connect ( ) ; session . execute ( ""USE \"""" + keyspace + ""\"""" ) ; this . started = true ; } ","public void start ( String ip , int port , String keyspace , int dataTableDaysTimeArea , int slotSecondsTimeArea ) throws Exception { if ( this . started ) { throw new Exception ( ""DBOperations already started"" ) ; } this . dataTableDaysTimeArea = dataTableDaysTimeArea ; this . slotSecondsTimeArea = slotSecondsTimeArea ; Builder builder = Cluster . builder ( ) ; builder . withPort ( port ) ; builder . addContactPoint ( ip ) ; this . cluster = builder . build ( ) ; Metadata metadata = cluster . getMetadata ( ) ; logger . info ( String . format ( ""Connected to cluster: %s\n"" , metadata . getClusterName ( ) ) ) ; for ( Host host : metadata . getAllHosts ( ) ) { logger . info ( String . format ( ""Datacenter: %s; Host: %s; Rack: %s\n"" , host . getDatacenter ( ) , host . getAddress ( ) , host . getRack ( ) ) ) ; } session = cluster . connect ( ) ; session . execute ( ""USE \"""" + keyspace + ""\"""" ) ; this . started = true ; } " 177,"private void addAlgorithm ( File processDescriptionFile ) { ProcessDescriptionType pd = this . loadProcessDescription ( processDescriptionFile ) ; String processID = pd . getIdentifier ( ) . getStringValue ( ) ; this . registeredProcessDescriptions . put ( processID , pd ) ; ToolParameter [ ] params = this . loadParameters ( pd ) ; this . registeredAlgorithmParameters . put ( processID , params ) ; if ( ! pd . validate ( ) ) { LOGGER . debug ( ""ProcessDescription is not valid. Removing "" + processID + "" from Repository."" ) ; this . registeredProcessDescriptions . remove ( processID ) ; this . registeredAlgorithmParameters . remove ( processID ) ; } } ","private void addAlgorithm ( File processDescriptionFile ) { ProcessDescriptionType pd = this . loadProcessDescription ( processDescriptionFile ) ; String processID = pd . getIdentifier ( ) . getStringValue ( ) ; LOGGER . debug ( ""Registering: "" + processID ) ; this . registeredProcessDescriptions . put ( processID , pd ) ; ToolParameter [ ] params = this . loadParameters ( pd ) ; this . registeredAlgorithmParameters . put ( processID , params ) ; if ( ! pd . validate ( ) ) { LOGGER . debug ( ""ProcessDescription is not valid. Removing "" + processID + "" from Repository."" ) ; this . registeredProcessDescriptions . remove ( processID ) ; this . registeredAlgorithmParameters . remove ( processID ) ; } } " 178,"private void addAlgorithm ( File processDescriptionFile ) { ProcessDescriptionType pd = this . loadProcessDescription ( processDescriptionFile ) ; String processID = pd . getIdentifier ( ) . getStringValue ( ) ; LOGGER . debug ( ""Registering: "" + processID ) ; this . registeredProcessDescriptions . put ( processID , pd ) ; ToolParameter [ ] params = this . loadParameters ( pd ) ; this . registeredAlgorithmParameters . put ( processID , params ) ; if ( ! pd . validate ( ) ) { this . registeredProcessDescriptions . remove ( processID ) ; this . registeredAlgorithmParameters . remove ( processID ) ; } } ","private void addAlgorithm ( File processDescriptionFile ) { ProcessDescriptionType pd = this . loadProcessDescription ( processDescriptionFile ) ; String processID = pd . getIdentifier ( ) . getStringValue ( ) ; LOGGER . debug ( ""Registering: "" + processID ) ; this . registeredProcessDescriptions . put ( processID , pd ) ; ToolParameter [ ] params = this . loadParameters ( pd ) ; this . registeredAlgorithmParameters . put ( processID , params ) ; if ( ! pd . validate ( ) ) { LOGGER . debug ( ""ProcessDescription is not valid. Removing "" + processID + "" from Repository."" ) ; this . registeredProcessDescriptions . remove ( processID ) ; this . registeredAlgorithmParameters . remove ( processID ) ; } } " 179,"private SequenceContainer readSequenceContainer ( SpaceSystem spaceSystem ) throws XMLStreamException { checkStartElementPreconditions ( ) ; String value = readMandatoryAttribute ( ""name"" , xmlEvent . asStartElement ( ) ) ; SequenceContainer seqContainer = new SequenceContainer ( value ) ; seqContainer . setShortDescription ( readAttribute ( ""shortDescription"" , xmlEvent . asStartElement ( ) , null ) ) ; while ( true ) { xmlEvent = xmlEventReader . nextEvent ( ) ; if ( isNamedItemProperty ( ) ) { readNamedItemProperty ( seqContainer ) ; } else if ( isStartElementWithName ( XTCE_ENTRY_LIST ) ) { readEntryList ( spaceSystem , seqContainer , null ) ; } else if ( isStartElementWithName ( XTCE_BASE_CONTAINER ) ) { readBaseContainer ( spaceSystem , seqContainer ) ; } else if ( isStartElementWithName ( XTCE_DEFAULT_RATE_IN_STREAM ) ) { seqContainer . setRateInStream ( readRateInStream ( spaceSystem ) ) ; } else if ( isStartElementWithName ( XTCE_BINARY_ENCODING ) ) { BinaryDataEncoding . Builder bde = readBinaryDataEncoding ( spaceSystem ) ; seqContainer . setSizeInBits ( bde . getSizeInBits ( ) ) ; } else if ( isEndElementWithName ( XTCE_SEQUENCE_CONTAINER ) ) { return seqContainer ; } else { logUnknown ( ) ; } } } ","private SequenceContainer readSequenceContainer ( SpaceSystem spaceSystem ) throws XMLStreamException { log . trace ( XTCE_SEQUENCE_CONTAINER ) ; checkStartElementPreconditions ( ) ; String value = readMandatoryAttribute ( ""name"" , xmlEvent . asStartElement ( ) ) ; SequenceContainer seqContainer = new SequenceContainer ( value ) ; seqContainer . setShortDescription ( readAttribute ( ""shortDescription"" , xmlEvent . asStartElement ( ) , null ) ) ; while ( true ) { xmlEvent = xmlEventReader . nextEvent ( ) ; if ( isNamedItemProperty ( ) ) { readNamedItemProperty ( seqContainer ) ; } else if ( isStartElementWithName ( XTCE_ENTRY_LIST ) ) { readEntryList ( spaceSystem , seqContainer , null ) ; } else if ( isStartElementWithName ( XTCE_BASE_CONTAINER ) ) { readBaseContainer ( spaceSystem , seqContainer ) ; } else if ( isStartElementWithName ( XTCE_DEFAULT_RATE_IN_STREAM ) ) { seqContainer . setRateInStream ( readRateInStream ( spaceSystem ) ) ; } else if ( isStartElementWithName ( XTCE_BINARY_ENCODING ) ) { BinaryDataEncoding . Builder bde = readBinaryDataEncoding ( spaceSystem ) ; seqContainer . setSizeInBits ( bde . getSizeInBits ( ) ) ; } else if ( isEndElementWithName ( XTCE_SEQUENCE_CONTAINER ) ) { return seqContainer ; } else { logUnknown ( ) ; } } } " 180,"public void persist ( CachedRunningQuery crq , String owner ) { synchronized ( this ) { this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getQueryId ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getAlias ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getView ( ) ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getQueryId ( ) , crq ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getAlias ( ) , crq ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getView ( ) , crq ) ; log . debug ( ""persisting cachedRunningQuery "" + crq . getQueryId ( ) + "" to database with status "" + crq . getStatus ( ) ) ; crq . saveToDatabase ( ctx . getCallerPrincipal ( ) , metricFactory ) ; } } ","public void persist ( CachedRunningQuery crq , String owner ) { synchronized ( this ) { log . debug ( ""persisting cachedRunningQuery "" + crq . getQueryId ( ) + "" to cache with status "" + crq . getStatus ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getQueryId ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getAlias ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getView ( ) ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getQueryId ( ) , crq ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getAlias ( ) , crq ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getView ( ) , crq ) ; log . debug ( ""persisting cachedRunningQuery "" + crq . getQueryId ( ) + "" to database with status "" + crq . getStatus ( ) ) ; crq . saveToDatabase ( ctx . getCallerPrincipal ( ) , metricFactory ) ; } } " 181,"public void persist ( CachedRunningQuery crq , String owner ) { synchronized ( this ) { log . debug ( ""persisting cachedRunningQuery "" + crq . getQueryId ( ) + "" to cache with status "" + crq . getStatus ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getQueryId ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getAlias ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getView ( ) ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getQueryId ( ) , crq ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getAlias ( ) , crq ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getView ( ) , crq ) ; crq . saveToDatabase ( ctx . getCallerPrincipal ( ) , metricFactory ) ; } } ","public void persist ( CachedRunningQuery crq , String owner ) { synchronized ( this ) { log . debug ( ""persisting cachedRunningQuery "" + crq . getQueryId ( ) + "" to cache with status "" + crq . getStatus ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getQueryId ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getAlias ( ) ) ; this . cachedRunningQueryCache . remove ( owner + ""-"" + crq . getView ( ) ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getQueryId ( ) , crq ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getAlias ( ) , crq ) ; this . cachedRunningQueryCache . put ( owner + ""-"" + crq . getView ( ) , crq ) ; log . debug ( ""persisting cachedRunningQuery "" + crq . getQueryId ( ) + "" to database with status "" + crq . getStatus ( ) ) ; crq . saveToDatabase ( ctx . getCallerPrincipal ( ) , metricFactory ) ; } } " 182,"public Socket createSocket ( final InetAddress address , final int port , final InetAddress localAddr , final int localPort ) throws IOException { if ( address instanceof Inet6Address ) { final NetworkInterface network = this . findIPv6Interface ( ( Inet6Address ) address ) ; if ( null == network ) { return delegate . createSocket ( address , port , localAddr , localPort ) ; } return delegate . createSocket ( this . getByAddressForInterface ( network , address ) , port , localAddr , localPort ) ; } if ( log . isDebugEnabled ( ) ) { } return delegate . createSocket ( address , port , localAddr , localPort ) ; } ","public Socket createSocket ( final InetAddress address , final int port , final InetAddress localAddr , final int localPort ) throws IOException { if ( address instanceof Inet6Address ) { final NetworkInterface network = this . findIPv6Interface ( ( Inet6Address ) address ) ; if ( null == network ) { return delegate . createSocket ( address , port , localAddr , localPort ) ; } return delegate . createSocket ( this . getByAddressForInterface ( network , address ) , port , localAddr , localPort ) ; } if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Use default network interface to bind %s"" , address ) ) ; } return delegate . createSocket ( address , port , localAddr , localPort ) ; } " 183,"void notifyRemoval ( Identifiable identifiable ) { for ( NetworkListener listener : listeners ) { try { listener . onRemoval ( identifiable ) ; } catch ( Throwable t ) { } } } ","void notifyRemoval ( Identifiable identifiable ) { for ( NetworkListener listener : listeners ) { try { listener . onRemoval ( identifiable ) ; } catch ( Throwable t ) { LOGGER . error ( t . toString ( ) , t ) ; } } } " 184,"static synchronized ThreadPoolExecutor getExecutor ( ThreadPoolBuilder builder , Map < String , Object > poolCache ) { ThreadPoolExecutor pool = ( ThreadPoolExecutor ) poolCache . get ( builder . getName ( ) ) ; if ( pool == null || pool . isTerminating ( ) || pool . isShutdown ( ) ) { pool = getDefaultExecutor ( builder ) ; poolCache . put ( builder . getName ( ) , pool ) ; } ( ( ShutdownOnUnusedThreadPoolExecutor ) pool ) . addReference ( ) ; return pool ; } ","static synchronized ThreadPoolExecutor getExecutor ( ThreadPoolBuilder builder , Map < String , Object > poolCache ) { ThreadPoolExecutor pool = ( ThreadPoolExecutor ) poolCache . get ( builder . getName ( ) ) ; if ( pool == null || pool . isTerminating ( ) || pool . isShutdown ( ) ) { pool = getDefaultExecutor ( builder ) ; LOG . info ( ""Creating new pool for "" + builder . getName ( ) ) ; poolCache . put ( builder . getName ( ) , pool ) ; } ( ( ShutdownOnUnusedThreadPoolExecutor ) pool ) . addReference ( ) ; return pool ; } " 185,"private < T > ServiceResponse < T > executePatch ( ServiceRequest request , boolean isChangeSet ) { ServiceResponse < T > response = new ServiceResponse < > ( ) ; PersistenceManager pm = null ; try { if ( request . getUrlPath ( ) == null || request . getUrlPath ( ) . equals ( ""/"" ) ) { return errorResponse ( response , 400 , ""PATCH only allowed on Entities."" ) ; } pm = getPm ( ) ; if ( isChangeSet ) { return handleChangeSet ( pm , request , response ) ; } return handlePatch ( pm , request , response ) ; } catch ( IncompleteEntityException | IOException | RuntimeException exc ) { if ( pm != null ) { pm . rollbackAndClose ( ) ; } return errorResponse ( response , 500 , ""Failed to store data."" ) ; } finally { maybeRollbackAndClose ( ) ; } } ","private < T > ServiceResponse < T > executePatch ( ServiceRequest request , boolean isChangeSet ) { ServiceResponse < T > response = new ServiceResponse < > ( ) ; PersistenceManager pm = null ; try { if ( request . getUrlPath ( ) == null || request . getUrlPath ( ) . equals ( ""/"" ) ) { return errorResponse ( response , 400 , ""PATCH only allowed on Entities."" ) ; } pm = getPm ( ) ; if ( isChangeSet ) { return handleChangeSet ( pm , request , response ) ; } return handlePatch ( pm , request , response ) ; } catch ( IncompleteEntityException | IOException | RuntimeException exc ) { LOGGER . error ( """" , exc ) ; if ( pm != null ) { pm . rollbackAndClose ( ) ; } return errorResponse ( response , 500 , ""Failed to store data."" ) ; } finally { maybeRollbackAndClose ( ) ; } } " 186,"private Map < Interval , Int2ObjectMap < List < File > > > fetchSegmentFiles ( TaskToolbox toolbox , Map < Interval , Int2ObjectMap < List < P > > > intervalToBuckets ) throws IOException { final File tempDir = toolbox . getIndexingTmpDir ( ) ; FileUtils . deleteQuietly ( tempDir ) ; FileUtils . forceMkdir ( tempDir ) ; final Map < Interval , Int2ObjectMap < List < File > > > intervalToUnzippedFiles = new HashMap < > ( ) ; for ( Entry < Interval , Int2ObjectMap < List < P > > > entryPerInterval : intervalToBuckets . entrySet ( ) ) { final Interval interval = entryPerInterval . getKey ( ) ; for ( Int2ObjectMap . Entry < List < P > > entryPerBucketId : entryPerInterval . getValue ( ) . int2ObjectEntrySet ( ) ) { final int bucketId = entryPerBucketId . getIntKey ( ) ; final File partitionDir = FileUtils . getFile ( tempDir , interval . getStart ( ) . toString ( ) , interval . getEnd ( ) . toString ( ) , Integer . toString ( bucketId ) ) ; FileUtils . forceMkdir ( partitionDir ) ; for ( P location : entryPerBucketId . getValue ( ) ) { final File zippedFile = toolbox . getShuffleClient ( ) . fetchSegmentFile ( partitionDir , supervisorTaskId , location ) ; try { final File unzippedDir = new File ( partitionDir , StringUtils . format ( ""unzipped_%s"" , location . getSubTaskId ( ) ) ) ; FileUtils . forceMkdir ( unzippedDir ) ; CompressionUtils . unzip ( zippedFile , unzippedDir ) ; intervalToUnzippedFiles . computeIfAbsent ( interval , k -> new Int2ObjectOpenHashMap < > ( ) ) . computeIfAbsent ( bucketId , k -> new ArrayList < > ( ) ) . add ( unzippedDir ) ; } finally { if ( ! zippedFile . delete ( ) ) { } } } } } return intervalToUnzippedFiles ; } ","private Map < Interval , Int2ObjectMap < List < File > > > fetchSegmentFiles ( TaskToolbox toolbox , Map < Interval , Int2ObjectMap < List < P > > > intervalToBuckets ) throws IOException { final File tempDir = toolbox . getIndexingTmpDir ( ) ; FileUtils . deleteQuietly ( tempDir ) ; FileUtils . forceMkdir ( tempDir ) ; final Map < Interval , Int2ObjectMap < List < File > > > intervalToUnzippedFiles = new HashMap < > ( ) ; for ( Entry < Interval , Int2ObjectMap < List < P > > > entryPerInterval : intervalToBuckets . entrySet ( ) ) { final Interval interval = entryPerInterval . getKey ( ) ; for ( Int2ObjectMap . Entry < List < P > > entryPerBucketId : entryPerInterval . getValue ( ) . int2ObjectEntrySet ( ) ) { final int bucketId = entryPerBucketId . getIntKey ( ) ; final File partitionDir = FileUtils . getFile ( tempDir , interval . getStart ( ) . toString ( ) , interval . getEnd ( ) . toString ( ) , Integer . toString ( bucketId ) ) ; FileUtils . forceMkdir ( partitionDir ) ; for ( P location : entryPerBucketId . getValue ( ) ) { final File zippedFile = toolbox . getShuffleClient ( ) . fetchSegmentFile ( partitionDir , supervisorTaskId , location ) ; try { final File unzippedDir = new File ( partitionDir , StringUtils . format ( ""unzipped_%s"" , location . getSubTaskId ( ) ) ) ; FileUtils . forceMkdir ( unzippedDir ) ; CompressionUtils . unzip ( zippedFile , unzippedDir ) ; intervalToUnzippedFiles . computeIfAbsent ( interval , k -> new Int2ObjectOpenHashMap < > ( ) ) . computeIfAbsent ( bucketId , k -> new ArrayList < > ( ) ) . add ( unzippedDir ) ; } finally { if ( ! zippedFile . delete ( ) ) { LOG . warn ( ""Failed to delete temp file[%s]"" , zippedFile ) ; } } } } } return intervalToUnzippedFiles ; } " 187,"public static File extractFile ( String fileName , String targetInfix , TokenResolver tokenResolver ) throws IOException { InputStream in = Externalization . class . getClassLoader ( ) . getResourceAsStream ( fileName ) ; if ( in == null ) return null ; File target = getTempFile ( fileName . replace ( ""."" , ""_"" + targetInfix + ""."" ) ) ; Reader reader = new TokenReplacingReader ( new InputStreamReader ( in ) , tokenResolver ) ; FileWriter writer = new FileWriter ( target ) ; copyAndClose ( reader , writer ) ; return target ; } ","public static File extractFile ( String fileName , String targetInfix , TokenResolver tokenResolver ) throws IOException { InputStream in = Externalization . class . getClassLoader ( ) . getResourceAsStream ( fileName ) ; if ( in == null ) return null ; File target = getTempFile ( fileName . replace ( ""."" , ""_"" + targetInfix + ""."" ) ) ; log . info ( ""Extracting "" + fileName + "" to "" + target ) ; Reader reader = new TokenReplacingReader ( new InputStreamReader ( in ) , tokenResolver ) ; FileWriter writer = new FileWriter ( target ) ; copyAndClose ( reader , writer ) ; return target ; } " 188,"private static ConfigCenterConfigurationSource createConfigCenterConfigurationSource ( Configuration localConfiguration ) { ConfigCenterConfigurationSource configCenterConfigurationSource = ConfigCenterConfigurationSourceLoader . getConfigCenterConfigurationSource ( localConfiguration ) ; if ( null == configCenterConfigurationSource ) { return null ; } LOGGER . info ( ""use config center source {}"" , configCenterConfigurationSource . getClass ( ) . getName ( ) ) ; return configCenterConfigurationSource ; } ","private static ConfigCenterConfigurationSource createConfigCenterConfigurationSource ( Configuration localConfiguration ) { ConfigCenterConfigurationSource configCenterConfigurationSource = ConfigCenterConfigurationSourceLoader . getConfigCenterConfigurationSource ( localConfiguration ) ; if ( null == configCenterConfigurationSource ) { LOGGER . info ( ""none of config center source enabled."" ) ; return null ; } LOGGER . info ( ""use config center source {}"" , configCenterConfigurationSource . getClass ( ) . getName ( ) ) ; return configCenterConfigurationSource ; } " 189,"private static ConfigCenterConfigurationSource createConfigCenterConfigurationSource ( Configuration localConfiguration ) { ConfigCenterConfigurationSource configCenterConfigurationSource = ConfigCenterConfigurationSourceLoader . getConfigCenterConfigurationSource ( localConfiguration ) ; if ( null == configCenterConfigurationSource ) { LOGGER . info ( ""none of config center source enabled."" ) ; return null ; } return configCenterConfigurationSource ; } ","private static ConfigCenterConfigurationSource createConfigCenterConfigurationSource ( Configuration localConfiguration ) { ConfigCenterConfigurationSource configCenterConfigurationSource = ConfigCenterConfigurationSourceLoader . getConfigCenterConfigurationSource ( localConfiguration ) ; if ( null == configCenterConfigurationSource ) { LOGGER . info ( ""none of config center source enabled."" ) ; return null ; } LOGGER . info ( ""use config center source {}"" , configCenterConfigurationSource . getClass ( ) . getName ( ) ) ; return configCenterConfigurationSource ; } " 190,"public Future < ModelNode > deploy ( final ModelNode operation , ExecutorService executorService ) { ready = true ; synchronized ( lock ) { logger . info ( ""Deploying on delegate."" ) ; return delegate . deploy ( operation , null ) ; } } ","public Future < ModelNode > deploy ( final ModelNode operation , ExecutorService executorService ) { ready = true ; logger . info ( ""Ready to deploy"" ) ; synchronized ( lock ) { logger . info ( ""Deploying on delegate."" ) ; return delegate . deploy ( operation , null ) ; } } " 191,"public Future < ModelNode > deploy ( final ModelNode operation , ExecutorService executorService ) { ready = true ; logger . info ( ""Ready to deploy"" ) ; synchronized ( lock ) { return delegate . deploy ( operation , null ) ; } } ","public Future < ModelNode > deploy ( final ModelNode operation , ExecutorService executorService ) { ready = true ; logger . info ( ""Ready to deploy"" ) ; synchronized ( lock ) { logger . info ( ""Deploying on delegate."" ) ; return delegate . deploy ( operation , null ) ; } } " 192,"public void addOrder ( Transaction transaction , ColoredCoinsBidOrderPlacement attachment ) { final BidOrder order = new BidOrder ( transaction , attachment , blockchain . getHeight ( ) ) ; bidOrderTable . insert ( order ) ; } ","public void addOrder ( Transaction transaction , ColoredCoinsBidOrderPlacement attachment ) { final BidOrder order = new BidOrder ( transaction , attachment , blockchain . getHeight ( ) ) ; log . trace ( "">> addOrder() bidOrder={}"" , order ) ; bidOrderTable . insert ( order ) ; } " 193,"private OrderNumberGenerator getOrderNumberGenerator ( ) { if ( orderNumberGenerator == null ) { String generatorBeanId = Context . getAdministrationService ( ) . getGlobalProperty ( OpenmrsConstants . GP_ORDER_NUMBER_GENERATOR_BEAN_ID ) ; if ( StringUtils . hasText ( generatorBeanId ) ) { orderNumberGenerator = Context . getRegisteredComponent ( generatorBeanId , OrderNumberGenerator . class ) ; } else { orderNumberGenerator = this ; log . info ( ""Setting default order number generator"" ) ; } } return orderNumberGenerator ; } ","private OrderNumberGenerator getOrderNumberGenerator ( ) { if ( orderNumberGenerator == null ) { String generatorBeanId = Context . getAdministrationService ( ) . getGlobalProperty ( OpenmrsConstants . GP_ORDER_NUMBER_GENERATOR_BEAN_ID ) ; if ( StringUtils . hasText ( generatorBeanId ) ) { orderNumberGenerator = Context . getRegisteredComponent ( generatorBeanId , OrderNumberGenerator . class ) ; log . info ( ""Successfully set the configured order number generator"" ) ; } else { orderNumberGenerator = this ; log . info ( ""Setting default order number generator"" ) ; } } return orderNumberGenerator ; } " 194,"private OrderNumberGenerator getOrderNumberGenerator ( ) { if ( orderNumberGenerator == null ) { String generatorBeanId = Context . getAdministrationService ( ) . getGlobalProperty ( OpenmrsConstants . GP_ORDER_NUMBER_GENERATOR_BEAN_ID ) ; if ( StringUtils . hasText ( generatorBeanId ) ) { orderNumberGenerator = Context . getRegisteredComponent ( generatorBeanId , OrderNumberGenerator . class ) ; log . info ( ""Successfully set the configured order number generator"" ) ; } else { orderNumberGenerator = this ; } } return orderNumberGenerator ; } ","private OrderNumberGenerator getOrderNumberGenerator ( ) { if ( orderNumberGenerator == null ) { String generatorBeanId = Context . getAdministrationService ( ) . getGlobalProperty ( OpenmrsConstants . GP_ORDER_NUMBER_GENERATOR_BEAN_ID ) ; if ( StringUtils . hasText ( generatorBeanId ) ) { orderNumberGenerator = Context . getRegisteredComponent ( generatorBeanId , OrderNumberGenerator . class ) ; log . info ( ""Successfully set the configured order number generator"" ) ; } else { orderNumberGenerator = this ; log . info ( ""Setting default order number generator"" ) ; } } return orderNumberGenerator ; } " 195,"public void run ( final SyncTaskChain chain ) { if ( isCancelled ( ) ) { callNext ( chain ) ; return ; } try { getTask ( ) . run ( ( ) -> { try { done ( ) ; } finally { callNext ( chain ) ; } } ) ; } catch ( Throwable t ) { try { if ( ! ( t instanceof OperationFailureException ) ) { } done ( ) ; } finally { callNext ( chain ) ; } } } ","public void run ( final SyncTaskChain chain ) { if ( isCancelled ( ) ) { callNext ( chain ) ; return ; } try { getTask ( ) . run ( ( ) -> { try { done ( ) ; } finally { callNext ( chain ) ; } } ) ; } catch ( Throwable t ) { try { if ( ! ( t instanceof OperationFailureException ) ) { _logger . warn ( String . format ( ""unhandled exception happened when calling %s"" , task . getClass ( ) . getName ( ) ) , t ) ; } done ( ) ; } finally { callNext ( chain ) ; } } } " 196,"@ Test public void testAsyncCallUseProperAssignedExecutor ( ) throws Exception { URL wsdl = getClass ( ) . getResource ( ""/wsdl/hello_world.wsdl"" ) ; assertNotNull ( wsdl ) ; SOAPService service = new SOAPService ( wsdl , serviceName ) ; class TestExecutor implements Executor { private AtomicInteger count = new AtomicInteger ( ) ; public void execute ( Runnable command ) { int c = count . incrementAndGet ( ) ; command . run ( ) ; } public int getCount ( ) { return count . get ( ) ; } } Executor executor = new TestExecutor ( ) ; service . setExecutor ( executor ) ; assertNotNull ( service ) ; assertSame ( executor , service . getExecutor ( ) ) ; assertEquals ( ( ( TestExecutor ) executor ) . getCount ( ) , 0 ) ; Greeter greeter = service . getPort ( portName , Greeter . class ) ; updateAddressPort ( greeter , PORT ) ; List < Response < GreetMeResponse > > responses = new ArrayList < > ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { responses . add ( greeter . greetMeAsync ( ""asyn call"" + i ) ) ; } for ( Response < GreetMeResponse > resp : responses ) { resp . get ( ) ; } assertEquals ( 5 , ( ( TestExecutor ) executor ) . getCount ( ) ) ; } ","@ Test public void testAsyncCallUseProperAssignedExecutor ( ) throws Exception { URL wsdl = getClass ( ) . getResource ( ""/wsdl/hello_world.wsdl"" ) ; assertNotNull ( wsdl ) ; SOAPService service = new SOAPService ( wsdl , serviceName ) ; class TestExecutor implements Executor { private AtomicInteger count = new AtomicInteger ( ) ; public void execute ( Runnable command ) { int c = count . incrementAndGet ( ) ; LOG . info ( ""asyn call time "" + c ) ; command . run ( ) ; } public int getCount ( ) { return count . get ( ) ; } } Executor executor = new TestExecutor ( ) ; service . setExecutor ( executor ) ; assertNotNull ( service ) ; assertSame ( executor , service . getExecutor ( ) ) ; assertEquals ( ( ( TestExecutor ) executor ) . getCount ( ) , 0 ) ; Greeter greeter = service . getPort ( portName , Greeter . class ) ; updateAddressPort ( greeter , PORT ) ; List < Response < GreetMeResponse > > responses = new ArrayList < > ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { responses . add ( greeter . greetMeAsync ( ""asyn call"" + i ) ) ; } for ( Response < GreetMeResponse > resp : responses ) { resp . get ( ) ; } assertEquals ( 5 , ( ( TestExecutor ) executor ) . getCount ( ) ) ; } " 197,"public String addNzb ( byte [ ] content , String title , String category ) throws DownloaderException { try { return callAppend ( BaseEncoding . base64 ( ) . encode ( content ) , title , category ) ; } catch ( Throwable throwable ) { logger . info ( ""Error while trying to add link {} for NZB \""{}\"" to NZBGet queue: {}"" , content , title , throwable . getMessage ( ) ) ; if ( throwable . getMessage ( ) != null ) { throw new DownloaderException ( ""Error while adding NZB to NZBGet: "" + throwable . getMessage ( ) ) ; } throw new DownloaderException ( ""Unknown error while adding NZB to NZBGet"" ) ; } } ","public String addNzb ( byte [ ] content , String title , String category ) throws DownloaderException { logger . debug ( ""Adding NZB for {} to NZB with category {}"" , title , category ) ; try { return callAppend ( BaseEncoding . base64 ( ) . encode ( content ) , title , category ) ; } catch ( Throwable throwable ) { logger . info ( ""Error while trying to add link {} for NZB \""{}\"" to NZBGet queue: {}"" , content , title , throwable . getMessage ( ) ) ; if ( throwable . getMessage ( ) != null ) { throw new DownloaderException ( ""Error while adding NZB to NZBGet: "" + throwable . getMessage ( ) ) ; } throw new DownloaderException ( ""Unknown error while adding NZB to NZBGet"" ) ; } } " 198,"public String addNzb ( byte [ ] content , String title , String category ) throws DownloaderException { logger . debug ( ""Adding NZB for {} to NZB with category {}"" , title , category ) ; try { return callAppend ( BaseEncoding . base64 ( ) . encode ( content ) , title , category ) ; } catch ( Throwable throwable ) { if ( throwable . getMessage ( ) != null ) { throw new DownloaderException ( ""Error while adding NZB to NZBGet: "" + throwable . getMessage ( ) ) ; } throw new DownloaderException ( ""Unknown error while adding NZB to NZBGet"" ) ; } } ","public String addNzb ( byte [ ] content , String title , String category ) throws DownloaderException { logger . debug ( ""Adding NZB for {} to NZB with category {}"" , title , category ) ; try { return callAppend ( BaseEncoding . base64 ( ) . encode ( content ) , title , category ) ; } catch ( Throwable throwable ) { logger . info ( ""Error while trying to add link {} for NZB \""{}\"" to NZBGet queue: {}"" , content , title , throwable . getMessage ( ) ) ; if ( throwable . getMessage ( ) != null ) { throw new DownloaderException ( ""Error while adding NZB to NZBGet: "" + throwable . getMessage ( ) ) ; } throw new DownloaderException ( ""Unknown error while adding NZB to NZBGet"" ) ; } } " 199,"public void setResponseString ( String responseString ) { waitResponseOpen ( ) ; synchronized ( response ) { response . setString ( responseString ) ; response . notifyAll ( ) ; } } ","public void setResponseString ( String responseString ) { waitResponseOpen ( ) ; synchronized ( response ) { response . setString ( responseString ) ; response . notifyAll ( ) ; logger . debug ( ""Got response string from player: "" + getId ( ) ) ; } } " 200,"public SearchResult < Series > getByQuery ( SeriesSearchQuery query ) throws SearchIndexException { final SearchRequest searchRequest = getSearchRequest ( query , new SeriesQueryBuilder ( query ) ) ; try { final Unmarshaller unmarshaller = Series . createUnmarshaller ( ) ; return executeQuery ( query , searchRequest , metadata -> { try { return SeriesIndexUtils . toSeries ( metadata , unmarshaller ) ; } catch ( IOException e ) { return chuck ( e ) ; } } ) ; } catch ( Throwable t ) { throw new SearchIndexException ( ""Error querying series index"" , t ) ; } } ","public SearchResult < Series > getByQuery ( SeriesSearchQuery query ) throws SearchIndexException { logger . debug ( ""Searching index using series query '{}'"" , query ) ; final SearchRequest searchRequest = getSearchRequest ( query , new SeriesQueryBuilder ( query ) ) ; try { final Unmarshaller unmarshaller = Series . createUnmarshaller ( ) ; return executeQuery ( query , searchRequest , metadata -> { try { return SeriesIndexUtils . toSeries ( metadata , unmarshaller ) ; } catch ( IOException e ) { return chuck ( e ) ; } } ) ; } catch ( Throwable t ) { throw new SearchIndexException ( ""Error querying series index"" , t ) ; } } " 201,"private void run ( ) { try { final ServerSocket serverSocket = new ServerSocket ( StructrLicenseManager . ServerPort ) ; serverSocket . setReuseAddress ( true ) ; while ( true ) { try ( final Socket socket = serverSocket . accept ( ) ) { logger . info ( ""##### New connection from {}"" , socket . getInetAddress ( ) . getHostAddress ( ) ) ; final InputStream is = socket . getInputStream ( ) ; final int bufSize = 4096 ; socket . setSoTimeout ( 2000 ) ; final byte [ ] sessionKey = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] ivSpec = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] buf = new byte [ bufSize ] ; int count = 0 ; streamCipher . init ( Cipher . DECRYPT_MODE , new SecretKeySpec ( sessionKey , ""AES"" ) , new IvParameterSpec ( ivSpec ) ) ; try { count = is . read ( buf , 0 , bufSize ) ; } catch ( IOException ioex ) { } final byte [ ] decrypted = streamCipher . doFinal ( buf , 0 , count ) ; final String data = new String ( decrypted , ""utf-8"" ) ; final List < Pair > pairs = split ( data ) . stream ( ) . map ( StructrLicenseVerifier :: keyValue ) . collect ( Collectors . toList ( ) ) ; final Map < String , String > map = pairs . stream ( ) . filter ( Objects :: nonNull ) . collect ( Collectors . toMap ( Pair :: getLeft , Pair :: getRight ) ) ; if ( isValid ( map ) ) { final String name = ( String ) map . get ( StructrLicenseManager . NameKey ) ; final byte [ ] response = name . getBytes ( ""utf-8"" ) ; socket . getOutputStream ( ) . write ( sign ( response ) ) ; socket . getOutputStream ( ) . flush ( ) ; } else { logger . info ( ""License verification failed."" ) ; } socket . getOutputStream ( ) . close ( ) ; } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } ","private void run ( ) { try { logger . info ( ""Listening on port {}"" , StructrLicenseManager . ServerPort ) ; final ServerSocket serverSocket = new ServerSocket ( StructrLicenseManager . ServerPort ) ; serverSocket . setReuseAddress ( true ) ; while ( true ) { try ( final Socket socket = serverSocket . accept ( ) ) { logger . info ( ""##### New connection from {}"" , socket . getInetAddress ( ) . getHostAddress ( ) ) ; final InputStream is = socket . getInputStream ( ) ; final int bufSize = 4096 ; socket . setSoTimeout ( 2000 ) ; final byte [ ] sessionKey = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] ivSpec = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] buf = new byte [ bufSize ] ; int count = 0 ; streamCipher . init ( Cipher . DECRYPT_MODE , new SecretKeySpec ( sessionKey , ""AES"" ) , new IvParameterSpec ( ivSpec ) ) ; try { count = is . read ( buf , 0 , bufSize ) ; } catch ( IOException ioex ) { } final byte [ ] decrypted = streamCipher . doFinal ( buf , 0 , count ) ; final String data = new String ( decrypted , ""utf-8"" ) ; final List < Pair > pairs = split ( data ) . stream ( ) . map ( StructrLicenseVerifier :: keyValue ) . collect ( Collectors . toList ( ) ) ; final Map < String , String > map = pairs . stream ( ) . filter ( Objects :: nonNull ) . collect ( Collectors . toMap ( Pair :: getLeft , Pair :: getRight ) ) ; if ( isValid ( map ) ) { final String name = ( String ) map . get ( StructrLicenseManager . NameKey ) ; final byte [ ] response = name . getBytes ( ""utf-8"" ) ; socket . getOutputStream ( ) . write ( sign ( response ) ) ; socket . getOutputStream ( ) . flush ( ) ; } else { logger . info ( ""License verification failed."" ) ; } socket . getOutputStream ( ) . close ( ) ; } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } " 202,"private void run ( ) { try { logger . info ( ""Listening on port {}"" , StructrLicenseManager . ServerPort ) ; final ServerSocket serverSocket = new ServerSocket ( StructrLicenseManager . ServerPort ) ; serverSocket . setReuseAddress ( true ) ; while ( true ) { try ( final Socket socket = serverSocket . accept ( ) ) { final InputStream is = socket . getInputStream ( ) ; final int bufSize = 4096 ; socket . setSoTimeout ( 2000 ) ; final byte [ ] sessionKey = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] ivSpec = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] buf = new byte [ bufSize ] ; int count = 0 ; streamCipher . init ( Cipher . DECRYPT_MODE , new SecretKeySpec ( sessionKey , ""AES"" ) , new IvParameterSpec ( ivSpec ) ) ; try { count = is . read ( buf , 0 , bufSize ) ; } catch ( IOException ioex ) { } final byte [ ] decrypted = streamCipher . doFinal ( buf , 0 , count ) ; final String data = new String ( decrypted , ""utf-8"" ) ; final List < Pair > pairs = split ( data ) . stream ( ) . map ( StructrLicenseVerifier :: keyValue ) . collect ( Collectors . toList ( ) ) ; final Map < String , String > map = pairs . stream ( ) . filter ( Objects :: nonNull ) . collect ( Collectors . toMap ( Pair :: getLeft , Pair :: getRight ) ) ; if ( isValid ( map ) ) { final String name = ( String ) map . get ( StructrLicenseManager . NameKey ) ; final byte [ ] response = name . getBytes ( ""utf-8"" ) ; socket . getOutputStream ( ) . write ( sign ( response ) ) ; socket . getOutputStream ( ) . flush ( ) ; } else { logger . info ( ""License verification failed."" ) ; } socket . getOutputStream ( ) . close ( ) ; } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } ","private void run ( ) { try { logger . info ( ""Listening on port {}"" , StructrLicenseManager . ServerPort ) ; final ServerSocket serverSocket = new ServerSocket ( StructrLicenseManager . ServerPort ) ; serverSocket . setReuseAddress ( true ) ; while ( true ) { try ( final Socket socket = serverSocket . accept ( ) ) { logger . info ( ""##### New connection from {}"" , socket . getInetAddress ( ) . getHostAddress ( ) ) ; final InputStream is = socket . getInputStream ( ) ; final int bufSize = 4096 ; socket . setSoTimeout ( 2000 ) ; final byte [ ] sessionKey = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] ivSpec = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] buf = new byte [ bufSize ] ; int count = 0 ; streamCipher . init ( Cipher . DECRYPT_MODE , new SecretKeySpec ( sessionKey , ""AES"" ) , new IvParameterSpec ( ivSpec ) ) ; try { count = is . read ( buf , 0 , bufSize ) ; } catch ( IOException ioex ) { } final byte [ ] decrypted = streamCipher . doFinal ( buf , 0 , count ) ; final String data = new String ( decrypted , ""utf-8"" ) ; final List < Pair > pairs = split ( data ) . stream ( ) . map ( StructrLicenseVerifier :: keyValue ) . collect ( Collectors . toList ( ) ) ; final Map < String , String > map = pairs . stream ( ) . filter ( Objects :: nonNull ) . collect ( Collectors . toMap ( Pair :: getLeft , Pair :: getRight ) ) ; if ( isValid ( map ) ) { final String name = ( String ) map . get ( StructrLicenseManager . NameKey ) ; final byte [ ] response = name . getBytes ( ""utf-8"" ) ; socket . getOutputStream ( ) . write ( sign ( response ) ) ; socket . getOutputStream ( ) . flush ( ) ; } else { logger . info ( ""License verification failed."" ) ; } socket . getOutputStream ( ) . close ( ) ; } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } " 203,"private void run ( ) { try { logger . info ( ""Listening on port {}"" , StructrLicenseManager . ServerPort ) ; final ServerSocket serverSocket = new ServerSocket ( StructrLicenseManager . ServerPort ) ; serverSocket . setReuseAddress ( true ) ; while ( true ) { try ( final Socket socket = serverSocket . accept ( ) ) { logger . info ( ""##### New connection from {}"" , socket . getInetAddress ( ) . getHostAddress ( ) ) ; final InputStream is = socket . getInputStream ( ) ; final int bufSize = 4096 ; socket . setSoTimeout ( 2000 ) ; final byte [ ] sessionKey = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] ivSpec = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] buf = new byte [ bufSize ] ; int count = 0 ; streamCipher . init ( Cipher . DECRYPT_MODE , new SecretKeySpec ( sessionKey , ""AES"" ) , new IvParameterSpec ( ivSpec ) ) ; try { count = is . read ( buf , 0 , bufSize ) ; } catch ( IOException ioex ) { } final byte [ ] decrypted = streamCipher . doFinal ( buf , 0 , count ) ; final String data = new String ( decrypted , ""utf-8"" ) ; final List < Pair > pairs = split ( data ) . stream ( ) . map ( StructrLicenseVerifier :: keyValue ) . collect ( Collectors . toList ( ) ) ; final Map < String , String > map = pairs . stream ( ) . filter ( Objects :: nonNull ) . collect ( Collectors . toMap ( Pair :: getLeft , Pair :: getRight ) ) ; if ( isValid ( map ) ) { final String name = ( String ) map . get ( StructrLicenseManager . NameKey ) ; final byte [ ] response = name . getBytes ( ""utf-8"" ) ; socket . getOutputStream ( ) . write ( sign ( response ) ) ; socket . getOutputStream ( ) . flush ( ) ; } else { } socket . getOutputStream ( ) . close ( ) ; } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } ","private void run ( ) { try { logger . info ( ""Listening on port {}"" , StructrLicenseManager . ServerPort ) ; final ServerSocket serverSocket = new ServerSocket ( StructrLicenseManager . ServerPort ) ; serverSocket . setReuseAddress ( true ) ; while ( true ) { try ( final Socket socket = serverSocket . accept ( ) ) { logger . info ( ""##### New connection from {}"" , socket . getInetAddress ( ) . getHostAddress ( ) ) ; final InputStream is = socket . getInputStream ( ) ; final int bufSize = 4096 ; socket . setSoTimeout ( 2000 ) ; final byte [ ] sessionKey = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] ivSpec = blockCipher . doFinal ( IOUtils . readFully ( is , 256 ) ) ; final byte [ ] buf = new byte [ bufSize ] ; int count = 0 ; streamCipher . init ( Cipher . DECRYPT_MODE , new SecretKeySpec ( sessionKey , ""AES"" ) , new IvParameterSpec ( ivSpec ) ) ; try { count = is . read ( buf , 0 , bufSize ) ; } catch ( IOException ioex ) { } final byte [ ] decrypted = streamCipher . doFinal ( buf , 0 , count ) ; final String data = new String ( decrypted , ""utf-8"" ) ; final List < Pair > pairs = split ( data ) . stream ( ) . map ( StructrLicenseVerifier :: keyValue ) . collect ( Collectors . toList ( ) ) ; final Map < String , String > map = pairs . stream ( ) . filter ( Objects :: nonNull ) . collect ( Collectors . toMap ( Pair :: getLeft , Pair :: getRight ) ) ; if ( isValid ( map ) ) { final String name = ( String ) map . get ( StructrLicenseManager . NameKey ) ; final byte [ ] response = name . getBytes ( ""utf-8"" ) ; socket . getOutputStream ( ) . write ( sign ( response ) ) ; socket . getOutputStream ( ) . flush ( ) ; } else { logger . info ( ""License verification failed."" ) ; } socket . getOutputStream ( ) . close ( ) ; } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } } catch ( Throwable t ) { logger . warn ( ""Unable to verify license: {}"" , t . getMessage ( ) ) ; } } " 204,"public void ack ( Tuple input ) { if ( ! ackingEnabled ) { return ; } long ackValue = ( ( TupleImpl ) input ) . getAckVal ( ) ; Map < Long , Long > anchorsToIds = input . getMessageId ( ) . getAnchorsToIds ( ) ; for ( Map . Entry < Long , Long > entry : anchorsToIds . entrySet ( ) ) { task . sendUnanchored ( Acker . ACKER_ACK_STREAM_ID , new Values ( entry . getKey ( ) , Utils . bitXor ( entry . getValue ( ) , ackValue ) ) , executor . getExecutorTransfer ( ) , executor . getPendingEmits ( ) ) ; } long delta = tupleTimeDelta ( ( TupleImpl ) input ) ; if ( isDebug ) { } if ( ! task . getUserContext ( ) . getHooks ( ) . isEmpty ( ) ) { BoltAckInfo boltAckInfo = new BoltAckInfo ( input , taskId , delta ) ; boltAckInfo . applyOn ( task . getUserContext ( ) ) ; } if ( delta >= 0 ) { executor . getStats ( ) . boltAckedTuple ( input . getSourceComponent ( ) , input . getSourceStreamId ( ) , delta ) ; task . getTaskMetrics ( ) . boltAckedTuple ( input . getSourceComponent ( ) , input . getSourceStreamId ( ) , delta ) ; } } ","public void ack ( Tuple input ) { if ( ! ackingEnabled ) { return ; } long ackValue = ( ( TupleImpl ) input ) . getAckVal ( ) ; Map < Long , Long > anchorsToIds = input . getMessageId ( ) . getAnchorsToIds ( ) ; for ( Map . Entry < Long , Long > entry : anchorsToIds . entrySet ( ) ) { task . sendUnanchored ( Acker . ACKER_ACK_STREAM_ID , new Values ( entry . getKey ( ) , Utils . bitXor ( entry . getValue ( ) , ackValue ) ) , executor . getExecutorTransfer ( ) , executor . getPendingEmits ( ) ) ; } long delta = tupleTimeDelta ( ( TupleImpl ) input ) ; if ( isDebug ) { LOG . info ( ""BOLT ack TASK: {} TIME: {} TUPLE: {}"" , taskId , delta , input ) ; } if ( ! task . getUserContext ( ) . getHooks ( ) . isEmpty ( ) ) { BoltAckInfo boltAckInfo = new BoltAckInfo ( input , taskId , delta ) ; boltAckInfo . applyOn ( task . getUserContext ( ) ) ; } if ( delta >= 0 ) { executor . getStats ( ) . boltAckedTuple ( input . getSourceComponent ( ) , input . getSourceStreamId ( ) , delta ) ; task . getTaskMetrics ( ) . boltAckedTuple ( input . getSourceComponent ( ) , input . getSourceStreamId ( ) , delta ) ; } } " 205,"public void start ( int port , int backlog , int listenThreadCount , int handleThreadCount , boolean forceExit ) { EventLoopGroup bossGroup = new NioEventLoopGroup ( listenThreadCount ) ; EventLoopGroup workerGroup = new NioEventLoopGroup ( handleThreadCount ) ; server = new ServerBootstrap ( ) ; server . group ( bossGroup , workerGroup ) . channel ( NioServerSocketChannel . class ) . localAddress ( port ) . option ( ChannelOption . SO_BACKLOG , backlog ) . childHandler ( new HttpServerInitializer ( this ) ) ; try { this . host = NetworkHelper . getLocalIP ( ) ; this . port = port ; server . bind ( ) . sync ( ) ; if ( log . isTraceEnable ( ) ) { } } catch ( Exception e ) { log . err ( this , ""HttpServiceComponent["" + this . cName + ""] for feature["" + this . feature + ""] starts FAIL."" , e ) ; if ( forceExit == true ) { System . exit ( - 1 ) ; } } } ","public void start ( int port , int backlog , int listenThreadCount , int handleThreadCount , boolean forceExit ) { EventLoopGroup bossGroup = new NioEventLoopGroup ( listenThreadCount ) ; EventLoopGroup workerGroup = new NioEventLoopGroup ( handleThreadCount ) ; server = new ServerBootstrap ( ) ; server . group ( bossGroup , workerGroup ) . channel ( NioServerSocketChannel . class ) . localAddress ( port ) . option ( ChannelOption . SO_BACKLOG , backlog ) . childHandler ( new HttpServerInitializer ( this ) ) ; try { this . host = NetworkHelper . getLocalIP ( ) ; this . port = port ; server . bind ( ) . sync ( ) ; if ( log . isTraceEnable ( ) ) { log . info ( this , ""HttpServiceComponent["" + this . cName + ""] for feature["" + this . feature + ""] started SUCCESS: port="" + this . port ) ; } } catch ( Exception e ) { log . err ( this , ""HttpServiceComponent["" + this . cName + ""] for feature["" + this . feature + ""] starts FAIL."" , e ) ; if ( forceExit == true ) { System . exit ( - 1 ) ; } } } " 206,"public void start ( ) { if ( authzPaths != null || authzPermissions != null ) { boolean success = false ; try { success = update ( ) ; } catch ( Exception ex ) { success = false ; } if ( ! success ) { waitUntil = System . currentTimeMillis ( ) + retryWaitMillisec ; } executor = Executors . newSingleThreadScheduledExecutor ( new ThreadFactory ( ) { @ Override public Thread newThread ( Runnable r ) { Thread t = new Thread ( r , SentryAuthorizationInfo . class . getName ( ) + ""-refresher"" ) ; t . setDaemon ( true ) ; return t ; } } ) ; executor . scheduleWithFixedDelay ( this , refreshIntervalMillisec , refreshIntervalMillisec , TimeUnit . MILLISECONDS ) ; } } ","public void start ( ) { if ( authzPaths != null || authzPermissions != null ) { boolean success = false ; try { success = update ( ) ; } catch ( Exception ex ) { success = false ; LOG . warn ( ""Failed to do initial update, will retry in [{}]ms, error: "" , new Object [ ] { retryWaitMillisec , ex . getMessage ( ) , ex } ) ; } if ( ! success ) { waitUntil = System . currentTimeMillis ( ) + retryWaitMillisec ; } executor = Executors . newSingleThreadScheduledExecutor ( new ThreadFactory ( ) { @ Override public Thread newThread ( Runnable r ) { Thread t = new Thread ( r , SentryAuthorizationInfo . class . getName ( ) + ""-refresher"" ) ; t . setDaemon ( true ) ; return t ; } } ) ; executor . scheduleWithFixedDelay ( this , refreshIntervalMillisec , refreshIntervalMillisec , TimeUnit . MILLISECONDS ) ; } } " 207,"@ VisibleForTesting public Pair < String , TTransport > getAnyTransport ( List < ThriftTransportKey > servers , boolean preferCachedConnection ) throws TTransportException { servers = new ArrayList < > ( servers ) ; if ( preferCachedConnection ) { HashSet < ThriftTransportKey > serversSet = new HashSet < > ( servers ) ; ConnectionPool pool = getConnectionPool ( ) ; serversSet . retainAll ( pool . getThriftTransportKeys ( ) ) ; if ( ! serversSet . isEmpty ( ) ) { ArrayList < ThriftTransportKey > cachedServers = new ArrayList < > ( serversSet ) ; Collections . shuffle ( cachedServers , random ) ; for ( ThriftTransportKey ttk : cachedServers ) { CachedConnection connection = pool . reserveAny ( ttk ) ; if ( connection != null ) { final String serverAddr = ttk . getServer ( ) . toString ( ) ; return new Pair < > ( serverAddr , connection . transport ) ; } } } } ConnectionPool pool = getConnectionPool ( ) ; int retryCount = 0 ; while ( ! servers . isEmpty ( ) && retryCount < 10 ) { int index = random . nextInt ( servers . size ( ) ) ; ThriftTransportKey ttk = servers . get ( index ) ; if ( preferCachedConnection ) { CachedConnection connection = pool . reserveAnyIfPresent ( ttk ) ; if ( connection != null ) { return new Pair < > ( ttk . getServer ( ) . toString ( ) , connection . transport ) ; } } try { return new Pair < > ( ttk . getServer ( ) . toString ( ) , createNewTransport ( ttk ) ) ; } catch ( TTransportException tte ) { log . debug ( ""Failed to connect to {}"" , servers . get ( index ) , tte ) ; servers . remove ( index ) ; retryCount ++ ; } } throw new TTransportException ( ""Failed to connect to a server"" ) ; } ","@ VisibleForTesting public Pair < String , TTransport > getAnyTransport ( List < ThriftTransportKey > servers , boolean preferCachedConnection ) throws TTransportException { servers = new ArrayList < > ( servers ) ; if ( preferCachedConnection ) { HashSet < ThriftTransportKey > serversSet = new HashSet < > ( servers ) ; ConnectionPool pool = getConnectionPool ( ) ; serversSet . retainAll ( pool . getThriftTransportKeys ( ) ) ; if ( ! serversSet . isEmpty ( ) ) { ArrayList < ThriftTransportKey > cachedServers = new ArrayList < > ( serversSet ) ; Collections . shuffle ( cachedServers , random ) ; for ( ThriftTransportKey ttk : cachedServers ) { CachedConnection connection = pool . reserveAny ( ttk ) ; if ( connection != null ) { final String serverAddr = ttk . getServer ( ) . toString ( ) ; log . trace ( ""Using existing connection to {}"" , serverAddr ) ; return new Pair < > ( serverAddr , connection . transport ) ; } } } } ConnectionPool pool = getConnectionPool ( ) ; int retryCount = 0 ; while ( ! servers . isEmpty ( ) && retryCount < 10 ) { int index = random . nextInt ( servers . size ( ) ) ; ThriftTransportKey ttk = servers . get ( index ) ; if ( preferCachedConnection ) { CachedConnection connection = pool . reserveAnyIfPresent ( ttk ) ; if ( connection != null ) { return new Pair < > ( ttk . getServer ( ) . toString ( ) , connection . transport ) ; } } try { return new Pair < > ( ttk . getServer ( ) . toString ( ) , createNewTransport ( ttk ) ) ; } catch ( TTransportException tte ) { log . debug ( ""Failed to connect to {}"" , servers . get ( index ) , tte ) ; servers . remove ( index ) ; retryCount ++ ; } } throw new TTransportException ( ""Failed to connect to a server"" ) ; } " 208,"@ VisibleForTesting public Pair < String , TTransport > getAnyTransport ( List < ThriftTransportKey > servers , boolean preferCachedConnection ) throws TTransportException { servers = new ArrayList < > ( servers ) ; if ( preferCachedConnection ) { HashSet < ThriftTransportKey > serversSet = new HashSet < > ( servers ) ; ConnectionPool pool = getConnectionPool ( ) ; serversSet . retainAll ( pool . getThriftTransportKeys ( ) ) ; if ( ! serversSet . isEmpty ( ) ) { ArrayList < ThriftTransportKey > cachedServers = new ArrayList < > ( serversSet ) ; Collections . shuffle ( cachedServers , random ) ; for ( ThriftTransportKey ttk : cachedServers ) { CachedConnection connection = pool . reserveAny ( ttk ) ; if ( connection != null ) { final String serverAddr = ttk . getServer ( ) . toString ( ) ; log . trace ( ""Using existing connection to {}"" , serverAddr ) ; return new Pair < > ( serverAddr , connection . transport ) ; } } } } ConnectionPool pool = getConnectionPool ( ) ; int retryCount = 0 ; while ( ! servers . isEmpty ( ) && retryCount < 10 ) { int index = random . nextInt ( servers . size ( ) ) ; ThriftTransportKey ttk = servers . get ( index ) ; if ( preferCachedConnection ) { CachedConnection connection = pool . reserveAnyIfPresent ( ttk ) ; if ( connection != null ) { return new Pair < > ( ttk . getServer ( ) . toString ( ) , connection . transport ) ; } } try { return new Pair < > ( ttk . getServer ( ) . toString ( ) , createNewTransport ( ttk ) ) ; } catch ( TTransportException tte ) { servers . remove ( index ) ; retryCount ++ ; } } throw new TTransportException ( ""Failed to connect to a server"" ) ; } ","@ VisibleForTesting public Pair < String , TTransport > getAnyTransport ( List < ThriftTransportKey > servers , boolean preferCachedConnection ) throws TTransportException { servers = new ArrayList < > ( servers ) ; if ( preferCachedConnection ) { HashSet < ThriftTransportKey > serversSet = new HashSet < > ( servers ) ; ConnectionPool pool = getConnectionPool ( ) ; serversSet . retainAll ( pool . getThriftTransportKeys ( ) ) ; if ( ! serversSet . isEmpty ( ) ) { ArrayList < ThriftTransportKey > cachedServers = new ArrayList < > ( serversSet ) ; Collections . shuffle ( cachedServers , random ) ; for ( ThriftTransportKey ttk : cachedServers ) { CachedConnection connection = pool . reserveAny ( ttk ) ; if ( connection != null ) { final String serverAddr = ttk . getServer ( ) . toString ( ) ; log . trace ( ""Using existing connection to {}"" , serverAddr ) ; return new Pair < > ( serverAddr , connection . transport ) ; } } } } ConnectionPool pool = getConnectionPool ( ) ; int retryCount = 0 ; while ( ! servers . isEmpty ( ) && retryCount < 10 ) { int index = random . nextInt ( servers . size ( ) ) ; ThriftTransportKey ttk = servers . get ( index ) ; if ( preferCachedConnection ) { CachedConnection connection = pool . reserveAnyIfPresent ( ttk ) ; if ( connection != null ) { return new Pair < > ( ttk . getServer ( ) . toString ( ) , connection . transport ) ; } } try { return new Pair < > ( ttk . getServer ( ) . toString ( ) , createNewTransport ( ttk ) ) ; } catch ( TTransportException tte ) { log . debug ( ""Failed to connect to {}"" , servers . get ( index ) , tte ) ; servers . remove ( index ) ; retryCount ++ ; } } throw new TTransportException ( ""Failed to connect to a server"" ) ; } " 209,"private void flushBuffer ( final boolean scheduled ) { if ( _queue . isEmpty ( ) ) { return ; } if ( ! scheduled ) { if ( _queue . size ( ) < _maxBatchSize ) { return ; } } final List < BatchEntry < ? , O > > entries = new ArrayList < > ( _maxBatchSize ) ; final int batchSize = _queue . drainTo ( entries ) ; if ( batchSize == 0 ) { logger . debug ( ""Batch ignored, no elements left in queue"" ) ; return ; } final int batchNumber = _batchNo . incrementAndGet ( ) ; logger . info ( ""Batch #{} - Preparing {} entries, scheduled={}"" , batchNumber , batchSize , scheduled ) ; final Object [ ] input = new Object [ batchSize ] ; for ( int i = 0 ; i < batchSize ; i ++ ) { input [ i ] = entries . get ( i ) . getInput ( ) ; } final BatchSource < I > source = new ArrayBatchSource < > ( input ) ; final BatchEntryBatchSink < O > sink = new BatchEntryBatchSink < > ( entries ) ; _transformation . map ( source , sink ) ; logger . info ( ""Batch #{} - Finished"" , batchNumber , batchSize ) ; } ","private void flushBuffer ( final boolean scheduled ) { if ( _queue . isEmpty ( ) ) { return ; } if ( ! scheduled ) { if ( _queue . size ( ) < _maxBatchSize ) { logger . debug ( ""Batch ignored, flush operation not scheduled and queue is not full"" ) ; return ; } } final List < BatchEntry < ? , O > > entries = new ArrayList < > ( _maxBatchSize ) ; final int batchSize = _queue . drainTo ( entries ) ; if ( batchSize == 0 ) { logger . debug ( ""Batch ignored, no elements left in queue"" ) ; return ; } final int batchNumber = _batchNo . incrementAndGet ( ) ; logger . info ( ""Batch #{} - Preparing {} entries, scheduled={}"" , batchNumber , batchSize , scheduled ) ; final Object [ ] input = new Object [ batchSize ] ; for ( int i = 0 ; i < batchSize ; i ++ ) { input [ i ] = entries . get ( i ) . getInput ( ) ; } final BatchSource < I > source = new ArrayBatchSource < > ( input ) ; final BatchEntryBatchSink < O > sink = new BatchEntryBatchSink < > ( entries ) ; _transformation . map ( source , sink ) ; logger . info ( ""Batch #{} - Finished"" , batchNumber , batchSize ) ; } " 210,"private void flushBuffer ( final boolean scheduled ) { if ( _queue . isEmpty ( ) ) { return ; } if ( ! scheduled ) { if ( _queue . size ( ) < _maxBatchSize ) { logger . debug ( ""Batch ignored, flush operation not scheduled and queue is not full"" ) ; return ; } } final List < BatchEntry < ? , O > > entries = new ArrayList < > ( _maxBatchSize ) ; final int batchSize = _queue . drainTo ( entries ) ; if ( batchSize == 0 ) { return ; } final int batchNumber = _batchNo . incrementAndGet ( ) ; logger . info ( ""Batch #{} - Preparing {} entries, scheduled={}"" , batchNumber , batchSize , scheduled ) ; final Object [ ] input = new Object [ batchSize ] ; for ( int i = 0 ; i < batchSize ; i ++ ) { input [ i ] = entries . get ( i ) . getInput ( ) ; } final BatchSource < I > source = new ArrayBatchSource < > ( input ) ; final BatchEntryBatchSink < O > sink = new BatchEntryBatchSink < > ( entries ) ; _transformation . map ( source , sink ) ; logger . info ( ""Batch #{} - Finished"" , batchNumber , batchSize ) ; } ","private void flushBuffer ( final boolean scheduled ) { if ( _queue . isEmpty ( ) ) { return ; } if ( ! scheduled ) { if ( _queue . size ( ) < _maxBatchSize ) { logger . debug ( ""Batch ignored, flush operation not scheduled and queue is not full"" ) ; return ; } } final List < BatchEntry < ? , O > > entries = new ArrayList < > ( _maxBatchSize ) ; final int batchSize = _queue . drainTo ( entries ) ; if ( batchSize == 0 ) { logger . debug ( ""Batch ignored, no elements left in queue"" ) ; return ; } final int batchNumber = _batchNo . incrementAndGet ( ) ; logger . info ( ""Batch #{} - Preparing {} entries, scheduled={}"" , batchNumber , batchSize , scheduled ) ; final Object [ ] input = new Object [ batchSize ] ; for ( int i = 0 ; i < batchSize ; i ++ ) { input [ i ] = entries . get ( i ) . getInput ( ) ; } final BatchSource < I > source = new ArrayBatchSource < > ( input ) ; final BatchEntryBatchSink < O > sink = new BatchEntryBatchSink < > ( entries ) ; _transformation . map ( source , sink ) ; logger . info ( ""Batch #{} - Finished"" , batchNumber , batchSize ) ; } " 211,"private void flushBuffer ( final boolean scheduled ) { if ( _queue . isEmpty ( ) ) { return ; } if ( ! scheduled ) { if ( _queue . size ( ) < _maxBatchSize ) { logger . debug ( ""Batch ignored, flush operation not scheduled and queue is not full"" ) ; return ; } } final List < BatchEntry < ? , O > > entries = new ArrayList < > ( _maxBatchSize ) ; final int batchSize = _queue . drainTo ( entries ) ; if ( batchSize == 0 ) { logger . debug ( ""Batch ignored, no elements left in queue"" ) ; return ; } final int batchNumber = _batchNo . incrementAndGet ( ) ; final Object [ ] input = new Object [ batchSize ] ; for ( int i = 0 ; i < batchSize ; i ++ ) { input [ i ] = entries . get ( i ) . getInput ( ) ; } final BatchSource < I > source = new ArrayBatchSource < > ( input ) ; final BatchEntryBatchSink < O > sink = new BatchEntryBatchSink < > ( entries ) ; _transformation . map ( source , sink ) ; logger . info ( ""Batch #{} - Finished"" , batchNumber , batchSize ) ; } ","private void flushBuffer ( final boolean scheduled ) { if ( _queue . isEmpty ( ) ) { return ; } if ( ! scheduled ) { if ( _queue . size ( ) < _maxBatchSize ) { logger . debug ( ""Batch ignored, flush operation not scheduled and queue is not full"" ) ; return ; } } final List < BatchEntry < ? , O > > entries = new ArrayList < > ( _maxBatchSize ) ; final int batchSize = _queue . drainTo ( entries ) ; if ( batchSize == 0 ) { logger . debug ( ""Batch ignored, no elements left in queue"" ) ; return ; } final int batchNumber = _batchNo . incrementAndGet ( ) ; logger . info ( ""Batch #{} - Preparing {} entries, scheduled={}"" , batchNumber , batchSize , scheduled ) ; final Object [ ] input = new Object [ batchSize ] ; for ( int i = 0 ; i < batchSize ; i ++ ) { input [ i ] = entries . get ( i ) . getInput ( ) ; } final BatchSource < I > source = new ArrayBatchSource < > ( input ) ; final BatchEntryBatchSink < O > sink = new BatchEntryBatchSink < > ( entries ) ; _transformation . map ( source , sink ) ; logger . info ( ""Batch #{} - Finished"" , batchNumber , batchSize ) ; } " 212,"private void flushBuffer ( final boolean scheduled ) { if ( _queue . isEmpty ( ) ) { return ; } if ( ! scheduled ) { if ( _queue . size ( ) < _maxBatchSize ) { logger . debug ( ""Batch ignored, flush operation not scheduled and queue is not full"" ) ; return ; } } final List < BatchEntry < ? , O > > entries = new ArrayList < > ( _maxBatchSize ) ; final int batchSize = _queue . drainTo ( entries ) ; if ( batchSize == 0 ) { logger . debug ( ""Batch ignored, no elements left in queue"" ) ; return ; } final int batchNumber = _batchNo . incrementAndGet ( ) ; logger . info ( ""Batch #{} - Preparing {} entries, scheduled={}"" , batchNumber , batchSize , scheduled ) ; final Object [ ] input = new Object [ batchSize ] ; for ( int i = 0 ; i < batchSize ; i ++ ) { input [ i ] = entries . get ( i ) . getInput ( ) ; } final BatchSource < I > source = new ArrayBatchSource < > ( input ) ; final BatchEntryBatchSink < O > sink = new BatchEntryBatchSink < > ( entries ) ; _transformation . map ( source , sink ) ; } ","private void flushBuffer ( final boolean scheduled ) { if ( _queue . isEmpty ( ) ) { return ; } if ( ! scheduled ) { if ( _queue . size ( ) < _maxBatchSize ) { logger . debug ( ""Batch ignored, flush operation not scheduled and queue is not full"" ) ; return ; } } final List < BatchEntry < ? , O > > entries = new ArrayList < > ( _maxBatchSize ) ; final int batchSize = _queue . drainTo ( entries ) ; if ( batchSize == 0 ) { logger . debug ( ""Batch ignored, no elements left in queue"" ) ; return ; } final int batchNumber = _batchNo . incrementAndGet ( ) ; logger . info ( ""Batch #{} - Preparing {} entries, scheduled={}"" , batchNumber , batchSize , scheduled ) ; final Object [ ] input = new Object [ batchSize ] ; for ( int i = 0 ; i < batchSize ; i ++ ) { input [ i ] = entries . get ( i ) . getInput ( ) ; } final BatchSource < I > source = new ArrayBatchSource < > ( input ) ; final BatchEntryBatchSink < O > sink = new BatchEntryBatchSink < > ( entries ) ; _transformation . map ( source , sink ) ; logger . info ( ""Batch #{} - Finished"" , batchNumber , batchSize ) ; } " 213,"public JPACommit getLastCommit ( Map < String , Object > param ) throws EDBException { synchronized ( entityManager ) { CriteriaBuilder criteriaBuilder = entityManager . getCriteriaBuilder ( ) ; CriteriaQuery < JPACommit > query = criteriaBuilder . createQuery ( JPACommit . class ) ; Root < JPACommit > from = query . from ( JPACommit . class ) ; query . select ( from ) ; Predicate [ ] predicates = analyzeParamMap ( criteriaBuilder , from , param ) ; query . where ( criteriaBuilder . and ( predicates ) ) ; query . orderBy ( criteriaBuilder . desc ( from . get ( ""timestamp"" ) ) ) ; TypedQuery < JPACommit > typedQuery = entityManager . createQuery ( query ) . setMaxResults ( 1 ) ; try { return typedQuery . getSingleResult ( ) ; } catch ( NoResultException ex ) { throw new EDBException ( ""there was no Object found with the given query parameters"" , ex ) ; } } } ","public JPACommit getLastCommit ( Map < String , Object > param ) throws EDBException { synchronized ( entityManager ) { LOGGER . debug ( ""Get last commit which are given to a param map with {} elements"" , param . size ( ) ) ; CriteriaBuilder criteriaBuilder = entityManager . getCriteriaBuilder ( ) ; CriteriaQuery < JPACommit > query = criteriaBuilder . createQuery ( JPACommit . class ) ; Root < JPACommit > from = query . from ( JPACommit . class ) ; query . select ( from ) ; Predicate [ ] predicates = analyzeParamMap ( criteriaBuilder , from , param ) ; query . where ( criteriaBuilder . and ( predicates ) ) ; query . orderBy ( criteriaBuilder . desc ( from . get ( ""timestamp"" ) ) ) ; TypedQuery < JPACommit > typedQuery = entityManager . createQuery ( query ) . setMaxResults ( 1 ) ; try { return typedQuery . getSingleResult ( ) ; } catch ( NoResultException ex ) { throw new EDBException ( ""there was no Object found with the given query parameters"" , ex ) ; } } } " 214,"public void tryMkDir ( final Path dir ) throws IOException { callHdfsOperation ( new HdfsOperation < Void > ( ) { @ Override public Void call ( ) throws IOException { if ( ! fs . exists ( dir ) ) { fs . mkdirs ( dir ) ; } if ( fs . getFileStatus ( dir ) . isFile ( ) ) { throw new IOException ( dir . toString ( ) + "" is file instead of directory, please remove "" + ""it or specify another directory"" ) ; } fs . mkdirs ( dir ) ; return null ; } } ) ; } ","public void tryMkDir ( final Path dir ) throws IOException { callHdfsOperation ( new HdfsOperation < Void > ( ) { @ Override public Void call ( ) throws IOException { if ( ! fs . exists ( dir ) ) { fs . mkdirs ( dir ) ; LOGGER . info ( ""Create dir {} in hdfs"" , dir ) ; } if ( fs . getFileStatus ( dir ) . isFile ( ) ) { throw new IOException ( dir . toString ( ) + "" is file instead of directory, please remove "" + ""it or specify another directory"" ) ; } fs . mkdirs ( dir ) ; return null ; } } ) ; } " 215,"@ Test void testXml ( ) throws Exception { List < CamelEndpointDetails > endpoints = new ArrayList < > ( ) ; InputStream is = new FileInputStream ( ""src/test/resources/org/apache/camel/parser/xml/mycamel-onexception.xml"" ) ; String fqn = ""src/test/resources/org/apache/camel/parser/xml/mycamel-onexception.xml"" ; String baseDir = ""src/test/resources"" ; XmlRouteParser . parseXmlRouteEndpoints ( is , baseDir , fqn , endpoints ) ; for ( CamelEndpointDetails detail : endpoints ) { } assertEquals ( ""log:all"" , endpoints . get ( 0 ) . getEndpointUri ( ) ) ; assertEquals ( ""mock:dead"" , endpoints . get ( 1 ) . getEndpointUri ( ) ) ; assertEquals ( ""log:done"" , endpoints . get ( 2 ) . getEndpointUri ( ) ) ; assertEquals ( ""stream:in?promptMessage=Enter something:"" , endpoints . get ( 3 ) . getEndpointUri ( ) ) ; assertEquals ( ""stream:out"" , endpoints . get ( 4 ) . getEndpointUri ( ) ) ; } ","@ Test void testXml ( ) throws Exception { List < CamelEndpointDetails > endpoints = new ArrayList < > ( ) ; InputStream is = new FileInputStream ( ""src/test/resources/org/apache/camel/parser/xml/mycamel-onexception.xml"" ) ; String fqn = ""src/test/resources/org/apache/camel/parser/xml/mycamel-onexception.xml"" ; String baseDir = ""src/test/resources"" ; XmlRouteParser . parseXmlRouteEndpoints ( is , baseDir , fqn , endpoints ) ; for ( CamelEndpointDetails detail : endpoints ) { LOG . info ( detail . getEndpointUri ( ) ) ; } assertEquals ( ""log:all"" , endpoints . get ( 0 ) . getEndpointUri ( ) ) ; assertEquals ( ""mock:dead"" , endpoints . get ( 1 ) . getEndpointUri ( ) ) ; assertEquals ( ""log:done"" , endpoints . get ( 2 ) . getEndpointUri ( ) ) ; assertEquals ( ""stream:in?promptMessage=Enter something:"" , endpoints . get ( 3 ) . getEndpointUri ( ) ) ; assertEquals ( ""stream:out"" , endpoints . get ( 4 ) . getEndpointUri ( ) ) ; } " 216,"public void getNext ( JCas aJCas ) throws IOException , CollectionException { Resource res = nextFile ( ) ; initCas ( aJCas , res ) ; InputStream is = null ; try { is = CompressionUtils . getInputStream ( res . getLocation ( ) , res . getInputStream ( ) ) ; XMLInputFactory xmlInputFactory = XMLInputFactory . newInstance ( ) ; XMLEventReader xmlEventReaderBasic = xmlInputFactory . createXMLEventReader ( is ) ; JAXBContext contextBasic = JAXBContext . newInstance ( XcesBodyBasic . class ) ; Unmarshaller unmarshallerBasic = contextBasic . createUnmarshaller ( ) ; unmarshallerBasic . setEventHandler ( new ValidationEventHandler ( ) { @ Override public boolean handleEvent ( ValidationEvent event ) { throw new RuntimeException ( event . getMessage ( ) , event . getLinkedException ( ) ) ; } } ) ; JCasBuilder jb = new JCasBuilder ( aJCas ) ; XMLEvent eBasic = null ; while ( ( eBasic = xmlEventReaderBasic . peek ( ) ) != null ) { if ( isStartElement ( eBasic , ""body"" ) ) { try { XcesBodyBasic parasBasic = ( XcesBodyBasic ) unmarshallerBasic . unmarshal ( xmlEventReaderBasic , XcesBodyBasic . class ) . getValue ( ) ; readPara ( jb , parasBasic ) ; } catch ( RuntimeException ex ) { } } else { xmlEventReaderBasic . next ( ) ; } } jb . close ( ) ; } catch ( XMLStreamException ex1 ) { throw new IOException ( ex1 ) ; } catch ( JAXBException e1 ) { throw new IOException ( e1 ) ; } finally { closeQuietly ( is ) ; } } ","public void getNext ( JCas aJCas ) throws IOException , CollectionException { Resource res = nextFile ( ) ; initCas ( aJCas , res ) ; InputStream is = null ; try { is = CompressionUtils . getInputStream ( res . getLocation ( ) , res . getInputStream ( ) ) ; XMLInputFactory xmlInputFactory = XMLInputFactory . newInstance ( ) ; XMLEventReader xmlEventReaderBasic = xmlInputFactory . createXMLEventReader ( is ) ; JAXBContext contextBasic = JAXBContext . newInstance ( XcesBodyBasic . class ) ; Unmarshaller unmarshallerBasic = contextBasic . createUnmarshaller ( ) ; unmarshallerBasic . setEventHandler ( new ValidationEventHandler ( ) { @ Override public boolean handleEvent ( ValidationEvent event ) { throw new RuntimeException ( event . getMessage ( ) , event . getLinkedException ( ) ) ; } } ) ; JCasBuilder jb = new JCasBuilder ( aJCas ) ; XMLEvent eBasic = null ; while ( ( eBasic = xmlEventReaderBasic . peek ( ) ) != null ) { if ( isStartElement ( eBasic , ""body"" ) ) { try { XcesBodyBasic parasBasic = ( XcesBodyBasic ) unmarshallerBasic . unmarshal ( xmlEventReaderBasic , XcesBodyBasic . class ) . getValue ( ) ; readPara ( jb , parasBasic ) ; } catch ( RuntimeException ex ) { getLogger ( ) . warn ( ""Input is not in basic xces format."" ) ; } } else { xmlEventReaderBasic . next ( ) ; } } jb . close ( ) ; } catch ( XMLStreamException ex1 ) { throw new IOException ( ex1 ) ; } catch ( JAXBException e1 ) { throw new IOException ( e1 ) ; } finally { closeQuietly ( is ) ; } } " 217,"public void permissionDenied ( final SessionId session ) { invalidateSessionCookiesIfNeeded ( ) ; if ( session == null ) { authenticationFailedSessionInvalid ( ) ; return ; } String baseRedirectUri = session . getSessionAttributes ( ) . get ( AuthorizeRequestParam . REDIRECT_URI ) ; String state = session . getSessionAttributes ( ) . get ( AuthorizeRequestParam . STATE ) ; ResponseMode responseMode = ResponseMode . fromString ( session . getSessionAttributes ( ) . get ( AuthorizeRequestParam . RESPONSE_MODE ) ) ; List < ResponseType > responseType = ResponseType . fromString ( session . getSessionAttributes ( ) . get ( AuthorizeRequestParam . RESPONSE_TYPE ) , "" "" ) ; RedirectUri redirectUri = new RedirectUri ( baseRedirectUri , responseType , responseMode ) ; redirectUri . parseQueryString ( errorResponseFactory . getErrorAsQueryString ( AuthorizeErrorResponseType . ACCESS_DENIED , state ) ) ; Map < String , String > sessionAttribute = requestParameterService . getAllowedParameters ( session . getSessionAttributes ( ) ) ; if ( sessionAttribute . containsKey ( AuthorizeRequestParam . AUTH_REQ_ID ) ) { String authReqId = sessionAttribute . get ( AuthorizeRequestParam . AUTH_REQ_ID ) ; CibaRequestCacheControl request = cibaRequestService . getCibaRequest ( authReqId ) ; if ( request != null && request . getClient ( ) != null ) { if ( request . getStatus ( ) == CibaRequestStatus . PENDING ) { cibaRequestService . removeCibaRequest ( authReqId ) ; } switch ( request . getClient ( ) . getBackchannelTokenDeliveryMode ( ) ) { case POLL : request . setStatus ( CibaRequestStatus . DENIED ) ; request . setTokensDelivered ( false ) ; cibaRequestService . update ( request ) ; break ; case PING : request . setStatus ( CibaRequestStatus . DENIED ) ; request . setTokensDelivered ( false ) ; cibaRequestService . update ( request ) ; cibaPingCallbackService . pingCallback ( request . getAuthReqId ( ) , request . getClient ( ) . getBackchannelClientNotificationEndpoint ( ) , request . getClientNotificationToken ( ) ) ; break ; case PUSH : cibaPushErrorService . pushError ( request . getAuthReqId ( ) , request . getClient ( ) . getBackchannelClientNotificationEndpoint ( ) , request . getClientNotificationToken ( ) , PushErrorResponseType . ACCESS_DENIED , ""The end-user denied the authorization request."" ) ; break ; } } } if ( sessionAttribute . containsKey ( DeviceAuthorizationService . SESSION_USER_CODE ) ) { processDeviceAuthDeniedResponse ( sessionAttribute ) ; } facesService . redirectToExternalURL ( redirectUri . toString ( ) ) ; } ","public void permissionDenied ( final SessionId session ) { log . trace ( ""permissionDenied"" ) ; invalidateSessionCookiesIfNeeded ( ) ; if ( session == null ) { authenticationFailedSessionInvalid ( ) ; return ; } String baseRedirectUri = session . getSessionAttributes ( ) . get ( AuthorizeRequestParam . REDIRECT_URI ) ; String state = session . getSessionAttributes ( ) . get ( AuthorizeRequestParam . STATE ) ; ResponseMode responseMode = ResponseMode . fromString ( session . getSessionAttributes ( ) . get ( AuthorizeRequestParam . RESPONSE_MODE ) ) ; List < ResponseType > responseType = ResponseType . fromString ( session . getSessionAttributes ( ) . get ( AuthorizeRequestParam . RESPONSE_TYPE ) , "" "" ) ; RedirectUri redirectUri = new RedirectUri ( baseRedirectUri , responseType , responseMode ) ; redirectUri . parseQueryString ( errorResponseFactory . getErrorAsQueryString ( AuthorizeErrorResponseType . ACCESS_DENIED , state ) ) ; Map < String , String > sessionAttribute = requestParameterService . getAllowedParameters ( session . getSessionAttributes ( ) ) ; if ( sessionAttribute . containsKey ( AuthorizeRequestParam . AUTH_REQ_ID ) ) { String authReqId = sessionAttribute . get ( AuthorizeRequestParam . AUTH_REQ_ID ) ; CibaRequestCacheControl request = cibaRequestService . getCibaRequest ( authReqId ) ; if ( request != null && request . getClient ( ) != null ) { if ( request . getStatus ( ) == CibaRequestStatus . PENDING ) { cibaRequestService . removeCibaRequest ( authReqId ) ; } switch ( request . getClient ( ) . getBackchannelTokenDeliveryMode ( ) ) { case POLL : request . setStatus ( CibaRequestStatus . DENIED ) ; request . setTokensDelivered ( false ) ; cibaRequestService . update ( request ) ; break ; case PING : request . setStatus ( CibaRequestStatus . DENIED ) ; request . setTokensDelivered ( false ) ; cibaRequestService . update ( request ) ; cibaPingCallbackService . pingCallback ( request . getAuthReqId ( ) , request . getClient ( ) . getBackchannelClientNotificationEndpoint ( ) , request . getClientNotificationToken ( ) ) ; break ; case PUSH : cibaPushErrorService . pushError ( request . getAuthReqId ( ) , request . getClient ( ) . getBackchannelClientNotificationEndpoint ( ) , request . getClientNotificationToken ( ) , PushErrorResponseType . ACCESS_DENIED , ""The end-user denied the authorization request."" ) ; break ; } } } if ( sessionAttribute . containsKey ( DeviceAuthorizationService . SESSION_USER_CODE ) ) { processDeviceAuthDeniedResponse ( sessionAttribute ) ; } facesService . redirectToExternalURL ( redirectUri . toString ( ) ) ; } " 218,"public void actionPerformed ( ActionEvent ev ) { boolean ok = toolsDialog . showDialog ( config , true ) ; if ( ! ok ) { return ; } } ","public void actionPerformed ( ActionEvent ev ) { logger . debug ( ""Edit tools"" ) ; boolean ok = toolsDialog . showDialog ( config , true ) ; if ( ! ok ) { return ; } } " 219,"public static java . util . List < com . liferay . layout . page . template . model . LayoutPageTemplateEntry > getLayoutPageTemplateEntries ( HttpPrincipal httpPrincipal , long groupId , int type , int status , int start , int end , com . liferay . portal . kernel . util . OrderByComparator < com . liferay . layout . page . template . model . LayoutPageTemplateEntry > orderByComparator ) { try { MethodKey methodKey = new MethodKey ( LayoutPageTemplateEntryServiceUtil . class , ""getLayoutPageTemplateEntries"" , _getLayoutPageTemplateEntriesParameterTypes12 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , groupId , type , status , start , end , orderByComparator ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( java . util . List < com . liferay . layout . page . template . model . LayoutPageTemplateEntry > ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { throw systemException ; } } ","public static java . util . List < com . liferay . layout . page . template . model . LayoutPageTemplateEntry > getLayoutPageTemplateEntries ( HttpPrincipal httpPrincipal , long groupId , int type , int status , int start , int end , com . liferay . portal . kernel . util . OrderByComparator < com . liferay . layout . page . template . model . LayoutPageTemplateEntry > orderByComparator ) { try { MethodKey methodKey = new MethodKey ( LayoutPageTemplateEntryServiceUtil . class , ""getLayoutPageTemplateEntries"" , _getLayoutPageTemplateEntriesParameterTypes12 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , groupId , type , status , start , end , orderByComparator ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( java . util . List < com . liferay . layout . page . template . model . LayoutPageTemplateEntry > ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { _log . error ( systemException , systemException ) ; throw systemException ; } } " 220,"public void addAttachment ( BasicIssue basicIssue , File snapshot ) { if ( snapshot != null ) { Issue issue = restClient . getIssueClient ( ) . getIssue ( basicIssue . getKey ( ) ) . claim ( ) ; restClient . getIssueClient ( ) . addAttachments ( issue . getAttachmentsUri ( ) , snapshot ) . claim ( ) ; } } ","public void addAttachment ( BasicIssue basicIssue , File snapshot ) { if ( snapshot != null ) { LOG . info ( ""Attaching Jira {} with snapshot"" , basicIssue . getKey ( ) ) ; Issue issue = restClient . getIssueClient ( ) . getIssue ( basicIssue . getKey ( ) ) . claim ( ) ; restClient . getIssueClient ( ) . addAttachments ( issue . getAttachmentsUri ( ) , snapshot ) . claim ( ) ; } } " 221,"@ RequestMapping ( ""/adminStudies/deleteComprehensionQuestion.do"" ) public void deleteComprehensionTestQuestion ( HttpServletRequest request , HttpServletResponse response ) { logger . entry ( ""begin deleteComprehensionTestQuestion()"" ) ; JSONObject jsonobject = new JSONObject ( ) ; PrintWriter out = null ; String message = FdahpStudyDesignerConstants . FAILURE ; try { SessionObject sesObj = ( SessionObject ) request . getSession ( ) . getAttribute ( FdahpStudyDesignerConstants . SESSION_OBJECT ) ; if ( sesObj != null ) { String comprehensionQuestionId = FdahpStudyDesignerUtil . isEmpty ( request . getParameter ( FdahpStudyDesignerConstants . COMPREHENSION_QUESTION_ID ) ) ? """" : request . getParameter ( FdahpStudyDesignerConstants . COMPREHENSION_QUESTION_ID ) ; String studyId = FdahpStudyDesignerUtil . isEmpty ( request . getParameter ( FdahpStudyDesignerConstants . STUDY_ID ) ) ? """" : request . getParameter ( FdahpStudyDesignerConstants . STUDY_ID ) ; if ( StringUtils . isNotEmpty ( comprehensionQuestionId ) && StringUtils . isNotEmpty ( studyId ) ) { message = studyService . deleteComprehensionTestQuestion ( Integer . valueOf ( comprehensionQuestionId ) , Integer . valueOf ( studyId ) , sesObj ) ; } } jsonobject . put ( FdahpStudyDesignerConstants . MESSAGE , message ) ; response . setContentType ( FdahpStudyDesignerConstants . APPLICATION_JSON ) ; out = response . getWriter ( ) ; out . print ( jsonobject ) ; } catch ( Exception e ) { } logger . exit ( ""deleteComprehensionTestQuestion() - Ends"" ) ; } ","@ RequestMapping ( ""/adminStudies/deleteComprehensionQuestion.do"" ) public void deleteComprehensionTestQuestion ( HttpServletRequest request , HttpServletResponse response ) { logger . entry ( ""begin deleteComprehensionTestQuestion()"" ) ; JSONObject jsonobject = new JSONObject ( ) ; PrintWriter out = null ; String message = FdahpStudyDesignerConstants . FAILURE ; try { SessionObject sesObj = ( SessionObject ) request . getSession ( ) . getAttribute ( FdahpStudyDesignerConstants . SESSION_OBJECT ) ; if ( sesObj != null ) { String comprehensionQuestionId = FdahpStudyDesignerUtil . isEmpty ( request . getParameter ( FdahpStudyDesignerConstants . COMPREHENSION_QUESTION_ID ) ) ? """" : request . getParameter ( FdahpStudyDesignerConstants . COMPREHENSION_QUESTION_ID ) ; String studyId = FdahpStudyDesignerUtil . isEmpty ( request . getParameter ( FdahpStudyDesignerConstants . STUDY_ID ) ) ? """" : request . getParameter ( FdahpStudyDesignerConstants . STUDY_ID ) ; if ( StringUtils . isNotEmpty ( comprehensionQuestionId ) && StringUtils . isNotEmpty ( studyId ) ) { message = studyService . deleteComprehensionTestQuestion ( Integer . valueOf ( comprehensionQuestionId ) , Integer . valueOf ( studyId ) , sesObj ) ; } } jsonobject . put ( FdahpStudyDesignerConstants . MESSAGE , message ) ; response . setContentType ( FdahpStudyDesignerConstants . APPLICATION_JSON ) ; out = response . getWriter ( ) ; out . print ( jsonobject ) ; } catch ( Exception e ) { logger . error ( ""StudyController - deleteComprehensionTestQuestion - ERROR"" , e ) ; } logger . exit ( ""deleteComprehensionTestQuestion() - Ends"" ) ; } " 222,"@ GET @ Path ( ""/info"" ) public Response getNotebookInfo ( ) { File notebookJson = new File ( ""notebook/note.json"" ) ; BufferedReader bufferedReader = null ; StringBuilder stringBuilder = new StringBuilder ( ) ; try { bufferedReader = new BufferedReader ( new FileReader ( notebookJson ) ) ; String line ; while ( ( line = bufferedReader . readLine ( ) ) != null ) { stringBuilder . append ( line ) ; } } catch ( Exception e ) { LOG . error ( ""Exception in NotebookRestApi while get notebook info"" , e ) ; return new JsonResponse < > ( Response . Status . INTERNAL_SERVER_ERROR , e . getMessage ( ) , ExceptionUtils . getStackTrace ( e ) ) . build ( ) ; } return Response . status ( Response . Status . OK ) . entity ( stringBuilder . toString ( ) ) . build ( ) ; } ","@ GET @ Path ( ""/info"" ) public Response getNotebookInfo ( ) { LOG . info ( ""Request to get notebook info"" ) ; File notebookJson = new File ( ""notebook/note.json"" ) ; BufferedReader bufferedReader = null ; StringBuilder stringBuilder = new StringBuilder ( ) ; try { bufferedReader = new BufferedReader ( new FileReader ( notebookJson ) ) ; String line ; while ( ( line = bufferedReader . readLine ( ) ) != null ) { stringBuilder . append ( line ) ; } } catch ( Exception e ) { LOG . error ( ""Exception in NotebookRestApi while get notebook info"" , e ) ; return new JsonResponse < > ( Response . Status . INTERNAL_SERVER_ERROR , e . getMessage ( ) , ExceptionUtils . getStackTrace ( e ) ) . build ( ) ; } return Response . status ( Response . Status . OK ) . entity ( stringBuilder . toString ( ) ) . build ( ) ; } " 223,"@ GET @ Path ( ""/info"" ) public Response getNotebookInfo ( ) { LOG . info ( ""Request to get notebook info"" ) ; File notebookJson = new File ( ""notebook/note.json"" ) ; BufferedReader bufferedReader = null ; StringBuilder stringBuilder = new StringBuilder ( ) ; try { bufferedReader = new BufferedReader ( new FileReader ( notebookJson ) ) ; String line ; while ( ( line = bufferedReader . readLine ( ) ) != null ) { stringBuilder . append ( line ) ; } } catch ( Exception e ) { return new JsonResponse < > ( Response . Status . INTERNAL_SERVER_ERROR , e . getMessage ( ) , ExceptionUtils . getStackTrace ( e ) ) . build ( ) ; } return Response . status ( Response . Status . OK ) . entity ( stringBuilder . toString ( ) ) . build ( ) ; } ","@ GET @ Path ( ""/info"" ) public Response getNotebookInfo ( ) { LOG . info ( ""Request to get notebook info"" ) ; File notebookJson = new File ( ""notebook/note.json"" ) ; BufferedReader bufferedReader = null ; StringBuilder stringBuilder = new StringBuilder ( ) ; try { bufferedReader = new BufferedReader ( new FileReader ( notebookJson ) ) ; String line ; while ( ( line = bufferedReader . readLine ( ) ) != null ) { stringBuilder . append ( line ) ; } } catch ( Exception e ) { LOG . error ( ""Exception in NotebookRestApi while get notebook info"" , e ) ; return new JsonResponse < > ( Response . Status . INTERNAL_SERVER_ERROR , e . getMessage ( ) , ExceptionUtils . getStackTrace ( e ) ) . build ( ) ; } return Response . status ( Response . Status . OK ) . entity ( stringBuilder . toString ( ) ) . build ( ) ; } " 224,"public void afterPropertiesSet ( ) throws Exception { loadPlugins ( ) ; startPlugins ( ) ; AbstractAutowireCapableBeanFactory beanFactory = ( AbstractAutowireCapableBeanFactory ) applicationContext . getAutowireCapableBeanFactory ( ) ; ExtensionsInjector extensionsInjector = new ExtensionsInjector ( this , beanFactory ) ; extensionsInjector . injectExtensions ( ) ; for ( PluginWrapper plugin : getStartedPlugins ( ) ) { Class pluginClass = plugin . getPlugin ( ) . getClass ( ) ; GenericApplicationContext pluginContext = ( GenericApplicationContext ) ( ( Plugin ) plugin . getPlugin ( ) ) . getApplicationContext ( ) ; pluginContext . setParent ( applicationContext ) ; } } ","public void afterPropertiesSet ( ) throws Exception { loadPlugins ( ) ; startPlugins ( ) ; AbstractAutowireCapableBeanFactory beanFactory = ( AbstractAutowireCapableBeanFactory ) applicationContext . getAutowireCapableBeanFactory ( ) ; ExtensionsInjector extensionsInjector = new ExtensionsInjector ( this , beanFactory ) ; extensionsInjector . injectExtensions ( ) ; for ( PluginWrapper plugin : getStartedPlugins ( ) ) { Class pluginClass = plugin . getPlugin ( ) . getClass ( ) ; LOG . info ( ""Found plugin: {}"" , plugin . getDescriptor ( ) . getPluginId ( ) ) ; GenericApplicationContext pluginContext = ( GenericApplicationContext ) ( ( Plugin ) plugin . getPlugin ( ) ) . getApplicationContext ( ) ; pluginContext . setParent ( applicationContext ) ; } } " 225,"public void handleResponse ( final DeviceResponse deviceResponse ) { if ( ( ( EmptyDeviceResponse ) deviceResponse ) . getStatus ( ) . equals ( DeviceMessageStatus . OK ) ) { } else { PublicLightingSetLightRequestMessageProcessor . this . handleEmptyDeviceResponse ( deviceResponse , PublicLightingSetLightRequestMessageProcessor . this . responseMessageSender , domain , domainVersion , messageType , retryCount ) ; } } ","public void handleResponse ( final DeviceResponse deviceResponse ) { if ( ( ( EmptyDeviceResponse ) deviceResponse ) . getStatus ( ) . equals ( DeviceMessageStatus . OK ) ) { LOGGER . info ( ""setLight() successful for device : {}"" , deviceResponse . getDeviceIdentification ( ) ) ; } else { PublicLightingSetLightRequestMessageProcessor . this . handleEmptyDeviceResponse ( deviceResponse , PublicLightingSetLightRequestMessageProcessor . this . responseMessageSender , domain , domainVersion , messageType , retryCount ) ; } } " 226,"public Object up ( Event evt ) { switch ( evt . getType ( ) ) { case Event . MSG : Message msg = ( Message ) evt . getArg ( ) ; WorkerHeader header = ( WorkerHeader ) msg . getHeader ( PROTOCOL_ID ) ; if ( header != null && header . getIndex ( ) < 0 ) { } else if ( header != null && allowedWorkers != null ) { if ( ! allowedWorkers . contains ( header . getIndex ( ) ) ) { log . trace ( ""Discarding message "" + msg . getSrc ( ) + "" -> "" + msg . getDest ( ) + "" with workerIndex "" + header . getIndex ( ) ) ; return null ; } } } return up_prot . up ( evt ) ; } ","public Object up ( Event evt ) { switch ( evt . getType ( ) ) { case Event . MSG : Message msg = ( Message ) evt . getArg ( ) ; WorkerHeader header = ( WorkerHeader ) msg . getHeader ( PROTOCOL_ID ) ; if ( header != null && header . getIndex ( ) < 0 ) { log . trace ( ""Message "" + msg . getSrc ( ) + "" -> "" + msg . getDest ( ) + "" with workerIndex -1"" ) ; } else if ( header != null && allowedWorkers != null ) { if ( ! allowedWorkers . contains ( header . getIndex ( ) ) ) { log . trace ( ""Discarding message "" + msg . getSrc ( ) + "" -> "" + msg . getDest ( ) + "" with workerIndex "" + header . getIndex ( ) ) ; return null ; } } } return up_prot . up ( evt ) ; } " 227,"public Object up ( Event evt ) { switch ( evt . getType ( ) ) { case Event . MSG : Message msg = ( Message ) evt . getArg ( ) ; WorkerHeader header = ( WorkerHeader ) msg . getHeader ( PROTOCOL_ID ) ; if ( header != null && header . getIndex ( ) < 0 ) { log . trace ( ""Message "" + msg . getSrc ( ) + "" -> "" + msg . getDest ( ) + "" with workerIndex -1"" ) ; } else if ( header != null && allowedWorkers != null ) { if ( ! allowedWorkers . contains ( header . getIndex ( ) ) ) { return null ; } } } return up_prot . up ( evt ) ; } ","public Object up ( Event evt ) { switch ( evt . getType ( ) ) { case Event . MSG : Message msg = ( Message ) evt . getArg ( ) ; WorkerHeader header = ( WorkerHeader ) msg . getHeader ( PROTOCOL_ID ) ; if ( header != null && header . getIndex ( ) < 0 ) { log . trace ( ""Message "" + msg . getSrc ( ) + "" -> "" + msg . getDest ( ) + "" with workerIndex -1"" ) ; } else if ( header != null && allowedWorkers != null ) { if ( ! allowedWorkers . contains ( header . getIndex ( ) ) ) { log . trace ( ""Discarding message "" + msg . getSrc ( ) + "" -> "" + msg . getDest ( ) + "" with workerIndex "" + header . getIndex ( ) ) ; return null ; } } } return up_prot . up ( evt ) ; } " 228,"private void pluginRegistered ( ServiceReference srefPlugin ) { PluginInfo pluginInfo ; Plugin daoPlugin = pluginRefToPluginDAO ( srefPlugin ) ; if ( daoPlugin != null ) { pluginInfo = createInstalledPI ( srefPlugin , daoPlugin ) ; } else { pluginInfo = createRegisteredPI ( srefPlugin ) ; } if ( pluginInfo == null ) { } else { registeredPlugins . put ( pluginInfo . getHashcode ( ) , pluginInfo ) ; logger . info ( ""Plug-in service ("" + pluginInfo . getPluginName ( ) + "")"" + "" was registered."" ) ; } } ","private void pluginRegistered ( ServiceReference srefPlugin ) { PluginInfo pluginInfo ; Plugin daoPlugin = pluginRefToPluginDAO ( srefPlugin ) ; if ( daoPlugin != null ) { pluginInfo = createInstalledPI ( srefPlugin , daoPlugin ) ; } else { pluginInfo = createRegisteredPI ( srefPlugin ) ; } if ( pluginInfo == null ) { logger . error ( ""Upon plug-in service registration - "" + "" can not create a PluginInfo object!"" ) ; } else { registeredPlugins . put ( pluginInfo . getHashcode ( ) , pluginInfo ) ; logger . info ( ""Plug-in service ("" + pluginInfo . getPluginName ( ) + "")"" + "" was registered."" ) ; } } " 229,"private void pluginRegistered ( ServiceReference srefPlugin ) { PluginInfo pluginInfo ; Plugin daoPlugin = pluginRefToPluginDAO ( srefPlugin ) ; if ( daoPlugin != null ) { pluginInfo = createInstalledPI ( srefPlugin , daoPlugin ) ; } else { pluginInfo = createRegisteredPI ( srefPlugin ) ; } if ( pluginInfo == null ) { logger . error ( ""Upon plug-in service registration - "" + "" can not create a PluginInfo object!"" ) ; } else { registeredPlugins . put ( pluginInfo . getHashcode ( ) , pluginInfo ) ; } } ","private void pluginRegistered ( ServiceReference srefPlugin ) { PluginInfo pluginInfo ; Plugin daoPlugin = pluginRefToPluginDAO ( srefPlugin ) ; if ( daoPlugin != null ) { pluginInfo = createInstalledPI ( srefPlugin , daoPlugin ) ; } else { pluginInfo = createRegisteredPI ( srefPlugin ) ; } if ( pluginInfo == null ) { logger . error ( ""Upon plug-in service registration - "" + "" can not create a PluginInfo object!"" ) ; } else { registeredPlugins . put ( pluginInfo . getHashcode ( ) , pluginInfo ) ; logger . info ( ""Plug-in service ("" + pluginInfo . getPluginName ( ) + "")"" + "" was registered."" ) ; } } " 230,"public void acceptReducedValues ( DataInput reducedValuesInput ) throws IOException { int numReducers = reducedValuesInput . readInt ( ) ; for ( int i = 0 ; i < numReducers ; i ++ ) { String name = reducedValuesInput . readUTF ( ) ; GlobalCommType type = GlobalCommType . values ( ) [ reducedValuesInput . readByte ( ) ] ; if ( type != GlobalCommType . REDUCED_VALUE ) { throw new IllegalStateException ( ""SendReducedToMasterRequest received "" + type ) ; } Reducer < Object , Writable > reducer = reducerMap . get ( name ) ; if ( reducer == null ) { throw new IllegalStateException ( ""acceptReducedValues: "" + ""Master received reduced value which isn't registered: "" + name ) ; } Writable valueToReduce = reducer . createInitialValue ( ) ; valueToReduce . readFields ( reducedValuesInput ) ; if ( reducer . getCurrentValue ( ) != null ) { reducer . reduceMerge ( valueToReduce ) ; } else { reducer . setCurrentValue ( valueToReduce ) ; } progressable . progress ( ) ; } if ( LOG . isDebugEnabled ( ) ) { } } ","public void acceptReducedValues ( DataInput reducedValuesInput ) throws IOException { int numReducers = reducedValuesInput . readInt ( ) ; for ( int i = 0 ; i < numReducers ; i ++ ) { String name = reducedValuesInput . readUTF ( ) ; GlobalCommType type = GlobalCommType . values ( ) [ reducedValuesInput . readByte ( ) ] ; if ( type != GlobalCommType . REDUCED_VALUE ) { throw new IllegalStateException ( ""SendReducedToMasterRequest received "" + type ) ; } Reducer < Object , Writable > reducer = reducerMap . get ( name ) ; if ( reducer == null ) { throw new IllegalStateException ( ""acceptReducedValues: "" + ""Master received reduced value which isn't registered: "" + name ) ; } Writable valueToReduce = reducer . createInitialValue ( ) ; valueToReduce . readFields ( reducedValuesInput ) ; if ( reducer . getCurrentValue ( ) != null ) { reducer . reduceMerge ( valueToReduce ) ; } else { reducer . setCurrentValue ( valueToReduce ) ; } progressable . progress ( ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""acceptReducedValues: Accepted one set with "" + numReducers + "" aggregated values"" ) ; } } " 231,"public Map < K , ICacheElement < K , V > > getMatching ( final String pattern ) throws IOException { for ( final RemoteCacheNoWait < K , V > nw : noWaits ) { try { return nw . getMatching ( pattern ) ; } catch ( final IOException ex ) { } } return Collections . emptyMap ( ) ; } ","public Map < K , ICacheElement < K , V > > getMatching ( final String pattern ) throws IOException { for ( final RemoteCacheNoWait < K , V > nw : noWaits ) { try { return nw . getMatching ( pattern ) ; } catch ( final IOException ex ) { log . debug ( ""Failed to getMatching."" ) ; } } return Collections . emptyMap ( ) ; } " 232,"private void checkToSendTaskFinishedMail ( SingularityTaskId taskId ) { Optional < SingularityRequestWithState > requestWithState = requestManager . getRequest ( taskId . getRequestId ( ) ) ; Optional < SingularityTaskHistory > taskHistory = taskManager . getTaskHistory ( taskId ) ; if ( ! taskHistory . isPresent ( ) ) { taskHistory = historyManager . getTaskHistory ( taskId . getId ( ) ) ; } ShouldSendMailState shouldSendState = shouldSendTaskFinishedMail ( taskId , requestWithState , taskHistory ) ; if ( shouldSendState == ShouldSendMailState . WAIT ) { return ; } try { mailer . sendTaskCompletedMail ( taskHistory . get ( ) , requestWithState . get ( ) . getRequest ( ) ) ; } catch ( Throwable t ) { } finally { SingularityDeleteResult result = taskManager . deleteFinishedTaskMailQueue ( taskId ) ; LOG . debug ( ""Task {} mail sent with status {} (delete result {})"" , taskId , shouldSendState , result ) ; } } ","private void checkToSendTaskFinishedMail ( SingularityTaskId taskId ) { Optional < SingularityRequestWithState > requestWithState = requestManager . getRequest ( taskId . getRequestId ( ) ) ; Optional < SingularityTaskHistory > taskHistory = taskManager . getTaskHistory ( taskId ) ; if ( ! taskHistory . isPresent ( ) ) { taskHistory = historyManager . getTaskHistory ( taskId . getId ( ) ) ; } ShouldSendMailState shouldSendState = shouldSendTaskFinishedMail ( taskId , requestWithState , taskHistory ) ; if ( shouldSendState == ShouldSendMailState . WAIT ) { return ; } try { mailer . sendTaskCompletedMail ( taskHistory . get ( ) , requestWithState . get ( ) . getRequest ( ) ) ; } catch ( Throwable t ) { LOG . error ( ""While trying to send task completed mail for {}"" , taskId , t ) ; } finally { SingularityDeleteResult result = taskManager . deleteFinishedTaskMailQueue ( taskId ) ; LOG . debug ( ""Task {} mail sent with status {} (delete result {})"" , taskId , shouldSendState , result ) ; } } " 233,"private void checkToSendTaskFinishedMail ( SingularityTaskId taskId ) { Optional < SingularityRequestWithState > requestWithState = requestManager . getRequest ( taskId . getRequestId ( ) ) ; Optional < SingularityTaskHistory > taskHistory = taskManager . getTaskHistory ( taskId ) ; if ( ! taskHistory . isPresent ( ) ) { taskHistory = historyManager . getTaskHistory ( taskId . getId ( ) ) ; } ShouldSendMailState shouldSendState = shouldSendTaskFinishedMail ( taskId , requestWithState , taskHistory ) ; if ( shouldSendState == ShouldSendMailState . WAIT ) { return ; } try { mailer . sendTaskCompletedMail ( taskHistory . get ( ) , requestWithState . get ( ) . getRequest ( ) ) ; } catch ( Throwable t ) { LOG . error ( ""While trying to send task completed mail for {}"" , taskId , t ) ; } finally { SingularityDeleteResult result = taskManager . deleteFinishedTaskMailQueue ( taskId ) ; } } ","private void checkToSendTaskFinishedMail ( SingularityTaskId taskId ) { Optional < SingularityRequestWithState > requestWithState = requestManager . getRequest ( taskId . getRequestId ( ) ) ; Optional < SingularityTaskHistory > taskHistory = taskManager . getTaskHistory ( taskId ) ; if ( ! taskHistory . isPresent ( ) ) { taskHistory = historyManager . getTaskHistory ( taskId . getId ( ) ) ; } ShouldSendMailState shouldSendState = shouldSendTaskFinishedMail ( taskId , requestWithState , taskHistory ) ; if ( shouldSendState == ShouldSendMailState . WAIT ) { return ; } try { mailer . sendTaskCompletedMail ( taskHistory . get ( ) , requestWithState . get ( ) . getRequest ( ) ) ; } catch ( Throwable t ) { LOG . error ( ""While trying to send task completed mail for {}"" , taskId , t ) ; } finally { SingularityDeleteResult result = taskManager . deleteFinishedTaskMailQueue ( taskId ) ; LOG . debug ( ""Task {} mail sent with status {} (delete result {})"" , taskId , shouldSendState , result ) ; } } " 234,"public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } ","public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } " 235,"public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } ","public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } " 236,"public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } ","public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } " 237,"public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } ","public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } " 238,"public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } ","public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } " 239,"public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } ","public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } " 240,"public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { } } } } } ","public void updateRegisteredDeployments ( @ Observes SystemRepositoryChangedEvent changedEvent ) { logger . debug ( ""Received deployment changed event, processing..."" ) ; Collection < ConfigGroup > deployments = configurationService . getConfiguration ( ConfigType . DEPLOYMENT ) ; if ( deployments != null ) { List < String > processedDeployments = new ArrayList < String > ( ) ; for ( ConfigGroup deploymentConfig : deployments ) { String name = deploymentConfig . getName ( ) ; if ( ! this . registeredDeployments . containsKey ( name ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , name ) ; DeploymentConfig deployment = deploymentFactory . newDeployment ( deploymentConfig ) ; addedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; registeredDeployments . put ( deployment . getIdentifier ( ) , deployment ) ; logger . debug ( ""Deployment {} deployed successfully"" , name ) ; } catch ( RuntimeException e ) { logger . warn ( ""Deployment {} failed to deploy due to {}"" , name , e . getMessage ( ) , e ) ; } } processedDeployments . add ( name ) ; } Set < String > registeredDeploymedIds = registeredDeployments . keySet ( ) ; for ( String identifier : registeredDeploymedIds ) { if ( ! processedDeployments . contains ( identifier ) ) { try { logger . debug ( ""New deployment {} has been discovered and will be deployed"" , identifier ) ; DeploymentConfig deployment = registeredDeployments . remove ( identifier ) ; removedDeploymentEvent . fire ( new DeploymentConfigChangedEvent ( deployment . getDeploymentUnit ( ) ) ) ; logger . debug ( ""Deployment {} undeployed successfully"" , identifier ) ; } catch ( RuntimeException e ) { logger . warn ( ""Undeployment {} failed to deploy due to {}"" , identifier , e . getMessage ( ) , e ) ; } } } } } " 241,"public void stopCounting ( ) { runCounting = false ; stopLogReport ( ) ; } ","public void stopCounting ( ) { runCounting = false ; LOG . debug ( ""Stop counting..."" ) ; stopLogReport ( ) ; } " 242,"public void importData ( JsonReader reader ) throws IOException { reader . beginObject ( ) ; while ( reader . hasNext ( ) ) { JsonToken tok = reader . peek ( ) ; switch ( tok ) { case NAME : String name = reader . nextName ( ) ; if ( name . equals ( CLIENTS ) ) { readClients ( reader ) ; } else if ( name . equals ( GRANTS ) ) { readGrants ( reader ) ; } else if ( name . equals ( WHITELISTEDSITES ) ) { readWhitelistedSites ( reader ) ; } else if ( name . equals ( BLACKLISTEDSITES ) ) { readBlacklistedSites ( reader ) ; } else if ( name . equals ( AUTHENTICATIONHOLDERS ) ) { readAuthenticationHolders ( reader ) ; } else if ( name . equals ( ACCESSTOKENS ) ) { readAccessTokens ( reader ) ; } else if ( name . equals ( REFRESHTOKENS ) ) { readRefreshTokens ( reader ) ; } else if ( name . equals ( SYSTEMSCOPES ) ) { readSystemScopes ( reader ) ; } else { for ( MITREidDataServiceExtension extension : extensions ) { if ( extension . supportsVersion ( THIS_VERSION ) ) { extension . importExtensionData ( name , reader ) ; break ; } } reader . skipValue ( ) ; } break ; case END_OBJECT : reader . endObject ( ) ; continue ; default : logger . debug ( ""Found unexpected entry"" ) ; reader . skipValue ( ) ; continue ; } } fixObjectReferences ( ) ; for ( MITREidDataServiceExtension extension : extensions ) { if ( extension . supportsVersion ( THIS_VERSION ) ) { extension . fixExtensionObjectReferences ( maps ) ; break ; } } maps . clearAll ( ) ; } ","public void importData ( JsonReader reader ) throws IOException { logger . info ( ""Reading configuration for 1.2"" ) ; reader . beginObject ( ) ; while ( reader . hasNext ( ) ) { JsonToken tok = reader . peek ( ) ; switch ( tok ) { case NAME : String name = reader . nextName ( ) ; if ( name . equals ( CLIENTS ) ) { readClients ( reader ) ; } else if ( name . equals ( GRANTS ) ) { readGrants ( reader ) ; } else if ( name . equals ( WHITELISTEDSITES ) ) { readWhitelistedSites ( reader ) ; } else if ( name . equals ( BLACKLISTEDSITES ) ) { readBlacklistedSites ( reader ) ; } else if ( name . equals ( AUTHENTICATIONHOLDERS ) ) { readAuthenticationHolders ( reader ) ; } else if ( name . equals ( ACCESSTOKENS ) ) { readAccessTokens ( reader ) ; } else if ( name . equals ( REFRESHTOKENS ) ) { readRefreshTokens ( reader ) ; } else if ( name . equals ( SYSTEMSCOPES ) ) { readSystemScopes ( reader ) ; } else { for ( MITREidDataServiceExtension extension : extensions ) { if ( extension . supportsVersion ( THIS_VERSION ) ) { extension . importExtensionData ( name , reader ) ; break ; } } reader . skipValue ( ) ; } break ; case END_OBJECT : reader . endObject ( ) ; continue ; default : logger . debug ( ""Found unexpected entry"" ) ; reader . skipValue ( ) ; continue ; } } fixObjectReferences ( ) ; for ( MITREidDataServiceExtension extension : extensions ) { if ( extension . supportsVersion ( THIS_VERSION ) ) { extension . fixExtensionObjectReferences ( maps ) ; break ; } } maps . clearAll ( ) ; } " 243,"public void importData ( JsonReader reader ) throws IOException { logger . info ( ""Reading configuration for 1.2"" ) ; reader . beginObject ( ) ; while ( reader . hasNext ( ) ) { JsonToken tok = reader . peek ( ) ; switch ( tok ) { case NAME : String name = reader . nextName ( ) ; if ( name . equals ( CLIENTS ) ) { readClients ( reader ) ; } else if ( name . equals ( GRANTS ) ) { readGrants ( reader ) ; } else if ( name . equals ( WHITELISTEDSITES ) ) { readWhitelistedSites ( reader ) ; } else if ( name . equals ( BLACKLISTEDSITES ) ) { readBlacklistedSites ( reader ) ; } else if ( name . equals ( AUTHENTICATIONHOLDERS ) ) { readAuthenticationHolders ( reader ) ; } else if ( name . equals ( ACCESSTOKENS ) ) { readAccessTokens ( reader ) ; } else if ( name . equals ( REFRESHTOKENS ) ) { readRefreshTokens ( reader ) ; } else if ( name . equals ( SYSTEMSCOPES ) ) { readSystemScopes ( reader ) ; } else { for ( MITREidDataServiceExtension extension : extensions ) { if ( extension . supportsVersion ( THIS_VERSION ) ) { extension . importExtensionData ( name , reader ) ; break ; } } reader . skipValue ( ) ; } break ; case END_OBJECT : reader . endObject ( ) ; continue ; default : reader . skipValue ( ) ; continue ; } } fixObjectReferences ( ) ; for ( MITREidDataServiceExtension extension : extensions ) { if ( extension . supportsVersion ( THIS_VERSION ) ) { extension . fixExtensionObjectReferences ( maps ) ; break ; } } maps . clearAll ( ) ; } ","public void importData ( JsonReader reader ) throws IOException { logger . info ( ""Reading configuration for 1.2"" ) ; reader . beginObject ( ) ; while ( reader . hasNext ( ) ) { JsonToken tok = reader . peek ( ) ; switch ( tok ) { case NAME : String name = reader . nextName ( ) ; if ( name . equals ( CLIENTS ) ) { readClients ( reader ) ; } else if ( name . equals ( GRANTS ) ) { readGrants ( reader ) ; } else if ( name . equals ( WHITELISTEDSITES ) ) { readWhitelistedSites ( reader ) ; } else if ( name . equals ( BLACKLISTEDSITES ) ) { readBlacklistedSites ( reader ) ; } else if ( name . equals ( AUTHENTICATIONHOLDERS ) ) { readAuthenticationHolders ( reader ) ; } else if ( name . equals ( ACCESSTOKENS ) ) { readAccessTokens ( reader ) ; } else if ( name . equals ( REFRESHTOKENS ) ) { readRefreshTokens ( reader ) ; } else if ( name . equals ( SYSTEMSCOPES ) ) { readSystemScopes ( reader ) ; } else { for ( MITREidDataServiceExtension extension : extensions ) { if ( extension . supportsVersion ( THIS_VERSION ) ) { extension . importExtensionData ( name , reader ) ; break ; } } reader . skipValue ( ) ; } break ; case END_OBJECT : reader . endObject ( ) ; continue ; default : logger . debug ( ""Found unexpected entry"" ) ; reader . skipValue ( ) ; continue ; } } fixObjectReferences ( ) ; for ( MITREidDataServiceExtension extension : extensions ) { if ( extension . supportsVersion ( THIS_VERSION ) ) { extension . fixExtensionObjectReferences ( maps ) ; break ; } } maps . clearAll ( ) ; } " 244,"public void addHandler ( JettyHandler handler ) { ServletHolder servletHolder = new ServletHolder ( ) ; servletHolder . setServlet ( handler ) ; servletContextHandler . addServlet ( servletHolder , handler . pathSpec ( ) ) ; } ","public void addHandler ( JettyHandler handler ) { LOGGER . info ( ""Bind handler {} into jetty server {}:{}"" , handler . getClass ( ) . getSimpleName ( ) , jettyServerConfig . getHost ( ) , jettyServerConfig . getPort ( ) ) ; ServletHolder servletHolder = new ServletHolder ( ) ; servletHolder . setServlet ( handler ) ; servletContextHandler . addServlet ( servletHolder , handler . pathSpec ( ) ) ; } " 245,"@ Test public void testManyFiles ( ) throws Exception { Session s = conn . createSession ( true , Session . SESSION_TRANSACTED ) ; Queue jmsQueue = s . createQueue ( address . toString ( ) ) ; MessageProducer p = s . createProducer ( jmsQueue ) ; p . setDeliveryMode ( DeliveryMode . PERSISTENT ) ; conn . start ( ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { p . send ( s . createTextMessage ( ""payload"" ) ) ; server . getStorageManager ( ) . getMessageJournal ( ) . forceMoveNextFile ( ) ; } s . commit ( ) ; Assert . assertTrue ( server . getStorageManager ( ) . getJournalSequentialFileFactory ( ) . getCriticalAnalyzer ( ) . getNumberOfComponents ( ) < 10 ) ; } ","@ Test public void testManyFiles ( ) throws Exception { Session s = conn . createSession ( true , Session . SESSION_TRANSACTED ) ; Queue jmsQueue = s . createQueue ( address . toString ( ) ) ; MessageProducer p = s . createProducer ( jmsQueue ) ; p . setDeliveryMode ( DeliveryMode . PERSISTENT ) ; conn . start ( ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { p . send ( s . createTextMessage ( ""payload"" ) ) ; server . getStorageManager ( ) . getMessageJournal ( ) . forceMoveNextFile ( ) ; } s . commit ( ) ; Assert . assertTrue ( server . getStorageManager ( ) . getJournalSequentialFileFactory ( ) . getCriticalAnalyzer ( ) . getNumberOfComponents ( ) < 10 ) ; log . debug ( ""Number of components:"" + server . getStorageManager ( ) . getJournalSequentialFileFactory ( ) . getCriticalAnalyzer ( ) . getNumberOfComponents ( ) ) ; } " 246,"public Double dot ( Matrix m ) { if ( numRows != m . numRows || numCols != m . numCols ) { return 0.0 ; } double sum = 0 ; for ( int r = 0 ; r < numRows ; r ++ ) for ( int c = 0 ; c < numCols ; c ++ ) sum += this . elements [ r ] [ c ] * m . elements [ r ] [ c ] ; return sum ; } ","public Double dot ( Matrix m ) { if ( numRows != m . numRows || numCols != m . numCols ) { log . info ( ""dimensions bad in dot()"" ) ; return 0.0 ; } double sum = 0 ; for ( int r = 0 ; r < numRows ; r ++ ) for ( int c = 0 ; c < numCols ; c ++ ) sum += this . elements [ r ] [ c ] * m . elements [ r ] [ c ] ; return sum ; } " 247,"public void init ( SortedKeyValueIterator < Key , Value > source , Map < String , String > options , IteratorEnvironment env ) throws IOException { if ( log . isTraceEnabled ( ) ) { } super . init ( source , options , env ) ; this . mustUseFieldIndex = true ; fieldIndexKeyDataTypeFilter = parseIndexFilteringChain ( new SourcedOptions < > ( source , env , options ) ) ; disableIndexOnlyDocuments = false ; } ","public void init ( SortedKeyValueIterator < Key , Value > source , Map < String , String > options , IteratorEnvironment env ) throws IOException { if ( log . isTraceEnabled ( ) ) { log . trace ( ""AncestorQueryIterator init()"" ) ; } super . init ( source , options , env ) ; this . mustUseFieldIndex = true ; fieldIndexKeyDataTypeFilter = parseIndexFilteringChain ( new SourcedOptions < > ( source , env , options ) ) ; disableIndexOnlyDocuments = false ; } " 248,"private void renewToken ( ) throws VaultException { Vault vault = this . vault ; if ( vault == null ) { return ; } try { AuthResponse response = vault . auth ( ) . renewSelf ( ) ; long ttl = response . getAuthLeaseDuration ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { } if ( response . isAuthRenewable ( ) ) { if ( ttl > 1 ) { long delay = TimeUnit . SECONDS . toMillis ( suggestedRefreshInterval ( ttl ) ) ; timer . schedule ( new RenewTokenTask ( ) , delay ) ; } else { LOGGER . warn ( ""Token TTL ({}) is not enough for scheduling"" , ttl ) ; vault = recreateVault ( vault ) ; } } else { LOGGER . warn ( ""Vault token is not renewable now"" ) ; } } catch ( VaultException e ) { if ( e . getHttpStatusCode ( ) == STATUS_CODE_FORBIDDEN ) { LOGGER . warn ( ""Could not renew the Vault token"" , e ) ; vault = recreateVault ( vault ) ; } } } ","private void renewToken ( ) throws VaultException { Vault vault = this . vault ; if ( vault == null ) { return ; } try { AuthResponse response = vault . auth ( ) . renewSelf ( ) ; long ttl = response . getAuthLeaseDuration ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Token was successfully renewed (new TTL = {} seconds), response: {}"" , ttl , bodyAsString ( response . getRestResponse ( ) ) ) ; } if ( response . isAuthRenewable ( ) ) { if ( ttl > 1 ) { long delay = TimeUnit . SECONDS . toMillis ( suggestedRefreshInterval ( ttl ) ) ; timer . schedule ( new RenewTokenTask ( ) , delay ) ; } else { LOGGER . warn ( ""Token TTL ({}) is not enough for scheduling"" , ttl ) ; vault = recreateVault ( vault ) ; } } else { LOGGER . warn ( ""Vault token is not renewable now"" ) ; } } catch ( VaultException e ) { if ( e . getHttpStatusCode ( ) == STATUS_CODE_FORBIDDEN ) { LOGGER . warn ( ""Could not renew the Vault token"" , e ) ; vault = recreateVault ( vault ) ; } } } " 249,"private void renewToken ( ) throws VaultException { Vault vault = this . vault ; if ( vault == null ) { return ; } try { AuthResponse response = vault . auth ( ) . renewSelf ( ) ; long ttl = response . getAuthLeaseDuration ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Token was successfully renewed (new TTL = {} seconds), response: {}"" , ttl , bodyAsString ( response . getRestResponse ( ) ) ) ; } if ( response . isAuthRenewable ( ) ) { if ( ttl > 1 ) { long delay = TimeUnit . SECONDS . toMillis ( suggestedRefreshInterval ( ttl ) ) ; timer . schedule ( new RenewTokenTask ( ) , delay ) ; } else { vault = recreateVault ( vault ) ; } } else { LOGGER . warn ( ""Vault token is not renewable now"" ) ; } } catch ( VaultException e ) { if ( e . getHttpStatusCode ( ) == STATUS_CODE_FORBIDDEN ) { LOGGER . warn ( ""Could not renew the Vault token"" , e ) ; vault = recreateVault ( vault ) ; } } } ","private void renewToken ( ) throws VaultException { Vault vault = this . vault ; if ( vault == null ) { return ; } try { AuthResponse response = vault . auth ( ) . renewSelf ( ) ; long ttl = response . getAuthLeaseDuration ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Token was successfully renewed (new TTL = {} seconds), response: {}"" , ttl , bodyAsString ( response . getRestResponse ( ) ) ) ; } if ( response . isAuthRenewable ( ) ) { if ( ttl > 1 ) { long delay = TimeUnit . SECONDS . toMillis ( suggestedRefreshInterval ( ttl ) ) ; timer . schedule ( new RenewTokenTask ( ) , delay ) ; } else { LOGGER . warn ( ""Token TTL ({}) is not enough for scheduling"" , ttl ) ; vault = recreateVault ( vault ) ; } } else { LOGGER . warn ( ""Vault token is not renewable now"" ) ; } } catch ( VaultException e ) { if ( e . getHttpStatusCode ( ) == STATUS_CODE_FORBIDDEN ) { LOGGER . warn ( ""Could not renew the Vault token"" , e ) ; vault = recreateVault ( vault ) ; } } } " 250,"private void renewToken ( ) throws VaultException { Vault vault = this . vault ; if ( vault == null ) { return ; } try { AuthResponse response = vault . auth ( ) . renewSelf ( ) ; long ttl = response . getAuthLeaseDuration ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Token was successfully renewed (new TTL = {} seconds), response: {}"" , ttl , bodyAsString ( response . getRestResponse ( ) ) ) ; } if ( response . isAuthRenewable ( ) ) { if ( ttl > 1 ) { long delay = TimeUnit . SECONDS . toMillis ( suggestedRefreshInterval ( ttl ) ) ; timer . schedule ( new RenewTokenTask ( ) , delay ) ; } else { LOGGER . warn ( ""Token TTL ({}) is not enough for scheduling"" , ttl ) ; vault = recreateVault ( vault ) ; } } else { } } catch ( VaultException e ) { if ( e . getHttpStatusCode ( ) == STATUS_CODE_FORBIDDEN ) { LOGGER . warn ( ""Could not renew the Vault token"" , e ) ; vault = recreateVault ( vault ) ; } } } ","private void renewToken ( ) throws VaultException { Vault vault = this . vault ; if ( vault == null ) { return ; } try { AuthResponse response = vault . auth ( ) . renewSelf ( ) ; long ttl = response . getAuthLeaseDuration ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Token was successfully renewed (new TTL = {} seconds), response: {}"" , ttl , bodyAsString ( response . getRestResponse ( ) ) ) ; } if ( response . isAuthRenewable ( ) ) { if ( ttl > 1 ) { long delay = TimeUnit . SECONDS . toMillis ( suggestedRefreshInterval ( ttl ) ) ; timer . schedule ( new RenewTokenTask ( ) , delay ) ; } else { LOGGER . warn ( ""Token TTL ({}) is not enough for scheduling"" , ttl ) ; vault = recreateVault ( vault ) ; } } else { LOGGER . warn ( ""Vault token is not renewable now"" ) ; } } catch ( VaultException e ) { if ( e . getHttpStatusCode ( ) == STATUS_CODE_FORBIDDEN ) { LOGGER . warn ( ""Could not renew the Vault token"" , e ) ; vault = recreateVault ( vault ) ; } } } " 251,"private void renewToken ( ) throws VaultException { Vault vault = this . vault ; if ( vault == null ) { return ; } try { AuthResponse response = vault . auth ( ) . renewSelf ( ) ; long ttl = response . getAuthLeaseDuration ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Token was successfully renewed (new TTL = {} seconds), response: {}"" , ttl , bodyAsString ( response . getRestResponse ( ) ) ) ; } if ( response . isAuthRenewable ( ) ) { if ( ttl > 1 ) { long delay = TimeUnit . SECONDS . toMillis ( suggestedRefreshInterval ( ttl ) ) ; timer . schedule ( new RenewTokenTask ( ) , delay ) ; } else { LOGGER . warn ( ""Token TTL ({}) is not enough for scheduling"" , ttl ) ; vault = recreateVault ( vault ) ; } } else { LOGGER . warn ( ""Vault token is not renewable now"" ) ; } } catch ( VaultException e ) { if ( e . getHttpStatusCode ( ) == STATUS_CODE_FORBIDDEN ) { vault = recreateVault ( vault ) ; } } } ","private void renewToken ( ) throws VaultException { Vault vault = this . vault ; if ( vault == null ) { return ; } try { AuthResponse response = vault . auth ( ) . renewSelf ( ) ; long ttl = response . getAuthLeaseDuration ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Token was successfully renewed (new TTL = {} seconds), response: {}"" , ttl , bodyAsString ( response . getRestResponse ( ) ) ) ; } if ( response . isAuthRenewable ( ) ) { if ( ttl > 1 ) { long delay = TimeUnit . SECONDS . toMillis ( suggestedRefreshInterval ( ttl ) ) ; timer . schedule ( new RenewTokenTask ( ) , delay ) ; } else { LOGGER . warn ( ""Token TTL ({}) is not enough for scheduling"" , ttl ) ; vault = recreateVault ( vault ) ; } } else { LOGGER . warn ( ""Vault token is not renewable now"" ) ; } } catch ( VaultException e ) { if ( e . getHttpStatusCode ( ) == STATUS_CODE_FORBIDDEN ) { LOGGER . warn ( ""Could not renew the Vault token"" , e ) ; vault = recreateVault ( vault ) ; } } } " 252,"public void cleanup ( ) { try { lookup . close ( ) ; } catch ( Exception e ) { } } ","public void cleanup ( ) { try { lookup . close ( ) ; } catch ( Exception e ) { LOG . error ( ""Unable to cleanup access tracker"" , e ) ; } } " 253,"protected void doStop ( ) throws Exception { super . doStop ( ) ; if ( configuration . isWebhookAutoRegister ( ) && delegateEndpoint != null ) { delegateEndpoint . unregisterWebhook ( ) ; } ServiceHelper . stopService ( delegateEndpoint ) ; } ","protected void doStop ( ) throws Exception { super . doStop ( ) ; if ( configuration . isWebhookAutoRegister ( ) && delegateEndpoint != null ) { LOG . info ( ""Unregistering webhook for endpoint: {}"" , delegateEndpoint ) ; delegateEndpoint . unregisterWebhook ( ) ; } ServiceHelper . stopService ( delegateEndpoint ) ; } " 254,"@ SuppressWarnings ( ""checkstyle:IllegalCatch"" ) @ SuppressFBWarnings ( value = ""NP_NULL_PARAM_DEREF"" , justification = ""Unrecognised NullableDecl"" ) @ Override public Optional < String > invokeRpc ( final String uriPath , final Optional < String > input ) throws OperationFailedException { requireNonNull ( uriPath , ""uriPath can't be null"" ) ; final String actualInput = input . isPresent ( ) ? input . get ( ) : null ; String output = null ; try { NormalizedNodeContext outputContext ; if ( actualInput != null ) { final InputStream entityStream = new ByteArrayInputStream ( actualInput . getBytes ( StandardCharsets . UTF_8 ) ) ; final NormalizedNodeContext inputContext = JsonNormalizedNodeBodyReader . readFrom ( uriPath , entityStream , true , controllerContext ) ; LOG . debug ( ""Parsed YangInstanceIdentifier: {}"" , inputContext . getInstanceIdentifierContext ( ) . getInstanceIdentifier ( ) ) ; LOG . debug ( ""Parsed NormalizedNode: {}"" , inputContext . getData ( ) ) ; outputContext = restconfService . invokeRpc ( uriPath , inputContext , null ) ; } else { outputContext = restconfService . invokeRpc ( uriPath , null , null ) ; } if ( outputContext . getData ( ) != null ) { output = toJson ( outputContext ) ; } } catch ( final RuntimeException | IOException e ) { propagateExceptionAs ( uriPath , e , ""RPC"" ) ; } return Optional . ofNullable ( output ) ; } ","@ SuppressWarnings ( ""checkstyle:IllegalCatch"" ) @ SuppressFBWarnings ( value = ""NP_NULL_PARAM_DEREF"" , justification = ""Unrecognised NullableDecl"" ) @ Override public Optional < String > invokeRpc ( final String uriPath , final Optional < String > input ) throws OperationFailedException { requireNonNull ( uriPath , ""uriPath can't be null"" ) ; final String actualInput = input . isPresent ( ) ? input . get ( ) : null ; LOG . debug ( ""invokeRpc: uriPath: {}, input: {}"" , uriPath , actualInput ) ; String output = null ; try { NormalizedNodeContext outputContext ; if ( actualInput != null ) { final InputStream entityStream = new ByteArrayInputStream ( actualInput . getBytes ( StandardCharsets . UTF_8 ) ) ; final NormalizedNodeContext inputContext = JsonNormalizedNodeBodyReader . readFrom ( uriPath , entityStream , true , controllerContext ) ; LOG . debug ( ""Parsed YangInstanceIdentifier: {}"" , inputContext . getInstanceIdentifierContext ( ) . getInstanceIdentifier ( ) ) ; LOG . debug ( ""Parsed NormalizedNode: {}"" , inputContext . getData ( ) ) ; outputContext = restconfService . invokeRpc ( uriPath , inputContext , null ) ; } else { outputContext = restconfService . invokeRpc ( uriPath , null , null ) ; } if ( outputContext . getData ( ) != null ) { output = toJson ( outputContext ) ; } } catch ( final RuntimeException | IOException e ) { propagateExceptionAs ( uriPath , e , ""RPC"" ) ; } return Optional . ofNullable ( output ) ; } " 255,"@ SuppressWarnings ( ""checkstyle:IllegalCatch"" ) @ SuppressFBWarnings ( value = ""NP_NULL_PARAM_DEREF"" , justification = ""Unrecognised NullableDecl"" ) @ Override public Optional < String > invokeRpc ( final String uriPath , final Optional < String > input ) throws OperationFailedException { requireNonNull ( uriPath , ""uriPath can't be null"" ) ; final String actualInput = input . isPresent ( ) ? input . get ( ) : null ; LOG . debug ( ""invokeRpc: uriPath: {}, input: {}"" , uriPath , actualInput ) ; String output = null ; try { NormalizedNodeContext outputContext ; if ( actualInput != null ) { final InputStream entityStream = new ByteArrayInputStream ( actualInput . getBytes ( StandardCharsets . UTF_8 ) ) ; final NormalizedNodeContext inputContext = JsonNormalizedNodeBodyReader . readFrom ( uriPath , entityStream , true , controllerContext ) ; LOG . debug ( ""Parsed NormalizedNode: {}"" , inputContext . getData ( ) ) ; outputContext = restconfService . invokeRpc ( uriPath , inputContext , null ) ; } else { outputContext = restconfService . invokeRpc ( uriPath , null , null ) ; } if ( outputContext . getData ( ) != null ) { output = toJson ( outputContext ) ; } } catch ( final RuntimeException | IOException e ) { propagateExceptionAs ( uriPath , e , ""RPC"" ) ; } return Optional . ofNullable ( output ) ; } ","@ SuppressWarnings ( ""checkstyle:IllegalCatch"" ) @ SuppressFBWarnings ( value = ""NP_NULL_PARAM_DEREF"" , justification = ""Unrecognised NullableDecl"" ) @ Override public Optional < String > invokeRpc ( final String uriPath , final Optional < String > input ) throws OperationFailedException { requireNonNull ( uriPath , ""uriPath can't be null"" ) ; final String actualInput = input . isPresent ( ) ? input . get ( ) : null ; LOG . debug ( ""invokeRpc: uriPath: {}, input: {}"" , uriPath , actualInput ) ; String output = null ; try { NormalizedNodeContext outputContext ; if ( actualInput != null ) { final InputStream entityStream = new ByteArrayInputStream ( actualInput . getBytes ( StandardCharsets . UTF_8 ) ) ; final NormalizedNodeContext inputContext = JsonNormalizedNodeBodyReader . readFrom ( uriPath , entityStream , true , controllerContext ) ; LOG . debug ( ""Parsed YangInstanceIdentifier: {}"" , inputContext . getInstanceIdentifierContext ( ) . getInstanceIdentifier ( ) ) ; LOG . debug ( ""Parsed NormalizedNode: {}"" , inputContext . getData ( ) ) ; outputContext = restconfService . invokeRpc ( uriPath , inputContext , null ) ; } else { outputContext = restconfService . invokeRpc ( uriPath , null , null ) ; } if ( outputContext . getData ( ) != null ) { output = toJson ( outputContext ) ; } } catch ( final RuntimeException | IOException e ) { propagateExceptionAs ( uriPath , e , ""RPC"" ) ; } return Optional . ofNullable ( output ) ; } " 256,"@ SuppressWarnings ( ""checkstyle:IllegalCatch"" ) @ SuppressFBWarnings ( value = ""NP_NULL_PARAM_DEREF"" , justification = ""Unrecognised NullableDecl"" ) @ Override public Optional < String > invokeRpc ( final String uriPath , final Optional < String > input ) throws OperationFailedException { requireNonNull ( uriPath , ""uriPath can't be null"" ) ; final String actualInput = input . isPresent ( ) ? input . get ( ) : null ; LOG . debug ( ""invokeRpc: uriPath: {}, input: {}"" , uriPath , actualInput ) ; String output = null ; try { NormalizedNodeContext outputContext ; if ( actualInput != null ) { final InputStream entityStream = new ByteArrayInputStream ( actualInput . getBytes ( StandardCharsets . UTF_8 ) ) ; final NormalizedNodeContext inputContext = JsonNormalizedNodeBodyReader . readFrom ( uriPath , entityStream , true , controllerContext ) ; LOG . debug ( ""Parsed YangInstanceIdentifier: {}"" , inputContext . getInstanceIdentifierContext ( ) . getInstanceIdentifier ( ) ) ; outputContext = restconfService . invokeRpc ( uriPath , inputContext , null ) ; } else { outputContext = restconfService . invokeRpc ( uriPath , null , null ) ; } if ( outputContext . getData ( ) != null ) { output = toJson ( outputContext ) ; } } catch ( final RuntimeException | IOException e ) { propagateExceptionAs ( uriPath , e , ""RPC"" ) ; } return Optional . ofNullable ( output ) ; } ","@ SuppressWarnings ( ""checkstyle:IllegalCatch"" ) @ SuppressFBWarnings ( value = ""NP_NULL_PARAM_DEREF"" , justification = ""Unrecognised NullableDecl"" ) @ Override public Optional < String > invokeRpc ( final String uriPath , final Optional < String > input ) throws OperationFailedException { requireNonNull ( uriPath , ""uriPath can't be null"" ) ; final String actualInput = input . isPresent ( ) ? input . get ( ) : null ; LOG . debug ( ""invokeRpc: uriPath: {}, input: {}"" , uriPath , actualInput ) ; String output = null ; try { NormalizedNodeContext outputContext ; if ( actualInput != null ) { final InputStream entityStream = new ByteArrayInputStream ( actualInput . getBytes ( StandardCharsets . UTF_8 ) ) ; final NormalizedNodeContext inputContext = JsonNormalizedNodeBodyReader . readFrom ( uriPath , entityStream , true , controllerContext ) ; LOG . debug ( ""Parsed YangInstanceIdentifier: {}"" , inputContext . getInstanceIdentifierContext ( ) . getInstanceIdentifier ( ) ) ; LOG . debug ( ""Parsed NormalizedNode: {}"" , inputContext . getData ( ) ) ; outputContext = restconfService . invokeRpc ( uriPath , inputContext , null ) ; } else { outputContext = restconfService . invokeRpc ( uriPath , null , null ) ; } if ( outputContext . getData ( ) != null ) { output = toJson ( outputContext ) ; } } catch ( final RuntimeException | IOException e ) { propagateExceptionAs ( uriPath , e , ""RPC"" ) ; } return Optional . ofNullable ( output ) ; } " 257,"private void insertObservations ( ) throws UnsupportedEncodingException , IOException , XmlException , OwsExceptionReport { ExecutorService threadPool = Executors . newFixedThreadPool ( 5 , new GroupedAndNamedThreadFactory ( ""52n-sample-data-insert-observations"" ) ) ; for ( File observationFile : getFilesBySuffix ( OBS_XML_FILE_ENDING ) ) { threadPool . submit ( new InsertObservationTask ( observationFile ) ) ; } try { threadPool . shutdown ( ) ; while ( ! threadPool . isTerminated ( ) ) { Thread . sleep ( THREADPOOL_SLEEP_BETWEEN_CHECKS ) ; } } catch ( InterruptedException e ) { } exceptions . throwIfNotEmpty ( ) ; } ","private void insertObservations ( ) throws UnsupportedEncodingException , IOException , XmlException , OwsExceptionReport { ExecutorService threadPool = Executors . newFixedThreadPool ( 5 , new GroupedAndNamedThreadFactory ( ""52n-sample-data-insert-observations"" ) ) ; for ( File observationFile : getFilesBySuffix ( OBS_XML_FILE_ENDING ) ) { threadPool . submit ( new InsertObservationTask ( observationFile ) ) ; } try { threadPool . shutdown ( ) ; while ( ! threadPool . isTerminated ( ) ) { Thread . sleep ( THREADPOOL_SLEEP_BETWEEN_CHECKS ) ; } } catch ( InterruptedException e ) { LOG . error ( ""Insert obervations thread was interrupted!"" , e ) ; } exceptions . throwIfNotEmpty ( ) ; } " 258,"protected void doClean ( Exchange exchange , String operation ) throws Exception { Set < String > result = null ; try { if ( ObjectHelper . isNotEmpty ( endpoint . getBranchName ( ) ) ) { git . checkout ( ) . setCreateBranch ( false ) . setName ( endpoint . getBranchName ( ) ) . call ( ) ; } result = git . clean ( ) . setCleanDirectories ( true ) . call ( ) ; } catch ( Exception e ) { throw e ; } updateExchange ( exchange , result ) ; } ","protected void doClean ( Exchange exchange , String operation ) throws Exception { Set < String > result = null ; try { if ( ObjectHelper . isNotEmpty ( endpoint . getBranchName ( ) ) ) { git . checkout ( ) . setCreateBranch ( false ) . setName ( endpoint . getBranchName ( ) ) . call ( ) ; } result = git . clean ( ) . setCleanDirectories ( true ) . call ( ) ; } catch ( Exception e ) { LOG . error ( ""There was an error in Git {} operation"" , operation ) ; throw e ; } updateExchange ( exchange , result ) ; } " 259,"protected void failRevertFileVersion ( String version ) throws PortalException { try { revertFileVersion ( version , null ) ; Assert . fail ( ) ; } catch ( InvalidFileVersionException invalidFileVersionException ) { if ( _log . isDebugEnabled ( ) ) { } } } ","protected void failRevertFileVersion ( String version ) throws PortalException { try { revertFileVersion ( version , null ) ; Assert . fail ( ) ; } catch ( InvalidFileVersionException invalidFileVersionException ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( invalidFileVersionException , invalidFileVersionException ) ; } } } " 260,"public NSDictionary objectForKey ( final String key ) { final NSObject value = dict . objectForKey ( key ) ; if ( null == value ) { return null ; } if ( value instanceof NSDictionary ) { return ( NSDictionary ) value ; } return null ; } ","public NSDictionary objectForKey ( final String key ) { final NSObject value = dict . objectForKey ( key ) ; if ( null == value ) { return null ; } if ( value instanceof NSDictionary ) { return ( NSDictionary ) value ; } log . warn ( String . format ( ""Unexpected value type for serialized key %s"" , key ) ) ; return null ; } " 261,"public void checkServerTrusted ( final X509Certificate [ ] chain , final String authType ) throws CertificateException { CertificateException certEx = null ; for ( X509ExtendedTrustManager tm : trustManagers ) { try { tm . checkServerTrusted ( chain , authType ) ; if ( trustStrategy == Strategy . ANY ) { return ; } } catch ( CertificateException e ) { logger . debug ( ""checkServerTrusted for {} failed"" , tm ) ; if ( trustStrategy == Strategy . ALL ) { throw e ; } if ( certEx == null ) { certEx = e ; } } } if ( certEx != null ) { throw certEx ; } } ","public void checkServerTrusted ( final X509Certificate [ ] chain , final String authType ) throws CertificateException { CertificateException certEx = null ; for ( X509ExtendedTrustManager tm : trustManagers ) { try { tm . checkServerTrusted ( chain , authType ) ; logger . debug ( ""checkServerTrusted for {} succeeded"" , tm ) ; if ( trustStrategy == Strategy . ANY ) { return ; } } catch ( CertificateException e ) { logger . debug ( ""checkServerTrusted for {} failed"" , tm ) ; if ( trustStrategy == Strategy . ALL ) { throw e ; } if ( certEx == null ) { certEx = e ; } } } if ( certEx != null ) { throw certEx ; } } " 262,"public void checkServerTrusted ( final X509Certificate [ ] chain , final String authType ) throws CertificateException { CertificateException certEx = null ; for ( X509ExtendedTrustManager tm : trustManagers ) { try { tm . checkServerTrusted ( chain , authType ) ; logger . debug ( ""checkServerTrusted for {} succeeded"" , tm ) ; if ( trustStrategy == Strategy . ANY ) { return ; } } catch ( CertificateException e ) { if ( trustStrategy == Strategy . ALL ) { throw e ; } if ( certEx == null ) { certEx = e ; } } } if ( certEx != null ) { throw certEx ; } } ","public void checkServerTrusted ( final X509Certificate [ ] chain , final String authType ) throws CertificateException { CertificateException certEx = null ; for ( X509ExtendedTrustManager tm : trustManagers ) { try { tm . checkServerTrusted ( chain , authType ) ; logger . debug ( ""checkServerTrusted for {} succeeded"" , tm ) ; if ( trustStrategy == Strategy . ANY ) { return ; } } catch ( CertificateException e ) { logger . debug ( ""checkServerTrusted for {} failed"" , tm ) ; if ( trustStrategy == Strategy . ALL ) { throw e ; } if ( certEx == null ) { certEx = e ; } } } if ( certEx != null ) { throw certEx ; } } " 263,"public RSAPrivateKey decodePrivateKey ( SessionContext session , String keyType , FilePasswordProvider passwordProvider , InputStream keyData ) throws IOException , GeneralSecurityException { if ( ! KeyPairProvider . SSH_RSA . equals ( keyType ) ) { throw new InvalidKeySpecException ( ""Unexpected key type: "" + keyType ) ; } BigInteger n = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger e = KeyEntryResolver . decodeBigInt ( keyData ) ; if ( ! Objects . equals ( e , DEFAULT_PUBLIC_EXPONENT ) ) { } BigInteger d = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger inverseQmodP = KeyEntryResolver . decodeBigInt ( keyData ) ; Objects . requireNonNull ( inverseQmodP , ""Missing iqmodp"" ) ; BigInteger p = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger q = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger modulus = p . multiply ( q ) ; if ( ! Objects . equals ( n , modulus ) ) { log . warn ( ""decodePrivateKey({}) mismatched modulus values: encoded={}, calculated={}"" , keyType , n , modulus ) ; } try { return generatePrivateKey ( new RSAPrivateCrtKeySpec ( n , e , d , p , q , d . mod ( p . subtract ( BigInteger . ONE ) ) , d . mod ( q . subtract ( BigInteger . ONE ) ) , inverseQmodP ) ) ; } finally { d = null ; inverseQmodP = null ; p = null ; q = null ; } } ","public RSAPrivateKey decodePrivateKey ( SessionContext session , String keyType , FilePasswordProvider passwordProvider , InputStream keyData ) throws IOException , GeneralSecurityException { if ( ! KeyPairProvider . SSH_RSA . equals ( keyType ) ) { throw new InvalidKeySpecException ( ""Unexpected key type: "" + keyType ) ; } BigInteger n = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger e = KeyEntryResolver . decodeBigInt ( keyData ) ; if ( ! Objects . equals ( e , DEFAULT_PUBLIC_EXPONENT ) ) { log . warn ( ""decodePrivateKey({}) non-standard RSA exponent found: {}"" , keyType , e ) ; } BigInteger d = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger inverseQmodP = KeyEntryResolver . decodeBigInt ( keyData ) ; Objects . requireNonNull ( inverseQmodP , ""Missing iqmodp"" ) ; BigInteger p = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger q = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger modulus = p . multiply ( q ) ; if ( ! Objects . equals ( n , modulus ) ) { log . warn ( ""decodePrivateKey({}) mismatched modulus values: encoded={}, calculated={}"" , keyType , n , modulus ) ; } try { return generatePrivateKey ( new RSAPrivateCrtKeySpec ( n , e , d , p , q , d . mod ( p . subtract ( BigInteger . ONE ) ) , d . mod ( q . subtract ( BigInteger . ONE ) ) , inverseQmodP ) ) ; } finally { d = null ; inverseQmodP = null ; p = null ; q = null ; } } " 264,"public RSAPrivateKey decodePrivateKey ( SessionContext session , String keyType , FilePasswordProvider passwordProvider , InputStream keyData ) throws IOException , GeneralSecurityException { if ( ! KeyPairProvider . SSH_RSA . equals ( keyType ) ) { throw new InvalidKeySpecException ( ""Unexpected key type: "" + keyType ) ; } BigInteger n = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger e = KeyEntryResolver . decodeBigInt ( keyData ) ; if ( ! Objects . equals ( e , DEFAULT_PUBLIC_EXPONENT ) ) { log . warn ( ""decodePrivateKey({}) non-standard RSA exponent found: {}"" , keyType , e ) ; } BigInteger d = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger inverseQmodP = KeyEntryResolver . decodeBigInt ( keyData ) ; Objects . requireNonNull ( inverseQmodP , ""Missing iqmodp"" ) ; BigInteger p = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger q = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger modulus = p . multiply ( q ) ; if ( ! Objects . equals ( n , modulus ) ) { } try { return generatePrivateKey ( new RSAPrivateCrtKeySpec ( n , e , d , p , q , d . mod ( p . subtract ( BigInteger . ONE ) ) , d . mod ( q . subtract ( BigInteger . ONE ) ) , inverseQmodP ) ) ; } finally { d = null ; inverseQmodP = null ; p = null ; q = null ; } } ","public RSAPrivateKey decodePrivateKey ( SessionContext session , String keyType , FilePasswordProvider passwordProvider , InputStream keyData ) throws IOException , GeneralSecurityException { if ( ! KeyPairProvider . SSH_RSA . equals ( keyType ) ) { throw new InvalidKeySpecException ( ""Unexpected key type: "" + keyType ) ; } BigInteger n = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger e = KeyEntryResolver . decodeBigInt ( keyData ) ; if ( ! Objects . equals ( e , DEFAULT_PUBLIC_EXPONENT ) ) { log . warn ( ""decodePrivateKey({}) non-standard RSA exponent found: {}"" , keyType , e ) ; } BigInteger d = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger inverseQmodP = KeyEntryResolver . decodeBigInt ( keyData ) ; Objects . requireNonNull ( inverseQmodP , ""Missing iqmodp"" ) ; BigInteger p = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger q = KeyEntryResolver . decodeBigInt ( keyData ) ; BigInteger modulus = p . multiply ( q ) ; if ( ! Objects . equals ( n , modulus ) ) { log . warn ( ""decodePrivateKey({}) mismatched modulus values: encoded={}, calculated={}"" , keyType , n , modulus ) ; } try { return generatePrivateKey ( new RSAPrivateCrtKeySpec ( n , e , d , p , q , d . mod ( p . subtract ( BigInteger . ONE ) ) , d . mod ( q . subtract ( BigInteger . ONE ) ) , inverseQmodP ) ) ; } finally { d = null ; inverseQmodP = null ; p = null ; q = null ; } } " 265,"public static int install ( ResourceUtils resolver , Map < String , ? > props , SshMachineLocation machine , String urlToInstall , String target , int numAttempts ) { if ( resolver == null ) resolver = ResourceUtils . create ( machine ) ; Exception lastError = null ; int retriesRemaining = numAttempts ; int attemptNum = 0 ; do { attemptNum ++ ; try { Tasks . setBlockingDetails ( ""Installing "" + urlToInstall + "" at "" + machine ) ; return machine . installTo ( resolver , props , urlToInstall , target ) ; } catch ( Exception e ) { Exceptions . propagateIfFatal ( e ) ; lastError = e ; String stack = StackTraceSimplifier . toString ( e ) ; if ( stack . contains ( ""net.schmizz.sshj.sftp.RemoteFile.write"" ) ) { continue ; } log . warn ( ""Failed to transfer "" + urlToInstall + "" to "" + machine + "", not a retryable error so failing: "" + e ) ; throw Exceptions . propagate ( e ) ; } finally { Tasks . resetBlockingDetails ( ) ; } } while ( retriesRemaining -- > 0 ) ; throw Exceptions . propagate ( lastError ) ; } ","public static int install ( ResourceUtils resolver , Map < String , ? > props , SshMachineLocation machine , String urlToInstall , String target , int numAttempts ) { if ( resolver == null ) resolver = ResourceUtils . create ( machine ) ; Exception lastError = null ; int retriesRemaining = numAttempts ; int attemptNum = 0 ; do { attemptNum ++ ; try { Tasks . setBlockingDetails ( ""Installing "" + urlToInstall + "" at "" + machine ) ; return machine . installTo ( resolver , props , urlToInstall , target ) ; } catch ( Exception e ) { Exceptions . propagateIfFatal ( e ) ; lastError = e ; String stack = StackTraceSimplifier . toString ( e ) ; if ( stack . contains ( ""net.schmizz.sshj.sftp.RemoteFile.write"" ) ) { log . warn ( ""Failed to transfer "" + urlToInstall + "" to "" + machine + "", retryable error, attempt "" + attemptNum + ""/"" + numAttempts + "": "" + e ) ; continue ; } log . warn ( ""Failed to transfer "" + urlToInstall + "" to "" + machine + "", not a retryable error so failing: "" + e ) ; throw Exceptions . propagate ( e ) ; } finally { Tasks . resetBlockingDetails ( ) ; } } while ( retriesRemaining -- > 0 ) ; throw Exceptions . propagate ( lastError ) ; } " 266,"public static int install ( ResourceUtils resolver , Map < String , ? > props , SshMachineLocation machine , String urlToInstall , String target , int numAttempts ) { if ( resolver == null ) resolver = ResourceUtils . create ( machine ) ; Exception lastError = null ; int retriesRemaining = numAttempts ; int attemptNum = 0 ; do { attemptNum ++ ; try { Tasks . setBlockingDetails ( ""Installing "" + urlToInstall + "" at "" + machine ) ; return machine . installTo ( resolver , props , urlToInstall , target ) ; } catch ( Exception e ) { Exceptions . propagateIfFatal ( e ) ; lastError = e ; String stack = StackTraceSimplifier . toString ( e ) ; if ( stack . contains ( ""net.schmizz.sshj.sftp.RemoteFile.write"" ) ) { log . warn ( ""Failed to transfer "" + urlToInstall + "" to "" + machine + "", retryable error, attempt "" + attemptNum + ""/"" + numAttempts + "": "" + e ) ; continue ; } throw Exceptions . propagate ( e ) ; } finally { Tasks . resetBlockingDetails ( ) ; } } while ( retriesRemaining -- > 0 ) ; throw Exceptions . propagate ( lastError ) ; } ","public static int install ( ResourceUtils resolver , Map < String , ? > props , SshMachineLocation machine , String urlToInstall , String target , int numAttempts ) { if ( resolver == null ) resolver = ResourceUtils . create ( machine ) ; Exception lastError = null ; int retriesRemaining = numAttempts ; int attemptNum = 0 ; do { attemptNum ++ ; try { Tasks . setBlockingDetails ( ""Installing "" + urlToInstall + "" at "" + machine ) ; return machine . installTo ( resolver , props , urlToInstall , target ) ; } catch ( Exception e ) { Exceptions . propagateIfFatal ( e ) ; lastError = e ; String stack = StackTraceSimplifier . toString ( e ) ; if ( stack . contains ( ""net.schmizz.sshj.sftp.RemoteFile.write"" ) ) { log . warn ( ""Failed to transfer "" + urlToInstall + "" to "" + machine + "", retryable error, attempt "" + attemptNum + ""/"" + numAttempts + "": "" + e ) ; continue ; } log . warn ( ""Failed to transfer "" + urlToInstall + "" to "" + machine + "", not a retryable error so failing: "" + e ) ; throw Exceptions . propagate ( e ) ; } finally { Tasks . resetBlockingDetails ( ) ; } } while ( retriesRemaining -- > 0 ) ; throw Exceptions . propagate ( lastError ) ; } " 267,"private void logDebug ( OAuth2TokenResponse response ) { if ( ! LOGGER . isDebugEnabled ( ) ) { return ; } try { DecodedJwt decodedJwt = response . getDecodedAccessToken ( ) ; } catch ( IllegalArgumentException e ) { LOGGER . debug ( ""Access token can not be logged. {}"" , e . getMessage ( ) ) ; } } ","private void logDebug ( OAuth2TokenResponse response ) { if ( ! LOGGER . isDebugEnabled ( ) ) { return ; } try { DecodedJwt decodedJwt = response . getDecodedAccessToken ( ) ; LOGGER . debug ( ""Access token: {}"" , decodedJwt ) ; } catch ( IllegalArgumentException e ) { LOGGER . debug ( ""Access token can not be logged. {}"" , e . getMessage ( ) ) ; } } " 268,"private void logDebug ( OAuth2TokenResponse response ) { if ( ! LOGGER . isDebugEnabled ( ) ) { return ; } try { DecodedJwt decodedJwt = response . getDecodedAccessToken ( ) ; LOGGER . debug ( ""Access token: {}"" , decodedJwt ) ; } catch ( IllegalArgumentException e ) { } } ","private void logDebug ( OAuth2TokenResponse response ) { if ( ! LOGGER . isDebugEnabled ( ) ) { return ; } try { DecodedJwt decodedJwt = response . getDecodedAccessToken ( ) ; LOGGER . debug ( ""Access token: {}"" , decodedJwt ) ; } catch ( IllegalArgumentException e ) { LOGGER . debug ( ""Access token can not be logged. {}"" , e . getMessage ( ) ) ; } } " 269,"protected void run ( ) throws Exception { while ( isRunning ( ) ) { if ( ! connected ) { connect ( ) ; } if ( ! connected ) { continue ; } try { byte [ ] p = queue . poll ( 1 , TimeUnit . SECONDS ) ; if ( p != null ) { socket . getOutputStream ( ) . write ( p ) ; } } catch ( IOException e1 ) { connect ( ) ; } try { if ( socket . getInputStream ( ) . available ( ) > 0 ) { SimulatorCcsdsPacket tc = readPacket ( inputStream ) ; if ( tc != null ) { simulator . processTc ( tc ) ; } else { connected = false ; } } } catch ( IOException e1 ) { log . error ( ""Error while receiving packet on "" + name + "" socket"" , e1 ) ; connect ( ) ; } } } ","protected void run ( ) throws Exception { while ( isRunning ( ) ) { if ( ! connected ) { connect ( ) ; } if ( ! connected ) { continue ; } try { byte [ ] p = queue . poll ( 1 , TimeUnit . SECONDS ) ; if ( p != null ) { socket . getOutputStream ( ) . write ( p ) ; } } catch ( IOException e1 ) { log . error ( ""Error while sending "" + name + "" packet"" , e1 ) ; connect ( ) ; } try { if ( socket . getInputStream ( ) . available ( ) > 0 ) { SimulatorCcsdsPacket tc = readPacket ( inputStream ) ; if ( tc != null ) { simulator . processTc ( tc ) ; } else { connected = false ; } } } catch ( IOException e1 ) { log . error ( ""Error while receiving packet on "" + name + "" socket"" , e1 ) ; connect ( ) ; } } } " 270,"protected void run ( ) throws Exception { while ( isRunning ( ) ) { if ( ! connected ) { connect ( ) ; } if ( ! connected ) { continue ; } try { byte [ ] p = queue . poll ( 1 , TimeUnit . SECONDS ) ; if ( p != null ) { socket . getOutputStream ( ) . write ( p ) ; } } catch ( IOException e1 ) { log . error ( ""Error while sending "" + name + "" packet"" , e1 ) ; connect ( ) ; } try { if ( socket . getInputStream ( ) . available ( ) > 0 ) { SimulatorCcsdsPacket tc = readPacket ( inputStream ) ; if ( tc != null ) { simulator . processTc ( tc ) ; } else { connected = false ; } } } catch ( IOException e1 ) { connect ( ) ; } } } ","protected void run ( ) throws Exception { while ( isRunning ( ) ) { if ( ! connected ) { connect ( ) ; } if ( ! connected ) { continue ; } try { byte [ ] p = queue . poll ( 1 , TimeUnit . SECONDS ) ; if ( p != null ) { socket . getOutputStream ( ) . write ( p ) ; } } catch ( IOException e1 ) { log . error ( ""Error while sending "" + name + "" packet"" , e1 ) ; connect ( ) ; } try { if ( socket . getInputStream ( ) . available ( ) > 0 ) { SimulatorCcsdsPacket tc = readPacket ( inputStream ) ; if ( tc != null ) { simulator . processTc ( tc ) ; } else { connected = false ; } } } catch ( IOException e1 ) { log . error ( ""Error while receiving packet on "" + name + "" socket"" , e1 ) ; connect ( ) ; } } } " 271,"public void rollback ( Xid xid ) throws XAException { if ( this . xid == null || ! this . xid . equals ( xid ) ) { throw newXAException ( XAER_INVAL , ""Invalid Xid"" ) ; } this . xid = null ; try { owner . connection . rollback ( ) ; } catch ( SQLException e ) { throw newXAException ( XAER_RMERR , ""Cannot rollback"" , e ) ; } finally { try { owner . connection . setAutoCommit ( true ) ; } catch ( SQLException e ) { } } } ","public void rollback ( Xid xid ) throws XAException { if ( this . xid == null || ! this . xid . equals ( xid ) ) { throw newXAException ( XAER_INVAL , ""Invalid Xid"" ) ; } this . xid = null ; try { owner . connection . rollback ( ) ; } catch ( SQLException e ) { throw newXAException ( XAER_RMERR , ""Cannot rollback"" , e ) ; } finally { try { owner . connection . setAutoCommit ( true ) ; } catch ( SQLException e ) { log . error ( ""Cannot set autoCommit=true"" , e ) ; } } } " 272,"public Set < Artifact > resolveArtifacts ( Set < String > coords ) { Set < Artifact > result = new LinkedHashSet < > ( ) ; for ( String coord : coords ) { Artifact artifact = resolveArtifact ( coord ) ; if ( artifact != null ) { result . add ( artifact ) ; } } return result ; } ","public Set < Artifact > resolveArtifacts ( Set < String > coords ) { Set < Artifact > result = new LinkedHashSet < > ( ) ; for ( String coord : coords ) { Artifact artifact = resolveArtifact ( coord ) ; if ( artifact != null ) { result . add ( artifact ) ; } } LOG . trace ( ""resolveArtifacts({}) returns {}"" , coords , result ) ; return result ; } " 273,"private List < Triple < String , Date , Boolean > > getInstallations ( ) { List < Triple < String , Date , Boolean > > wmInstallations = new ArrayList < > ( ) ; try { XStringSubstitution xSS = UNO . XStringSubstitution ( UnoComponent . createComponentWithContext ( UnoComponent . CSS_UTIL_PATH_SUBSTITUTION ) ) ; String myPath = xSS . substituteVariables ( ""$(user)/uno_packages/cache/uno_packages/"" , true ) ; String oooPath = xSS . substituteVariables ( ""$(inst)/share/uno_packages/cache/uno_packages/"" , true ) ; String oooPathNew = xSS . substituteVariables ( ""$(brandbaseurl)/share/uno_packages/cache/uno_packages/"" , true ) ; if ( myPath == null || oooPath == null ) { return wmInstallations ; } findWollMuxInstallations ( wmInstallations , myPath , false ) ; findWollMuxInstallations ( wmInstallations , oooPath , true ) ; if ( oooPathNew != null ) { findWollMuxInstallations ( wmInstallations , oooPathNew , true ) ; } } catch ( NoSuchElementException e ) { LOGGER . error ( """" , e ) ; } return wmInstallations ; } ","private List < Triple < String , Date , Boolean > > getInstallations ( ) { List < Triple < String , Date , Boolean > > wmInstallations = new ArrayList < > ( ) ; try { XStringSubstitution xSS = UNO . XStringSubstitution ( UnoComponent . createComponentWithContext ( UnoComponent . CSS_UTIL_PATH_SUBSTITUTION ) ) ; String myPath = xSS . substituteVariables ( ""$(user)/uno_packages/cache/uno_packages/"" , true ) ; String oooPath = xSS . substituteVariables ( ""$(inst)/share/uno_packages/cache/uno_packages/"" , true ) ; String oooPathNew = xSS . substituteVariables ( ""$(brandbaseurl)/share/uno_packages/cache/uno_packages/"" , true ) ; if ( myPath == null || oooPath == null ) { LOGGER . error ( ""Bestimmung der Installationspfade für das WollMux-Paket fehlgeschlagen."" ) ; return wmInstallations ; } findWollMuxInstallations ( wmInstallations , myPath , false ) ; findWollMuxInstallations ( wmInstallations , oooPath , true ) ; if ( oooPathNew != null ) { findWollMuxInstallations ( wmInstallations , oooPathNew , true ) ; } } catch ( NoSuchElementException e ) { LOGGER . error ( """" , e ) ; } return wmInstallations ; } " 274,"private List < Triple < String , Date , Boolean > > getInstallations ( ) { List < Triple < String , Date , Boolean > > wmInstallations = new ArrayList < > ( ) ; try { XStringSubstitution xSS = UNO . XStringSubstitution ( UnoComponent . createComponentWithContext ( UnoComponent . CSS_UTIL_PATH_SUBSTITUTION ) ) ; String myPath = xSS . substituteVariables ( ""$(user)/uno_packages/cache/uno_packages/"" , true ) ; String oooPath = xSS . substituteVariables ( ""$(inst)/share/uno_packages/cache/uno_packages/"" , true ) ; String oooPathNew = xSS . substituteVariables ( ""$(brandbaseurl)/share/uno_packages/cache/uno_packages/"" , true ) ; if ( myPath == null || oooPath == null ) { LOGGER . error ( ""Bestimmung der Installationspfade für das WollMux-Paket fehlgeschlagen."" ) ; return wmInstallations ; } findWollMuxInstallations ( wmInstallations , myPath , false ) ; findWollMuxInstallations ( wmInstallations , oooPath , true ) ; if ( oooPathNew != null ) { findWollMuxInstallations ( wmInstallations , oooPathNew , true ) ; } } catch ( NoSuchElementException e ) { } return wmInstallations ; } ","private List < Triple < String , Date , Boolean > > getInstallations ( ) { List < Triple < String , Date , Boolean > > wmInstallations = new ArrayList < > ( ) ; try { XStringSubstitution xSS = UNO . XStringSubstitution ( UnoComponent . createComponentWithContext ( UnoComponent . CSS_UTIL_PATH_SUBSTITUTION ) ) ; String myPath = xSS . substituteVariables ( ""$(user)/uno_packages/cache/uno_packages/"" , true ) ; String oooPath = xSS . substituteVariables ( ""$(inst)/share/uno_packages/cache/uno_packages/"" , true ) ; String oooPathNew = xSS . substituteVariables ( ""$(brandbaseurl)/share/uno_packages/cache/uno_packages/"" , true ) ; if ( myPath == null || oooPath == null ) { LOGGER . error ( ""Bestimmung der Installationspfade für das WollMux-Paket fehlgeschlagen."" ) ; return wmInstallations ; } findWollMuxInstallations ( wmInstallations , myPath , false ) ; findWollMuxInstallations ( wmInstallations , oooPath , true ) ; if ( oooPathNew != null ) { findWollMuxInstallations ( wmInstallations , oooPathNew , true ) ; } } catch ( NoSuchElementException e ) { LOGGER . error ( """" , e ) ; } return wmInstallations ; } " 275,"private PoxPayloadOut createIntakeInstance ( String entryNumber , String entryDate , String depositor ) throws Exception { IntakesCommon intake = new IntakesCommon ( ) ; intake . setEntryNumber ( entryNumber ) ; intake . setEntryDate ( entryDate ) ; DepositorGroupList depositorGroupList = new DepositorGroupList ( ) ; List < DepositorGroup > depositorGroups = depositorGroupList . getDepositorGroup ( ) ; DepositorGroup depositorGroup = new DepositorGroup ( ) ; depositorGroup . setDepositor ( depositor ) ; depositorGroups . add ( depositorGroup ) ; intake . setDepositorGroupList ( depositorGroupList ) ; PoxPayloadOut multipart = new PoxPayloadOut ( IntakeClient . SERVICE_PAYLOAD_NAME ) ; PayloadOutputPart commonPart = multipart . addPart ( intake , MediaType . APPLICATION_XML_TYPE ) ; commonPart . setLabel ( new IntakeClient ( ) . getCommonPartName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( objectAsXmlString ( intake , IntakesCommon . class ) ) ; } return multipart ; } ","private PoxPayloadOut createIntakeInstance ( String entryNumber , String entryDate , String depositor ) throws Exception { IntakesCommon intake = new IntakesCommon ( ) ; intake . setEntryNumber ( entryNumber ) ; intake . setEntryDate ( entryDate ) ; DepositorGroupList depositorGroupList = new DepositorGroupList ( ) ; List < DepositorGroup > depositorGroups = depositorGroupList . getDepositorGroup ( ) ; DepositorGroup depositorGroup = new DepositorGroup ( ) ; depositorGroup . setDepositor ( depositor ) ; depositorGroups . add ( depositorGroup ) ; intake . setDepositorGroupList ( depositorGroupList ) ; PoxPayloadOut multipart = new PoxPayloadOut ( IntakeClient . SERVICE_PAYLOAD_NAME ) ; PayloadOutputPart commonPart = multipart . addPart ( intake , MediaType . APPLICATION_XML_TYPE ) ; commonPart . setLabel ( new IntakeClient ( ) . getCommonPartName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""to be created, intake common"" ) ; logger . debug ( objectAsXmlString ( intake , IntakesCommon . class ) ) ; } return multipart ; } " 276,"private PoxPayloadOut createIntakeInstance ( String entryNumber , String entryDate , String depositor ) throws Exception { IntakesCommon intake = new IntakesCommon ( ) ; intake . setEntryNumber ( entryNumber ) ; intake . setEntryDate ( entryDate ) ; DepositorGroupList depositorGroupList = new DepositorGroupList ( ) ; List < DepositorGroup > depositorGroups = depositorGroupList . getDepositorGroup ( ) ; DepositorGroup depositorGroup = new DepositorGroup ( ) ; depositorGroup . setDepositor ( depositor ) ; depositorGroups . add ( depositorGroup ) ; intake . setDepositorGroupList ( depositorGroupList ) ; PoxPayloadOut multipart = new PoxPayloadOut ( IntakeClient . SERVICE_PAYLOAD_NAME ) ; PayloadOutputPart commonPart = multipart . addPart ( intake , MediaType . APPLICATION_XML_TYPE ) ; commonPart . setLabel ( new IntakeClient ( ) . getCommonPartName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""to be created, intake common"" ) ; } return multipart ; } ","private PoxPayloadOut createIntakeInstance ( String entryNumber , String entryDate , String depositor ) throws Exception { IntakesCommon intake = new IntakesCommon ( ) ; intake . setEntryNumber ( entryNumber ) ; intake . setEntryDate ( entryDate ) ; DepositorGroupList depositorGroupList = new DepositorGroupList ( ) ; List < DepositorGroup > depositorGroups = depositorGroupList . getDepositorGroup ( ) ; DepositorGroup depositorGroup = new DepositorGroup ( ) ; depositorGroup . setDepositor ( depositor ) ; depositorGroups . add ( depositorGroup ) ; intake . setDepositorGroupList ( depositorGroupList ) ; PoxPayloadOut multipart = new PoxPayloadOut ( IntakeClient . SERVICE_PAYLOAD_NAME ) ; PayloadOutputPart commonPart = multipart . addPart ( intake , MediaType . APPLICATION_XML_TYPE ) ; commonPart . setLabel ( new IntakeClient ( ) . getCommonPartName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""to be created, intake common"" ) ; logger . debug ( objectAsXmlString ( intake , IntakesCommon . class ) ) ; } return multipart ; } " 277,"public MbZielobjTypTxt findById ( sernet . gs . reveng . MbZielobjTypTxtId id ) { try { MbZielobjTypTxt instance = ( MbZielobjTypTxt ) sessionFactory . getCurrentSession ( ) . get ( ""sernet.gs.reveng.MbZielobjTypTxt"" , id ) ; if ( instance == null ) { log . debug ( ""get successful, no instance found"" ) ; } else { log . debug ( ""get successful, instance found"" ) ; } return instance ; } catch ( RuntimeException re ) { log . error ( ""get failed"" , re ) ; throw re ; } } ","public MbZielobjTypTxt findById ( sernet . gs . reveng . MbZielobjTypTxtId id ) { log . debug ( ""getting MbZielobjTypTxt instance with id: "" + id ) ; try { MbZielobjTypTxt instance = ( MbZielobjTypTxt ) sessionFactory . getCurrentSession ( ) . get ( ""sernet.gs.reveng.MbZielobjTypTxt"" , id ) ; if ( instance == null ) { log . debug ( ""get successful, no instance found"" ) ; } else { log . debug ( ""get successful, instance found"" ) ; } return instance ; } catch ( RuntimeException re ) { log . error ( ""get failed"" , re ) ; throw re ; } } " 278,"public MbZielobjTypTxt findById ( sernet . gs . reveng . MbZielobjTypTxtId id ) { log . debug ( ""getting MbZielobjTypTxt instance with id: "" + id ) ; try { MbZielobjTypTxt instance = ( MbZielobjTypTxt ) sessionFactory . getCurrentSession ( ) . get ( ""sernet.gs.reveng.MbZielobjTypTxt"" , id ) ; if ( instance == null ) { } else { log . debug ( ""get successful, instance found"" ) ; } return instance ; } catch ( RuntimeException re ) { log . error ( ""get failed"" , re ) ; throw re ; } } ","public MbZielobjTypTxt findById ( sernet . gs . reveng . MbZielobjTypTxtId id ) { log . debug ( ""getting MbZielobjTypTxt instance with id: "" + id ) ; try { MbZielobjTypTxt instance = ( MbZielobjTypTxt ) sessionFactory . getCurrentSession ( ) . get ( ""sernet.gs.reveng.MbZielobjTypTxt"" , id ) ; if ( instance == null ) { log . debug ( ""get successful, no instance found"" ) ; } else { log . debug ( ""get successful, instance found"" ) ; } return instance ; } catch ( RuntimeException re ) { log . error ( ""get failed"" , re ) ; throw re ; } } " 279,"public MbZielobjTypTxt findById ( sernet . gs . reveng . MbZielobjTypTxtId id ) { log . debug ( ""getting MbZielobjTypTxt instance with id: "" + id ) ; try { MbZielobjTypTxt instance = ( MbZielobjTypTxt ) sessionFactory . getCurrentSession ( ) . get ( ""sernet.gs.reveng.MbZielobjTypTxt"" , id ) ; if ( instance == null ) { log . debug ( ""get successful, no instance found"" ) ; } else { } return instance ; } catch ( RuntimeException re ) { log . error ( ""get failed"" , re ) ; throw re ; } } ","public MbZielobjTypTxt findById ( sernet . gs . reveng . MbZielobjTypTxtId id ) { log . debug ( ""getting MbZielobjTypTxt instance with id: "" + id ) ; try { MbZielobjTypTxt instance = ( MbZielobjTypTxt ) sessionFactory . getCurrentSession ( ) . get ( ""sernet.gs.reveng.MbZielobjTypTxt"" , id ) ; if ( instance == null ) { log . debug ( ""get successful, no instance found"" ) ; } else { log . debug ( ""get successful, instance found"" ) ; } return instance ; } catch ( RuntimeException re ) { log . error ( ""get failed"" , re ) ; throw re ; } } " 280,"public MbZielobjTypTxt findById ( sernet . gs . reveng . MbZielobjTypTxtId id ) { log . debug ( ""getting MbZielobjTypTxt instance with id: "" + id ) ; try { MbZielobjTypTxt instance = ( MbZielobjTypTxt ) sessionFactory . getCurrentSession ( ) . get ( ""sernet.gs.reveng.MbZielobjTypTxt"" , id ) ; if ( instance == null ) { log . debug ( ""get successful, no instance found"" ) ; } else { log . debug ( ""get successful, instance found"" ) ; } return instance ; } catch ( RuntimeException re ) { throw re ; } } ","public MbZielobjTypTxt findById ( sernet . gs . reveng . MbZielobjTypTxtId id ) { log . debug ( ""getting MbZielobjTypTxt instance with id: "" + id ) ; try { MbZielobjTypTxt instance = ( MbZielobjTypTxt ) sessionFactory . getCurrentSession ( ) . get ( ""sernet.gs.reveng.MbZielobjTypTxt"" , id ) ; if ( instance == null ) { log . debug ( ""get successful, no instance found"" ) ; } else { log . debug ( ""get successful, instance found"" ) ; } return instance ; } catch ( RuntimeException re ) { log . error ( ""get failed"" , re ) ; throw re ; } } " 281,"public static PublicKey loadPublicKeyFromPem ( String publicPart , String algorithm ) { try { var reader = new StringReader ( publicPart ) ; var readerPem = new PemReader ( reader ) ; var obj = readerPem . readPemObject ( ) ; readerPem . close ( ) ; return KeyFactory . getInstance ( algorithm ) . generatePublic ( new X509EncodedKeySpec ( obj . getContent ( ) ) ) ; } catch ( InvalidKeySpecException | NoSuchAlgorithmException | IOException e ) { return null ; } } ","public static PublicKey loadPublicKeyFromPem ( String publicPart , String algorithm ) { try { var reader = new StringReader ( publicPart ) ; var readerPem = new PemReader ( reader ) ; var obj = readerPem . readPemObject ( ) ; readerPem . close ( ) ; return KeyFactory . getInstance ( algorithm ) . generatePublic ( new X509EncodedKeySpec ( obj . getContent ( ) ) ) ; } catch ( InvalidKeySpecException | NoSuchAlgorithmException | IOException e ) { logger . warn ( ""Exception loading public key from PEM"" , e ) ; return null ; } } " 282,"@ Path ( ""/entity/{entityId}/credential/{credential}/status/{status}"" ) @ PUT public void setCredentialStatus ( @ PathParam ( ""entityId"" ) String entityId , @ PathParam ( ""credential"" ) String credential , @ QueryParam ( ""identityType"" ) String idType , @ PathParam ( ""status"" ) String status ) throws EngineException , JsonProcessingException { LocalCredentialState desiredCredentialState = LocalCredentialState . valueOf ( status ) ; entityCredMan . setEntityCredentialStatus ( getEP ( entityId , idType ) , credential , desiredCredentialState ) ; } ","@ Path ( ""/entity/{entityId}/credential/{credential}/status/{status}"" ) @ PUT public void setCredentialStatus ( @ PathParam ( ""entityId"" ) String entityId , @ PathParam ( ""credential"" ) String credential , @ QueryParam ( ""identityType"" ) String idType , @ PathParam ( ""status"" ) String status ) throws EngineException , JsonProcessingException { log . info ( ""setCredential {} status for {} to {}"" , credential , entityId , status ) ; LocalCredentialState desiredCredentialState = LocalCredentialState . valueOf ( status ) ; entityCredMan . setEntityCredentialStatus ( getEP ( entityId , idType ) , credential , desiredCredentialState ) ; } " 283,"@ Test public void testBbox1 ( ) { Document doc = getAsDOM ( ""wfs?request=GetFeature&version=1.1.0&typename=gsml:MappedFeature&srsName=EPSG:4979&bbox=-200,-200,0,200,200,50"" ) ; assertXpathCount ( 0 , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf1']"" , doc ) ; assertXpathCount ( 1 , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf2']"" , doc ) ; assertXpathCount ( 1 , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf3']"" , doc ) ; assertXpathCount ( 0 , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf4']"" , doc ) ; assertXpathEvaluatesTo ( ""167.9388 -29.0434 7"" , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf2']/gsml:shape/gml:Point/gml:pos"" , doc ) ; assertXpathEvaluatesTo ( ""3"" , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf2']/gsml:shape/gml:Point/@srsDimension"" , doc ) ; assertXpathEvaluatesTo ( ""http://www.opengis.net/gml/srs/epsg.xml#4979"" , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf2']/gsml:shape/gml:Point/@srsName"" , doc ) ; } ","@ Test public void testBbox1 ( ) { Document doc = getAsDOM ( ""wfs?request=GetFeature&version=1.1.0&typename=gsml:MappedFeature&srsName=EPSG:4979&bbox=-200,-200,0,200,200,50"" ) ; LOGGER . info ( ""WFS GetFeature&typename=gsml:MappedFeature response:\n"" + prettyString ( doc ) ) ; assertXpathCount ( 0 , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf1']"" , doc ) ; assertXpathCount ( 1 , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf2']"" , doc ) ; assertXpathCount ( 1 , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf3']"" , doc ) ; assertXpathCount ( 0 , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf4']"" , doc ) ; assertXpathEvaluatesTo ( ""167.9388 -29.0434 7"" , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf2']/gsml:shape/gml:Point/gml:pos"" , doc ) ; assertXpathEvaluatesTo ( ""3"" , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf2']/gsml:shape/gml:Point/@srsDimension"" , doc ) ; assertXpathEvaluatesTo ( ""http://www.opengis.net/gml/srs/epsg.xml#4979"" , ""//gsml:MappedFeature[@gml:id='gsml.mappedfeature.mf2']/gsml:shape/gml:Point/@srsName"" , doc ) ; } " 284,"private ServerConnector createHttpConnector ( Config config ) { final ServerConnector httpConnector = new ServerConnector ( jettyServer , new HttpConnectionFactory ( baseHttpConfig ( ) ) ) ; httpConnector . setPort ( config . getInt ( DrillOnYarnConfig . HTTP_PORT ) ) ; return httpConnector ; } ","private ServerConnector createHttpConnector ( Config config ) { LOG . info ( ""Setting up HTTP connector for web server"" ) ; final ServerConnector httpConnector = new ServerConnector ( jettyServer , new HttpConnectionFactory ( baseHttpConfig ( ) ) ) ; httpConnector . setPort ( config . getInt ( DrillOnYarnConfig . HTTP_PORT ) ) ; return httpConnector ; } " 285,"public FileStatus [ ] listStatus ( Path f ) throws FileNotFoundException , IOException { return listStatus ( f , null ) ; } ","public FileStatus [ ] listStatus ( Path f ) throws FileNotFoundException , IOException { LOG . debug ( ""List status of {}"" , f . toString ( ) ) ; return listStatus ( f , null ) ; } " 286,"public Object addingBundle ( Bundle bundle , BundleEvent event ) { Dictionary < String , String > headers = bundle . getHeaders ( ) ; String name = headers . get ( Constants . DOMAIN_NAME_HEADER ) ; if ( name == null ) { LOGGER . trace ( ""Bundle {} is not a domain, ignoring"" , bundle ) ; return null ; } return registerDomainProvider ( bundle , name ) ; } ","public Object addingBundle ( Bundle bundle , BundleEvent event ) { LOGGER . trace ( ""checking whether Bundle {} is a domain"" , bundle ) ; Dictionary < String , String > headers = bundle . getHeaders ( ) ; String name = headers . get ( Constants . DOMAIN_NAME_HEADER ) ; if ( name == null ) { LOGGER . trace ( ""Bundle {} is not a domain, ignoring"" , bundle ) ; return null ; } return registerDomainProvider ( bundle , name ) ; } " 287,"public Object addingBundle ( Bundle bundle , BundleEvent event ) { LOGGER . trace ( ""checking whether Bundle {} is a domain"" , bundle ) ; Dictionary < String , String > headers = bundle . getHeaders ( ) ; String name = headers . get ( Constants . DOMAIN_NAME_HEADER ) ; if ( name == null ) { return null ; } return registerDomainProvider ( bundle , name ) ; } ","public Object addingBundle ( Bundle bundle , BundleEvent event ) { LOGGER . trace ( ""checking whether Bundle {} is a domain"" , bundle ) ; Dictionary < String , String > headers = bundle . getHeaders ( ) ; String name = headers . get ( Constants . DOMAIN_NAME_HEADER ) ; if ( name == null ) { LOGGER . trace ( ""Bundle {} is not a domain, ignoring"" , bundle ) ; return null ; } return registerDomainProvider ( bundle , name ) ; } " 288,"public void onError ( java . lang . Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TSerializable msg ; removeGroupComputePrefs_result result = new removeGroupComputePrefs_result ( ) ; if ( e instanceof org . apache . airavata . model . error . InvalidRequestException ) { result . ire = ( org . apache . airavata . model . error . InvalidRequestException ) e ; result . setIreIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataClientException ) { result . ace = ( org . apache . airavata . model . error . AiravataClientException ) e ; result . setAceIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataSystemException ) { result . ase = ( org . apache . airavata . model . error . AiravataSystemException ) e ; result . setAseIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AuthorizationException ) { result . ae = ( org . apache . airavata . model . error . AuthorizationException ) e ; result . setAeIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . thrift . transport . TTransportException ) { fb . close ( ) ; return ; } else if ( e instanceof org . apache . thrift . TApplicationException ) { _LOGGER . error ( ""TApplicationException inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TApplicationException ) e ; } else { _LOGGER . error ( ""Exception inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; } try { fcall . sendResponse ( fb , msg , msgType , seqid ) ; } catch ( java . lang . Exception ex ) { _LOGGER . error ( ""Exception writing to internal frame buffer"" , ex ) ; fb . close ( ) ; } } ","public void onError ( java . lang . Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TSerializable msg ; removeGroupComputePrefs_result result = new removeGroupComputePrefs_result ( ) ; if ( e instanceof org . apache . airavata . model . error . InvalidRequestException ) { result . ire = ( org . apache . airavata . model . error . InvalidRequestException ) e ; result . setIreIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataClientException ) { result . ace = ( org . apache . airavata . model . error . AiravataClientException ) e ; result . setAceIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataSystemException ) { result . ase = ( org . apache . airavata . model . error . AiravataSystemException ) e ; result . setAseIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AuthorizationException ) { result . ae = ( org . apache . airavata . model . error . AuthorizationException ) e ; result . setAeIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . thrift . transport . TTransportException ) { _LOGGER . error ( ""TTransportException inside handler"" , e ) ; fb . close ( ) ; return ; } else if ( e instanceof org . apache . thrift . TApplicationException ) { _LOGGER . error ( ""TApplicationException inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TApplicationException ) e ; } else { _LOGGER . error ( ""Exception inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; } try { fcall . sendResponse ( fb , msg , msgType , seqid ) ; } catch ( java . lang . Exception ex ) { _LOGGER . error ( ""Exception writing to internal frame buffer"" , ex ) ; fb . close ( ) ; } } " 289,"public void onError ( java . lang . Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TSerializable msg ; removeGroupComputePrefs_result result = new removeGroupComputePrefs_result ( ) ; if ( e instanceof org . apache . airavata . model . error . InvalidRequestException ) { result . ire = ( org . apache . airavata . model . error . InvalidRequestException ) e ; result . setIreIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataClientException ) { result . ace = ( org . apache . airavata . model . error . AiravataClientException ) e ; result . setAceIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataSystemException ) { result . ase = ( org . apache . airavata . model . error . AiravataSystemException ) e ; result . setAseIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AuthorizationException ) { result . ae = ( org . apache . airavata . model . error . AuthorizationException ) e ; result . setAeIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . thrift . transport . TTransportException ) { _LOGGER . error ( ""TTransportException inside handler"" , e ) ; fb . close ( ) ; return ; } else if ( e instanceof org . apache . thrift . TApplicationException ) { msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TApplicationException ) e ; } else { _LOGGER . error ( ""Exception inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; } try { fcall . sendResponse ( fb , msg , msgType , seqid ) ; } catch ( java . lang . Exception ex ) { _LOGGER . error ( ""Exception writing to internal frame buffer"" , ex ) ; fb . close ( ) ; } } ","public void onError ( java . lang . Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TSerializable msg ; removeGroupComputePrefs_result result = new removeGroupComputePrefs_result ( ) ; if ( e instanceof org . apache . airavata . model . error . InvalidRequestException ) { result . ire = ( org . apache . airavata . model . error . InvalidRequestException ) e ; result . setIreIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataClientException ) { result . ace = ( org . apache . airavata . model . error . AiravataClientException ) e ; result . setAceIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataSystemException ) { result . ase = ( org . apache . airavata . model . error . AiravataSystemException ) e ; result . setAseIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AuthorizationException ) { result . ae = ( org . apache . airavata . model . error . AuthorizationException ) e ; result . setAeIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . thrift . transport . TTransportException ) { _LOGGER . error ( ""TTransportException inside handler"" , e ) ; fb . close ( ) ; return ; } else if ( e instanceof org . apache . thrift . TApplicationException ) { _LOGGER . error ( ""TApplicationException inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TApplicationException ) e ; } else { _LOGGER . error ( ""Exception inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; } try { fcall . sendResponse ( fb , msg , msgType , seqid ) ; } catch ( java . lang . Exception ex ) { _LOGGER . error ( ""Exception writing to internal frame buffer"" , ex ) ; fb . close ( ) ; } } " 290,"public void onError ( java . lang . Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TSerializable msg ; removeGroupComputePrefs_result result = new removeGroupComputePrefs_result ( ) ; if ( e instanceof org . apache . airavata . model . error . InvalidRequestException ) { result . ire = ( org . apache . airavata . model . error . InvalidRequestException ) e ; result . setIreIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataClientException ) { result . ace = ( org . apache . airavata . model . error . AiravataClientException ) e ; result . setAceIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataSystemException ) { result . ase = ( org . apache . airavata . model . error . AiravataSystemException ) e ; result . setAseIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AuthorizationException ) { result . ae = ( org . apache . airavata . model . error . AuthorizationException ) e ; result . setAeIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . thrift . transport . TTransportException ) { _LOGGER . error ( ""TTransportException inside handler"" , e ) ; fb . close ( ) ; return ; } else if ( e instanceof org . apache . thrift . TApplicationException ) { _LOGGER . error ( ""TApplicationException inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TApplicationException ) e ; } else { msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; } try { fcall . sendResponse ( fb , msg , msgType , seqid ) ; } catch ( java . lang . Exception ex ) { _LOGGER . error ( ""Exception writing to internal frame buffer"" , ex ) ; fb . close ( ) ; } } ","public void onError ( java . lang . Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TSerializable msg ; removeGroupComputePrefs_result result = new removeGroupComputePrefs_result ( ) ; if ( e instanceof org . apache . airavata . model . error . InvalidRequestException ) { result . ire = ( org . apache . airavata . model . error . InvalidRequestException ) e ; result . setIreIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataClientException ) { result . ace = ( org . apache . airavata . model . error . AiravataClientException ) e ; result . setAceIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataSystemException ) { result . ase = ( org . apache . airavata . model . error . AiravataSystemException ) e ; result . setAseIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AuthorizationException ) { result . ae = ( org . apache . airavata . model . error . AuthorizationException ) e ; result . setAeIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . thrift . transport . TTransportException ) { _LOGGER . error ( ""TTransportException inside handler"" , e ) ; fb . close ( ) ; return ; } else if ( e instanceof org . apache . thrift . TApplicationException ) { _LOGGER . error ( ""TApplicationException inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TApplicationException ) e ; } else { _LOGGER . error ( ""Exception inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; } try { fcall . sendResponse ( fb , msg , msgType , seqid ) ; } catch ( java . lang . Exception ex ) { _LOGGER . error ( ""Exception writing to internal frame buffer"" , ex ) ; fb . close ( ) ; } } " 291,"public void onError ( java . lang . Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TSerializable msg ; removeGroupComputePrefs_result result = new removeGroupComputePrefs_result ( ) ; if ( e instanceof org . apache . airavata . model . error . InvalidRequestException ) { result . ire = ( org . apache . airavata . model . error . InvalidRequestException ) e ; result . setIreIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataClientException ) { result . ace = ( org . apache . airavata . model . error . AiravataClientException ) e ; result . setAceIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataSystemException ) { result . ase = ( org . apache . airavata . model . error . AiravataSystemException ) e ; result . setAseIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AuthorizationException ) { result . ae = ( org . apache . airavata . model . error . AuthorizationException ) e ; result . setAeIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . thrift . transport . TTransportException ) { _LOGGER . error ( ""TTransportException inside handler"" , e ) ; fb . close ( ) ; return ; } else if ( e instanceof org . apache . thrift . TApplicationException ) { _LOGGER . error ( ""TApplicationException inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TApplicationException ) e ; } else { _LOGGER . error ( ""Exception inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; } try { fcall . sendResponse ( fb , msg , msgType , seqid ) ; } catch ( java . lang . Exception ex ) { fb . close ( ) ; } } ","public void onError ( java . lang . Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TSerializable msg ; removeGroupComputePrefs_result result = new removeGroupComputePrefs_result ( ) ; if ( e instanceof org . apache . airavata . model . error . InvalidRequestException ) { result . ire = ( org . apache . airavata . model . error . InvalidRequestException ) e ; result . setIreIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataClientException ) { result . ace = ( org . apache . airavata . model . error . AiravataClientException ) e ; result . setAceIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AiravataSystemException ) { result . ase = ( org . apache . airavata . model . error . AiravataSystemException ) e ; result . setAseIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . airavata . model . error . AuthorizationException ) { result . ae = ( org . apache . airavata . model . error . AuthorizationException ) e ; result . setAeIsSet ( true ) ; msg = result ; } else if ( e instanceof org . apache . thrift . transport . TTransportException ) { _LOGGER . error ( ""TTransportException inside handler"" , e ) ; fb . close ( ) ; return ; } else if ( e instanceof org . apache . thrift . TApplicationException ) { _LOGGER . error ( ""TApplicationException inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TApplicationException ) e ; } else { _LOGGER . error ( ""Exception inside handler"" , e ) ; msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; } try { fcall . sendResponse ( fb , msg , msgType , seqid ) ; } catch ( java . lang . Exception ex ) { _LOGGER . error ( ""Exception writing to internal frame buffer"" , ex ) ; fb . close ( ) ; } } " 292,"private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } ","private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } " 293,"private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } ","private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } " 294,"private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } ","private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } " 295,"private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } ","private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } " 296,"private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } ","private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } " 297,"private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } ","private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } " 298,"private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } ","private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } " 299,"private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { } return geocodedAddresses ; } ","private ArrayList < GeocodedAddress > getGeocodedAddresses ( String url ) { ArrayList < GeocodedAddress > geocodedAddresses = new ArrayList < > ( ) ; String json = """" ; try { json = UrlRequest . getResponseFromUrl ( url ) ; if ( json != null ) { JsonNode jsonNode = objectMapper . readTree ( json ) ; String status = jsonNode . get ( ""info"" ) . get ( ""statuscode"" ) . asText ( ) ; if ( status != ""0"" ) { logger . debug ( ""MapQuest statuscode: "" + status ) ; logger . error ( ""MapQuest messages "" + jsonNode . get ( ""info"" ) . get ( ""messages"" ) ) ; return geocodedAddresses ; } JsonNode jsonResults = jsonNode . get ( ""results"" ) ; int numResults = jsonResults . size ( ) ; for ( int j = 0 ; j < numResults ; j ++ ) { try { JsonNode location = jsonResults . get ( j ) . get ( ""locations"" ) . get ( 0 ) ; geocodedAddresses . add ( getGeocodedAddressFromLocationNode ( location ) ) ; } catch ( Exception ex ) { logger . warn ( ""Error retrieving GeocodedAddress from MapQuest response "" + json , ex ) ; geocodedAddresses . add ( new GeocodedAddress ( ) ) ; } } } return geocodedAddresses ; } catch ( MalformedURLException ex ) { logger . error ( ""Malformed MapQuest url!"" , ex ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( ""UTF-8 Unsupported?!"" , ex ) ; } catch ( IOException ex ) { logger . error ( ""Error opening API resource! "" + ex . toString ( ) + "" Response: "" + json ) ; } catch ( NullPointerException ex ) { logger . error ( ""MapQuest response was not formatted correctly. Response: "" + json , ex ) ; } catch ( Exception ex ) { logger . error ( """" + ex ) ; } return geocodedAddresses ; } " 300,"private void detectConflictingRoutes ( Map < RouteMatcher , MethodInfo > matchers ) { if ( matchers . isEmpty ( ) ) { return ; } Set < LinkedHashSet < RouteMatcher > > groups = new HashSet < > ( ) ; for ( Iterator < Entry < RouteMatcher , MethodInfo > > iterator = matchers . entrySet ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { Entry < RouteMatcher , MethodInfo > entry = iterator . next ( ) ; LinkedHashSet < RouteMatcher > group = new LinkedHashSet < > ( ) ; group . add ( entry . getKey ( ) ) ; matchers . entrySet ( ) . stream ( ) . filter ( e -> { if ( e . getKey ( ) . equals ( entry . getKey ( ) ) ) { return false ; } if ( e . getValue ( ) . equals ( entry . getValue ( ) ) ) { return false ; } if ( e . getKey ( ) . getOrder ( ) != entry . getKey ( ) . getOrder ( ) ) { return false ; } return canMatchSameRequest ( entry . getKey ( ) , e . getKey ( ) ) ; } ) . map ( Entry :: getKey ) . forEach ( group :: add ) ; groups . add ( group ) ; } boolean conflictExists = false ; for ( Set < RouteMatcher > group : groups ) { if ( group . size ( ) > 1 ) { Iterator < RouteMatcher > it = group . iterator ( ) ; RouteMatcher firstMatcher = it . next ( ) ; MethodInfo firstMethod = matchers . get ( firstMatcher ) ; conflictExists = true ; StringBuilder conflictingRoutes = new StringBuilder ( ) ; while ( it . hasNext ( ) ) { RouteMatcher rm = it . next ( ) ; MethodInfo method = matchers . get ( rm ) ; conflictingRoutes . append ( ""\n\t- "" ) . append ( method . declaringClass ( ) . name ( ) . toString ( ) ) . append ( ""#"" ) . append ( method . name ( ) ) . append ( ""()"" ) ; } LOGGER . warnf ( ""Route %s#%s() can match the same request and has the same order [%s] as:%s"" , firstMethod . declaringClass ( ) . name ( ) , firstMethod . name ( ) , firstMatcher . getOrder ( ) , conflictingRoutes ) ; } } if ( conflictExists ) { } } ","private void detectConflictingRoutes ( Map < RouteMatcher , MethodInfo > matchers ) { if ( matchers . isEmpty ( ) ) { return ; } Set < LinkedHashSet < RouteMatcher > > groups = new HashSet < > ( ) ; for ( Iterator < Entry < RouteMatcher , MethodInfo > > iterator = matchers . entrySet ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { Entry < RouteMatcher , MethodInfo > entry = iterator . next ( ) ; LinkedHashSet < RouteMatcher > group = new LinkedHashSet < > ( ) ; group . add ( entry . getKey ( ) ) ; matchers . entrySet ( ) . stream ( ) . filter ( e -> { if ( e . getKey ( ) . equals ( entry . getKey ( ) ) ) { return false ; } if ( e . getValue ( ) . equals ( entry . getValue ( ) ) ) { return false ; } if ( e . getKey ( ) . getOrder ( ) != entry . getKey ( ) . getOrder ( ) ) { return false ; } return canMatchSameRequest ( entry . getKey ( ) , e . getKey ( ) ) ; } ) . map ( Entry :: getKey ) . forEach ( group :: add ) ; groups . add ( group ) ; } boolean conflictExists = false ; for ( Set < RouteMatcher > group : groups ) { if ( group . size ( ) > 1 ) { Iterator < RouteMatcher > it = group . iterator ( ) ; RouteMatcher firstMatcher = it . next ( ) ; MethodInfo firstMethod = matchers . get ( firstMatcher ) ; conflictExists = true ; StringBuilder conflictingRoutes = new StringBuilder ( ) ; while ( it . hasNext ( ) ) { RouteMatcher rm = it . next ( ) ; MethodInfo method = matchers . get ( rm ) ; conflictingRoutes . append ( ""\n\t- "" ) . append ( method . declaringClass ( ) . name ( ) . toString ( ) ) . append ( ""#"" ) . append ( method . name ( ) ) . append ( ""()"" ) ; } LOGGER . warnf ( ""Route %s#%s() can match the same request and has the same order [%s] as:%s"" , firstMethod . declaringClass ( ) . name ( ) , firstMethod . name ( ) , firstMatcher . getOrder ( ) , conflictingRoutes ) ; } } if ( conflictExists ) { LOGGER . warn ( ""You can use @Route#order() to ensure the routes are not executed in random order"" ) ; } } " 301,"private boolean parseStandardNoSeparator ( boolean isLatitude , String locStr ) { boolean isLikelyValue = false ; String toParse = locStr ; if ( toParse . length ( ) > 5 ) { if ( toParse . contains ( ""."" ) ) { toParse = toParse . split ( ""\\."" ) [ 0 ] ; } try { if ( isLatitude ) { int locValue = Integer . parseInt ( toParse . substring ( 0 , 2 ) ) ; if ( locValue >= 0 && locValue <= 90 && validateMinSecValue ( toParse . substring ( 2 , 4 ) ) && validateMinSecValue ( toParse . substring ( 4 , 6 ) ) ) { isLikelyValue = true ; myConfidence = 1.0f ; } } else { int locValue = - 1 ; String minStr = null ; String secStr = null ; if ( toParse . length ( ) == 6 ) { locValue = Integer . parseInt ( toParse . substring ( 0 , 2 ) ) ; minStr = toParse . substring ( 2 , 3 ) ; secStr = toParse . substring ( 4 ) ; } else if ( toParse . length ( ) == 7 ) { locValue = Integer . parseInt ( toParse . substring ( 0 , 3 ) ) ; minStr = toParse . substring ( 3 , 5 ) ; secStr = toParse . substring ( 5 ) ; } if ( locValue >= 0 && locValue <= 180 && validateMinSecValue ( minStr ) && validateMinSecValue ( secStr ) ) { isLikelyValue = true ; myConfidence = 1.0f ; } } } catch ( NumberFormatException e ) { if ( LOGGER . isDebugEnabled ( ) ) { } } catch ( PatternSyntaxException e ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Error validating standard format DMS pattern."" , e ) ; } } } return isLikelyValue ; } ","private boolean parseStandardNoSeparator ( boolean isLatitude , String locStr ) { boolean isLikelyValue = false ; String toParse = locStr ; if ( toParse . length ( ) > 5 ) { if ( toParse . contains ( ""."" ) ) { toParse = toParse . split ( ""\\."" ) [ 0 ] ; } try { if ( isLatitude ) { int locValue = Integer . parseInt ( toParse . substring ( 0 , 2 ) ) ; if ( locValue >= 0 && locValue <= 90 && validateMinSecValue ( toParse . substring ( 2 , 4 ) ) && validateMinSecValue ( toParse . substring ( 4 , 6 ) ) ) { isLikelyValue = true ; myConfidence = 1.0f ; } } else { int locValue = - 1 ; String minStr = null ; String secStr = null ; if ( toParse . length ( ) == 6 ) { locValue = Integer . parseInt ( toParse . substring ( 0 , 2 ) ) ; minStr = toParse . substring ( 2 , 3 ) ; secStr = toParse . substring ( 4 ) ; } else if ( toParse . length ( ) == 7 ) { locValue = Integer . parseInt ( toParse . substring ( 0 , 3 ) ) ; minStr = toParse . substring ( 3 , 5 ) ; secStr = toParse . substring ( 5 ) ; } if ( locValue >= 0 && locValue <= 180 && validateMinSecValue ( minStr ) && validateMinSecValue ( secStr ) ) { isLikelyValue = true ; myConfidence = 1.0f ; } } } catch ( NumberFormatException e ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Error validating standard format DMS string."" , e ) ; } } catch ( PatternSyntaxException e ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Error validating standard format DMS pattern."" , e ) ; } } } return isLikelyValue ; } " 302,"private boolean parseStandardNoSeparator ( boolean isLatitude , String locStr ) { boolean isLikelyValue = false ; String toParse = locStr ; if ( toParse . length ( ) > 5 ) { if ( toParse . contains ( ""."" ) ) { toParse = toParse . split ( ""\\."" ) [ 0 ] ; } try { if ( isLatitude ) { int locValue = Integer . parseInt ( toParse . substring ( 0 , 2 ) ) ; if ( locValue >= 0 && locValue <= 90 && validateMinSecValue ( toParse . substring ( 2 , 4 ) ) && validateMinSecValue ( toParse . substring ( 4 , 6 ) ) ) { isLikelyValue = true ; myConfidence = 1.0f ; } } else { int locValue = - 1 ; String minStr = null ; String secStr = null ; if ( toParse . length ( ) == 6 ) { locValue = Integer . parseInt ( toParse . substring ( 0 , 2 ) ) ; minStr = toParse . substring ( 2 , 3 ) ; secStr = toParse . substring ( 4 ) ; } else if ( toParse . length ( ) == 7 ) { locValue = Integer . parseInt ( toParse . substring ( 0 , 3 ) ) ; minStr = toParse . substring ( 3 , 5 ) ; secStr = toParse . substring ( 5 ) ; } if ( locValue >= 0 && locValue <= 180 && validateMinSecValue ( minStr ) && validateMinSecValue ( secStr ) ) { isLikelyValue = true ; myConfidence = 1.0f ; } } } catch ( NumberFormatException e ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Error validating standard format DMS string."" , e ) ; } } catch ( PatternSyntaxException e ) { if ( LOGGER . isDebugEnabled ( ) ) { } } } return isLikelyValue ; } ","private boolean parseStandardNoSeparator ( boolean isLatitude , String locStr ) { boolean isLikelyValue = false ; String toParse = locStr ; if ( toParse . length ( ) > 5 ) { if ( toParse . contains ( ""."" ) ) { toParse = toParse . split ( ""\\."" ) [ 0 ] ; } try { if ( isLatitude ) { int locValue = Integer . parseInt ( toParse . substring ( 0 , 2 ) ) ; if ( locValue >= 0 && locValue <= 90 && validateMinSecValue ( toParse . substring ( 2 , 4 ) ) && validateMinSecValue ( toParse . substring ( 4 , 6 ) ) ) { isLikelyValue = true ; myConfidence = 1.0f ; } } else { int locValue = - 1 ; String minStr = null ; String secStr = null ; if ( toParse . length ( ) == 6 ) { locValue = Integer . parseInt ( toParse . substring ( 0 , 2 ) ) ; minStr = toParse . substring ( 2 , 3 ) ; secStr = toParse . substring ( 4 ) ; } else if ( toParse . length ( ) == 7 ) { locValue = Integer . parseInt ( toParse . substring ( 0 , 3 ) ) ; minStr = toParse . substring ( 3 , 5 ) ; secStr = toParse . substring ( 5 ) ; } if ( locValue >= 0 && locValue <= 180 && validateMinSecValue ( minStr ) && validateMinSecValue ( secStr ) ) { isLikelyValue = true ; myConfidence = 1.0f ; } } } catch ( NumberFormatException e ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Error validating standard format DMS string."" , e ) ; } } catch ( PatternSyntaxException e ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""Error validating standard format DMS pattern."" , e ) ; } } } return isLikelyValue ; } " 303,"private ArrayList < BufferedImage > getImages ( String channelId ) { ArrayList < BufferedImage > images = new ArrayList < > ( ) ; Integer numberOfImages = config . montageNumImages ; if ( numberOfImages != null ) { for ( int imageNumber = 1 ; imageNumber <= numberOfImages ; imageNumber ++ ) { DoorbirdImage historyImage = CHANNEL_DOORBELL_IMAGE_MONTAGE . equals ( channelId ) ? api . downloadDoorbellHistoryImage ( String . valueOf ( imageNumber ) ) : api . downloadMotionHistoryImage ( String . valueOf ( imageNumber ) ) ; if ( historyImage != null ) { RawType image = historyImage . getImage ( ) ; if ( image != null ) { try { BufferedImage i = ImageIO . read ( new ByteArrayInputStream ( image . getBytes ( ) ) ) ; images . add ( i ) ; } catch ( IOException e ) { logger . debug ( ""IOException creating BufferedImage from downloaded image: {}"" , e . getMessage ( ) ) ; } } } } if ( images . size ( ) < numberOfImages ) { logger . debug ( ""Some images could not be downloaded: wanted={}, actual={}"" , numberOfImages , images . size ( ) ) ; } } return images ; } ","private ArrayList < BufferedImage > getImages ( String channelId ) { ArrayList < BufferedImage > images = new ArrayList < > ( ) ; Integer numberOfImages = config . montageNumImages ; if ( numberOfImages != null ) { for ( int imageNumber = 1 ; imageNumber <= numberOfImages ; imageNumber ++ ) { logger . trace ( ""Downloading montage image {} for channel '{}'"" , imageNumber , channelId ) ; DoorbirdImage historyImage = CHANNEL_DOORBELL_IMAGE_MONTAGE . equals ( channelId ) ? api . downloadDoorbellHistoryImage ( String . valueOf ( imageNumber ) ) : api . downloadMotionHistoryImage ( String . valueOf ( imageNumber ) ) ; if ( historyImage != null ) { RawType image = historyImage . getImage ( ) ; if ( image != null ) { try { BufferedImage i = ImageIO . read ( new ByteArrayInputStream ( image . getBytes ( ) ) ) ; images . add ( i ) ; } catch ( IOException e ) { logger . debug ( ""IOException creating BufferedImage from downloaded image: {}"" , e . getMessage ( ) ) ; } } } } if ( images . size ( ) < numberOfImages ) { logger . debug ( ""Some images could not be downloaded: wanted={}, actual={}"" , numberOfImages , images . size ( ) ) ; } } return images ; } " 304,"private ArrayList < BufferedImage > getImages ( String channelId ) { ArrayList < BufferedImage > images = new ArrayList < > ( ) ; Integer numberOfImages = config . montageNumImages ; if ( numberOfImages != null ) { for ( int imageNumber = 1 ; imageNumber <= numberOfImages ; imageNumber ++ ) { logger . trace ( ""Downloading montage image {} for channel '{}'"" , imageNumber , channelId ) ; DoorbirdImage historyImage = CHANNEL_DOORBELL_IMAGE_MONTAGE . equals ( channelId ) ? api . downloadDoorbellHistoryImage ( String . valueOf ( imageNumber ) ) : api . downloadMotionHistoryImage ( String . valueOf ( imageNumber ) ) ; if ( historyImage != null ) { RawType image = historyImage . getImage ( ) ; if ( image != null ) { try { BufferedImage i = ImageIO . read ( new ByteArrayInputStream ( image . getBytes ( ) ) ) ; images . add ( i ) ; } catch ( IOException e ) { } } } } if ( images . size ( ) < numberOfImages ) { logger . debug ( ""Some images could not be downloaded: wanted={}, actual={}"" , numberOfImages , images . size ( ) ) ; } } return images ; } ","private ArrayList < BufferedImage > getImages ( String channelId ) { ArrayList < BufferedImage > images = new ArrayList < > ( ) ; Integer numberOfImages = config . montageNumImages ; if ( numberOfImages != null ) { for ( int imageNumber = 1 ; imageNumber <= numberOfImages ; imageNumber ++ ) { logger . trace ( ""Downloading montage image {} for channel '{}'"" , imageNumber , channelId ) ; DoorbirdImage historyImage = CHANNEL_DOORBELL_IMAGE_MONTAGE . equals ( channelId ) ? api . downloadDoorbellHistoryImage ( String . valueOf ( imageNumber ) ) : api . downloadMotionHistoryImage ( String . valueOf ( imageNumber ) ) ; if ( historyImage != null ) { RawType image = historyImage . getImage ( ) ; if ( image != null ) { try { BufferedImage i = ImageIO . read ( new ByteArrayInputStream ( image . getBytes ( ) ) ) ; images . add ( i ) ; } catch ( IOException e ) { logger . debug ( ""IOException creating BufferedImage from downloaded image: {}"" , e . getMessage ( ) ) ; } } } } if ( images . size ( ) < numberOfImages ) { logger . debug ( ""Some images could not be downloaded: wanted={}, actual={}"" , numberOfImages , images . size ( ) ) ; } } return images ; } " 305,"private ArrayList < BufferedImage > getImages ( String channelId ) { ArrayList < BufferedImage > images = new ArrayList < > ( ) ; Integer numberOfImages = config . montageNumImages ; if ( numberOfImages != null ) { for ( int imageNumber = 1 ; imageNumber <= numberOfImages ; imageNumber ++ ) { logger . trace ( ""Downloading montage image {} for channel '{}'"" , imageNumber , channelId ) ; DoorbirdImage historyImage = CHANNEL_DOORBELL_IMAGE_MONTAGE . equals ( channelId ) ? api . downloadDoorbellHistoryImage ( String . valueOf ( imageNumber ) ) : api . downloadMotionHistoryImage ( String . valueOf ( imageNumber ) ) ; if ( historyImage != null ) { RawType image = historyImage . getImage ( ) ; if ( image != null ) { try { BufferedImage i = ImageIO . read ( new ByteArrayInputStream ( image . getBytes ( ) ) ) ; images . add ( i ) ; } catch ( IOException e ) { logger . debug ( ""IOException creating BufferedImage from downloaded image: {}"" , e . getMessage ( ) ) ; } } } } if ( images . size ( ) < numberOfImages ) { } } return images ; } ","private ArrayList < BufferedImage > getImages ( String channelId ) { ArrayList < BufferedImage > images = new ArrayList < > ( ) ; Integer numberOfImages = config . montageNumImages ; if ( numberOfImages != null ) { for ( int imageNumber = 1 ; imageNumber <= numberOfImages ; imageNumber ++ ) { logger . trace ( ""Downloading montage image {} for channel '{}'"" , imageNumber , channelId ) ; DoorbirdImage historyImage = CHANNEL_DOORBELL_IMAGE_MONTAGE . equals ( channelId ) ? api . downloadDoorbellHistoryImage ( String . valueOf ( imageNumber ) ) : api . downloadMotionHistoryImage ( String . valueOf ( imageNumber ) ) ; if ( historyImage != null ) { RawType image = historyImage . getImage ( ) ; if ( image != null ) { try { BufferedImage i = ImageIO . read ( new ByteArrayInputStream ( image . getBytes ( ) ) ) ; images . add ( i ) ; } catch ( IOException e ) { logger . debug ( ""IOException creating BufferedImage from downloaded image: {}"" , e . getMessage ( ) ) ; } } } } if ( images . size ( ) < numberOfImages ) { logger . debug ( ""Some images could not be downloaded: wanted={}, actual={}"" , numberOfImages , images . size ( ) ) ; } } return images ; } " 306,"private static void initialize ( ) { try { URL . setURLStreamHandlerFactory ( new FsUrlStreamHandlerFactory ( ) ) ; } catch ( final Error factoryError ) { String type = """" ; Field f = null ; try { f = URL . class . getDeclaredField ( ""factory"" ) ; } catch ( final NoSuchFieldException e ) { LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to; additionally unable to discover type of Factory"" , e ) ; throw ( factoryError ) ; } f . setAccessible ( true ) ; Object o ; try { o = f . get ( null ) ; } catch ( final IllegalAccessException e ) { LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to; additionally unable to discover type of Factory"" , e ) ; throw ( factoryError ) ; } if ( o instanceof FsUrlStreamHandlerFactory ) { return ; } else { type = o . getClass ( ) . getCanonicalName ( ) ; } LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to: "" + type ) ; throw ( factoryError ) ; } } ","private static void initialize ( ) { try { URL . setURLStreamHandlerFactory ( new FsUrlStreamHandlerFactory ( ) ) ; } catch ( final Error factoryError ) { String type = """" ; Field f = null ; try { f = URL . class . getDeclaredField ( ""factory"" ) ; } catch ( final NoSuchFieldException e ) { LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to; additionally unable to discover type of Factory"" , e ) ; throw ( factoryError ) ; } f . setAccessible ( true ) ; Object o ; try { o = f . get ( null ) ; } catch ( final IllegalAccessException e ) { LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to; additionally unable to discover type of Factory"" , e ) ; throw ( factoryError ) ; } if ( o instanceof FsUrlStreamHandlerFactory ) { LOGGER . info ( ""setURLStreamHandlerFactory already set on this JVM to FsUrlStreamHandlerFactory. Nothing to do"" ) ; return ; } else { type = o . getClass ( ) . getCanonicalName ( ) ; } LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to: "" + type ) ; throw ( factoryError ) ; } } " 307,"private static void initialize ( ) { try { URL . setURLStreamHandlerFactory ( new FsUrlStreamHandlerFactory ( ) ) ; } catch ( final Error factoryError ) { String type = """" ; Field f = null ; try { f = URL . class . getDeclaredField ( ""factory"" ) ; } catch ( final NoSuchFieldException e ) { LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to; additionally unable to discover type of Factory"" , e ) ; throw ( factoryError ) ; } f . setAccessible ( true ) ; Object o ; try { o = f . get ( null ) ; } catch ( final IllegalAccessException e ) { LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to; additionally unable to discover type of Factory"" , e ) ; throw ( factoryError ) ; } if ( o instanceof FsUrlStreamHandlerFactory ) { LOGGER . info ( ""setURLStreamHandlerFactory already set on this JVM to FsUrlStreamHandlerFactory. Nothing to do"" ) ; return ; } else { type = o . getClass ( ) . getCanonicalName ( ) ; } throw ( factoryError ) ; } } ","private static void initialize ( ) { try { URL . setURLStreamHandlerFactory ( new FsUrlStreamHandlerFactory ( ) ) ; } catch ( final Error factoryError ) { String type = """" ; Field f = null ; try { f = URL . class . getDeclaredField ( ""factory"" ) ; } catch ( final NoSuchFieldException e ) { LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to; additionally unable to discover type of Factory"" , e ) ; throw ( factoryError ) ; } f . setAccessible ( true ) ; Object o ; try { o = f . get ( null ) ; } catch ( final IllegalAccessException e ) { LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to; additionally unable to discover type of Factory"" , e ) ; throw ( factoryError ) ; } if ( o instanceof FsUrlStreamHandlerFactory ) { LOGGER . info ( ""setURLStreamHandlerFactory already set on this JVM to FsUrlStreamHandlerFactory. Nothing to do"" ) ; return ; } else { type = o . getClass ( ) . getCanonicalName ( ) ; } LOGGER . error ( ""URL.setURLStreamHandlerFactory() can only be called once per JVM instance, and currently something has set it to: "" + type ) ; throw ( factoryError ) ; } } " 308,"public boolean isEmpty ( ) { return atomContainerCount == 0 ; } ","public boolean isEmpty ( ) { logger . debug ( ""Checking if the atom container set empty: "" , atomContainerCount == 0 ) ; return atomContainerCount == 0 ; } " 309,"public synchronized void triggerTimeout ( final long timeout , final boolean causedBySession ) { final Future < ? > f = sessionFuture . get ( ) ; if ( f != null && ! f . isDone ( ) ) { if ( closeReason . compareAndSet ( null , causedBySession ? CloseReason . SESSION_TIMEOUT : CloseReason . REQUEST_TIMEOUT ) ) { actualTimeoutLengthWhenClosed = timeout ; if ( causedBySession || ! sessionIdOnRequest ) cancel ( true ) ; else { if ( sessionThread != null ) { sessionThread . interrupt ( ) ; } else { } } } } } ","public synchronized void triggerTimeout ( final long timeout , final boolean causedBySession ) { final Future < ? > f = sessionFuture . get ( ) ; if ( f != null && ! f . isDone ( ) ) { if ( closeReason . compareAndSet ( null , causedBySession ? CloseReason . SESSION_TIMEOUT : CloseReason . REQUEST_TIMEOUT ) ) { actualTimeoutLengthWhenClosed = timeout ; if ( causedBySession || ! sessionIdOnRequest ) cancel ( true ) ; else { if ( sessionThread != null ) { sessionThread . interrupt ( ) ; } else { logger . debug ( ""{} is a {} which is not interruptable as the thread running the session has not "" + ""been set - please check the implementation if this is not desirable"" , sessionId , this . getClass ( ) . getSimpleName ( ) ) ; } } } } } " 310,"protected void onStop ( ) { setPollingWait ( - 1 ) ; } ","protected void onStop ( ) { LOG . info ( ""Twilight plugin stopped "" ) ; setPollingWait ( - 1 ) ; } " 311,"@ Test public void testExecuteFailure ( ) throws Exception { String command = getJavaCommand ( ) + "" org.springframework.batch.sample.tasklet.UnknownClass"" ; tasklet . setCommand ( command ) ; tasklet . setTimeout ( 200L ) ; tasklet . afterPropertiesSet ( ) ; try { StepContribution contribution = stepExecution . createStepContribution ( ) ; RepeatStatus exitStatus = tasklet . execute ( contribution , null ) ; assertEquals ( RepeatStatus . FINISHED , exitStatus ) ; assertEquals ( ExitStatus . FAILED , contribution . getExitStatus ( ) ) ; } catch ( RuntimeException e ) { assertEquals ( ""Execution of system command did not finish within the timeout"" , e . getMessage ( ) ) ; } } ","@ Test public void testExecuteFailure ( ) throws Exception { String command = getJavaCommand ( ) + "" org.springframework.batch.sample.tasklet.UnknownClass"" ; tasklet . setCommand ( command ) ; tasklet . setTimeout ( 200L ) ; tasklet . afterPropertiesSet ( ) ; log . info ( ""Executing command: "" + command ) ; try { StepContribution contribution = stepExecution . createStepContribution ( ) ; RepeatStatus exitStatus = tasklet . execute ( contribution , null ) ; assertEquals ( RepeatStatus . FINISHED , exitStatus ) ; assertEquals ( ExitStatus . FAILED , contribution . getExitStatus ( ) ) ; } catch ( RuntimeException e ) { assertEquals ( ""Execution of system command did not finish within the timeout"" , e . getMessage ( ) ) ; } } " 312,"public void run ( ) { try { } catch ( MatchManagerException e ) { logger . error ( ""Error while processing scheduled MatchManager scheduled task.."" ) ; logger . error ( ""error"" , e ) ; } } ","public void run ( ) { try { logger . info ( ""Processing schedule MatchManagerTask..."" + matchManager . processEvent ( null , IMatchManager . Event . SCHEDULED_EVENT ) ) ; } catch ( MatchManagerException e ) { logger . error ( ""Error while processing scheduled MatchManager scheduled task.."" ) ; logger . error ( ""error"" , e ) ; } } " 313,"public void run ( ) { try { logger . info ( ""Processing schedule MatchManagerTask..."" + matchManager . processEvent ( null , IMatchManager . Event . SCHEDULED_EVENT ) ) ; } catch ( MatchManagerException e ) { logger . error ( ""error"" , e ) ; } } ","public void run ( ) { try { logger . info ( ""Processing schedule MatchManagerTask..."" + matchManager . processEvent ( null , IMatchManager . Event . SCHEDULED_EVENT ) ) ; } catch ( MatchManagerException e ) { logger . error ( ""Error while processing scheduled MatchManager scheduled task.."" ) ; logger . error ( ""error"" , e ) ; } } " 314,"public void run ( ) { try { logger . info ( ""Processing schedule MatchManagerTask..."" + matchManager . processEvent ( null , IMatchManager . Event . SCHEDULED_EVENT ) ) ; } catch ( MatchManagerException e ) { logger . error ( ""Error while processing scheduled MatchManager scheduled task.."" ) ; } } ","public void run ( ) { try { logger . info ( ""Processing schedule MatchManagerTask..."" + matchManager . processEvent ( null , IMatchManager . Event . SCHEDULED_EVENT ) ) ; } catch ( MatchManagerException e ) { logger . error ( ""Error while processing scheduled MatchManager scheduled task.."" ) ; logger . error ( ""error"" , e ) ; } } " 315,"public void onClick ( final AjaxRequestTarget target , final RemediationTO ignore ) { try { RemediationRestClient . delete ( model . getObject ( ) . getKey ( ) ) ; SyncopeConsoleSession . get ( ) . success ( getString ( Constants . OPERATION_SUCCEEDED ) ) ; target . add ( container ) ; } catch ( SyncopeClientException e ) { SyncopeConsoleSession . get ( ) . onException ( e ) ; } ( ( BasePage ) pageRef . getPage ( ) ) . getNotificationPanel ( ) . refresh ( target ) ; } ","public void onClick ( final AjaxRequestTarget target , final RemediationTO ignore ) { try { RemediationRestClient . delete ( model . getObject ( ) . getKey ( ) ) ; SyncopeConsoleSession . get ( ) . success ( getString ( Constants . OPERATION_SUCCEEDED ) ) ; target . add ( container ) ; } catch ( SyncopeClientException e ) { LOG . error ( ""While deleting {}"" , model . getObject ( ) . getKey ( ) , e ) ; SyncopeConsoleSession . get ( ) . onException ( e ) ; } ( ( BasePage ) pageRef . getPage ( ) ) . getNotificationPanel ( ) . refresh ( target ) ; } " 316,"public void runIteration ( Configuration conf , Path corpusInput , Path modelInput , Path modelOutput , int iterationNumber , int maxIterations , int numReduceTasks ) throws IOException , ClassNotFoundException , InterruptedException { String jobName = String . format ( ""Iteration %d of %d, input path: %s"" , iterationNumber , maxIterations , modelInput ) ; Job job = prepareJob ( corpusInput , modelOutput , CachingCVB0Mapper . class , IntWritable . class , VectorWritable . class , VectorSumReducer . class , IntWritable . class , VectorWritable . class ) ; job . setCombinerClass ( VectorSumReducer . class ) ; job . setNumReduceTasks ( numReduceTasks ) ; job . setJobName ( jobName ) ; setModelPaths ( job , modelInput ) ; HadoopUtil . delete ( conf , modelOutput ) ; if ( ! job . waitForCompletion ( true ) ) { throw new InterruptedException ( String . format ( ""Failed to complete iteration %d stage 1"" , iterationNumber ) ) ; } } ","public void runIteration ( Configuration conf , Path corpusInput , Path modelInput , Path modelOutput , int iterationNumber , int maxIterations , int numReduceTasks ) throws IOException , ClassNotFoundException , InterruptedException { String jobName = String . format ( ""Iteration %d of %d, input path: %s"" , iterationNumber , maxIterations , modelInput ) ; log . info ( ""About to run: {}"" , jobName ) ; Job job = prepareJob ( corpusInput , modelOutput , CachingCVB0Mapper . class , IntWritable . class , VectorWritable . class , VectorSumReducer . class , IntWritable . class , VectorWritable . class ) ; job . setCombinerClass ( VectorSumReducer . class ) ; job . setNumReduceTasks ( numReduceTasks ) ; job . setJobName ( jobName ) ; setModelPaths ( job , modelInput ) ; HadoopUtil . delete ( conf , modelOutput ) ; if ( ! job . waitForCompletion ( true ) ) { throw new InterruptedException ( String . format ( ""Failed to complete iteration %d stage 1"" , iterationNumber ) ) ; } } " 317,"@ Before public void setUp ( ) throws Exception { log . debug ( ""Starting wiser on port "" + smtpPort ) ; wiser = startWiser ( smtpPort ) ; setDriver ( new ChromeDriver ( ) ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( 30 , TimeUnit . SECONDS ) ; getDriver ( ) . manage ( ) . window ( ) . setSize ( new Dimension ( 1024 , 900 ) ) ; } ","@ Before public void setUp ( ) throws Exception { log . debug ( """" ) ; log . debug ( ""Starting wiser on port "" + smtpPort ) ; wiser = startWiser ( smtpPort ) ; setDriver ( new ChromeDriver ( ) ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( 30 , TimeUnit . SECONDS ) ; getDriver ( ) . manage ( ) . window ( ) . setSize ( new Dimension ( 1024 , 900 ) ) ; } " 318,"@ Before public void setUp ( ) throws Exception { log . debug ( """" ) ; wiser = startWiser ( smtpPort ) ; setDriver ( new ChromeDriver ( ) ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( 30 , TimeUnit . SECONDS ) ; getDriver ( ) . manage ( ) . window ( ) . setSize ( new Dimension ( 1024 , 900 ) ) ; } ","@ Before public void setUp ( ) throws Exception { log . debug ( """" ) ; log . debug ( ""Starting wiser on port "" + smtpPort ) ; wiser = startWiser ( smtpPort ) ; setDriver ( new ChromeDriver ( ) ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( 30 , TimeUnit . SECONDS ) ; getDriver ( ) . manage ( ) . window ( ) . setSize ( new Dimension ( 1024 , 900 ) ) ; } " 319,"public Optional < QoSInterDirectPingMeasurement > getInterDirectPingMeasurementByMeasurement ( final QoSInterDirectMeasurement measurement ) { if ( measurement == null ) { throw new InvalidParameterException ( ""QoSIntraMeasurement"" + NULL_ERROR_MESSAGE ) ; } try { return qoSInterDirectMeasurementPingRepository . findByMeasurement ( measurement ) ; } catch ( final Exception ex ) { logger . debug ( ex . getMessage ( ) , ex ) ; throw new ArrowheadException ( CoreCommonConstants . DATABASE_OPERATION_EXCEPTION_MSG ) ; } } ","public Optional < QoSInterDirectPingMeasurement > getInterDirectPingMeasurementByMeasurement ( final QoSInterDirectMeasurement measurement ) { logger . debug ( ""getInterDirectPingMeasurementByMeasurement started ..."" ) ; if ( measurement == null ) { throw new InvalidParameterException ( ""QoSIntraMeasurement"" + NULL_ERROR_MESSAGE ) ; } try { return qoSInterDirectMeasurementPingRepository . findByMeasurement ( measurement ) ; } catch ( final Exception ex ) { logger . debug ( ex . getMessage ( ) , ex ) ; throw new ArrowheadException ( CoreCommonConstants . DATABASE_OPERATION_EXCEPTION_MSG ) ; } } " 320,"public Optional < QoSInterDirectPingMeasurement > getInterDirectPingMeasurementByMeasurement ( final QoSInterDirectMeasurement measurement ) { logger . debug ( ""getInterDirectPingMeasurementByMeasurement started ..."" ) ; if ( measurement == null ) { throw new InvalidParameterException ( ""QoSIntraMeasurement"" + NULL_ERROR_MESSAGE ) ; } try { return qoSInterDirectMeasurementPingRepository . findByMeasurement ( measurement ) ; } catch ( final Exception ex ) { throw new ArrowheadException ( CoreCommonConstants . DATABASE_OPERATION_EXCEPTION_MSG ) ; } } ","public Optional < QoSInterDirectPingMeasurement > getInterDirectPingMeasurementByMeasurement ( final QoSInterDirectMeasurement measurement ) { logger . debug ( ""getInterDirectPingMeasurementByMeasurement started ..."" ) ; if ( measurement == null ) { throw new InvalidParameterException ( ""QoSIntraMeasurement"" + NULL_ERROR_MESSAGE ) ; } try { return qoSInterDirectMeasurementPingRepository . findByMeasurement ( measurement ) ; } catch ( final Exception ex ) { logger . debug ( ex . getMessage ( ) , ex ) ; throw new ArrowheadException ( CoreCommonConstants . DATABASE_OPERATION_EXCEPTION_MSG ) ; } } " 321,"public void release ( ) { ITransactionMember [ ] a ; synchronized ( m_memberMapLock ) { a = getMembersNoLocking ( ) ; m_memberMap . clear ( ) ; } for ( ITransactionMember mem : a ) { try { mem . release ( ) ; } catch ( Throwable t ) { LOG . error ( ""release member {}"" , mem , t ) ; } } } ","public void release ( ) { ITransactionMember [ ] a ; synchronized ( m_memberMapLock ) { a = getMembersNoLocking ( ) ; m_memberMap . clear ( ) ; } for ( ITransactionMember mem : a ) { try { LOG . debug ( ""release of transaction member '{}'. "" , mem ) ; mem . release ( ) ; } catch ( Throwable t ) { LOG . error ( ""release member {}"" , mem , t ) ; } } } " 322,"public void release ( ) { ITransactionMember [ ] a ; synchronized ( m_memberMapLock ) { a = getMembersNoLocking ( ) ; m_memberMap . clear ( ) ; } for ( ITransactionMember mem : a ) { try { LOG . debug ( ""release of transaction member '{}'. "" , mem ) ; mem . release ( ) ; } catch ( Throwable t ) { } } } ","public void release ( ) { ITransactionMember [ ] a ; synchronized ( m_memberMapLock ) { a = getMembersNoLocking ( ) ; m_memberMap . clear ( ) ; } for ( ITransactionMember mem : a ) { try { LOG . debug ( ""release of transaction member '{}'. "" , mem ) ; mem . release ( ) ; } catch ( Throwable t ) { LOG . error ( ""release member {}"" , mem , t ) ; } } } " 323,"@ SuppressWarnings ( { ""unchecked"" } ) private List < Object [ ] > getIdSizeList ( ) { return ( List < Object [ ] > ) getDaoFactory ( ) . getDAO ( Attachment . class ) . executeCallback ( new HibernateCallback ( ) { @ Override public Object doInHibernate ( Session session ) throws HibernateException , SQLException { if ( log . isDebugEnabled ( ) ) { } String sql = determineDialectSpecificQueryText ( getHibernateDialect ( ) ) ; return getFilesizeDataFromDB ( session , sql ) ; } private Object getFilesizeDataFromDB ( Session session , String sql ) throws SQLException { if ( ! sql . isEmpty ( ) ) { if ( ! isOracle ( ) ) { return session . createSQLQuery ( sql ) . list ( ) ; } else { return handleOracleDB ( session , sql ) ; } } else { log . warn ( ""Unsupported dialect ("" + getHibernateDialect ( ) + "") configured.\nPlease use one of the supported (Oracle, Postgresql or Derby)"" ) ; return new ArrayList < Object [ ] > ( 0 ) ; } } private Object handleOracleDB ( Session session , String sql ) throws SQLException { session . createSQLQuery ( sql ) . executeUpdate ( ) ; Object retVal = null ; long start_time = System . currentTimeMillis ( ) ; final long MAX_DURATION = 180000 ; while ( retVal == null && ( ( System . currentTimeMillis ( ) - start_time ) < MAX_DURATION ) ) { try { retVal = session . createSQLQuery ( ""select dbid, dbms_lob.getlength(obj) from "" + ORACLE_TEMP_TABLE_NAME ) . list ( ) ; } catch ( Exception e ) { log . warn ( ""table not created yet, trying again"" , e ) ; } } if ( System . currentTimeMillis ( ) - start_time > MAX_DURATION ) { throw new SQLException ( ""Oracle DB takes to long to answer"" ) ; } return retVal ; } } ) ; } ","@ SuppressWarnings ( { ""unchecked"" } ) private List < Object [ ] > getIdSizeList ( ) { return ( List < Object [ ] > ) getDaoFactory ( ) . getDAO ( Attachment . class ) . executeCallback ( new HibernateCallback ( ) { @ Override public Object doInHibernate ( Session session ) throws HibernateException , SQLException { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Configured Hibernate Dialect:\t"" + getHibernateDialect ( ) ) ; } String sql = determineDialectSpecificQueryText ( getHibernateDialect ( ) ) ; return getFilesizeDataFromDB ( session , sql ) ; } private Object getFilesizeDataFromDB ( Session session , String sql ) throws SQLException { if ( ! sql . isEmpty ( ) ) { if ( ! isOracle ( ) ) { return session . createSQLQuery ( sql ) . list ( ) ; } else { return handleOracleDB ( session , sql ) ; } } else { log . warn ( ""Unsupported dialect ("" + getHibernateDialect ( ) + "") configured.\nPlease use one of the supported (Oracle, Postgresql or Derby)"" ) ; return new ArrayList < Object [ ] > ( 0 ) ; } } private Object handleOracleDB ( Session session , String sql ) throws SQLException { session . createSQLQuery ( sql ) . executeUpdate ( ) ; Object retVal = null ; long start_time = System . currentTimeMillis ( ) ; final long MAX_DURATION = 180000 ; while ( retVal == null && ( ( System . currentTimeMillis ( ) - start_time ) < MAX_DURATION ) ) { try { retVal = session . createSQLQuery ( ""select dbid, dbms_lob.getlength(obj) from "" + ORACLE_TEMP_TABLE_NAME ) . list ( ) ; } catch ( Exception e ) { log . warn ( ""table not created yet, trying again"" , e ) ; } } if ( System . currentTimeMillis ( ) - start_time > MAX_DURATION ) { throw new SQLException ( ""Oracle DB takes to long to answer"" ) ; } return retVal ; } } ) ; } " 324,"@ SuppressWarnings ( { ""unchecked"" } ) private List < Object [ ] > getIdSizeList ( ) { return ( List < Object [ ] > ) getDaoFactory ( ) . getDAO ( Attachment . class ) . executeCallback ( new HibernateCallback ( ) { @ Override public Object doInHibernate ( Session session ) throws HibernateException , SQLException { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Configured Hibernate Dialect:\t"" + getHibernateDialect ( ) ) ; } String sql = determineDialectSpecificQueryText ( getHibernateDialect ( ) ) ; return getFilesizeDataFromDB ( session , sql ) ; } private Object getFilesizeDataFromDB ( Session session , String sql ) throws SQLException { if ( ! sql . isEmpty ( ) ) { if ( ! isOracle ( ) ) { return session . createSQLQuery ( sql ) . list ( ) ; } else { return handleOracleDB ( session , sql ) ; } } else { return new ArrayList < Object [ ] > ( 0 ) ; } } private Object handleOracleDB ( Session session , String sql ) throws SQLException { session . createSQLQuery ( sql ) . executeUpdate ( ) ; Object retVal = null ; long start_time = System . currentTimeMillis ( ) ; final long MAX_DURATION = 180000 ; while ( retVal == null && ( ( System . currentTimeMillis ( ) - start_time ) < MAX_DURATION ) ) { try { retVal = session . createSQLQuery ( ""select dbid, dbms_lob.getlength(obj) from "" + ORACLE_TEMP_TABLE_NAME ) . list ( ) ; } catch ( Exception e ) { log . warn ( ""table not created yet, trying again"" , e ) ; } } if ( System . currentTimeMillis ( ) - start_time > MAX_DURATION ) { throw new SQLException ( ""Oracle DB takes to long to answer"" ) ; } return retVal ; } } ) ; } ","@ SuppressWarnings ( { ""unchecked"" } ) private List < Object [ ] > getIdSizeList ( ) { return ( List < Object [ ] > ) getDaoFactory ( ) . getDAO ( Attachment . class ) . executeCallback ( new HibernateCallback ( ) { @ Override public Object doInHibernate ( Session session ) throws HibernateException , SQLException { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Configured Hibernate Dialect:\t"" + getHibernateDialect ( ) ) ; } String sql = determineDialectSpecificQueryText ( getHibernateDialect ( ) ) ; return getFilesizeDataFromDB ( session , sql ) ; } private Object getFilesizeDataFromDB ( Session session , String sql ) throws SQLException { if ( ! sql . isEmpty ( ) ) { if ( ! isOracle ( ) ) { return session . createSQLQuery ( sql ) . list ( ) ; } else { return handleOracleDB ( session , sql ) ; } } else { log . warn ( ""Unsupported dialect ("" + getHibernateDialect ( ) + "") configured.\nPlease use one of the supported (Oracle, Postgresql or Derby)"" ) ; return new ArrayList < Object [ ] > ( 0 ) ; } } private Object handleOracleDB ( Session session , String sql ) throws SQLException { session . createSQLQuery ( sql ) . executeUpdate ( ) ; Object retVal = null ; long start_time = System . currentTimeMillis ( ) ; final long MAX_DURATION = 180000 ; while ( retVal == null && ( ( System . currentTimeMillis ( ) - start_time ) < MAX_DURATION ) ) { try { retVal = session . createSQLQuery ( ""select dbid, dbms_lob.getlength(obj) from "" + ORACLE_TEMP_TABLE_NAME ) . list ( ) ; } catch ( Exception e ) { log . warn ( ""table not created yet, trying again"" , e ) ; } } if ( System . currentTimeMillis ( ) - start_time > MAX_DURATION ) { throw new SQLException ( ""Oracle DB takes to long to answer"" ) ; } return retVal ; } } ) ; } " 325,"@ SuppressWarnings ( { ""unchecked"" } ) private List < Object [ ] > getIdSizeList ( ) { return ( List < Object [ ] > ) getDaoFactory ( ) . getDAO ( Attachment . class ) . executeCallback ( new HibernateCallback ( ) { @ Override public Object doInHibernate ( Session session ) throws HibernateException , SQLException { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Configured Hibernate Dialect:\t"" + getHibernateDialect ( ) ) ; } String sql = determineDialectSpecificQueryText ( getHibernateDialect ( ) ) ; return getFilesizeDataFromDB ( session , sql ) ; } private Object getFilesizeDataFromDB ( Session session , String sql ) throws SQLException { if ( ! sql . isEmpty ( ) ) { if ( ! isOracle ( ) ) { return session . createSQLQuery ( sql ) . list ( ) ; } else { return handleOracleDB ( session , sql ) ; } } else { log . warn ( ""Unsupported dialect ("" + getHibernateDialect ( ) + "") configured.\nPlease use one of the supported (Oracle, Postgresql or Derby)"" ) ; return new ArrayList < Object [ ] > ( 0 ) ; } } private Object handleOracleDB ( Session session , String sql ) throws SQLException { session . createSQLQuery ( sql ) . executeUpdate ( ) ; Object retVal = null ; long start_time = System . currentTimeMillis ( ) ; final long MAX_DURATION = 180000 ; while ( retVal == null && ( ( System . currentTimeMillis ( ) - start_time ) < MAX_DURATION ) ) { try { retVal = session . createSQLQuery ( ""select dbid, dbms_lob.getlength(obj) from "" + ORACLE_TEMP_TABLE_NAME ) . list ( ) ; } catch ( Exception e ) { } } if ( System . currentTimeMillis ( ) - start_time > MAX_DURATION ) { throw new SQLException ( ""Oracle DB takes to long to answer"" ) ; } return retVal ; } } ) ; } ","@ SuppressWarnings ( { ""unchecked"" } ) private List < Object [ ] > getIdSizeList ( ) { return ( List < Object [ ] > ) getDaoFactory ( ) . getDAO ( Attachment . class ) . executeCallback ( new HibernateCallback ( ) { @ Override public Object doInHibernate ( Session session ) throws HibernateException , SQLException { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Configured Hibernate Dialect:\t"" + getHibernateDialect ( ) ) ; } String sql = determineDialectSpecificQueryText ( getHibernateDialect ( ) ) ; return getFilesizeDataFromDB ( session , sql ) ; } private Object getFilesizeDataFromDB ( Session session , String sql ) throws SQLException { if ( ! sql . isEmpty ( ) ) { if ( ! isOracle ( ) ) { return session . createSQLQuery ( sql ) . list ( ) ; } else { return handleOracleDB ( session , sql ) ; } } else { log . warn ( ""Unsupported dialect ("" + getHibernateDialect ( ) + "") configured.\nPlease use one of the supported (Oracle, Postgresql or Derby)"" ) ; return new ArrayList < Object [ ] > ( 0 ) ; } } private Object handleOracleDB ( Session session , String sql ) throws SQLException { session . createSQLQuery ( sql ) . executeUpdate ( ) ; Object retVal = null ; long start_time = System . currentTimeMillis ( ) ; final long MAX_DURATION = 180000 ; while ( retVal == null && ( ( System . currentTimeMillis ( ) - start_time ) < MAX_DURATION ) ) { try { retVal = session . createSQLQuery ( ""select dbid, dbms_lob.getlength(obj) from "" + ORACLE_TEMP_TABLE_NAME ) . list ( ) ; } catch ( Exception e ) { log . warn ( ""table not created yet, trying again"" , e ) ; } } if ( System . currentTimeMillis ( ) - start_time > MAX_DURATION ) { throw new SQLException ( ""Oracle DB takes to long to answer"" ) ; } return retVal ; } } ) ; } " 326,"private String typeParser ( FieldType fieldType , String fieldName , Object fieldValue , String sql ) { switch ( fieldType ) { case STRING : sql += fieldName + "" = "" + ""'"" + fieldValue + ""'"" ; break ; case DATETIME : sql += fieldName + "" = "" + ""'"" + new DateTimeColumnParser ( ) . getValue ( fieldValue ) + ""'"" ; break ; case INT32 : case INT64 : case FLOAT32 : case FLOAT64 : case BIG_INTEGER : sql += fieldName + "" = "" + fieldValue ; break ; default : } return sql ; } ","private String typeParser ( FieldType fieldType , String fieldName , Object fieldValue , String sql ) { switch ( fieldType ) { case STRING : sql += fieldName + "" = "" + ""'"" + fieldValue + ""'"" ; break ; case DATETIME : sql += fieldName + "" = "" + ""'"" + new DateTimeColumnParser ( ) . getValue ( fieldValue ) + ""'"" ; break ; case INT32 : case INT64 : case FLOAT32 : case FLOAT64 : case BIG_INTEGER : sql += fieldName + "" = "" + fieldValue ; break ; default : log . error ( ""fieldType {} is illegal."" , fieldType . toString ( ) ) ; } return sql ; } " 327,"protected void writeCommand ( byte [ ] message ) throws SonyProjectorException { if ( simu ) { return ; } OutputStream dataOut = this . dataOut ; if ( dataOut == null ) { throw new SonyProjectorException ( ""writeCommand failed: output stream is null"" ) ; } try { dataOut . write ( message ) ; dataOut . flush ( ) ; } catch ( IOException e ) { logger . debug ( ""writeCommand failed: {}"" , e . getMessage ( ) ) ; throw new SonyProjectorException ( ""writeCommand failed: "" + e . getMessage ( ) ) ; } } ","protected void writeCommand ( byte [ ] message ) throws SonyProjectorException { logger . debug ( ""writeCommand: {}"" , HexUtils . bytesToHex ( message ) ) ; if ( simu ) { return ; } OutputStream dataOut = this . dataOut ; if ( dataOut == null ) { throw new SonyProjectorException ( ""writeCommand failed: output stream is null"" ) ; } try { dataOut . write ( message ) ; dataOut . flush ( ) ; } catch ( IOException e ) { logger . debug ( ""writeCommand failed: {}"" , e . getMessage ( ) ) ; throw new SonyProjectorException ( ""writeCommand failed: "" + e . getMessage ( ) ) ; } } " 328,"protected void writeCommand ( byte [ ] message ) throws SonyProjectorException { logger . debug ( ""writeCommand: {}"" , HexUtils . bytesToHex ( message ) ) ; if ( simu ) { return ; } OutputStream dataOut = this . dataOut ; if ( dataOut == null ) { throw new SonyProjectorException ( ""writeCommand failed: output stream is null"" ) ; } try { dataOut . write ( message ) ; dataOut . flush ( ) ; } catch ( IOException e ) { throw new SonyProjectorException ( ""writeCommand failed: "" + e . getMessage ( ) ) ; } } ","protected void writeCommand ( byte [ ] message ) throws SonyProjectorException { logger . debug ( ""writeCommand: {}"" , HexUtils . bytesToHex ( message ) ) ; if ( simu ) { return ; } OutputStream dataOut = this . dataOut ; if ( dataOut == null ) { throw new SonyProjectorException ( ""writeCommand failed: output stream is null"" ) ; } try { dataOut . write ( message ) ; dataOut . flush ( ) ; } catch ( IOException e ) { logger . debug ( ""writeCommand failed: {}"" , e . getMessage ( ) ) ; throw new SonyProjectorException ( ""writeCommand failed: "" + e . getMessage ( ) ) ; } } " 329,"NbtAddress [ ] getAllByName ( Name name , InetAddress addr ) throws UnknownHostException { int n ; Configuration config = this . transportContext . getConfig ( ) ; NameQueryRequest request = new NameQueryRequest ( config , name ) ; NameQueryResponse response = new NameQueryResponse ( config ) ; request . addr = addr != null ? addr : getWINSAddress ( ) ; request . isBroadcast = request . addr == null ; if ( request . isBroadcast ) { request . addr = this . baddr ; n = config . getNetbiosRetryCount ( ) ; } else { request . isBroadcast = false ; n = 1 ; } do { try { send ( request , response , config . getNetbiosRetryTimeout ( ) ) ; } catch ( InterruptedIOException ioe ) { if ( log . isTraceEnabled ( ) ) { } throw new UnknownHostException ( name . name ) ; } catch ( IOException ioe ) { log . info ( ""Failed to send nameservice request for "" + name . name , ioe ) ; throw new UnknownHostException ( name . name ) ; } if ( response . received && response . resultCode == 0 ) { return response . addrEntry ; } } while ( -- n > 0 && request . isBroadcast ) ; throw new UnknownHostException ( name . name ) ; } ","NbtAddress [ ] getAllByName ( Name name , InetAddress addr ) throws UnknownHostException { int n ; Configuration config = this . transportContext . getConfig ( ) ; NameQueryRequest request = new NameQueryRequest ( config , name ) ; NameQueryResponse response = new NameQueryResponse ( config ) ; request . addr = addr != null ? addr : getWINSAddress ( ) ; request . isBroadcast = request . addr == null ; if ( request . isBroadcast ) { request . addr = this . baddr ; n = config . getNetbiosRetryCount ( ) ; } else { request . isBroadcast = false ; n = 1 ; } do { try { send ( request , response , config . getNetbiosRetryTimeout ( ) ) ; } catch ( InterruptedIOException ioe ) { if ( log . isTraceEnabled ( ) ) { log . trace ( ""Failed to send nameservice request for "" + name . name , ioe ) ; } throw new UnknownHostException ( name . name ) ; } catch ( IOException ioe ) { log . info ( ""Failed to send nameservice request for "" + name . name , ioe ) ; throw new UnknownHostException ( name . name ) ; } if ( response . received && response . resultCode == 0 ) { return response . addrEntry ; } } while ( -- n > 0 && request . isBroadcast ) ; throw new UnknownHostException ( name . name ) ; } " 330,"NbtAddress [ ] getAllByName ( Name name , InetAddress addr ) throws UnknownHostException { int n ; Configuration config = this . transportContext . getConfig ( ) ; NameQueryRequest request = new NameQueryRequest ( config , name ) ; NameQueryResponse response = new NameQueryResponse ( config ) ; request . addr = addr != null ? addr : getWINSAddress ( ) ; request . isBroadcast = request . addr == null ; if ( request . isBroadcast ) { request . addr = this . baddr ; n = config . getNetbiosRetryCount ( ) ; } else { request . isBroadcast = false ; n = 1 ; } do { try { send ( request , response , config . getNetbiosRetryTimeout ( ) ) ; } catch ( InterruptedIOException ioe ) { if ( log . isTraceEnabled ( ) ) { log . trace ( ""Failed to send nameservice request for "" + name . name , ioe ) ; } throw new UnknownHostException ( name . name ) ; } catch ( IOException ioe ) { throw new UnknownHostException ( name . name ) ; } if ( response . received && response . resultCode == 0 ) { return response . addrEntry ; } } while ( -- n > 0 && request . isBroadcast ) ; throw new UnknownHostException ( name . name ) ; } ","NbtAddress [ ] getAllByName ( Name name , InetAddress addr ) throws UnknownHostException { int n ; Configuration config = this . transportContext . getConfig ( ) ; NameQueryRequest request = new NameQueryRequest ( config , name ) ; NameQueryResponse response = new NameQueryResponse ( config ) ; request . addr = addr != null ? addr : getWINSAddress ( ) ; request . isBroadcast = request . addr == null ; if ( request . isBroadcast ) { request . addr = this . baddr ; n = config . getNetbiosRetryCount ( ) ; } else { request . isBroadcast = false ; n = 1 ; } do { try { send ( request , response , config . getNetbiosRetryTimeout ( ) ) ; } catch ( InterruptedIOException ioe ) { if ( log . isTraceEnabled ( ) ) { log . trace ( ""Failed to send nameservice request for "" + name . name , ioe ) ; } throw new UnknownHostException ( name . name ) ; } catch ( IOException ioe ) { log . info ( ""Failed to send nameservice request for "" + name . name , ioe ) ; throw new UnknownHostException ( name . name ) ; } if ( response . received && response . resultCode == 0 ) { return response . addrEntry ; } } while ( -- n > 0 && request . isBroadcast ) ; throw new UnknownHostException ( name . name ) ; } " 331,"public void onComplete ( AsyncEvent asyncEvent ) { if ( Log . isTraceEnabled ( ) ) { } synchronized ( connectionQueue ) { connectionQueue . remove ( connection ) ; lastActivity = Instant . now ( ) ; } SessionEventDispatcher . dispatchEvent ( HttpSession . this , SessionEventDispatcher . EventType . connection_closed , connection , context ) ; } ","public void onComplete ( AsyncEvent asyncEvent ) { if ( Log . isTraceEnabled ( ) ) { Log . trace ( ""Session {} Request ID {}, event complete: {}"" , streamID , rid , asyncEvent ) ; } synchronized ( connectionQueue ) { connectionQueue . remove ( connection ) ; lastActivity = Instant . now ( ) ; } SessionEventDispatcher . dispatchEvent ( HttpSession . this , SessionEventDispatcher . EventType . connection_closed , connection , context ) ; } " 332,"public void process ( ClusterEvent event ) { long startTime = System . currentTimeMillis ( ) ; WorkflowControllerDataProvider cache = event . getAttribute ( AttributeName . ControllerDataProvider . name ( ) ) ; HelixManager manager = event . getAttribute ( AttributeName . helixmanager . name ( ) ) ; cache . getTaskDataCache ( ) . persistDataChanges ( manager . getHelixDataAccessor ( ) ) ; long endTime = System . currentTimeMillis ( ) ; LOG . info ( ""END TaskPersistDataStage.process() for cluster {} took {} ms"" , cache . getClusterName ( ) , ( endTime - startTime ) ) ; } ","public void process ( ClusterEvent event ) { LOG . info ( ""START TaskPersistDataStage.process()"" ) ; long startTime = System . currentTimeMillis ( ) ; WorkflowControllerDataProvider cache = event . getAttribute ( AttributeName . ControllerDataProvider . name ( ) ) ; HelixManager manager = event . getAttribute ( AttributeName . helixmanager . name ( ) ) ; cache . getTaskDataCache ( ) . persistDataChanges ( manager . getHelixDataAccessor ( ) ) ; long endTime = System . currentTimeMillis ( ) ; LOG . info ( ""END TaskPersistDataStage.process() for cluster {} took {} ms"" , cache . getClusterName ( ) , ( endTime - startTime ) ) ; } " 333,"public void process ( ClusterEvent event ) { LOG . info ( ""START TaskPersistDataStage.process()"" ) ; long startTime = System . currentTimeMillis ( ) ; WorkflowControllerDataProvider cache = event . getAttribute ( AttributeName . ControllerDataProvider . name ( ) ) ; HelixManager manager = event . getAttribute ( AttributeName . helixmanager . name ( ) ) ; cache . getTaskDataCache ( ) . persistDataChanges ( manager . getHelixDataAccessor ( ) ) ; long endTime = System . currentTimeMillis ( ) ; } ","public void process ( ClusterEvent event ) { LOG . info ( ""START TaskPersistDataStage.process()"" ) ; long startTime = System . currentTimeMillis ( ) ; WorkflowControllerDataProvider cache = event . getAttribute ( AttributeName . ControllerDataProvider . name ( ) ) ; HelixManager manager = event . getAttribute ( AttributeName . helixmanager . name ( ) ) ; cache . getTaskDataCache ( ) . persistDataChanges ( manager . getHelixDataAccessor ( ) ) ; long endTime = System . currentTimeMillis ( ) ; LOG . info ( ""END TaskPersistDataStage.process() for cluster {} took {} ms"" , cache . getClusterName ( ) , ( endTime - startTime ) ) ; } " 334,"protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } ","protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } " 335,"protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } ","protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } " 336,"protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } ","protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } " 337,"protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } ","protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } " 338,"protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } ","protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } " 339,"protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } ","protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } " 340,"protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } ","protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } " 341,"protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { } } ","protected void configureProfile ( ) { String profileFilename ; FileUtil . createDirectory ( FileUtil . getPreferencesPath ( ) ) ; File profileFile ; profileFilename = getConfigFileName ( ) . replaceFirst ( "".xml"" , "".properties"" ) ; if ( ! new File ( profileFilename ) . isAbsolute ( ) ) { profileFile = new File ( FileUtil . getPreferencesPath ( ) + profileFilename ) ; } else { profileFile = new File ( profileFilename ) ; } ProfileManager . getDefault ( ) . setConfigFile ( profileFile ) ; if ( System . getProperties ( ) . containsKey ( ProfileManager . SYSTEM_PROPERTY ) ) { ProfileManager . getDefault ( ) . setActiveProfile ( System . getProperty ( ProfileManager . SYSTEM_PROPERTY ) ) ; } if ( ! profileFile . exists ( ) ) { try { if ( ProfileManager . getDefault ( ) . migrateToProfiles ( getConfigFileName ( ) ) ) { log . info ( Bundle . getMessage ( ""ConfigMigratedToProfile"" ) ) ; } } catch ( IOException | IllegalArgumentException ex ) { log . error ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } try { if ( ProfileManager . getStartingProfile ( ) != null ) { System . setProperty ( ""org.jmri.Apps.configFilename"" , Profile . CONFIG_FILENAME ) ; Profile profile = ProfileManager . getDefault ( ) . getActiveProfile ( ) ; if ( profile != null ) { log . info ( ""Starting with profile {}"" , profile . getId ( ) ) ; } else { log . info ( ""Starting without a profile"" ) ; } } else { log . error ( ""Specify profile to use as command line argument."" ) ; log . error ( ""If starting with saved profile configuration, ensure the autoStart property is set to \""true\"""" ) ; log . error ( ""Profiles not configurable. Using fallback per-application configuration."" ) ; } } catch ( IOException ex ) { log . info ( ""Profiles not configurable. Using fallback per-application configuration. Error: {}"" , ex . getMessage ( ) ) ; } } " 342,"private void log ( String string ) { System . out . println ( string ) ; } ","private void log ( String string ) { Log . info ( string ) ; System . out . println ( string ) ; } " 343,"public void attachClean ( StgMBstnStatus instance ) { try { sessionFactory . getCurrentSession ( ) . lock ( instance , LockMode . NONE ) ; log . debug ( ""attach successful"" ) ; } catch ( RuntimeException re ) { log . error ( ""attach failed"" , re ) ; throw re ; } } ","public void attachClean ( StgMBstnStatus instance ) { log . debug ( ""attaching clean StgMBstnStatus instance"" ) ; try { sessionFactory . getCurrentSession ( ) . lock ( instance , LockMode . NONE ) ; log . debug ( ""attach successful"" ) ; } catch ( RuntimeException re ) { log . error ( ""attach failed"" , re ) ; throw re ; } } " 344,"public void attachClean ( StgMBstnStatus instance ) { log . debug ( ""attaching clean StgMBstnStatus instance"" ) ; try { sessionFactory . getCurrentSession ( ) . lock ( instance , LockMode . NONE ) ; } catch ( RuntimeException re ) { log . error ( ""attach failed"" , re ) ; throw re ; } } ","public void attachClean ( StgMBstnStatus instance ) { log . debug ( ""attaching clean StgMBstnStatus instance"" ) ; try { sessionFactory . getCurrentSession ( ) . lock ( instance , LockMode . NONE ) ; log . debug ( ""attach successful"" ) ; } catch ( RuntimeException re ) { log . error ( ""attach failed"" , re ) ; throw re ; } } " 345,"public void attachClean ( StgMBstnStatus instance ) { log . debug ( ""attaching clean StgMBstnStatus instance"" ) ; try { sessionFactory . getCurrentSession ( ) . lock ( instance , LockMode . NONE ) ; log . debug ( ""attach successful"" ) ; } catch ( RuntimeException re ) { throw re ; } } ","public void attachClean ( StgMBstnStatus instance ) { log . debug ( ""attaching clean StgMBstnStatus instance"" ) ; try { sessionFactory . getCurrentSession ( ) . lock ( instance , LockMode . NONE ) ; log . debug ( ""attach successful"" ) ; } catch ( RuntimeException re ) { log . error ( ""attach failed"" , re ) ; throw re ; } } " 346,"private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } ","private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } " 347,"private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } ","private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } " 348,"private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } ","private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } " 349,"private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } ","private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } " 350,"private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } ","private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } " 351,"private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } ","private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } " 352,"private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } ","private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } " 353,"private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } ","private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } " 354,"private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } ","private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } " 355,"private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } ","private @ Nullable DSMRConnectorErrorEvent open ( DSMRSerialSettings portSettings , SerialPortIdentifier portIdentifier ) { DSMRConnectorErrorEvent errorEvent = null ; try { logger . trace ( ""Opening port {}"" , serialPortName ) ; SerialPort oldSerialPort = serialPortReference . get ( ) ; SerialPort serialPort = portIdentifier . open ( DSMRBindingConstants . DSMR_PORT_NAME , SERIAL_PORT_READ_TIMEOUT_MILLISECONDS ) ; logger . trace ( ""Configure serial port parameters: {}"" , portSettings ) ; serialPort . setSerialPortParams ( portSettings . getBaudrate ( ) , portSettings . getDataBits ( ) , portSettings . getStopbits ( ) , portSettings . getParity ( ) ) ; logger . trace ( ""SerialPort opened successful on {}"" , serialPortName ) ; open ( serialPort . getInputStream ( ) ) ; serialPort . addEventListener ( this ) ; serialPort . notifyOnDataAvailable ( true ) ; serialPort . notifyOnBreakInterrupt ( true ) ; serialPort . notifyOnFramingError ( true ) ; serialPort . notifyOnOverrunError ( true ) ; serialPort . notifyOnParityError ( true ) ; try { serialPort . enableReceiveThreshold ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive threshold is unsupported"" ) ; } try { serialPort . enableReceiveTimeout ( SERIAL_TIMEOUT_MILLISECONDS ) ; } catch ( UnsupportedCommOperationException e ) { logger . debug ( ""Enable receive timeout is unsupported"" ) ; } serialPort . setRTS ( true ) ; if ( ! serialPortReference . compareAndSet ( oldSerialPort , serialPort ) ) { logger . warn ( ""Possible bug because a new serial port value was set during opening new port."" ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } } catch ( IOException ioe ) { logger . debug ( ""Failed to get inputstream for serialPort"" , ioe ) ; errorEvent = DSMRConnectorErrorEvent . READ_ERROR ; } catch ( TooManyListenersException tmle ) { logger . warn ( ""Possible bug because a listener was added while one already set."" , tmle ) ; errorEvent = DSMRConnectorErrorEvent . INTERNAL_ERROR ; } catch ( PortInUseException piue ) { logger . debug ( ""Port already in use: {}"" , serialPortName , piue ) ; errorEvent = DSMRConnectorErrorEvent . IN_USE ; } catch ( UnsupportedCommOperationException ucoe ) { logger . debug ( ""Port does not support requested port settings (invalid dsmr:portsettings parameter?): {}"" , serialPortName , ucoe ) ; errorEvent = DSMRConnectorErrorEvent . NOT_COMPATIBLE ; } return errorEvent ; } " 356,"public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { final HttpServletRequest req = ( HttpServletRequest ) request ; final long startTime = currentTimeProvider . get ( ) ; try { chain . doFilter ( request , response ) ; } finally { final long elapsedNS = currentTimeProvider . get ( ) - startTime ; final long elapsedMS = NANOSECONDS . toMillis ( elapsedNS ) ; if ( elapsedNS >= threshold ) { } } } ","public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { final HttpServletRequest req = ( HttpServletRequest ) request ; final long startTime = currentTimeProvider . get ( ) ; try { chain . doFilter ( request , response ) ; } finally { final long elapsedNS = currentTimeProvider . get ( ) - startTime ; final long elapsedMS = NANOSECONDS . toMillis ( elapsedNS ) ; if ( elapsedNS >= threshold ) { logger . warn ( ""Slow request: {} {} ({}ms)"" , req . getMethod ( ) , getFullUrl ( req ) , elapsedMS ) ; } } } " 357,"public Template getWsagObject ( String serializedData ) throws ParserException { Template template = null ; try { template = mapper . readValue ( serializedData , Template . class ) ; logger . debug ( ""Template parsed {}"" , template ) ; } catch ( JsonProcessingException e ) { throw new ParserException ( e ) ; } catch ( Throwable e ) { throw new ParserException ( e ) ; } return template ; } ","public Template getWsagObject ( String serializedData ) throws ParserException { Template template = null ; try { logger . info ( ""Will parse {}"" , serializedData ) ; template = mapper . readValue ( serializedData , Template . class ) ; logger . debug ( ""Template parsed {}"" , template ) ; } catch ( JsonProcessingException e ) { throw new ParserException ( e ) ; } catch ( Throwable e ) { throw new ParserException ( e ) ; } return template ; } " 358,"public Template getWsagObject ( String serializedData ) throws ParserException { Template template = null ; try { logger . info ( ""Will parse {}"" , serializedData ) ; template = mapper . readValue ( serializedData , Template . class ) ; } catch ( JsonProcessingException e ) { throw new ParserException ( e ) ; } catch ( Throwable e ) { throw new ParserException ( e ) ; } return template ; } ","public Template getWsagObject ( String serializedData ) throws ParserException { Template template = null ; try { logger . info ( ""Will parse {}"" , serializedData ) ; template = mapper . readValue ( serializedData , Template . class ) ; logger . debug ( ""Template parsed {}"" , template ) ; } catch ( JsonProcessingException e ) { throw new ParserException ( e ) ; } catch ( Throwable e ) { throw new ParserException ( e ) ; } return template ; } " 359,"public static com . liferay . portal . reports . engine . console . model . Source addSource ( HttpPrincipal httpPrincipal , long groupId , java . util . Map < java . util . Locale , String > nameMap , String driverClassName , String driverUrl , String driverUserName , String driverPassword , com . liferay . portal . kernel . service . ServiceContext serviceContext ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( SourceServiceUtil . class , ""addSource"" , _addSourceParameterTypes0 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , groupId , nameMap , driverClassName , driverUrl , driverUserName , driverPassword , serviceContext ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( com . liferay . portal . reports . engine . console . model . Source ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { throw systemException ; } } ","public static com . liferay . portal . reports . engine . console . model . Source addSource ( HttpPrincipal httpPrincipal , long groupId , java . util . Map < java . util . Locale , String > nameMap , String driverClassName , String driverUrl , String driverUserName , String driverPassword , com . liferay . portal . kernel . service . ServiceContext serviceContext ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( SourceServiceUtil . class , ""addSource"" , _addSourceParameterTypes0 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , groupId , nameMap , driverClassName , driverUrl , driverUserName , driverPassword , serviceContext ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( com . liferay . portal . reports . engine . console . model . Source ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { _log . error ( systemException , systemException ) ; throw systemException ; } } " 360,"protected boolean processInOnly ( final Exchange exchange , final AsyncCallback callback ) { final org . apache . camel . Message in = exchange . getIn ( ) ; String destinationName = in . getHeader ( SjmsConstants . JMS_DESTINATION_NAME , String . class ) ; if ( destinationName != null ) { in . removeHeader ( SjmsConstants . JMS_DESTINATION_NAME ) ; } if ( destinationName == null ) { destinationName = endpoint . getDestinationName ( ) ; } final String to = destinationName ; MessageCreator messageCreator = new MessageCreator ( ) { public Message createMessage ( Session session ) throws JMSException { Message answer = endpoint . getBinding ( ) . makeJmsMessage ( exchange , in , session , null ) ; Object jmsReplyTo = JmsMessageHelper . getJMSReplyTo ( answer ) ; if ( endpoint . isDisableReplyTo ( ) ) { JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } else { if ( jmsReplyTo == null ) { jmsReplyTo = exchange . getIn ( ) . getHeader ( ""JMSReplyTo"" , String . class ) ; if ( jmsReplyTo == null ) { jmsReplyTo = endpoint . getReplyTo ( ) ; } } } if ( jmsReplyTo != null && ! ( endpoint . isPreserveMessageQos ( ) || endpoint . isExplicitQosEnabled ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Disabling JMSReplyTo: {} for destination: {}. Use preserveMessageQos=true to force Camel to keep the JMSReplyTo on endpoint: {}"" , new Object [ ] { jmsReplyTo , to , endpoint } ) ; } jmsReplyTo = null ; } if ( jmsReplyTo instanceof String ) { String replyTo = ( String ) jmsReplyTo ; jmsReplyTo = resolveOrCreateDestination ( replyTo , session ) ; } Destination replyTo = null ; String replyToOverride = endpoint . getReplyToOverride ( ) ; if ( replyToOverride != null ) { replyTo = resolveOrCreateDestination ( replyToOverride , session ) ; } else if ( jmsReplyTo != null ) { replyTo = ( Destination ) jmsReplyTo ; } if ( replyTo != null ) { LOG . debug ( ""Using JMSReplyTo destination: {}"" , replyTo ) ; JmsMessageHelper . setJMSReplyTo ( answer , replyTo ) ; } else { LOG . trace ( ""Not using JMSReplyTo"" ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } LOG . trace ( ""Created javax.jms.Message: {}"" , answer ) ; return answer ; } } ; try { doSend ( exchange , false , destinationName , messageCreator ) ; } catch ( Exception e ) { exchange . setException ( e ) ; callback . done ( true ) ; return true ; } setMessageId ( exchange ) ; callback . done ( true ) ; return true ; } ","protected boolean processInOnly ( final Exchange exchange , final AsyncCallback callback ) { final org . apache . camel . Message in = exchange . getIn ( ) ; String destinationName = in . getHeader ( SjmsConstants . JMS_DESTINATION_NAME , String . class ) ; if ( destinationName != null ) { in . removeHeader ( SjmsConstants . JMS_DESTINATION_NAME ) ; } if ( destinationName == null ) { destinationName = endpoint . getDestinationName ( ) ; } final String to = destinationName ; MessageCreator messageCreator = new MessageCreator ( ) { public Message createMessage ( Session session ) throws JMSException { Message answer = endpoint . getBinding ( ) . makeJmsMessage ( exchange , in , session , null ) ; Object jmsReplyTo = JmsMessageHelper . getJMSReplyTo ( answer ) ; if ( endpoint . isDisableReplyTo ( ) ) { LOG . trace ( ""ReplyTo is disabled on endpoint: {}"" , endpoint ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } else { if ( jmsReplyTo == null ) { jmsReplyTo = exchange . getIn ( ) . getHeader ( ""JMSReplyTo"" , String . class ) ; if ( jmsReplyTo == null ) { jmsReplyTo = endpoint . getReplyTo ( ) ; } } } if ( jmsReplyTo != null && ! ( endpoint . isPreserveMessageQos ( ) || endpoint . isExplicitQosEnabled ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Disabling JMSReplyTo: {} for destination: {}. Use preserveMessageQos=true to force Camel to keep the JMSReplyTo on endpoint: {}"" , new Object [ ] { jmsReplyTo , to , endpoint } ) ; } jmsReplyTo = null ; } if ( jmsReplyTo instanceof String ) { String replyTo = ( String ) jmsReplyTo ; jmsReplyTo = resolveOrCreateDestination ( replyTo , session ) ; } Destination replyTo = null ; String replyToOverride = endpoint . getReplyToOverride ( ) ; if ( replyToOverride != null ) { replyTo = resolveOrCreateDestination ( replyToOverride , session ) ; } else if ( jmsReplyTo != null ) { replyTo = ( Destination ) jmsReplyTo ; } if ( replyTo != null ) { LOG . debug ( ""Using JMSReplyTo destination: {}"" , replyTo ) ; JmsMessageHelper . setJMSReplyTo ( answer , replyTo ) ; } else { LOG . trace ( ""Not using JMSReplyTo"" ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } LOG . trace ( ""Created javax.jms.Message: {}"" , answer ) ; return answer ; } } ; try { doSend ( exchange , false , destinationName , messageCreator ) ; } catch ( Exception e ) { exchange . setException ( e ) ; callback . done ( true ) ; return true ; } setMessageId ( exchange ) ; callback . done ( true ) ; return true ; } " 361,"protected boolean processInOnly ( final Exchange exchange , final AsyncCallback callback ) { final org . apache . camel . Message in = exchange . getIn ( ) ; String destinationName = in . getHeader ( SjmsConstants . JMS_DESTINATION_NAME , String . class ) ; if ( destinationName != null ) { in . removeHeader ( SjmsConstants . JMS_DESTINATION_NAME ) ; } if ( destinationName == null ) { destinationName = endpoint . getDestinationName ( ) ; } final String to = destinationName ; MessageCreator messageCreator = new MessageCreator ( ) { public Message createMessage ( Session session ) throws JMSException { Message answer = endpoint . getBinding ( ) . makeJmsMessage ( exchange , in , session , null ) ; Object jmsReplyTo = JmsMessageHelper . getJMSReplyTo ( answer ) ; if ( endpoint . isDisableReplyTo ( ) ) { LOG . trace ( ""ReplyTo is disabled on endpoint: {}"" , endpoint ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } else { if ( jmsReplyTo == null ) { jmsReplyTo = exchange . getIn ( ) . getHeader ( ""JMSReplyTo"" , String . class ) ; if ( jmsReplyTo == null ) { jmsReplyTo = endpoint . getReplyTo ( ) ; } } } if ( jmsReplyTo != null && ! ( endpoint . isPreserveMessageQos ( ) || endpoint . isExplicitQosEnabled ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { } jmsReplyTo = null ; } if ( jmsReplyTo instanceof String ) { String replyTo = ( String ) jmsReplyTo ; jmsReplyTo = resolveOrCreateDestination ( replyTo , session ) ; } Destination replyTo = null ; String replyToOverride = endpoint . getReplyToOverride ( ) ; if ( replyToOverride != null ) { replyTo = resolveOrCreateDestination ( replyToOverride , session ) ; } else if ( jmsReplyTo != null ) { replyTo = ( Destination ) jmsReplyTo ; } if ( replyTo != null ) { LOG . debug ( ""Using JMSReplyTo destination: {}"" , replyTo ) ; JmsMessageHelper . setJMSReplyTo ( answer , replyTo ) ; } else { LOG . trace ( ""Not using JMSReplyTo"" ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } LOG . trace ( ""Created javax.jms.Message: {}"" , answer ) ; return answer ; } } ; try { doSend ( exchange , false , destinationName , messageCreator ) ; } catch ( Exception e ) { exchange . setException ( e ) ; callback . done ( true ) ; return true ; } setMessageId ( exchange ) ; callback . done ( true ) ; return true ; } ","protected boolean processInOnly ( final Exchange exchange , final AsyncCallback callback ) { final org . apache . camel . Message in = exchange . getIn ( ) ; String destinationName = in . getHeader ( SjmsConstants . JMS_DESTINATION_NAME , String . class ) ; if ( destinationName != null ) { in . removeHeader ( SjmsConstants . JMS_DESTINATION_NAME ) ; } if ( destinationName == null ) { destinationName = endpoint . getDestinationName ( ) ; } final String to = destinationName ; MessageCreator messageCreator = new MessageCreator ( ) { public Message createMessage ( Session session ) throws JMSException { Message answer = endpoint . getBinding ( ) . makeJmsMessage ( exchange , in , session , null ) ; Object jmsReplyTo = JmsMessageHelper . getJMSReplyTo ( answer ) ; if ( endpoint . isDisableReplyTo ( ) ) { LOG . trace ( ""ReplyTo is disabled on endpoint: {}"" , endpoint ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } else { if ( jmsReplyTo == null ) { jmsReplyTo = exchange . getIn ( ) . getHeader ( ""JMSReplyTo"" , String . class ) ; if ( jmsReplyTo == null ) { jmsReplyTo = endpoint . getReplyTo ( ) ; } } } if ( jmsReplyTo != null && ! ( endpoint . isPreserveMessageQos ( ) || endpoint . isExplicitQosEnabled ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Disabling JMSReplyTo: {} for destination: {}. Use preserveMessageQos=true to force Camel to keep the JMSReplyTo on endpoint: {}"" , new Object [ ] { jmsReplyTo , to , endpoint } ) ; } jmsReplyTo = null ; } if ( jmsReplyTo instanceof String ) { String replyTo = ( String ) jmsReplyTo ; jmsReplyTo = resolveOrCreateDestination ( replyTo , session ) ; } Destination replyTo = null ; String replyToOverride = endpoint . getReplyToOverride ( ) ; if ( replyToOverride != null ) { replyTo = resolveOrCreateDestination ( replyToOverride , session ) ; } else if ( jmsReplyTo != null ) { replyTo = ( Destination ) jmsReplyTo ; } if ( replyTo != null ) { LOG . debug ( ""Using JMSReplyTo destination: {}"" , replyTo ) ; JmsMessageHelper . setJMSReplyTo ( answer , replyTo ) ; } else { LOG . trace ( ""Not using JMSReplyTo"" ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } LOG . trace ( ""Created javax.jms.Message: {}"" , answer ) ; return answer ; } } ; try { doSend ( exchange , false , destinationName , messageCreator ) ; } catch ( Exception e ) { exchange . setException ( e ) ; callback . done ( true ) ; return true ; } setMessageId ( exchange ) ; callback . done ( true ) ; return true ; } " 362,"protected boolean processInOnly ( final Exchange exchange , final AsyncCallback callback ) { final org . apache . camel . Message in = exchange . getIn ( ) ; String destinationName = in . getHeader ( SjmsConstants . JMS_DESTINATION_NAME , String . class ) ; if ( destinationName != null ) { in . removeHeader ( SjmsConstants . JMS_DESTINATION_NAME ) ; } if ( destinationName == null ) { destinationName = endpoint . getDestinationName ( ) ; } final String to = destinationName ; MessageCreator messageCreator = new MessageCreator ( ) { public Message createMessage ( Session session ) throws JMSException { Message answer = endpoint . getBinding ( ) . makeJmsMessage ( exchange , in , session , null ) ; Object jmsReplyTo = JmsMessageHelper . getJMSReplyTo ( answer ) ; if ( endpoint . isDisableReplyTo ( ) ) { LOG . trace ( ""ReplyTo is disabled on endpoint: {}"" , endpoint ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } else { if ( jmsReplyTo == null ) { jmsReplyTo = exchange . getIn ( ) . getHeader ( ""JMSReplyTo"" , String . class ) ; if ( jmsReplyTo == null ) { jmsReplyTo = endpoint . getReplyTo ( ) ; } } } if ( jmsReplyTo != null && ! ( endpoint . isPreserveMessageQos ( ) || endpoint . isExplicitQosEnabled ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Disabling JMSReplyTo: {} for destination: {}. Use preserveMessageQos=true to force Camel to keep the JMSReplyTo on endpoint: {}"" , new Object [ ] { jmsReplyTo , to , endpoint } ) ; } jmsReplyTo = null ; } if ( jmsReplyTo instanceof String ) { String replyTo = ( String ) jmsReplyTo ; jmsReplyTo = resolveOrCreateDestination ( replyTo , session ) ; } Destination replyTo = null ; String replyToOverride = endpoint . getReplyToOverride ( ) ; if ( replyToOverride != null ) { replyTo = resolveOrCreateDestination ( replyToOverride , session ) ; } else if ( jmsReplyTo != null ) { replyTo = ( Destination ) jmsReplyTo ; } if ( replyTo != null ) { JmsMessageHelper . setJMSReplyTo ( answer , replyTo ) ; } else { LOG . trace ( ""Not using JMSReplyTo"" ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } LOG . trace ( ""Created javax.jms.Message: {}"" , answer ) ; return answer ; } } ; try { doSend ( exchange , false , destinationName , messageCreator ) ; } catch ( Exception e ) { exchange . setException ( e ) ; callback . done ( true ) ; return true ; } setMessageId ( exchange ) ; callback . done ( true ) ; return true ; } ","protected boolean processInOnly ( final Exchange exchange , final AsyncCallback callback ) { final org . apache . camel . Message in = exchange . getIn ( ) ; String destinationName = in . getHeader ( SjmsConstants . JMS_DESTINATION_NAME , String . class ) ; if ( destinationName != null ) { in . removeHeader ( SjmsConstants . JMS_DESTINATION_NAME ) ; } if ( destinationName == null ) { destinationName = endpoint . getDestinationName ( ) ; } final String to = destinationName ; MessageCreator messageCreator = new MessageCreator ( ) { public Message createMessage ( Session session ) throws JMSException { Message answer = endpoint . getBinding ( ) . makeJmsMessage ( exchange , in , session , null ) ; Object jmsReplyTo = JmsMessageHelper . getJMSReplyTo ( answer ) ; if ( endpoint . isDisableReplyTo ( ) ) { LOG . trace ( ""ReplyTo is disabled on endpoint: {}"" , endpoint ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } else { if ( jmsReplyTo == null ) { jmsReplyTo = exchange . getIn ( ) . getHeader ( ""JMSReplyTo"" , String . class ) ; if ( jmsReplyTo == null ) { jmsReplyTo = endpoint . getReplyTo ( ) ; } } } if ( jmsReplyTo != null && ! ( endpoint . isPreserveMessageQos ( ) || endpoint . isExplicitQosEnabled ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Disabling JMSReplyTo: {} for destination: {}. Use preserveMessageQos=true to force Camel to keep the JMSReplyTo on endpoint: {}"" , new Object [ ] { jmsReplyTo , to , endpoint } ) ; } jmsReplyTo = null ; } if ( jmsReplyTo instanceof String ) { String replyTo = ( String ) jmsReplyTo ; jmsReplyTo = resolveOrCreateDestination ( replyTo , session ) ; } Destination replyTo = null ; String replyToOverride = endpoint . getReplyToOverride ( ) ; if ( replyToOverride != null ) { replyTo = resolveOrCreateDestination ( replyToOverride , session ) ; } else if ( jmsReplyTo != null ) { replyTo = ( Destination ) jmsReplyTo ; } if ( replyTo != null ) { LOG . debug ( ""Using JMSReplyTo destination: {}"" , replyTo ) ; JmsMessageHelper . setJMSReplyTo ( answer , replyTo ) ; } else { LOG . trace ( ""Not using JMSReplyTo"" ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } LOG . trace ( ""Created javax.jms.Message: {}"" , answer ) ; return answer ; } } ; try { doSend ( exchange , false , destinationName , messageCreator ) ; } catch ( Exception e ) { exchange . setException ( e ) ; callback . done ( true ) ; return true ; } setMessageId ( exchange ) ; callback . done ( true ) ; return true ; } " 363,"protected boolean processInOnly ( final Exchange exchange , final AsyncCallback callback ) { final org . apache . camel . Message in = exchange . getIn ( ) ; String destinationName = in . getHeader ( SjmsConstants . JMS_DESTINATION_NAME , String . class ) ; if ( destinationName != null ) { in . removeHeader ( SjmsConstants . JMS_DESTINATION_NAME ) ; } if ( destinationName == null ) { destinationName = endpoint . getDestinationName ( ) ; } final String to = destinationName ; MessageCreator messageCreator = new MessageCreator ( ) { public Message createMessage ( Session session ) throws JMSException { Message answer = endpoint . getBinding ( ) . makeJmsMessage ( exchange , in , session , null ) ; Object jmsReplyTo = JmsMessageHelper . getJMSReplyTo ( answer ) ; if ( endpoint . isDisableReplyTo ( ) ) { LOG . trace ( ""ReplyTo is disabled on endpoint: {}"" , endpoint ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } else { if ( jmsReplyTo == null ) { jmsReplyTo = exchange . getIn ( ) . getHeader ( ""JMSReplyTo"" , String . class ) ; if ( jmsReplyTo == null ) { jmsReplyTo = endpoint . getReplyTo ( ) ; } } } if ( jmsReplyTo != null && ! ( endpoint . isPreserveMessageQos ( ) || endpoint . isExplicitQosEnabled ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Disabling JMSReplyTo: {} for destination: {}. Use preserveMessageQos=true to force Camel to keep the JMSReplyTo on endpoint: {}"" , new Object [ ] { jmsReplyTo , to , endpoint } ) ; } jmsReplyTo = null ; } if ( jmsReplyTo instanceof String ) { String replyTo = ( String ) jmsReplyTo ; jmsReplyTo = resolveOrCreateDestination ( replyTo , session ) ; } Destination replyTo = null ; String replyToOverride = endpoint . getReplyToOverride ( ) ; if ( replyToOverride != null ) { replyTo = resolveOrCreateDestination ( replyToOverride , session ) ; } else if ( jmsReplyTo != null ) { replyTo = ( Destination ) jmsReplyTo ; } if ( replyTo != null ) { LOG . debug ( ""Using JMSReplyTo destination: {}"" , replyTo ) ; JmsMessageHelper . setJMSReplyTo ( answer , replyTo ) ; } else { JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } LOG . trace ( ""Created javax.jms.Message: {}"" , answer ) ; return answer ; } } ; try { doSend ( exchange , false , destinationName , messageCreator ) ; } catch ( Exception e ) { exchange . setException ( e ) ; callback . done ( true ) ; return true ; } setMessageId ( exchange ) ; callback . done ( true ) ; return true ; } ","protected boolean processInOnly ( final Exchange exchange , final AsyncCallback callback ) { final org . apache . camel . Message in = exchange . getIn ( ) ; String destinationName = in . getHeader ( SjmsConstants . JMS_DESTINATION_NAME , String . class ) ; if ( destinationName != null ) { in . removeHeader ( SjmsConstants . JMS_DESTINATION_NAME ) ; } if ( destinationName == null ) { destinationName = endpoint . getDestinationName ( ) ; } final String to = destinationName ; MessageCreator messageCreator = new MessageCreator ( ) { public Message createMessage ( Session session ) throws JMSException { Message answer = endpoint . getBinding ( ) . makeJmsMessage ( exchange , in , session , null ) ; Object jmsReplyTo = JmsMessageHelper . getJMSReplyTo ( answer ) ; if ( endpoint . isDisableReplyTo ( ) ) { LOG . trace ( ""ReplyTo is disabled on endpoint: {}"" , endpoint ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } else { if ( jmsReplyTo == null ) { jmsReplyTo = exchange . getIn ( ) . getHeader ( ""JMSReplyTo"" , String . class ) ; if ( jmsReplyTo == null ) { jmsReplyTo = endpoint . getReplyTo ( ) ; } } } if ( jmsReplyTo != null && ! ( endpoint . isPreserveMessageQos ( ) || endpoint . isExplicitQosEnabled ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Disabling JMSReplyTo: {} for destination: {}. Use preserveMessageQos=true to force Camel to keep the JMSReplyTo on endpoint: {}"" , new Object [ ] { jmsReplyTo , to , endpoint } ) ; } jmsReplyTo = null ; } if ( jmsReplyTo instanceof String ) { String replyTo = ( String ) jmsReplyTo ; jmsReplyTo = resolveOrCreateDestination ( replyTo , session ) ; } Destination replyTo = null ; String replyToOverride = endpoint . getReplyToOverride ( ) ; if ( replyToOverride != null ) { replyTo = resolveOrCreateDestination ( replyToOverride , session ) ; } else if ( jmsReplyTo != null ) { replyTo = ( Destination ) jmsReplyTo ; } if ( replyTo != null ) { LOG . debug ( ""Using JMSReplyTo destination: {}"" , replyTo ) ; JmsMessageHelper . setJMSReplyTo ( answer , replyTo ) ; } else { LOG . trace ( ""Not using JMSReplyTo"" ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } LOG . trace ( ""Created javax.jms.Message: {}"" , answer ) ; return answer ; } } ; try { doSend ( exchange , false , destinationName , messageCreator ) ; } catch ( Exception e ) { exchange . setException ( e ) ; callback . done ( true ) ; return true ; } setMessageId ( exchange ) ; callback . done ( true ) ; return true ; } " 364,"protected boolean processInOnly ( final Exchange exchange , final AsyncCallback callback ) { final org . apache . camel . Message in = exchange . getIn ( ) ; String destinationName = in . getHeader ( SjmsConstants . JMS_DESTINATION_NAME , String . class ) ; if ( destinationName != null ) { in . removeHeader ( SjmsConstants . JMS_DESTINATION_NAME ) ; } if ( destinationName == null ) { destinationName = endpoint . getDestinationName ( ) ; } final String to = destinationName ; MessageCreator messageCreator = new MessageCreator ( ) { public Message createMessage ( Session session ) throws JMSException { Message answer = endpoint . getBinding ( ) . makeJmsMessage ( exchange , in , session , null ) ; Object jmsReplyTo = JmsMessageHelper . getJMSReplyTo ( answer ) ; if ( endpoint . isDisableReplyTo ( ) ) { LOG . trace ( ""ReplyTo is disabled on endpoint: {}"" , endpoint ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } else { if ( jmsReplyTo == null ) { jmsReplyTo = exchange . getIn ( ) . getHeader ( ""JMSReplyTo"" , String . class ) ; if ( jmsReplyTo == null ) { jmsReplyTo = endpoint . getReplyTo ( ) ; } } } if ( jmsReplyTo != null && ! ( endpoint . isPreserveMessageQos ( ) || endpoint . isExplicitQosEnabled ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Disabling JMSReplyTo: {} for destination: {}. Use preserveMessageQos=true to force Camel to keep the JMSReplyTo on endpoint: {}"" , new Object [ ] { jmsReplyTo , to , endpoint } ) ; } jmsReplyTo = null ; } if ( jmsReplyTo instanceof String ) { String replyTo = ( String ) jmsReplyTo ; jmsReplyTo = resolveOrCreateDestination ( replyTo , session ) ; } Destination replyTo = null ; String replyToOverride = endpoint . getReplyToOverride ( ) ; if ( replyToOverride != null ) { replyTo = resolveOrCreateDestination ( replyToOverride , session ) ; } else if ( jmsReplyTo != null ) { replyTo = ( Destination ) jmsReplyTo ; } if ( replyTo != null ) { LOG . debug ( ""Using JMSReplyTo destination: {}"" , replyTo ) ; JmsMessageHelper . setJMSReplyTo ( answer , replyTo ) ; } else { LOG . trace ( ""Not using JMSReplyTo"" ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } return answer ; } } ; try { doSend ( exchange , false , destinationName , messageCreator ) ; } catch ( Exception e ) { exchange . setException ( e ) ; callback . done ( true ) ; return true ; } setMessageId ( exchange ) ; callback . done ( true ) ; return true ; } ","protected boolean processInOnly ( final Exchange exchange , final AsyncCallback callback ) { final org . apache . camel . Message in = exchange . getIn ( ) ; String destinationName = in . getHeader ( SjmsConstants . JMS_DESTINATION_NAME , String . class ) ; if ( destinationName != null ) { in . removeHeader ( SjmsConstants . JMS_DESTINATION_NAME ) ; } if ( destinationName == null ) { destinationName = endpoint . getDestinationName ( ) ; } final String to = destinationName ; MessageCreator messageCreator = new MessageCreator ( ) { public Message createMessage ( Session session ) throws JMSException { Message answer = endpoint . getBinding ( ) . makeJmsMessage ( exchange , in , session , null ) ; Object jmsReplyTo = JmsMessageHelper . getJMSReplyTo ( answer ) ; if ( endpoint . isDisableReplyTo ( ) ) { LOG . trace ( ""ReplyTo is disabled on endpoint: {}"" , endpoint ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } else { if ( jmsReplyTo == null ) { jmsReplyTo = exchange . getIn ( ) . getHeader ( ""JMSReplyTo"" , String . class ) ; if ( jmsReplyTo == null ) { jmsReplyTo = endpoint . getReplyTo ( ) ; } } } if ( jmsReplyTo != null && ! ( endpoint . isPreserveMessageQos ( ) || endpoint . isExplicitQosEnabled ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Disabling JMSReplyTo: {} for destination: {}. Use preserveMessageQos=true to force Camel to keep the JMSReplyTo on endpoint: {}"" , new Object [ ] { jmsReplyTo , to , endpoint } ) ; } jmsReplyTo = null ; } if ( jmsReplyTo instanceof String ) { String replyTo = ( String ) jmsReplyTo ; jmsReplyTo = resolveOrCreateDestination ( replyTo , session ) ; } Destination replyTo = null ; String replyToOverride = endpoint . getReplyToOverride ( ) ; if ( replyToOverride != null ) { replyTo = resolveOrCreateDestination ( replyToOverride , session ) ; } else if ( jmsReplyTo != null ) { replyTo = ( Destination ) jmsReplyTo ; } if ( replyTo != null ) { LOG . debug ( ""Using JMSReplyTo destination: {}"" , replyTo ) ; JmsMessageHelper . setJMSReplyTo ( answer , replyTo ) ; } else { LOG . trace ( ""Not using JMSReplyTo"" ) ; JmsMessageHelper . setJMSReplyTo ( answer , null ) ; } LOG . trace ( ""Created javax.jms.Message: {}"" , answer ) ; return answer ; } } ; try { doSend ( exchange , false , destinationName , messageCreator ) ; } catch ( Exception e ) { exchange . setException ( e ) ; callback . done ( true ) ; return true ; } setMessageId ( exchange ) ; callback . done ( true ) ; return true ; } " 365,"public void addSpatialFilter ( String geometryWkt , Double inputRadius , String linearUnit , String spatialType ) { Filter filter = null ; try { if ( geometryWkt == null || geometryWkt . isEmpty ( ) ) { return ; } SpatialFilter spatialFilter = new SpatialFilter ( geometryWkt ) ; if ( spatialType . equals ( ""CONTAINS"" ) ) { filter = FILTER_FACTORY . within ( Metacard . ANY_GEO , spatialFilter . getGeometry ( ) ) ; } else if ( spatialType . equals ( ""OVERLAPS"" ) ) { filter = FILTER_FACTORY . intersects ( Metacard . ANY_GEO , spatialFilter . getGeometry ( ) ) ; } else if ( spatialType . equals ( ""NEAREST_NEIGHBOR"" ) ) { filter = FILTER_FACTORY . beyond ( Metacard . ANY_GEO , spatialFilter . getGeometry ( ) , 0.0 , UomOgcMapping . METRE . name ( ) ) ; } else if ( spatialType . equals ( ""POINT_RADIUS"" ) ) { Double normalizedRadius = convertRadius ( linearUnit , inputRadius ) ; filter = FILTER_FACTORY . dwithin ( Metacard . ANY_GEO , spatialFilter . getGeometry ( ) , normalizedRadius , UomOgcMapping . METRE . name ( ) ) ; } else { return ; } } catch ( IllegalArgumentException e ) { return ; } if ( filter != null ) { filters . add ( filter ) ; } } ","public void addSpatialFilter ( String geometryWkt , Double inputRadius , String linearUnit , String spatialType ) { Filter filter = null ; try { if ( geometryWkt == null || geometryWkt . isEmpty ( ) ) { return ; } SpatialFilter spatialFilter = new SpatialFilter ( geometryWkt ) ; if ( spatialType . equals ( ""CONTAINS"" ) ) { filter = FILTER_FACTORY . within ( Metacard . ANY_GEO , spatialFilter . getGeometry ( ) ) ; } else if ( spatialType . equals ( ""OVERLAPS"" ) ) { filter = FILTER_FACTORY . intersects ( Metacard . ANY_GEO , spatialFilter . getGeometry ( ) ) ; } else if ( spatialType . equals ( ""NEAREST_NEIGHBOR"" ) ) { filter = FILTER_FACTORY . beyond ( Metacard . ANY_GEO , spatialFilter . getGeometry ( ) , 0.0 , UomOgcMapping . METRE . name ( ) ) ; } else if ( spatialType . equals ( ""POINT_RADIUS"" ) ) { Double normalizedRadius = convertRadius ( linearUnit , inputRadius ) ; filter = FILTER_FACTORY . dwithin ( Metacard . ANY_GEO , spatialFilter . getGeometry ( ) , normalizedRadius , UomOgcMapping . METRE . name ( ) ) ; } else { return ; } } catch ( IllegalArgumentException e ) { LOGGER . debug ( ""Invalid spatial query type specified. Will not apply spatial filter."" ) ; return ; } if ( filter != null ) { filters . add ( filter ) ; } } " 366,"public List < AssetEntry > getInfoList ( InfoListProviderContext infoListProviderContext , Pagination pagination , Sort sort ) { AssetEntryQuery assetEntryQuery = getAssetEntryQuery ( infoListProviderContext , ""ratings"" , ""DESC"" , pagination ) ; try { return _assetEntryService . getEntries ( assetEntryQuery ) ; } catch ( Exception exception ) { } return Collections . emptyList ( ) ; } ","public List < AssetEntry > getInfoList ( InfoListProviderContext infoListProviderContext , Pagination pagination , Sort sort ) { AssetEntryQuery assetEntryQuery = getAssetEntryQuery ( infoListProviderContext , ""ratings"" , ""DESC"" , pagination ) ; try { return _assetEntryService . getEntries ( assetEntryQuery ) ; } catch ( Exception exception ) { _log . error ( ""Unable to get asset entries"" , exception ) ; } return Collections . emptyList ( ) ; } " 367,"private MCRILogicalStructMapTypeProvider getTypeProvider ( ) { try { return MCRConfiguration2 . < MCRDefaultLogicalStructMapTypeProvider > getClass ( ""MCR.Component.MetsMods.LogicalStructMapTypeProvider"" ) . orElse ( MCRDefaultLogicalStructMapTypeProvider . class ) . getDeclaredConstructor ( ) . newInstance ( ) ; } catch ( Exception e ) { return new MCRDefaultLogicalStructMapTypeProvider ( ) ; } } ","private MCRILogicalStructMapTypeProvider getTypeProvider ( ) { try { return MCRConfiguration2 . < MCRDefaultLogicalStructMapTypeProvider > getClass ( ""MCR.Component.MetsMods.LogicalStructMapTypeProvider"" ) . orElse ( MCRDefaultLogicalStructMapTypeProvider . class ) . getDeclaredConstructor ( ) . newInstance ( ) ; } catch ( Exception e ) { LOGGER . warn ( ""Could not load class"" , e ) ; return new MCRDefaultLogicalStructMapTypeProvider ( ) ; } } " 368,"public OutputStream append ( String path ) throws IOException { return updateFile ( path , true ) ; } ","public OutputStream append ( String path ) throws IOException { log . debug ( ""append [{}]"" , path ) ; return updateFile ( path , true ) ; } " 369,"public void sendMessage ( Message message , Role role ) throws MessageException { log . debug ( ""User Service : "" + Context . getUserService ( ) ) ; List < Role > roles = new ArrayList < > ( ) ; roles . add ( role ) ; Collection < User > users = Context . getUserService ( ) . getUsers ( null , roles , false ) ; log . debug ( ""Sending message "" + message + "" to "" + users ) ; Context . getMessageService ( ) . sendMessage ( message , users ) ; } ","public void sendMessage ( Message message , Role role ) throws MessageException { log . debug ( ""Sending message to role "" + role ) ; log . debug ( ""User Service : "" + Context . getUserService ( ) ) ; List < Role > roles = new ArrayList < > ( ) ; roles . add ( role ) ; Collection < User > users = Context . getUserService ( ) . getUsers ( null , roles , false ) ; log . debug ( ""Sending message "" + message + "" to "" + users ) ; Context . getMessageService ( ) . sendMessage ( message , users ) ; } " 370,"public void sendMessage ( Message message , Role role ) throws MessageException { log . debug ( ""Sending message to role "" + role ) ; List < Role > roles = new ArrayList < > ( ) ; roles . add ( role ) ; Collection < User > users = Context . getUserService ( ) . getUsers ( null , roles , false ) ; log . debug ( ""Sending message "" + message + "" to "" + users ) ; Context . getMessageService ( ) . sendMessage ( message , users ) ; } ","public void sendMessage ( Message message , Role role ) throws MessageException { log . debug ( ""Sending message to role "" + role ) ; log . debug ( ""User Service : "" + Context . getUserService ( ) ) ; List < Role > roles = new ArrayList < > ( ) ; roles . add ( role ) ; Collection < User > users = Context . getUserService ( ) . getUsers ( null , roles , false ) ; log . debug ( ""Sending message "" + message + "" to "" + users ) ; Context . getMessageService ( ) . sendMessage ( message , users ) ; } " 371,"public void sendMessage ( Message message , Role role ) throws MessageException { log . debug ( ""Sending message to role "" + role ) ; log . debug ( ""User Service : "" + Context . getUserService ( ) ) ; List < Role > roles = new ArrayList < > ( ) ; roles . add ( role ) ; Collection < User > users = Context . getUserService ( ) . getUsers ( null , roles , false ) ; Context . getMessageService ( ) . sendMessage ( message , users ) ; } ","public void sendMessage ( Message message , Role role ) throws MessageException { log . debug ( ""Sending message to role "" + role ) ; log . debug ( ""User Service : "" + Context . getUserService ( ) ) ; List < Role > roles = new ArrayList < > ( ) ; roles . add ( role ) ; Collection < User > users = Context . getUserService ( ) . getUsers ( null , roles , false ) ; log . debug ( ""Sending message "" + message + "" to "" + users ) ; Context . getMessageService ( ) . sendMessage ( message , users ) ; } " 372,"public void post ( LogRecord event ) { AppendLogResult < ScheduleIndex > result = facade . appendScheduleLog ( event ) ; int code = result . getCode ( ) ; if ( MessageProducerCode . SUCCESS != code ) { throw new AppendException ( ""appendScheduleLogError"" ) ; } iterateCallback . apply ( result . getAdditional ( ) ) ; } ","public void post ( LogRecord event ) { AppendLogResult < ScheduleIndex > result = facade . appendScheduleLog ( event ) ; int code = result . getCode ( ) ; if ( MessageProducerCode . SUCCESS != code ) { LOGGER . error ( ""appendMessageLog schedule log error,log:{} {},code:{}"" , event . getSubject ( ) , event . getMessageId ( ) , code ) ; throw new AppendException ( ""appendScheduleLogError"" ) ; } iterateCallback . apply ( result . getAdditional ( ) ) ; } " 373,"@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } ","@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } " 374,"@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } ","@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } " 375,"@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } ","@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } " 376,"@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } ","@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } " 377,"@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } ","@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } " 378,"@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } ","@ Test ( groups = { ""wso2.cep"" } , description = ""Testing the order: ExP, EP, ER, ES-1, ES-2"" , dependsOnMethods = { ""removeArtifactsTestScenario2"" } ) public void addArtifactsTestScenario3 ( ) throws Exception { log . info ( ""=======================Testing the order: ExP, EP, ER, ES-1, ES-2======================= "" ) ; eventStreamCount = eventStreamManagerAdminServiceClient . getEventStreamCount ( ) ; eventReceiverCount = eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) ; eventPublisherCount = eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) ; executionPlanCount = eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) ; log . info ( ""=======================Adding an execution plan ======================= "" ) ; String executionPlan = getExecutionPlanFromFile ( ""DeployArtifactsTestCase"" , ""testPlan.siddhiql"" ) ; eventProcessorAdminServiceClient . addExecutionPlan ( executionPlan ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , executionPlanCount ) ; log . info ( ""=======================Adding an event receiver ======================= "" ) ; String eventReceiverConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaOrder.xml"" ) ; eventReceiverAdminServiceClient . addEventReceiverConfiguration ( eventReceiverConfig ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , eventReceiverCount ) ; log . info ( ""=======================Adding an event publisher ======================= "" ) ; String eventPublisherConfig = getXMLArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""PizzaDeliveryNotification.xml"" ) ; eventPublisherAdminServiceClient . addEventPublisherConfiguration ( eventPublisherConfig ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , eventPublisherCount ) ; log . info ( ""=======================Adding a stream definition===================="" ) ; String pizzaStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""org.wso2.sample.pizza.order_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( pizzaStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; log . info ( ""=======================Adding another stream definition===================="" ) ; String outStreamDefinition = getJSONArtifactConfiguration ( ""DeployArtifactsTestCase"" , ""outStream_1.0.0.json"" ) ; eventStreamManagerAdminServiceClient . addEventStreamAsString ( outStreamDefinition ) ; Assert . assertEquals ( eventStreamManagerAdminServiceClient . getEventStreamCount ( ) , ++ eventStreamCount ) ; Thread . sleep ( 1000 ) ; Assert . assertEquals ( eventProcessorAdminServiceClient . getActiveExecutionPlanConfigurationCount ( ) , ++ executionPlanCount ) ; Assert . assertEquals ( eventReceiverAdminServiceClient . getActiveEventReceiverCount ( ) , ++ eventReceiverCount ) ; Assert . assertEquals ( eventPublisherAdminServiceClient . getActiveEventPublisherCount ( ) , ++ eventPublisherCount ) ; } " 379,"@ PostConstruct protected synchronized void init ( ) { if ( mangoProperties != null && mangoProperties . getBoolean ( ""properties.reloading"" , true ) ) { Path path = mangoProperties . getEnvPropertiesPath ( ) ; Path parent = path . getParent ( ) ; try { if ( Files . isDirectory ( parent ) ) { this . watchService = parent . getFileSystem ( ) . newWatchService ( ) ; parent . register ( watchService , StandardWatchEventKinds . ENTRY_CREATE , StandardWatchEventKinds . ENTRY_MODIFY ) ; this . scheduledTask = scheduledExecutorService . scheduleWithFixedDelay ( this :: doCheck , 10 , 10 , TimeUnit . SECONDS ) ; } } catch ( IOException e ) { } } } ","@ PostConstruct protected synchronized void init ( ) { if ( mangoProperties != null && mangoProperties . getBoolean ( ""properties.reloading"" , true ) ) { Path path = mangoProperties . getEnvPropertiesPath ( ) ; Path parent = path . getParent ( ) ; try { if ( Files . isDirectory ( parent ) ) { this . watchService = parent . getFileSystem ( ) . newWatchService ( ) ; parent . register ( watchService , StandardWatchEventKinds . ENTRY_CREATE , StandardWatchEventKinds . ENTRY_MODIFY ) ; this . scheduledTask = scheduledExecutorService . scheduleWithFixedDelay ( this :: doCheck , 10 , 10 , TimeUnit . SECONDS ) ; } } catch ( IOException e ) { log . error ( ""Can't watch env.properties file for changes"" , e ) ; } } } " 380,"@ VisibleForTesting io . prometheus . client . Gauge . Child gaugeFrom ( Gauge gauge ) { return new io . prometheus . client . Gauge . Child ( ) { @ Override public double get ( ) { final Object value = gauge . getValue ( ) ; if ( value == null ) { return 0 ; } if ( value instanceof Double ) { return ( double ) value ; } if ( value instanceof Number ) { return ( ( Number ) value ) . doubleValue ( ) ; } if ( value instanceof Boolean ) { return ( ( Boolean ) value ) ? 1 : 0 ; } log . debug ( ""Invalid type for Gauge {}: {}, only number types and booleans are supported by this reporter."" , gauge , value . getClass ( ) . getName ( ) ) ; return 0 ; } } ; } ","@ VisibleForTesting io . prometheus . client . Gauge . Child gaugeFrom ( Gauge gauge ) { return new io . prometheus . client . Gauge . Child ( ) { @ Override public double get ( ) { final Object value = gauge . getValue ( ) ; if ( value == null ) { log . debug ( ""Gauge {} is null-valued, defaulting to 0."" , gauge ) ; return 0 ; } if ( value instanceof Double ) { return ( double ) value ; } if ( value instanceof Number ) { return ( ( Number ) value ) . doubleValue ( ) ; } if ( value instanceof Boolean ) { return ( ( Boolean ) value ) ? 1 : 0 ; } log . debug ( ""Invalid type for Gauge {}: {}, only number types and booleans are supported by this reporter."" , gauge , value . getClass ( ) . getName ( ) ) ; return 0 ; } } ; } " 381,"@ VisibleForTesting io . prometheus . client . Gauge . Child gaugeFrom ( Gauge gauge ) { return new io . prometheus . client . Gauge . Child ( ) { @ Override public double get ( ) { final Object value = gauge . getValue ( ) ; if ( value == null ) { log . debug ( ""Gauge {} is null-valued, defaulting to 0."" , gauge ) ; return 0 ; } if ( value instanceof Double ) { return ( double ) value ; } if ( value instanceof Number ) { return ( ( Number ) value ) . doubleValue ( ) ; } if ( value instanceof Boolean ) { return ( ( Boolean ) value ) ? 1 : 0 ; } return 0 ; } } ; } ","@ VisibleForTesting io . prometheus . client . Gauge . Child gaugeFrom ( Gauge gauge ) { return new io . prometheus . client . Gauge . Child ( ) { @ Override public double get ( ) { final Object value = gauge . getValue ( ) ; if ( value == null ) { log . debug ( ""Gauge {} is null-valued, defaulting to 0."" , gauge ) ; return 0 ; } if ( value instanceof Double ) { return ( double ) value ; } if ( value instanceof Number ) { return ( ( Number ) value ) . doubleValue ( ) ; } if ( value instanceof Boolean ) { return ( ( Boolean ) value ) ? 1 : 0 ; } log . debug ( ""Invalid type for Gauge {}: {}, only number types and booleans are supported by this reporter."" , gauge , value . getClass ( ) . getName ( ) ) ; return 0 ; } } ; } " 382,"private void offloadNode ( ) throws InterruptedException { while ( true ) { final Future < Void > future = clusterCoordinator . requestNodeOffload ( localNodeIdentifier , OffloadCode . OFFLOADED , ""Node is being decommissioned"" ) ; try { future . get ( ) ; break ; } catch ( final ExecutionException e ) { final Throwable cause = e . getCause ( ) ; logger . error ( ""Failed when attempting to disconnect node from cluster"" , cause ) ; } } waitForState ( new HashSet < > ( Arrays . asList ( NodeConnectionState . OFFLOADING , NodeConnectionState . OFFLOADED ) ) ) ; } ","private void offloadNode ( ) throws InterruptedException { logger . info ( ""Requesting that Node be offloaded"" ) ; while ( true ) { final Future < Void > future = clusterCoordinator . requestNodeOffload ( localNodeIdentifier , OffloadCode . OFFLOADED , ""Node is being decommissioned"" ) ; try { future . get ( ) ; break ; } catch ( final ExecutionException e ) { final Throwable cause = e . getCause ( ) ; logger . error ( ""Failed when attempting to disconnect node from cluster"" , cause ) ; } } waitForState ( new HashSet < > ( Arrays . asList ( NodeConnectionState . OFFLOADING , NodeConnectionState . OFFLOADED ) ) ) ; } " 383,"private void offloadNode ( ) throws InterruptedException { logger . info ( ""Requesting that Node be offloaded"" ) ; while ( true ) { final Future < Void > future = clusterCoordinator . requestNodeOffload ( localNodeIdentifier , OffloadCode . OFFLOADED , ""Node is being decommissioned"" ) ; try { future . get ( ) ; break ; } catch ( final ExecutionException e ) { final Throwable cause = e . getCause ( ) ; } } waitForState ( new HashSet < > ( Arrays . asList ( NodeConnectionState . OFFLOADING , NodeConnectionState . OFFLOADED ) ) ) ; } ","private void offloadNode ( ) throws InterruptedException { logger . info ( ""Requesting that Node be offloaded"" ) ; while ( true ) { final Future < Void > future = clusterCoordinator . requestNodeOffload ( localNodeIdentifier , OffloadCode . OFFLOADED , ""Node is being decommissioned"" ) ; try { future . get ( ) ; break ; } catch ( final ExecutionException e ) { final Throwable cause = e . getCause ( ) ; logger . error ( ""Failed when attempting to disconnect node from cluster"" , cause ) ; } } waitForState ( new HashSet < > ( Arrays . asList ( NodeConnectionState . OFFLOADING , NodeConnectionState . OFFLOADED ) ) ) ; } " 384,"@ RuleAction ( label = ""get the ring time limit"" , description = ""Get the value of RING_TIME_LIMIT."" ) public @ ActionOutput ( name = ""getRingTimeLimit"" , type = ""java.lang.String"" ) String getRingTimeLimit ( ) { if ( handler != null ) { return handler . actionGetRingTimeLimit ( ) ; } else { logger . info ( ""Doorbird Action service ThingHandler is null!"" ) ; return """" ; } } ","@ RuleAction ( label = ""get the ring time limit"" , description = ""Get the value of RING_TIME_LIMIT."" ) public @ ActionOutput ( name = ""getRingTimeLimit"" , type = ""java.lang.String"" ) String getRingTimeLimit ( ) { logger . debug ( ""Doorbird action 'getRingTimeLimit' called"" ) ; if ( handler != null ) { return handler . actionGetRingTimeLimit ( ) ; } else { logger . info ( ""Doorbird Action service ThingHandler is null!"" ) ; return """" ; } } " 385,"@ RuleAction ( label = ""get the ring time limit"" , description = ""Get the value of RING_TIME_LIMIT."" ) public @ ActionOutput ( name = ""getRingTimeLimit"" , type = ""java.lang.String"" ) String getRingTimeLimit ( ) { logger . debug ( ""Doorbird action 'getRingTimeLimit' called"" ) ; if ( handler != null ) { return handler . actionGetRingTimeLimit ( ) ; } else { return """" ; } } ","@ RuleAction ( label = ""get the ring time limit"" , description = ""Get the value of RING_TIME_LIMIT."" ) public @ ActionOutput ( name = ""getRingTimeLimit"" , type = ""java.lang.String"" ) String getRingTimeLimit ( ) { logger . debug ( ""Doorbird action 'getRingTimeLimit' called"" ) ; if ( handler != null ) { return handler . actionGetRingTimeLimit ( ) ; } else { logger . info ( ""Doorbird Action service ThingHandler is null!"" ) ; return """" ; } } " 386,"public void run ( ) { emgrFactory . runInTrans ( emgr -> { final EntityManager em = emgr . getEntityManager ( ) ; final Set < String > alreadyReindexed = new HashSet < > ( ) ; final List < Entry > entryList = map . get ( obj . getClass ( ) ) ; reindexDependents ( em , obj , entryList , alreadyReindexed ) ; final int size = alreadyReindexed . size ( ) ; if ( size >= 10 ) { } return null ; } ) ; } ","public void run ( ) { emgrFactory . runInTrans ( emgr -> { final EntityManager em = emgr . getEntityManager ( ) ; final Set < String > alreadyReindexed = new HashSet < > ( ) ; final List < Entry > entryList = map . get ( obj . getClass ( ) ) ; reindexDependents ( em , obj , entryList , alreadyReindexed ) ; final int size = alreadyReindexed . size ( ) ; if ( size >= 10 ) { log . info ( ""Re-indexing of "" + size + "" objects done after updating "" + obj . getClass ( ) . getName ( ) + "":"" + obj . getId ( ) ) ; } return null ; } ) ; } " 387,"public static void printAST ( ASTNode node ) { try { printAST ( getHiveTokenMapping ( ) , node , 0 , 0 ) ; } catch ( Exception e ) { } System . out . println ( ) ; } ","public static void printAST ( ASTNode node ) { try { printAST ( getHiveTokenMapping ( ) , node , 0 , 0 ) ; } catch ( Exception e ) { log . error ( ""Error in printing AST."" , e ) ; } System . out . println ( ) ; } " 388,"@ BeforeMethod ( alwaysRun = true ) public void setUp ( ) throws Exception { startTime = TimeUtil . getTimeWrtSystemTime ( 0 ) ; endTime = TimeUtil . addMinsToTime ( startTime , 20 ) ; bundles [ 0 ] = BundleUtil . readELBundle ( ) ; bundles [ 0 ] = new Bundle ( bundles [ 0 ] , cluster ) ; bundles [ 0 ] . generateUniqueBundle ( this ) ; bundles [ 0 ] . setProcessWorkflow ( aggregateWorkflowDir ) ; bundles [ 0 ] . setProcessValidity ( startTime , endTime ) ; bundles [ 0 ] . setProcessPeriodicity ( 5 , Frequency . TimeUnit . minutes ) ; bundles [ 0 ] . setOutputFeedPeriodicity ( 5 , Frequency . TimeUnit . minutes ) ; clusterName = Util . readEntityName ( bundles [ 0 ] . getDataSets ( ) . get ( 0 ) ) ; } ","@ BeforeMethod ( alwaysRun = true ) public void setUp ( ) throws Exception { startTime = TimeUtil . getTimeWrtSystemTime ( 0 ) ; endTime = TimeUtil . addMinsToTime ( startTime , 20 ) ; LOGGER . info ( ""Time range between : "" + startTime + "" and "" + endTime ) ; bundles [ 0 ] = BundleUtil . readELBundle ( ) ; bundles [ 0 ] = new Bundle ( bundles [ 0 ] , cluster ) ; bundles [ 0 ] . generateUniqueBundle ( this ) ; bundles [ 0 ] . setProcessWorkflow ( aggregateWorkflowDir ) ; bundles [ 0 ] . setProcessValidity ( startTime , endTime ) ; bundles [ 0 ] . setProcessPeriodicity ( 5 , Frequency . TimeUnit . minutes ) ; bundles [ 0 ] . setOutputFeedPeriodicity ( 5 , Frequency . TimeUnit . minutes ) ; clusterName = Util . readEntityName ( bundles [ 0 ] . getDataSets ( ) . get ( 0 ) ) ; } " 389,"public void setup ( ProfilerPluginSetupContext context ) { if ( context == null ) { return ; } final ElasticsearchPluginConfig elasticsearchPluginConfig = new ElasticsearchPluginConfig ( context . getConfig ( ) ) ; if ( logger . isInfoEnabled ( ) ) { } if ( ! elasticsearchPluginConfig . isEnabled ( ) ) { return ; } addElasticsearchInterceptors ( ) ; addElasticsearchExecutorInterceptors ( ) ; this . addParallelElasticsearchInterceptors ( ) ; } ","public void setup ( ProfilerPluginSetupContext context ) { if ( context == null ) { return ; } final ElasticsearchPluginConfig elasticsearchPluginConfig = new ElasticsearchPluginConfig ( context . getConfig ( ) ) ; if ( logger . isInfoEnabled ( ) ) { logger . info ( ""ElasticsearchPlugin config:{}"" , elasticsearchPluginConfig ) ; } if ( ! elasticsearchPluginConfig . isEnabled ( ) ) { return ; } addElasticsearchInterceptors ( ) ; addElasticsearchExecutorInterceptors ( ) ; this . addParallelElasticsearchInterceptors ( ) ; } " 390,"public void waitForIO ( ) throws HyracksDataException { logManager . log ( waitLog ) ; synchronized ( this ) { while ( numActiveIOOps > 0 ) { try { wait ( ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw HyracksDataException . create ( e ) ; } } if ( numActiveIOOps < 0 ) { if ( LOGGER . isErrorEnabled ( ) ) { } throw new IllegalStateException ( ""Number of IO operations cannot be negative"" ) ; } } } ","public void waitForIO ( ) throws HyracksDataException { logManager . log ( waitLog ) ; synchronized ( this ) { while ( numActiveIOOps > 0 ) { try { wait ( ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw HyracksDataException . create ( e ) ; } } if ( numActiveIOOps < 0 ) { if ( LOGGER . isErrorEnabled ( ) ) { LOGGER . error ( ""Number of IO operations cannot be negative for dataset: "" + this ) ; } throw new IllegalStateException ( ""Number of IO operations cannot be negative"" ) ; } } } " 391,"@ Nullable @ Override public DeviceStateData apply ( @ Nullable List < T > data ) { try { long lastActivityTime = getEntryValue ( data , LAST_ACTIVITY_TIME , 0L ) ; long inactivityAlarmTime = getEntryValue ( data , INACTIVITY_ALARM_TIME , 0L ) ; long inactivityTimeout = getEntryValue ( data , INACTIVITY_TIMEOUT , TimeUnit . SECONDS . toMillis ( defaultInactivityTimeoutInSec ) ) ; boolean active = System . currentTimeMillis ( ) < lastActivityTime + inactivityTimeout ; DeviceState deviceState = DeviceState . builder ( ) . active ( active ) . lastConnectTime ( getEntryValue ( data , LAST_CONNECT_TIME , 0L ) ) . lastDisconnectTime ( getEntryValue ( data , LAST_DISCONNECT_TIME , 0L ) ) . lastActivityTime ( lastActivityTime ) . lastInactivityAlarmTime ( inactivityAlarmTime ) . inactivityTimeout ( inactivityTimeout ) . build ( ) ; TbMsgMetaData md = new TbMsgMetaData ( ) ; md . putValue ( ""deviceName"" , device . getName ( ) ) ; md . putValue ( ""deviceType"" , device . getType ( ) ) ; return DeviceStateData . builder ( ) . customerId ( device . getCustomerId ( ) ) . tenantId ( device . getTenantId ( ) ) . deviceId ( device . getId ( ) ) . deviceCreationTime ( device . getCreatedTime ( ) ) . metaData ( md ) . state ( deviceState ) . build ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } ","@ Nullable @ Override public DeviceStateData apply ( @ Nullable List < T > data ) { try { long lastActivityTime = getEntryValue ( data , LAST_ACTIVITY_TIME , 0L ) ; long inactivityAlarmTime = getEntryValue ( data , INACTIVITY_ALARM_TIME , 0L ) ; long inactivityTimeout = getEntryValue ( data , INACTIVITY_TIMEOUT , TimeUnit . SECONDS . toMillis ( defaultInactivityTimeoutInSec ) ) ; boolean active = System . currentTimeMillis ( ) < lastActivityTime + inactivityTimeout ; DeviceState deviceState = DeviceState . builder ( ) . active ( active ) . lastConnectTime ( getEntryValue ( data , LAST_CONNECT_TIME , 0L ) ) . lastDisconnectTime ( getEntryValue ( data , LAST_DISCONNECT_TIME , 0L ) ) . lastActivityTime ( lastActivityTime ) . lastInactivityAlarmTime ( inactivityAlarmTime ) . inactivityTimeout ( inactivityTimeout ) . build ( ) ; TbMsgMetaData md = new TbMsgMetaData ( ) ; md . putValue ( ""deviceName"" , device . getName ( ) ) ; md . putValue ( ""deviceType"" , device . getType ( ) ) ; return DeviceStateData . builder ( ) . customerId ( device . getCustomerId ( ) ) . tenantId ( device . getTenantId ( ) ) . deviceId ( device . getId ( ) ) . deviceCreationTime ( device . getCreatedTime ( ) ) . metaData ( md ) . state ( deviceState ) . build ( ) ; } catch ( Exception e ) { log . warn ( ""[{}] Failed to fetch device state data"" , device . getId ( ) , e ) ; throw new RuntimeException ( e ) ; } } " 392,"private static < T , ID > void addCreateSchemaStatements ( DatabaseType databaseType , String schemaName , List < String > statements , List < String > queriesAfter , boolean ifNotExists , boolean logDetails ) { StringBuilder sb = new StringBuilder ( 256 ) ; if ( logDetails ) { } sb . append ( ""CREATE SCHEMA "" ) ; if ( ifNotExists && databaseType . isCreateIfNotExistsSupported ( ) ) { sb . append ( ""IF NOT EXISTS "" ) ; } databaseType . appendEscapedEntityName ( sb , schemaName ) ; databaseType . appendCreateSchemaSuffix ( sb ) ; statements . add ( sb . toString ( ) ) ; } ","private static < T , ID > void addCreateSchemaStatements ( DatabaseType databaseType , String schemaName , List < String > statements , List < String > queriesAfter , boolean ifNotExists , boolean logDetails ) { StringBuilder sb = new StringBuilder ( 256 ) ; if ( logDetails ) { logger . info ( ""creating schema '{}'"" , schemaName ) ; } sb . append ( ""CREATE SCHEMA "" ) ; if ( ifNotExists && databaseType . isCreateIfNotExistsSupported ( ) ) { sb . append ( ""IF NOT EXISTS "" ) ; } databaseType . appendEscapedEntityName ( sb , schemaName ) ; databaseType . appendCreateSchemaSuffix ( sb ) ; statements . add ( sb . toString ( ) ) ; } " 393,"protected void reduce ( Text t , Iterable < VertexWritable > vertices , Context context ) throws IOException , InterruptedException { Configuration conf = context . getConfiguration ( ) ; boolean zero = false ; int i = - 1 ; int j = - 1 ; double k = 0 ; int count = 0 ; for ( VertexWritable v : vertices ) { count ++ ; if ( v . getType ( ) . equals ( conf . get ( EigencutsKeys . AFFINITY_PATH ) ) ) { i = v . getRow ( ) ; j = v . getCol ( ) ; k = v . getValue ( ) ; } else if ( v . getValue ( ) != 0.0 ) { zero = true ; } } if ( count == 2 ) { VertexWritable vw = new VertexWritable ( i , j , k , ""unimportant"" ) ; context . write ( new Text ( String . valueOf ( i ) ) , vw ) ; return ; } VertexWritable outI = new VertexWritable ( ) ; VertexWritable outJ = new VertexWritable ( ) ; if ( zero ) { context . getCounter ( CUTSCOUNTER . NUM_CUTS ) . increment ( 1 ) ; outI . setCol ( i ) ; outJ . setCol ( j ) ; VertexWritable zeroI = new VertexWritable ( ) ; VertexWritable zeroJ = new VertexWritable ( ) ; zeroI . setCol ( j ) ; zeroI . setValue ( 0 ) ; zeroJ . setCol ( i ) ; zeroJ . setValue ( 0 ) ; zeroI . setType ( ""unimportant"" ) ; zeroJ . setType ( ""unimportant"" ) ; context . write ( new Text ( String . valueOf ( i ) ) , zeroI ) ; context . write ( new Text ( String . valueOf ( j ) ) , zeroJ ) ; } else { outI . setCol ( j ) ; outJ . setCol ( i ) ; } outI . setValue ( k ) ; outJ . setValue ( k ) ; outI . setType ( ""unimportant"" ) ; outJ . setType ( ""unimportant"" ) ; context . write ( new Text ( String . valueOf ( i ) ) , outI ) ; context . write ( new Text ( String . valueOf ( j ) ) , outJ ) ; } ","protected void reduce ( Text t , Iterable < VertexWritable > vertices , Context context ) throws IOException , InterruptedException { Configuration conf = context . getConfiguration ( ) ; log . debug ( ""{}"" , t ) ; boolean zero = false ; int i = - 1 ; int j = - 1 ; double k = 0 ; int count = 0 ; for ( VertexWritable v : vertices ) { count ++ ; if ( v . getType ( ) . equals ( conf . get ( EigencutsKeys . AFFINITY_PATH ) ) ) { i = v . getRow ( ) ; j = v . getCol ( ) ; k = v . getValue ( ) ; } else if ( v . getValue ( ) != 0.0 ) { zero = true ; } } if ( count == 2 ) { VertexWritable vw = new VertexWritable ( i , j , k , ""unimportant"" ) ; context . write ( new Text ( String . valueOf ( i ) ) , vw ) ; return ; } VertexWritable outI = new VertexWritable ( ) ; VertexWritable outJ = new VertexWritable ( ) ; if ( zero ) { context . getCounter ( CUTSCOUNTER . NUM_CUTS ) . increment ( 1 ) ; outI . setCol ( i ) ; outJ . setCol ( j ) ; VertexWritable zeroI = new VertexWritable ( ) ; VertexWritable zeroJ = new VertexWritable ( ) ; zeroI . setCol ( j ) ; zeroI . setValue ( 0 ) ; zeroJ . setCol ( i ) ; zeroJ . setValue ( 0 ) ; zeroI . setType ( ""unimportant"" ) ; zeroJ . setType ( ""unimportant"" ) ; context . write ( new Text ( String . valueOf ( i ) ) , zeroI ) ; context . write ( new Text ( String . valueOf ( j ) ) , zeroJ ) ; } else { outI . setCol ( j ) ; outJ . setCol ( i ) ; } outI . setValue ( k ) ; outJ . setValue ( k ) ; outI . setType ( ""unimportant"" ) ; outJ . setType ( ""unimportant"" ) ; context . write ( new Text ( String . valueOf ( i ) ) , outI ) ; context . write ( new Text ( String . valueOf ( j ) ) , outJ ) ; } " 394,"@ Test public void rtreeTwoDimensionsInt ( ) throws Exception { if ( LOGGER . isInfoEnabled ( ) ) { } ISerializerDeserializer [ ] fieldSerdes = { IntegerSerializerDeserializer . INSTANCE , IntegerSerializerDeserializer . INSTANCE , IntegerSerializerDeserializer . INSTANCE , IntegerSerializerDeserializer . INSTANCE , IntegerSerializerDeserializer . INSTANCE } ; int numKeys = 4 ; IPrimitiveValueProviderFactory [ ] valueProviderFactories = RTreeUtils . createPrimitiveValueProviderFactories ( numKeys , IntegerPointable . FACTORY ) ; ITupleReference key = TupleUtils . createIntegerTuple ( - 1000 , - 1000 , 1000 , 1000 ) ; runTest ( fieldSerdes , valueProviderFactories , numKeys , key , RTreePolicyType . RTREE ) ; } ","@ Test public void rtreeTwoDimensionsInt ( ) throws Exception { if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( ""RTree "" + getTestOpName ( ) + "" Test With Two Dimensions With Integer Keys."" ) ; } ISerializerDeserializer [ ] fieldSerdes = { IntegerSerializerDeserializer . INSTANCE , IntegerSerializerDeserializer . INSTANCE , IntegerSerializerDeserializer . INSTANCE , IntegerSerializerDeserializer . INSTANCE , IntegerSerializerDeserializer . INSTANCE } ; int numKeys = 4 ; IPrimitiveValueProviderFactory [ ] valueProviderFactories = RTreeUtils . createPrimitiveValueProviderFactories ( numKeys , IntegerPointable . FACTORY ) ; ITupleReference key = TupleUtils . createIntegerTuple ( - 1000 , - 1000 , 1000 , 1000 ) ; runTest ( fieldSerdes , valueProviderFactories , numKeys , key , RTreePolicyType . RTREE ) ; } " 395,"private void closeZooKeeper ( ZooKeeper zooKeeper ) { try { zooKeeper . close ( ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } } ","private void closeZooKeeper ( ZooKeeper zooKeeper ) { try { zooKeeper . close ( ) ; } catch ( InterruptedException e ) { LOGGER . warn ( ""could not close ZooKeeper client due to interrupt"" , e ) ; Thread . currentThread ( ) . interrupt ( ) ; } } " 396,"public void load ( ) { loadFunctions ( parentClassLoader , empty ( ) ) ; if ( loadCustomerUdfs ) { try { if ( ! pluginDir . exists ( ) && ! pluginDir . isDirectory ( ) ) { return ; } Files . find ( pluginDir . toPath ( ) , 1 , ( path , attributes ) -> path . toString ( ) . endsWith ( "".jar"" ) ) . map ( path -> UdfClassLoader . newClassLoader ( path , parentClassLoader , blacklist ) ) . forEach ( classLoader -> loadFunctions ( classLoader , Optional . of ( classLoader . getJarPath ( ) ) ) ) ; } catch ( final IOException e ) { LOGGER . error ( ""Failed to load UDFs from location {}"" , pluginDir , e ) ; } } } ","public void load ( ) { loadFunctions ( parentClassLoader , empty ( ) ) ; if ( loadCustomerUdfs ) { try { if ( ! pluginDir . exists ( ) && ! pluginDir . isDirectory ( ) ) { LOGGER . info ( ""UDFs can't be loaded as as dir {} doesn't exist or is not a directory"" , pluginDir ) ; return ; } Files . find ( pluginDir . toPath ( ) , 1 , ( path , attributes ) -> path . toString ( ) . endsWith ( "".jar"" ) ) . map ( path -> UdfClassLoader . newClassLoader ( path , parentClassLoader , blacklist ) ) . forEach ( classLoader -> loadFunctions ( classLoader , Optional . of ( classLoader . getJarPath ( ) ) ) ) ; } catch ( final IOException e ) { LOGGER . error ( ""Failed to load UDFs from location {}"" , pluginDir , e ) ; } } } " 397,"public void load ( ) { loadFunctions ( parentClassLoader , empty ( ) ) ; if ( loadCustomerUdfs ) { try { if ( ! pluginDir . exists ( ) && ! pluginDir . isDirectory ( ) ) { LOGGER . info ( ""UDFs can't be loaded as as dir {} doesn't exist or is not a directory"" , pluginDir ) ; return ; } Files . find ( pluginDir . toPath ( ) , 1 , ( path , attributes ) -> path . toString ( ) . endsWith ( "".jar"" ) ) . map ( path -> UdfClassLoader . newClassLoader ( path , parentClassLoader , blacklist ) ) . forEach ( classLoader -> loadFunctions ( classLoader , Optional . of ( classLoader . getJarPath ( ) ) ) ) ; } catch ( final IOException e ) { } } } ","public void load ( ) { loadFunctions ( parentClassLoader , empty ( ) ) ; if ( loadCustomerUdfs ) { try { if ( ! pluginDir . exists ( ) && ! pluginDir . isDirectory ( ) ) { LOGGER . info ( ""UDFs can't be loaded as as dir {} doesn't exist or is not a directory"" , pluginDir ) ; return ; } Files . find ( pluginDir . toPath ( ) , 1 , ( path , attributes ) -> path . toString ( ) . endsWith ( "".jar"" ) ) . map ( path -> UdfClassLoader . newClassLoader ( path , parentClassLoader , blacklist ) ) . forEach ( classLoader -> loadFunctions ( classLoader , Optional . of ( classLoader . getJarPath ( ) ) ) ) ; } catch ( final IOException e ) { LOGGER . error ( ""Failed to load UDFs from location {}"" , pluginDir , e ) ; } } } " 398,"private void writeErrorResponse ( TransactionContext transactionContext , Application application , ByteBuf out ) { SoaHeader soaHeader = transactionContext . getHeader ( ) ; SoaException soaException = transactionContext . soaException ( ) ; if ( soaException == null ) { soaException = new SoaException ( soaHeader . getRespCode ( ) . get ( ) , soaHeader . getRespMessage ( ) . orElse ( SoaCode . ServerUnKnown . getMsg ( ) ) ) ; transactionContext . soaException ( soaException ) ; } if ( out . readableBytes ( ) > 0 ) { out . clear ( ) ; } TSoaTransport transport = new TSoaTransport ( out ) ; SoaMessageProcessor messageProcessor = new SoaMessageProcessor ( transport ) ; try { messageProcessor . writeHeader ( transactionContext ) ; messageProcessor . writeMessageEnd ( ) ; transport . flush ( ) ; MdcCtxInfoUtil . putMdcToAppClassLoader ( application . getAppClasssLoader ( ) , SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID , transactionContext . sessionTid ( ) . map ( DapengUtil :: longToHexStr ) . orElse ( ""0"" ) ) ; String infoLog = ""response[seqId:"" + transactionContext . seqId ( ) + "", respCode:"" + soaHeader . getRespCode ( ) . get ( ) + ""]:"" + ""service["" + soaHeader . getServiceName ( ) + ""]:version["" + soaHeader . getVersionName ( ) + ""]:method["" + soaHeader . getMethodName ( ) + ""]"" + ( soaHeader . getOperatorId ( ) . isPresent ( ) ? "" operatorId:"" + soaHeader . getOperatorId ( ) . get ( ) : """" ) + ( soaHeader . getUserId ( ) . isPresent ( ) ? "" userId:"" + soaHeader . getUserId ( ) . get ( ) : """" ) ; if ( DapengUtil . isDapengCoreException ( soaException ) ) { application . error ( this . getClass ( ) , infoLog , soaException ) ; } else { application . info ( this . getClass ( ) , infoLog ) ; } if ( LOGGER . isDebugEnabled ( ) ) { } } catch ( Throwable e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } finally { container . requestCounter ( ) . decrementAndGet ( ) ; MdcCtxInfoUtil . removeMdcToAppClassLoader ( application . getAppClasssLoader ( ) , SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID ) ; MDC . remove ( SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID ) ; } } ","private void writeErrorResponse ( TransactionContext transactionContext , Application application , ByteBuf out ) { SoaHeader soaHeader = transactionContext . getHeader ( ) ; SoaException soaException = transactionContext . soaException ( ) ; if ( soaException == null ) { soaException = new SoaException ( soaHeader . getRespCode ( ) . get ( ) , soaHeader . getRespMessage ( ) . orElse ( SoaCode . ServerUnKnown . getMsg ( ) ) ) ; transactionContext . soaException ( soaException ) ; } if ( out . readableBytes ( ) > 0 ) { out . clear ( ) ; } TSoaTransport transport = new TSoaTransport ( out ) ; SoaMessageProcessor messageProcessor = new SoaMessageProcessor ( transport ) ; try { messageProcessor . writeHeader ( transactionContext ) ; messageProcessor . writeMessageEnd ( ) ; transport . flush ( ) ; MdcCtxInfoUtil . putMdcToAppClassLoader ( application . getAppClasssLoader ( ) , SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID , transactionContext . sessionTid ( ) . map ( DapengUtil :: longToHexStr ) . orElse ( ""0"" ) ) ; String infoLog = ""response[seqId:"" + transactionContext . seqId ( ) + "", respCode:"" + soaHeader . getRespCode ( ) . get ( ) + ""]:"" + ""service["" + soaHeader . getServiceName ( ) + ""]:version["" + soaHeader . getVersionName ( ) + ""]:method["" + soaHeader . getMethodName ( ) + ""]"" + ( soaHeader . getOperatorId ( ) . isPresent ( ) ? "" operatorId:"" + soaHeader . getOperatorId ( ) . get ( ) : """" ) + ( soaHeader . getUserId ( ) . isPresent ( ) ? "" userId:"" + soaHeader . getUserId ( ) . get ( ) : """" ) ; if ( DapengUtil . isDapengCoreException ( soaException ) ) { application . error ( this . getClass ( ) , infoLog , soaException ) ; } else { application . info ( this . getClass ( ) , infoLog ) ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( getClass ( ) + "" "" + infoLog + "", payload:\n"" + soaException . getMessage ( ) ) ; } } catch ( Throwable e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } finally { container . requestCounter ( ) . decrementAndGet ( ) ; MdcCtxInfoUtil . removeMdcToAppClassLoader ( application . getAppClasssLoader ( ) , SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID ) ; MDC . remove ( SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID ) ; } } " 399,"private void writeErrorResponse ( TransactionContext transactionContext , Application application , ByteBuf out ) { SoaHeader soaHeader = transactionContext . getHeader ( ) ; SoaException soaException = transactionContext . soaException ( ) ; if ( soaException == null ) { soaException = new SoaException ( soaHeader . getRespCode ( ) . get ( ) , soaHeader . getRespMessage ( ) . orElse ( SoaCode . ServerUnKnown . getMsg ( ) ) ) ; transactionContext . soaException ( soaException ) ; } if ( out . readableBytes ( ) > 0 ) { out . clear ( ) ; } TSoaTransport transport = new TSoaTransport ( out ) ; SoaMessageProcessor messageProcessor = new SoaMessageProcessor ( transport ) ; try { messageProcessor . writeHeader ( transactionContext ) ; messageProcessor . writeMessageEnd ( ) ; transport . flush ( ) ; MdcCtxInfoUtil . putMdcToAppClassLoader ( application . getAppClasssLoader ( ) , SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID , transactionContext . sessionTid ( ) . map ( DapengUtil :: longToHexStr ) . orElse ( ""0"" ) ) ; String infoLog = ""response[seqId:"" + transactionContext . seqId ( ) + "", respCode:"" + soaHeader . getRespCode ( ) . get ( ) + ""]:"" + ""service["" + soaHeader . getServiceName ( ) + ""]:version["" + soaHeader . getVersionName ( ) + ""]:method["" + soaHeader . getMethodName ( ) + ""]"" + ( soaHeader . getOperatorId ( ) . isPresent ( ) ? "" operatorId:"" + soaHeader . getOperatorId ( ) . get ( ) : """" ) + ( soaHeader . getUserId ( ) . isPresent ( ) ? "" userId:"" + soaHeader . getUserId ( ) . get ( ) : """" ) ; if ( DapengUtil . isDapengCoreException ( soaException ) ) { application . error ( this . getClass ( ) , infoLog , soaException ) ; } else { application . info ( this . getClass ( ) , infoLog ) ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( getClass ( ) + "" "" + infoLog + "", payload:\n"" + soaException . getMessage ( ) ) ; } } catch ( Throwable e ) { } finally { container . requestCounter ( ) . decrementAndGet ( ) ; MdcCtxInfoUtil . removeMdcToAppClassLoader ( application . getAppClasssLoader ( ) , SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID ) ; MDC . remove ( SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID ) ; } } ","private void writeErrorResponse ( TransactionContext transactionContext , Application application , ByteBuf out ) { SoaHeader soaHeader = transactionContext . getHeader ( ) ; SoaException soaException = transactionContext . soaException ( ) ; if ( soaException == null ) { soaException = new SoaException ( soaHeader . getRespCode ( ) . get ( ) , soaHeader . getRespMessage ( ) . orElse ( SoaCode . ServerUnKnown . getMsg ( ) ) ) ; transactionContext . soaException ( soaException ) ; } if ( out . readableBytes ( ) > 0 ) { out . clear ( ) ; } TSoaTransport transport = new TSoaTransport ( out ) ; SoaMessageProcessor messageProcessor = new SoaMessageProcessor ( transport ) ; try { messageProcessor . writeHeader ( transactionContext ) ; messageProcessor . writeMessageEnd ( ) ; transport . flush ( ) ; MdcCtxInfoUtil . putMdcToAppClassLoader ( application . getAppClasssLoader ( ) , SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID , transactionContext . sessionTid ( ) . map ( DapengUtil :: longToHexStr ) . orElse ( ""0"" ) ) ; String infoLog = ""response[seqId:"" + transactionContext . seqId ( ) + "", respCode:"" + soaHeader . getRespCode ( ) . get ( ) + ""]:"" + ""service["" + soaHeader . getServiceName ( ) + ""]:version["" + soaHeader . getVersionName ( ) + ""]:method["" + soaHeader . getMethodName ( ) + ""]"" + ( soaHeader . getOperatorId ( ) . isPresent ( ) ? "" operatorId:"" + soaHeader . getOperatorId ( ) . get ( ) : """" ) + ( soaHeader . getUserId ( ) . isPresent ( ) ? "" userId:"" + soaHeader . getUserId ( ) . get ( ) : """" ) ; if ( DapengUtil . isDapengCoreException ( soaException ) ) { application . error ( this . getClass ( ) , infoLog , soaException ) ; } else { application . info ( this . getClass ( ) , infoLog ) ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( getClass ( ) + "" "" + infoLog + "", payload:\n"" + soaException . getMessage ( ) ) ; } } catch ( Throwable e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } finally { container . requestCounter ( ) . decrementAndGet ( ) ; MdcCtxInfoUtil . removeMdcToAppClassLoader ( application . getAppClasssLoader ( ) , SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID ) ; MDC . remove ( SoaSystemEnvProperties . KEY_LOGGER_SESSION_TID ) ; } } " 400,"private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } ","private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } " 401,"private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } ","private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } " 402,"private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } ","private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } " 403,"private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } ","private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } " 404,"private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } ","private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } " 405,"private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } ","private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } " 406,"private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } ","private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } " 407,"private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } ","private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } " 408,"private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } ","private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } " 409,"private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } return subscription ; } ","private synchronized CswSubscription deleteCswSubscription ( String subscriptionId ) throws CswException { String methodName = ""deleteCswSubscription"" ; LogSanitizer logSanitizedId = LogSanitizer . sanitize ( subscriptionId ) ; LOGGER . trace ( ENTERING_STR , methodName ) ; LOGGER . trace ( ""subscriptionId = {}"" , logSanitizedId ) ; if ( StringUtils . isEmpty ( subscriptionId ) ) { throw new CswException ( ""Unable to delete subscription because subscription ID is null or empty"" ) ; } CswSubscription subscription = getSubscription ( subscriptionId ) ; try { LOGGER . debug ( ""Removing (unregistering) subscription: {}"" , logSanitizedId ) ; ServiceRegistration sr = registeredSubscriptions . remove ( subscriptionId ) ; if ( sr != null ) { sr . unregister ( ) ; } else { LOGGER . debug ( ""No ServiceRegistration found for subscription: {}"" , logSanitizedId ) ; } Configuration subscriptionConfig = getSubscriptionConfiguration ( subscriptionId ) ; try { if ( subscriptionConfig != null ) { LOGGER . debug ( ""Deleting subscription for subscriptionId = {}"" , logSanitizedId ) ; subscriptionConfig . delete ( ) ; } else { LOGGER . debug ( ""subscriptionConfig is NULL for ID = {}"" , logSanitizedId ) ; } } catch ( IOException e ) { LOGGER . debug ( ""IOException trying to delete subscription's configuration for subscription ID {}"" , subscriptionId , e ) ; } LOGGER . debug ( ""Subscription removal complete"" ) ; } catch ( Exception e ) { LOGGER . debug ( ""Could not delete subscription for {}"" , logSanitizedId , e ) ; } LOGGER . trace ( ""EXITING: {} (status = {})"" , methodName , false ) ; return subscription ; } " 410,"public void routine ( String schemaName , String routineName , String language , Routine . CallingConvention callingConvention ) { Routine routine = Routine . create ( ais , schemaName , routineName , language , callingConvention ) ; } ","public void routine ( String schemaName , String routineName , String language , Routine . CallingConvention callingConvention ) { LOG . trace ( ""routine: {}.{} "" , schemaName , routineName ) ; Routine routine = Routine . create ( ais , schemaName , routineName , language , callingConvention ) ; } " 411,"public void esbJobFactoryAdded ( TalendESBJobFactory esbJobFactory , String name ) { MultiThreadedOperation op = new MultiThreadedOperation ( esbJobFactory , name , endpointRegistry , executorService ) ; operations . put ( name , op ) ; if ( esbJobFactory instanceof TalendESBJob ) { ( ( TalendESBJob ) esbJobFactory ) . setEndpointRegistry ( endpointRegistry ) ; } } ","public void esbJobFactoryAdded ( TalendESBJobFactory esbJobFactory , String name ) { LOG . info ( ""Adding ESB job factory for job "" + name + ""."" ) ; MultiThreadedOperation op = new MultiThreadedOperation ( esbJobFactory , name , endpointRegistry , executorService ) ; operations . put ( name , op ) ; if ( esbJobFactory instanceof TalendESBJob ) { ( ( TalendESBJob ) esbJobFactory ) . setEndpointRegistry ( endpointRegistry ) ; } } " 412,"protected void cleanUnusedHBaseTables ( ) throws IOException { if ( ""hbase"" . equals ( config . getStorageUrl ( ) . getScheme ( ) ) && ! """" . equals ( config . getMetadataUrl ( ) . getScheme ( ) ) ) { final int deleteTimeoutMin = 2 ; try { Class hbaseCleanUpUtil = Class . forName ( ""org.apache.kylin.rest.job.StorageCleanJobHbaseUtil"" ) ; Method cleanUnusedHBaseTables = hbaseCleanUpUtil . getDeclaredMethod ( ""cleanUnusedHBaseTables"" , boolean . class , int . class , int . class ) ; hbaseGarbageTables = ( List < String > ) cleanUnusedHBaseTables . invoke ( hbaseCleanUpUtil , delete , deleteTimeoutMin , threadsNum ) ; } catch ( Throwable e ) { } } } ","protected void cleanUnusedHBaseTables ( ) throws IOException { if ( ""hbase"" . equals ( config . getStorageUrl ( ) . getScheme ( ) ) && ! """" . equals ( config . getMetadataUrl ( ) . getScheme ( ) ) ) { final int deleteTimeoutMin = 2 ; try { Class hbaseCleanUpUtil = Class . forName ( ""org.apache.kylin.rest.job.StorageCleanJobHbaseUtil"" ) ; Method cleanUnusedHBaseTables = hbaseCleanUpUtil . getDeclaredMethod ( ""cleanUnusedHBaseTables"" , boolean . class , int . class , int . class ) ; hbaseGarbageTables = ( List < String > ) cleanUnusedHBaseTables . invoke ( hbaseCleanUpUtil , delete , deleteTimeoutMin , threadsNum ) ; } catch ( Throwable e ) { logger . error ( ""Error during HBase clean up"" , e ) ; } } } " 413,"public static void printSkipNotice ( String fixtureId , File fixtureFile ) { try { } catch ( Exception e ) { log . debug ( e ) ; } } ","public static void printSkipNotice ( String fixtureId , File fixtureFile ) { try { log . info ( ""Skipping "" + fixtureId + "" tests. Fixture file "" + fixtureFile . getCanonicalPath ( ) + "" not found."" ) ; } catch ( Exception e ) { log . debug ( e ) ; } } " 414,"public static void printSkipNotice ( String fixtureId , File fixtureFile ) { try { log . info ( ""Skipping "" + fixtureId + "" tests. Fixture file "" + fixtureFile . getCanonicalPath ( ) + "" not found."" ) ; } catch ( Exception e ) { } } ","public static void printSkipNotice ( String fixtureId , File fixtureFile ) { try { log . info ( ""Skipping "" + fixtureId + "" tests. Fixture file "" + fixtureFile . getCanonicalPath ( ) + "" not found."" ) ; } catch ( Exception e ) { log . debug ( e ) ; } } " 415,"protected static void clearReferences ( ) { Enumeration < Driver > drivers = DriverManager . getDrivers ( ) ; while ( drivers . hasMoreElements ( ) ) { Driver driver = drivers . nextElement ( ) ; if ( driver . getClass ( ) . getClassLoader ( ) == getInstance ( ) ) { try { DriverManager . deregisterDriver ( driver ) ; } catch ( SQLException e ) { } } } for ( WeakReference < Class < ? > > refClazz : getInstance ( ) . cachedClasses . values ( ) ) { if ( refClazz == null ) { continue ; } Class < ? > clazz = refClazz . get ( ) ; if ( clazz != null && clazz . getName ( ) . contains ( ""openmrs"" ) ) { try { Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Field field = fields [ i ] ; int mods = field . getModifiers ( ) ; if ( field . getType ( ) . isPrimitive ( ) || ( field . getName ( ) . indexOf ( ""$"" ) != - 1 ) ) { continue ; } if ( Modifier . isStatic ( mods ) ) { try { if ( clazz . equals ( OpenmrsClassLoader . class ) && ""log"" . equals ( field . getName ( ) ) ) { continue ; } field . setAccessible ( true ) ; if ( Modifier . isFinal ( mods ) ) { if ( ! ( field . getType ( ) . getName ( ) . startsWith ( ""javax."" ) ) ) { nullInstance ( field . get ( null ) ) ; } } else { field . set ( null , null ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) ) ; } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) , t ) ; } } } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not clean fields for class "" + clazz . getName ( ) , t ) ; } } } } OpenmrsClassLoader . log = null ; getInstance ( ) . cachedClasses . clear ( ) ; } ","protected static void clearReferences ( ) { Enumeration < Driver > drivers = DriverManager . getDrivers ( ) ; while ( drivers . hasMoreElements ( ) ) { Driver driver = drivers . nextElement ( ) ; if ( driver . getClass ( ) . getClassLoader ( ) == getInstance ( ) ) { try { DriverManager . deregisterDriver ( driver ) ; } catch ( SQLException e ) { log . warn ( ""SQL driver deregistration failed"" , e ) ; } } } for ( WeakReference < Class < ? > > refClazz : getInstance ( ) . cachedClasses . values ( ) ) { if ( refClazz == null ) { continue ; } Class < ? > clazz = refClazz . get ( ) ; if ( clazz != null && clazz . getName ( ) . contains ( ""openmrs"" ) ) { try { Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Field field = fields [ i ] ; int mods = field . getModifiers ( ) ; if ( field . getType ( ) . isPrimitive ( ) || ( field . getName ( ) . indexOf ( ""$"" ) != - 1 ) ) { continue ; } if ( Modifier . isStatic ( mods ) ) { try { if ( clazz . equals ( OpenmrsClassLoader . class ) && ""log"" . equals ( field . getName ( ) ) ) { continue ; } field . setAccessible ( true ) ; if ( Modifier . isFinal ( mods ) ) { if ( ! ( field . getType ( ) . getName ( ) . startsWith ( ""javax."" ) ) ) { nullInstance ( field . get ( null ) ) ; } } else { field . set ( null , null ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) ) ; } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) , t ) ; } } } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not clean fields for class "" + clazz . getName ( ) , t ) ; } } } } OpenmrsClassLoader . log = null ; getInstance ( ) . cachedClasses . clear ( ) ; } " 416,"protected static void clearReferences ( ) { Enumeration < Driver > drivers = DriverManager . getDrivers ( ) ; while ( drivers . hasMoreElements ( ) ) { Driver driver = drivers . nextElement ( ) ; if ( driver . getClass ( ) . getClassLoader ( ) == getInstance ( ) ) { try { DriverManager . deregisterDriver ( driver ) ; } catch ( SQLException e ) { log . warn ( ""SQL driver deregistration failed"" , e ) ; } } } for ( WeakReference < Class < ? > > refClazz : getInstance ( ) . cachedClasses . values ( ) ) { if ( refClazz == null ) { continue ; } Class < ? > clazz = refClazz . get ( ) ; if ( clazz != null && clazz . getName ( ) . contains ( ""openmrs"" ) ) { try { Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Field field = fields [ i ] ; int mods = field . getModifiers ( ) ; if ( field . getType ( ) . isPrimitive ( ) || ( field . getName ( ) . indexOf ( ""$"" ) != - 1 ) ) { continue ; } if ( Modifier . isStatic ( mods ) ) { try { if ( clazz . equals ( OpenmrsClassLoader . class ) && ""log"" . equals ( field . getName ( ) ) ) { continue ; } field . setAccessible ( true ) ; if ( Modifier . isFinal ( mods ) ) { if ( ! ( field . getType ( ) . getName ( ) . startsWith ( ""javax."" ) ) ) { nullInstance ( field . get ( null ) ) ; } } else { field . set ( null , null ) ; if ( log . isDebugEnabled ( ) ) { } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) , t ) ; } } } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not clean fields for class "" + clazz . getName ( ) , t ) ; } } } } OpenmrsClassLoader . log = null ; getInstance ( ) . cachedClasses . clear ( ) ; } ","protected static void clearReferences ( ) { Enumeration < Driver > drivers = DriverManager . getDrivers ( ) ; while ( drivers . hasMoreElements ( ) ) { Driver driver = drivers . nextElement ( ) ; if ( driver . getClass ( ) . getClassLoader ( ) == getInstance ( ) ) { try { DriverManager . deregisterDriver ( driver ) ; } catch ( SQLException e ) { log . warn ( ""SQL driver deregistration failed"" , e ) ; } } } for ( WeakReference < Class < ? > > refClazz : getInstance ( ) . cachedClasses . values ( ) ) { if ( refClazz == null ) { continue ; } Class < ? > clazz = refClazz . get ( ) ; if ( clazz != null && clazz . getName ( ) . contains ( ""openmrs"" ) ) { try { Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Field field = fields [ i ] ; int mods = field . getModifiers ( ) ; if ( field . getType ( ) . isPrimitive ( ) || ( field . getName ( ) . indexOf ( ""$"" ) != - 1 ) ) { continue ; } if ( Modifier . isStatic ( mods ) ) { try { if ( clazz . equals ( OpenmrsClassLoader . class ) && ""log"" . equals ( field . getName ( ) ) ) { continue ; } field . setAccessible ( true ) ; if ( Modifier . isFinal ( mods ) ) { if ( ! ( field . getType ( ) . getName ( ) . startsWith ( ""javax."" ) ) ) { nullInstance ( field . get ( null ) ) ; } } else { field . set ( null , null ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) ) ; } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) , t ) ; } } } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not clean fields for class "" + clazz . getName ( ) , t ) ; } } } } OpenmrsClassLoader . log = null ; getInstance ( ) . cachedClasses . clear ( ) ; } " 417,"protected static void clearReferences ( ) { Enumeration < Driver > drivers = DriverManager . getDrivers ( ) ; while ( drivers . hasMoreElements ( ) ) { Driver driver = drivers . nextElement ( ) ; if ( driver . getClass ( ) . getClassLoader ( ) == getInstance ( ) ) { try { DriverManager . deregisterDriver ( driver ) ; } catch ( SQLException e ) { log . warn ( ""SQL driver deregistration failed"" , e ) ; } } } for ( WeakReference < Class < ? > > refClazz : getInstance ( ) . cachedClasses . values ( ) ) { if ( refClazz == null ) { continue ; } Class < ? > clazz = refClazz . get ( ) ; if ( clazz != null && clazz . getName ( ) . contains ( ""openmrs"" ) ) { try { Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Field field = fields [ i ] ; int mods = field . getModifiers ( ) ; if ( field . getType ( ) . isPrimitive ( ) || ( field . getName ( ) . indexOf ( ""$"" ) != - 1 ) ) { continue ; } if ( Modifier . isStatic ( mods ) ) { try { if ( clazz . equals ( OpenmrsClassLoader . class ) && ""log"" . equals ( field . getName ( ) ) ) { continue ; } field . setAccessible ( true ) ; if ( Modifier . isFinal ( mods ) ) { if ( ! ( field . getType ( ) . getName ( ) . startsWith ( ""javax."" ) ) ) { nullInstance ( field . get ( null ) ) ; } } else { field . set ( null , null ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) ) ; } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { } } } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not clean fields for class "" + clazz . getName ( ) , t ) ; } } } } OpenmrsClassLoader . log = null ; getInstance ( ) . cachedClasses . clear ( ) ; } ","protected static void clearReferences ( ) { Enumeration < Driver > drivers = DriverManager . getDrivers ( ) ; while ( drivers . hasMoreElements ( ) ) { Driver driver = drivers . nextElement ( ) ; if ( driver . getClass ( ) . getClassLoader ( ) == getInstance ( ) ) { try { DriverManager . deregisterDriver ( driver ) ; } catch ( SQLException e ) { log . warn ( ""SQL driver deregistration failed"" , e ) ; } } } for ( WeakReference < Class < ? > > refClazz : getInstance ( ) . cachedClasses . values ( ) ) { if ( refClazz == null ) { continue ; } Class < ? > clazz = refClazz . get ( ) ; if ( clazz != null && clazz . getName ( ) . contains ( ""openmrs"" ) ) { try { Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Field field = fields [ i ] ; int mods = field . getModifiers ( ) ; if ( field . getType ( ) . isPrimitive ( ) || ( field . getName ( ) . indexOf ( ""$"" ) != - 1 ) ) { continue ; } if ( Modifier . isStatic ( mods ) ) { try { if ( clazz . equals ( OpenmrsClassLoader . class ) && ""log"" . equals ( field . getName ( ) ) ) { continue ; } field . setAccessible ( true ) ; if ( Modifier . isFinal ( mods ) ) { if ( ! ( field . getType ( ) . getName ( ) . startsWith ( ""javax."" ) ) ) { nullInstance ( field . get ( null ) ) ; } } else { field . set ( null , null ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) ) ; } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) , t ) ; } } } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not clean fields for class "" + clazz . getName ( ) , t ) ; } } } } OpenmrsClassLoader . log = null ; getInstance ( ) . cachedClasses . clear ( ) ; } " 418,"protected static void clearReferences ( ) { Enumeration < Driver > drivers = DriverManager . getDrivers ( ) ; while ( drivers . hasMoreElements ( ) ) { Driver driver = drivers . nextElement ( ) ; if ( driver . getClass ( ) . getClassLoader ( ) == getInstance ( ) ) { try { DriverManager . deregisterDriver ( driver ) ; } catch ( SQLException e ) { log . warn ( ""SQL driver deregistration failed"" , e ) ; } } } for ( WeakReference < Class < ? > > refClazz : getInstance ( ) . cachedClasses . values ( ) ) { if ( refClazz == null ) { continue ; } Class < ? > clazz = refClazz . get ( ) ; if ( clazz != null && clazz . getName ( ) . contains ( ""openmrs"" ) ) { try { Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Field field = fields [ i ] ; int mods = field . getModifiers ( ) ; if ( field . getType ( ) . isPrimitive ( ) || ( field . getName ( ) . indexOf ( ""$"" ) != - 1 ) ) { continue ; } if ( Modifier . isStatic ( mods ) ) { try { if ( clazz . equals ( OpenmrsClassLoader . class ) && ""log"" . equals ( field . getName ( ) ) ) { continue ; } field . setAccessible ( true ) ; if ( Modifier . isFinal ( mods ) ) { if ( ! ( field . getType ( ) . getName ( ) . startsWith ( ""javax."" ) ) ) { nullInstance ( field . get ( null ) ) ; } } else { field . set ( null , null ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) ) ; } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) , t ) ; } } } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { } } } } OpenmrsClassLoader . log = null ; getInstance ( ) . cachedClasses . clear ( ) ; } ","protected static void clearReferences ( ) { Enumeration < Driver > drivers = DriverManager . getDrivers ( ) ; while ( drivers . hasMoreElements ( ) ) { Driver driver = drivers . nextElement ( ) ; if ( driver . getClass ( ) . getClassLoader ( ) == getInstance ( ) ) { try { DriverManager . deregisterDriver ( driver ) ; } catch ( SQLException e ) { log . warn ( ""SQL driver deregistration failed"" , e ) ; } } } for ( WeakReference < Class < ? > > refClazz : getInstance ( ) . cachedClasses . values ( ) ) { if ( refClazz == null ) { continue ; } Class < ? > clazz = refClazz . get ( ) ; if ( clazz != null && clazz . getName ( ) . contains ( ""openmrs"" ) ) { try { Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Field field = fields [ i ] ; int mods = field . getModifiers ( ) ; if ( field . getType ( ) . isPrimitive ( ) || ( field . getName ( ) . indexOf ( ""$"" ) != - 1 ) ) { continue ; } if ( Modifier . isStatic ( mods ) ) { try { if ( clazz . equals ( OpenmrsClassLoader . class ) && ""log"" . equals ( field . getName ( ) ) ) { continue ; } field . setAccessible ( true ) ; if ( Modifier . isFinal ( mods ) ) { if ( ! ( field . getType ( ) . getName ( ) . startsWith ( ""javax."" ) ) ) { nullInstance ( field . get ( null ) ) ; } } else { field . set ( null , null ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) ) ; } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not set field "" + field . getName ( ) + "" to null in class "" + clazz . getName ( ) , t ) ; } } } } } catch ( Exception t ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Could not clean fields for class "" + clazz . getName ( ) , t ) ; } } } } OpenmrsClassLoader . log = null ; getInstance ( ) . cachedClasses . clear ( ) ; } " 419,"protected void doWork ( int count ) throws Exception { ClientMessage m = this . consumer . receive ( 1000 ) ; if ( m != null ) { receivedMessages . add ( m ) ; m . acknowledge ( ) ; session . commit ( ) ; logger . debug ( "" consumer "" + id + "" acked "" + m . getClass ( ) . getName ( ) + ""now total received: "" + receivedMessages . size ( ) ) ; } } ","protected void doWork ( int count ) throws Exception { ClientMessage m = this . consumer . receive ( 1000 ) ; logger . debug ( ""consumer "" + id + "" got m: "" + m ) ; if ( m != null ) { receivedMessages . add ( m ) ; m . acknowledge ( ) ; session . commit ( ) ; logger . debug ( "" consumer "" + id + "" acked "" + m . getClass ( ) . getName ( ) + ""now total received: "" + receivedMessages . size ( ) ) ; } } " 420,"protected void doWork ( int count ) throws Exception { ClientMessage m = this . consumer . receive ( 1000 ) ; logger . debug ( ""consumer "" + id + "" got m: "" + m ) ; if ( m != null ) { receivedMessages . add ( m ) ; m . acknowledge ( ) ; session . commit ( ) ; } } ","protected void doWork ( int count ) throws Exception { ClientMessage m = this . consumer . receive ( 1000 ) ; logger . debug ( ""consumer "" + id + "" got m: "" + m ) ; if ( m != null ) { receivedMessages . add ( m ) ; m . acknowledge ( ) ; session . commit ( ) ; logger . debug ( "" consumer "" + id + "" acked "" + m . getClass ( ) . getName ( ) + ""now total received: "" + receivedMessages . size ( ) ) ; } } " 421,"@ RequestMapping ( value = ""/all"" , method = RequestMethod . GET ) public List < ModuleTypeDto > getModuleTypes ( ) { List < ModuleType > moduleTypes = moduleTypeService . findModuleTypes ( ) ; List < ModuleTypeDto > moduleTypeDtos = moduleTypeToModuleTypeDtoConverter . convertToList ( moduleTypes ) ; return moduleTypeDtos ; } ","@ RequestMapping ( value = ""/all"" , method = RequestMethod . GET ) public List < ModuleTypeDto > getModuleTypes ( ) { log . debug ( ""getModuleTypes()"" ) ; List < ModuleType > moduleTypes = moduleTypeService . findModuleTypes ( ) ; List < ModuleTypeDto > moduleTypeDtos = moduleTypeToModuleTypeDtoConverter . convertToList ( moduleTypes ) ; return moduleTypeDtos ; } " 422,"public void updateSensorState ( FullSensor sensor , StateUpdate stateUpdate ) { if ( hueBridge != null ) { hueBridge . setSensorState ( sensor , stateUpdate ) . thenAccept ( result -> { try { hueBridge . handleErrors ( result ) ; } catch ( Exception e ) { handleSensorUpdateException ( sensor , e ) ; } } ) . exceptionally ( e -> { handleSensorUpdateException ( sensor , e ) ; return null ; } ) ; } else { } } ","public void updateSensorState ( FullSensor sensor , StateUpdate stateUpdate ) { if ( hueBridge != null ) { hueBridge . setSensorState ( sensor , stateUpdate ) . thenAccept ( result -> { try { hueBridge . handleErrors ( result ) ; } catch ( Exception e ) { handleSensorUpdateException ( sensor , e ) ; } } ) . exceptionally ( e -> { handleSensorUpdateException ( sensor , e ) ; return null ; } ) ; } else { logger . debug ( ""No bridge connected or selected. Cannot set sensor state."" ) ; } } " 423,"public void paint ( Graphics2D g2d ) { super . paint ( g2d ) ; if ( LOGGER . isTraceEnabled ( ) ) { for ( TimelineLayer layer : myLayers ) { long t0 = System . nanoTime ( ) ; layer . paint ( g2d ) ; } } else { for ( TimelineLayer layer : myLayers ) { layer . paint ( g2d ) ; } } } ","public void paint ( Graphics2D g2d ) { super . paint ( g2d ) ; if ( LOGGER . isTraceEnabled ( ) ) { for ( TimelineLayer layer : myLayers ) { long t0 = System . nanoTime ( ) ; layer . paint ( g2d ) ; LOGGER . trace ( StringUtilities . formatTimingMessage ( ""Time to paint layer "" + layer . getClass ( ) . getSimpleName ( ) + "": "" , System . nanoTime ( ) - t0 ) ) ; } } else { for ( TimelineLayer layer : myLayers ) { layer . paint ( g2d ) ; } } } " 424,"protected void jumpToItem ( int itemIndex ) throws Exception { if ( driverSupportsAbsolute ) { try { rs . absolute ( itemIndex ) ; } catch ( SQLException e ) { moveCursorToRow ( itemIndex ) ; } } else { moveCursorToRow ( itemIndex ) ; } } ","protected void jumpToItem ( int itemIndex ) throws Exception { if ( driverSupportsAbsolute ) { try { rs . absolute ( itemIndex ) ; } catch ( SQLException e ) { log . warn ( ""The JDBC driver does not appear to support ResultSet.absolute(). Consider"" + "" reverting to the default behavior setting the driverSupportsAbsolute to false"" , e ) ; moveCursorToRow ( itemIndex ) ; } } else { moveCursorToRow ( itemIndex ) ; } } " 425,"public void destroy ( ) throws ResourceException { if ( logger . isTraceEnabled ( ) ) { } if ( isDestroyed . get ( ) || connection == null ) { return ; } isDestroyed . set ( true ) ; try { connection . setExceptionListener ( null ) ; } catch ( JMSException e ) { logger . debug ( ""Error unsetting the exception listener "" + this , e ) ; } connection . signalStopToAllSessions ( ) ; try { if ( connectionFactory != null ) { ra . closeConnectionFactory ( mcf . getProperties ( ) ) ; } } catch ( Exception e ) { logger . debug ( e . getMessage ( ) , e ) ; } destroyHandles ( ) ; try { try { connection . close ( ) ; if ( nonXAsession != null ) { nonXAsession . close ( ) ; } if ( xaSession != null ) { xaSession . close ( ) ; } } catch ( JMSException e ) { ActiveMQRALogger . LOGGER . debug ( ""Error closing session "" + this , e ) ; } } catch ( Throwable e ) { throw new ResourceException ( ""Could not properly close the session and connection"" , e ) ; } } ","public void destroy ( ) throws ResourceException { if ( logger . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ""destroy()"" ) ; } if ( isDestroyed . get ( ) || connection == null ) { return ; } isDestroyed . set ( true ) ; try { connection . setExceptionListener ( null ) ; } catch ( JMSException e ) { logger . debug ( ""Error unsetting the exception listener "" + this , e ) ; } connection . signalStopToAllSessions ( ) ; try { if ( connectionFactory != null ) { ra . closeConnectionFactory ( mcf . getProperties ( ) ) ; } } catch ( Exception e ) { logger . debug ( e . getMessage ( ) , e ) ; } destroyHandles ( ) ; try { try { connection . close ( ) ; if ( nonXAsession != null ) { nonXAsession . close ( ) ; } if ( xaSession != null ) { xaSession . close ( ) ; } } catch ( JMSException e ) { ActiveMQRALogger . LOGGER . debug ( ""Error closing session "" + this , e ) ; } } catch ( Throwable e ) { throw new ResourceException ( ""Could not properly close the session and connection"" , e ) ; } } " 426,"public void destroy ( ) throws ResourceException { if ( logger . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ""destroy()"" ) ; } if ( isDestroyed . get ( ) || connection == null ) { return ; } isDestroyed . set ( true ) ; try { connection . setExceptionListener ( null ) ; } catch ( JMSException e ) { } connection . signalStopToAllSessions ( ) ; try { if ( connectionFactory != null ) { ra . closeConnectionFactory ( mcf . getProperties ( ) ) ; } } catch ( Exception e ) { logger . debug ( e . getMessage ( ) , e ) ; } destroyHandles ( ) ; try { try { connection . close ( ) ; if ( nonXAsession != null ) { nonXAsession . close ( ) ; } if ( xaSession != null ) { xaSession . close ( ) ; } } catch ( JMSException e ) { ActiveMQRALogger . LOGGER . debug ( ""Error closing session "" + this , e ) ; } } catch ( Throwable e ) { throw new ResourceException ( ""Could not properly close the session and connection"" , e ) ; } } ","public void destroy ( ) throws ResourceException { if ( logger . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ""destroy()"" ) ; } if ( isDestroyed . get ( ) || connection == null ) { return ; } isDestroyed . set ( true ) ; try { connection . setExceptionListener ( null ) ; } catch ( JMSException e ) { logger . debug ( ""Error unsetting the exception listener "" + this , e ) ; } connection . signalStopToAllSessions ( ) ; try { if ( connectionFactory != null ) { ra . closeConnectionFactory ( mcf . getProperties ( ) ) ; } } catch ( Exception e ) { logger . debug ( e . getMessage ( ) , e ) ; } destroyHandles ( ) ; try { try { connection . close ( ) ; if ( nonXAsession != null ) { nonXAsession . close ( ) ; } if ( xaSession != null ) { xaSession . close ( ) ; } } catch ( JMSException e ) { ActiveMQRALogger . LOGGER . debug ( ""Error closing session "" + this , e ) ; } } catch ( Throwable e ) { throw new ResourceException ( ""Could not properly close the session and connection"" , e ) ; } } " 427,"public void destroy ( ) throws ResourceException { if ( logger . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ""destroy()"" ) ; } if ( isDestroyed . get ( ) || connection == null ) { return ; } isDestroyed . set ( true ) ; try { connection . setExceptionListener ( null ) ; } catch ( JMSException e ) { logger . debug ( ""Error unsetting the exception listener "" + this , e ) ; } connection . signalStopToAllSessions ( ) ; try { if ( connectionFactory != null ) { ra . closeConnectionFactory ( mcf . getProperties ( ) ) ; } } catch ( Exception e ) { } destroyHandles ( ) ; try { try { connection . close ( ) ; if ( nonXAsession != null ) { nonXAsession . close ( ) ; } if ( xaSession != null ) { xaSession . close ( ) ; } } catch ( JMSException e ) { ActiveMQRALogger . LOGGER . debug ( ""Error closing session "" + this , e ) ; } } catch ( Throwable e ) { throw new ResourceException ( ""Could not properly close the session and connection"" , e ) ; } } ","public void destroy ( ) throws ResourceException { if ( logger . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ""destroy()"" ) ; } if ( isDestroyed . get ( ) || connection == null ) { return ; } isDestroyed . set ( true ) ; try { connection . setExceptionListener ( null ) ; } catch ( JMSException e ) { logger . debug ( ""Error unsetting the exception listener "" + this , e ) ; } connection . signalStopToAllSessions ( ) ; try { if ( connectionFactory != null ) { ra . closeConnectionFactory ( mcf . getProperties ( ) ) ; } } catch ( Exception e ) { logger . debug ( e . getMessage ( ) , e ) ; } destroyHandles ( ) ; try { try { connection . close ( ) ; if ( nonXAsession != null ) { nonXAsession . close ( ) ; } if ( xaSession != null ) { xaSession . close ( ) ; } } catch ( JMSException e ) { ActiveMQRALogger . LOGGER . debug ( ""Error closing session "" + this , e ) ; } } catch ( Throwable e ) { throw new ResourceException ( ""Could not properly close the session and connection"" , e ) ; } } " 428,"public void destroy ( ) throws ResourceException { if ( logger . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ""destroy()"" ) ; } if ( isDestroyed . get ( ) || connection == null ) { return ; } isDestroyed . set ( true ) ; try { connection . setExceptionListener ( null ) ; } catch ( JMSException e ) { logger . debug ( ""Error unsetting the exception listener "" + this , e ) ; } connection . signalStopToAllSessions ( ) ; try { if ( connectionFactory != null ) { ra . closeConnectionFactory ( mcf . getProperties ( ) ) ; } } catch ( Exception e ) { logger . debug ( e . getMessage ( ) , e ) ; } destroyHandles ( ) ; try { try { connection . close ( ) ; if ( nonXAsession != null ) { nonXAsession . close ( ) ; } if ( xaSession != null ) { xaSession . close ( ) ; } } catch ( JMSException e ) { } } catch ( Throwable e ) { throw new ResourceException ( ""Could not properly close the session and connection"" , e ) ; } } ","public void destroy ( ) throws ResourceException { if ( logger . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ""destroy()"" ) ; } if ( isDestroyed . get ( ) || connection == null ) { return ; } isDestroyed . set ( true ) ; try { connection . setExceptionListener ( null ) ; } catch ( JMSException e ) { logger . debug ( ""Error unsetting the exception listener "" + this , e ) ; } connection . signalStopToAllSessions ( ) ; try { if ( connectionFactory != null ) { ra . closeConnectionFactory ( mcf . getProperties ( ) ) ; } } catch ( Exception e ) { logger . debug ( e . getMessage ( ) , e ) ; } destroyHandles ( ) ; try { try { connection . close ( ) ; if ( nonXAsession != null ) { nonXAsession . close ( ) ; } if ( xaSession != null ) { xaSession . close ( ) ; } } catch ( JMSException e ) { ActiveMQRALogger . LOGGER . debug ( ""Error closing session "" + this , e ) ; } } catch ( Throwable e ) { throw new ResourceException ( ""Could not properly close the session and connection"" , e ) ; } } " 429,"public CompletableFuture < Void > checkAndReconnect ( Throwable t ) { String message = t . getMessage ( ) ; if ( t instanceof Mesos4xxException && message . contains ( ""403"" ) ) { return CompletableFuture . runAsync ( ( ) -> scheduler . onUncaughtException ( new PrematureChannelClosureException ( ) ) , executorService ) ; } return CompletableFuture . completedFuture ( null ) ; } ","public CompletableFuture < Void > checkAndReconnect ( Throwable t ) { LOG . error ( ""Exception calling mesos ({} so far)"" , failedMesosCalls . incrementAndGet ( ) , t ) ; String message = t . getMessage ( ) ; if ( t instanceof Mesos4xxException && message . contains ( ""403"" ) ) { return CompletableFuture . runAsync ( ( ) -> scheduler . onUncaughtException ( new PrematureChannelClosureException ( ) ) , executorService ) ; } return CompletableFuture . completedFuture ( null ) ; } " 430,"@ Test public void testOperationWithProfiledDatatypeParam ( ) { IParser p = ourCtx . newXmlParser ( ) ; Parameters outParams = new Parameters ( ) ; outParams . addParameter ( ) . setValue ( new StringType ( ""STRINGVALOUT1"" ) ) ; outParams . addParameter ( ) . setValue ( new StringType ( ""STRINGVALOUT2"" ) ) ; final String respString = p . encodeResourceToString ( outParams ) ; ourResponseContentType = Constants . CT_FHIR_XML + ""; charset=UTF-8"" ; ourResponseBody = respString ; IGenericClient client = ourCtx . newRestfulGenericClient ( ""http://localhost:"" + ourPort + ""/fhir"" ) ; client . operation ( ) . onInstance ( new IdType ( ""http://foo/Patient/1"" ) ) . named ( ""validate-code"" ) . withParameter ( Parameters . class , ""code"" , new CodeType ( ""8495-4"" ) ) . andParameter ( ""system"" , new UriType ( ""http://loinc.org"" ) ) . useHttpGet ( ) . execute ( ) ; assertEquals ( ""http://localhost:"" + ourPort + ""/fhir/Patient/1/$validate-code?code=8495-4&system=http%3A%2F%2Floinc.org"" , ourRequestUri ) ; client . operation ( ) . onInstance ( new IdType ( ""http://foo/Patient/1"" ) ) . named ( ""validate-code"" ) . withParameter ( Parameters . class , ""code"" , new CodeType ( ""8495-4"" ) ) . andParameter ( ""system"" , new UriType ( ""http://loinc.org"" ) ) . encodedXml ( ) . execute ( ) ; assertEquals ( ""http://localhost:"" + ourPort + ""/fhir/Patient/1/$validate-code"" , ourRequestUri ) ; assertEquals ( """" , ourRequestBodyString ) ; } ","@ Test public void testOperationWithProfiledDatatypeParam ( ) { IParser p = ourCtx . newXmlParser ( ) ; Parameters outParams = new Parameters ( ) ; outParams . addParameter ( ) . setValue ( new StringType ( ""STRINGVALOUT1"" ) ) ; outParams . addParameter ( ) . setValue ( new StringType ( ""STRINGVALOUT2"" ) ) ; final String respString = p . encodeResourceToString ( outParams ) ; ourResponseContentType = Constants . CT_FHIR_XML + ""; charset=UTF-8"" ; ourResponseBody = respString ; IGenericClient client = ourCtx . newRestfulGenericClient ( ""http://localhost:"" + ourPort + ""/fhir"" ) ; client . operation ( ) . onInstance ( new IdType ( ""http://foo/Patient/1"" ) ) . named ( ""validate-code"" ) . withParameter ( Parameters . class , ""code"" , new CodeType ( ""8495-4"" ) ) . andParameter ( ""system"" , new UriType ( ""http://loinc.org"" ) ) . useHttpGet ( ) . execute ( ) ; assertEquals ( ""http://localhost:"" + ourPort + ""/fhir/Patient/1/$validate-code?code=8495-4&system=http%3A%2F%2Floinc.org"" , ourRequestUri ) ; client . operation ( ) . onInstance ( new IdType ( ""http://foo/Patient/1"" ) ) . named ( ""validate-code"" ) . withParameter ( Parameters . class , ""code"" , new CodeType ( ""8495-4"" ) ) . andParameter ( ""system"" , new UriType ( ""http://loinc.org"" ) ) . encodedXml ( ) . execute ( ) ; assertEquals ( ""http://localhost:"" + ourPort + ""/fhir/Patient/1/$validate-code"" , ourRequestUri ) ; ourLog . info ( ourRequestBodyString ) ; assertEquals ( """" , ourRequestBodyString ) ; } " 431,"protected void afterTest ( ) throws Exception { super . afterTest ( ) ; log . info ( ""Test output for "" + getName ( ) ) ; setOut ( sysOut ) ; log . info ( testOut . toString ( ) ) ; resetTestOut ( ) ; } ","protected void afterTest ( ) throws Exception { super . afterTest ( ) ; log . info ( ""Test output for "" + getName ( ) ) ; log . info ( ""----------------------------------------"" ) ; setOut ( sysOut ) ; log . info ( testOut . toString ( ) ) ; resetTestOut ( ) ; } " 432,"protected void afterTest ( ) throws Exception { super . afterTest ( ) ; log . info ( ""Test output for "" + getName ( ) ) ; log . info ( ""----------------------------------------"" ) ; setOut ( sysOut ) ; resetTestOut ( ) ; } ","protected void afterTest ( ) throws Exception { super . afterTest ( ) ; log . info ( ""Test output for "" + getName ( ) ) ; log . info ( ""----------------------------------------"" ) ; setOut ( sysOut ) ; log . info ( testOut . toString ( ) ) ; resetTestOut ( ) ; } " 433,"public void stopContext ( ) { if ( _context != null && _publisher != null ) { try { _publisher . destroy ( _context ) ; } catch ( Exception e ) { } } } ","public void stopContext ( ) { if ( _context != null && _publisher != null ) { try { _publisher . destroy ( _context ) ; } catch ( Exception e ) { LOGGER . error ( e ) ; } } } " 434,"public void moveEyelids ( double eyelidleftPos , double eyelidrightPos ) { if ( head != null ) { head . moveEyelidsTo ( eyelidleftPos , eyelidrightPos ) ; } else { } } ","public void moveEyelids ( double eyelidleftPos , double eyelidrightPos ) { if ( head != null ) { head . moveEyelidsTo ( eyelidleftPos , eyelidrightPos ) ; } else { log . warn ( ""moveEyelids - I have a null head"" ) ; } } " 435,"public String getStatisticsType ( Integer statisticTypeId , List < StatisticImageListDto > statisticImageList ) throws DAOException { LOGGER . entry ( ""begin getStatisticsType()"" ) ; String statisticType = """" ; try { if ( ( statisticImageList != null ) && ! statisticImageList . isEmpty ( ) ) { for ( StatisticImageListDto statistic : statisticImageList ) { if ( statisticTypeId . intValue ( ) == statistic . getStatisticImageId ( ) . intValue ( ) ) { statisticType = statistic . getValue ( ) ; break ; } } } } catch ( Exception e ) { } LOGGER . exit ( ""getStatisticsType() :: Ends"" ) ; return statisticType ; } ","public String getStatisticsType ( Integer statisticTypeId , List < StatisticImageListDto > statisticImageList ) throws DAOException { LOGGER . entry ( ""begin getStatisticsType()"" ) ; String statisticType = """" ; try { if ( ( statisticImageList != null ) && ! statisticImageList . isEmpty ( ) ) { for ( StatisticImageListDto statistic : statisticImageList ) { if ( statisticTypeId . intValue ( ) == statistic . getStatisticImageId ( ) . intValue ( ) ) { statisticType = statistic . getValue ( ) ; break ; } } } } catch ( Exception e ) { LOGGER . error ( ""DashboardMetaDataDao - getStatisticsType() :: ERROR"" , e ) ; } LOGGER . exit ( ""getStatisticsType() :: Ends"" ) ; return statisticType ; } " 436,"public void abortJob ( JobContext jobContext , State state ) throws IOException { if ( outputMap . isEmpty ( ) ) { return ; } if ( LOG . isDebugEnabled ( ) ) { } long t0 = System . currentTimeMillis ( ) ; if ( state == State . FAILED ) { doCleanupJob ( jobContext ) ; } if ( LOG . isInfoEnabled ( ) ) { long t1 = System . currentTimeMillis ( ) ; LOG . info ( MessageFormat . format ( ""aborted Direct I/O output: job={0} ({1}), state={2}, elapsed={3}ms"" , jobContext . getJobID ( ) , jobContext . getJobName ( ) , state , t1 - t0 ) ) ; } } ","public void abortJob ( JobContext jobContext , State state ) throws IOException { if ( outputMap . isEmpty ( ) ) { return ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( MessageFormat . format ( ""Start Direct I/O output job abort: job={0} ({1}), state={2}"" , jobContext . getJobID ( ) , jobContext . getJobName ( ) , state ) ) ; } long t0 = System . currentTimeMillis ( ) ; if ( state == State . FAILED ) { doCleanupJob ( jobContext ) ; } if ( LOG . isInfoEnabled ( ) ) { long t1 = System . currentTimeMillis ( ) ; LOG . info ( MessageFormat . format ( ""aborted Direct I/O output: job={0} ({1}), state={2}, elapsed={3}ms"" , jobContext . getJobID ( ) , jobContext . getJobName ( ) , state , t1 - t0 ) ) ; } } " 437,"public void abortJob ( JobContext jobContext , State state ) throws IOException { if ( outputMap . isEmpty ( ) ) { return ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( MessageFormat . format ( ""Start Direct I/O output job abort: job={0} ({1}), state={2}"" , jobContext . getJobID ( ) , jobContext . getJobName ( ) , state ) ) ; } long t0 = System . currentTimeMillis ( ) ; if ( state == State . FAILED ) { doCleanupJob ( jobContext ) ; } if ( LOG . isInfoEnabled ( ) ) { long t1 = System . currentTimeMillis ( ) ; } } ","public void abortJob ( JobContext jobContext , State state ) throws IOException { if ( outputMap . isEmpty ( ) ) { return ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( MessageFormat . format ( ""Start Direct I/O output job abort: job={0} ({1}), state={2}"" , jobContext . getJobID ( ) , jobContext . getJobName ( ) , state ) ) ; } long t0 = System . currentTimeMillis ( ) ; if ( state == State . FAILED ) { doCleanupJob ( jobContext ) ; } if ( LOG . isInfoEnabled ( ) ) { long t1 = System . currentTimeMillis ( ) ; LOG . info ( MessageFormat . format ( ""aborted Direct I/O output: job={0} ({1}), state={2}, elapsed={3}ms"" , jobContext . getJobID ( ) , jobContext . getJobName ( ) , state , t1 - t0 ) ) ; } } " 438,"@ Test public void testSMILESFileWithSpacesAndTabs ( ) throws Exception { String filename = ""data/smiles/tabs.smi"" ; InputStream ins = this . getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; IteratingSMILESReader reader = new IteratingSMILESReader ( ins , DefaultChemObjectBuilder . getInstance ( ) ) ; int molCount = 0 ; while ( reader . hasNext ( ) ) { Object object = reader . next ( ) ; Assert . assertNotNull ( object ) ; assertTrue ( object instanceof IAtomContainer ) ; molCount ++ ; } Assert . assertEquals ( 5 , molCount ) ; reader . close ( ) ; } ","@ Test public void testSMILESFileWithSpacesAndTabs ( ) throws Exception { String filename = ""data/smiles/tabs.smi"" ; logger . info ( ""Testing: "" + filename ) ; InputStream ins = this . getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; IteratingSMILESReader reader = new IteratingSMILESReader ( ins , DefaultChemObjectBuilder . getInstance ( ) ) ; int molCount = 0 ; while ( reader . hasNext ( ) ) { Object object = reader . next ( ) ; Assert . assertNotNull ( object ) ; assertTrue ( object instanceof IAtomContainer ) ; molCount ++ ; } Assert . assertEquals ( 5 , molCount ) ; reader . close ( ) ; } " 439,"private Properties loadRawGitProperties ( String loc ) { Properties p = new Properties ( ) ; try ( InputStream in = getClass ( ) . getResourceAsStream ( loc ) ) { p . load ( in ) ; } catch ( Exception e ) { } return p ; } ","private Properties loadRawGitProperties ( String loc ) { Properties p = new Properties ( ) ; try ( InputStream in = getClass ( ) . getResourceAsStream ( loc ) ) { p . load ( in ) ; } catch ( Exception e ) { log . warn ( ""Error loading {}, possibly jar was not compiled with maven."" , GIT_PROPS , e ) ; } return p ; } " 440,"protected Void doInBackground ( ) throws Exception { ExecutorService executor = null ; try { Set < String > control = new HashSet < > ( ) ; executor = Executors . newWorkStealingPool ( ) ; CompletionService < Void > completionService = new ExecutorCompletionService < > ( executor ) ; List < Runnable > runnables = new ArrayList < > ( ) ; for ( String queryName : queries ) { for ( String start : origin ) { for ( String end : destiny ) { String id = Arrays . asList ( start , end ) . stream ( ) . sorted ( ) . collect ( Collectors . joining ( ""_"" ) ) + ""_"" + queryName ; if ( control . add ( id ) && ! start . equals ( end ) ) { SearchLinkRunnable subWorker = new SearchLinkRunnable ( this , queryName , start , end ) ; runnables . add ( subWorker ) ; total ++ ; } } } } app . setStatus ( Messages . getString ( ""GraphAnalysis.LinksSearching"" , found ) ) ; for ( Runnable runnable : runnables ) { completionService . submit ( runnable , null ) ; } while ( done < total ) { completionService . take ( ) ; } } catch ( Exception e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } finally { if ( executor != null ) { executor . shutdown ( ) ; } } return null ; } ","protected Void doInBackground ( ) throws Exception { ExecutorService executor = null ; try { Set < String > control = new HashSet < > ( ) ; executor = Executors . newWorkStealingPool ( ) ; CompletionService < Void > completionService = new ExecutorCompletionService < > ( executor ) ; LOGGER . info ( ""Running queries {}."" , queries . stream ( ) . collect ( Collectors . joining ( "", "" ) ) ) ; List < Runnable > runnables = new ArrayList < > ( ) ; for ( String queryName : queries ) { for ( String start : origin ) { for ( String end : destiny ) { String id = Arrays . asList ( start , end ) . stream ( ) . sorted ( ) . collect ( Collectors . joining ( ""_"" ) ) + ""_"" + queryName ; if ( control . add ( id ) && ! start . equals ( end ) ) { SearchLinkRunnable subWorker = new SearchLinkRunnable ( this , queryName , start , end ) ; runnables . add ( subWorker ) ; total ++ ; } } } } app . setStatus ( Messages . getString ( ""GraphAnalysis.LinksSearching"" , found ) ) ; for ( Runnable runnable : runnables ) { completionService . submit ( runnable , null ) ; } while ( done < total ) { completionService . take ( ) ; } } catch ( Exception e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } finally { if ( executor != null ) { executor . shutdown ( ) ; } } return null ; } " 441,"protected Void doInBackground ( ) throws Exception { ExecutorService executor = null ; try { Set < String > control = new HashSet < > ( ) ; executor = Executors . newWorkStealingPool ( ) ; CompletionService < Void > completionService = new ExecutorCompletionService < > ( executor ) ; LOGGER . info ( ""Running queries {}."" , queries . stream ( ) . collect ( Collectors . joining ( "", "" ) ) ) ; List < Runnable > runnables = new ArrayList < > ( ) ; for ( String queryName : queries ) { for ( String start : origin ) { for ( String end : destiny ) { String id = Arrays . asList ( start , end ) . stream ( ) . sorted ( ) . collect ( Collectors . joining ( ""_"" ) ) + ""_"" + queryName ; if ( control . add ( id ) && ! start . equals ( end ) ) { SearchLinkRunnable subWorker = new SearchLinkRunnable ( this , queryName , start , end ) ; runnables . add ( subWorker ) ; total ++ ; } } } } app . setStatus ( Messages . getString ( ""GraphAnalysis.LinksSearching"" , found ) ) ; for ( Runnable runnable : runnables ) { completionService . submit ( runnable , null ) ; } while ( done < total ) { completionService . take ( ) ; } } catch ( Exception e ) { } finally { if ( executor != null ) { executor . shutdown ( ) ; } } return null ; } ","protected Void doInBackground ( ) throws Exception { ExecutorService executor = null ; try { Set < String > control = new HashSet < > ( ) ; executor = Executors . newWorkStealingPool ( ) ; CompletionService < Void > completionService = new ExecutorCompletionService < > ( executor ) ; LOGGER . info ( ""Running queries {}."" , queries . stream ( ) . collect ( Collectors . joining ( "", "" ) ) ) ; List < Runnable > runnables = new ArrayList < > ( ) ; for ( String queryName : queries ) { for ( String start : origin ) { for ( String end : destiny ) { String id = Arrays . asList ( start , end ) . stream ( ) . sorted ( ) . collect ( Collectors . joining ( ""_"" ) ) + ""_"" + queryName ; if ( control . add ( id ) && ! start . equals ( end ) ) { SearchLinkRunnable subWorker = new SearchLinkRunnable ( this , queryName , start , end ) ; runnables . add ( subWorker ) ; total ++ ; } } } } app . setStatus ( Messages . getString ( ""GraphAnalysis.LinksSearching"" , found ) ) ; for ( Runnable runnable : runnables ) { completionService . submit ( runnable , null ) ; } while ( done < total ) { completionService . take ( ) ; } } catch ( Exception e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } finally { if ( executor != null ) { executor . shutdown ( ) ; } } return null ; } " 442,"public Date getAlertSystemRecoverTime ( ) { try { return configDao . getByKey ( KEY_ALERT_SYSTEM_ON ) . getUntil ( ) ; } catch ( DalException e ) { return null ; } } ","public Date getAlertSystemRecoverTime ( ) { try { return configDao . getByKey ( KEY_ALERT_SYSTEM_ON ) . getUntil ( ) ; } catch ( DalException e ) { logger . error ( ""[getAlertSystemRecovertIME]"" , e ) ; return null ; } } " 443,"private void setUpKubernetes ( ) { System . setProperty ( ""kubernetes.auth.tryKubeConfig"" , ""false"" ) ; k8s = StyxScheduler . getKubernetesClient ( schedulerConfig , ""default"" ) ; k8s . namespaces ( ) . createNew ( ) . withNewMetadata ( ) . withName ( testNamespace ) . endMetadata ( ) . done ( ) ; } ","private void setUpKubernetes ( ) { System . setProperty ( ""kubernetes.auth.tryKubeConfig"" , ""false"" ) ; log . info ( ""Creating k8s namespace: {}"" , testNamespace ) ; k8s = StyxScheduler . getKubernetesClient ( schedulerConfig , ""default"" ) ; k8s . namespaces ( ) . createNew ( ) . withNewMetadata ( ) . withName ( testNamespace ) . endMetadata ( ) . done ( ) ; } " 444,"@ UsedAsLiferayAction public void unscheduleAllServices ( ActionRequest request , ActionResponse response ) throws PortletException , IOException { try { User user = UserCacheHolder . getUserFromRequest ( request ) ; RequestStatus requestStatus = new ThriftClients ( ) . makeScheduleClient ( ) . unscheduleAllServices ( user ) ; setSessionMessage ( request , requestStatus , ""Every task"" , ""unschedule"" ) ; } catch ( TException e ) { } } ","@ UsedAsLiferayAction public void unscheduleAllServices ( ActionRequest request , ActionResponse response ) throws PortletException , IOException { try { User user = UserCacheHolder . getUserFromRequest ( request ) ; RequestStatus requestStatus = new ThriftClients ( ) . makeScheduleClient ( ) . unscheduleAllServices ( user ) ; setSessionMessage ( request , requestStatus , ""Every task"" , ""unschedule"" ) ; } catch ( TException e ) { log . error ( e ) ; } } " 445,"public void sessionDestroyed ( HttpSessionEvent se ) { ServletContext servletContext = se . getSession ( ) . getServletContext ( ) ; SessionStore sessionStore = getInstance ( SessionStore . class , servletContext ) ; if ( sessionStore == null ) { LOG . error ( ""Unable to remove session from SSO Store. Session store is not configured in servlet context."" ) ; } else { SsoClientPrincipal principal = ( SsoClientPrincipal ) se . getSession ( ) . getAttribute ( ""principal"" ) ; if ( principal != null ) { ServerClient client = getInstance ( ServerClient . class , servletContext ) ; if ( client != null ) { LOG . debug ( ""Logout by session timeout. Notify sso server about client {} - {} - {} logout"" , principal . getName ( ) , principal . getClientUrl ( ) , principal . getToken ( ) ) ; client . unregisterClient ( principal . getToken ( ) , principal . getClientUrl ( ) ) ; } } sessionStore . removeSessionById ( se . getSession ( ) . getId ( ) ) ; } } ","public void sessionDestroyed ( HttpSessionEvent se ) { LOG . debug ( ""Removing session {} from SSO client session store"" , se . getSession ( ) . getId ( ) ) ; ServletContext servletContext = se . getSession ( ) . getServletContext ( ) ; SessionStore sessionStore = getInstance ( SessionStore . class , servletContext ) ; if ( sessionStore == null ) { LOG . error ( ""Unable to remove session from SSO Store. Session store is not configured in servlet context."" ) ; } else { SsoClientPrincipal principal = ( SsoClientPrincipal ) se . getSession ( ) . getAttribute ( ""principal"" ) ; if ( principal != null ) { ServerClient client = getInstance ( ServerClient . class , servletContext ) ; if ( client != null ) { LOG . debug ( ""Logout by session timeout. Notify sso server about client {} - {} - {} logout"" , principal . getName ( ) , principal . getClientUrl ( ) , principal . getToken ( ) ) ; client . unregisterClient ( principal . getToken ( ) , principal . getClientUrl ( ) ) ; } } sessionStore . removeSessionById ( se . getSession ( ) . getId ( ) ) ; } } " 446,"public void sessionDestroyed ( HttpSessionEvent se ) { LOG . debug ( ""Removing session {} from SSO client session store"" , se . getSession ( ) . getId ( ) ) ; ServletContext servletContext = se . getSession ( ) . getServletContext ( ) ; SessionStore sessionStore = getInstance ( SessionStore . class , servletContext ) ; if ( sessionStore == null ) { } else { SsoClientPrincipal principal = ( SsoClientPrincipal ) se . getSession ( ) . getAttribute ( ""principal"" ) ; if ( principal != null ) { ServerClient client = getInstance ( ServerClient . class , servletContext ) ; if ( client != null ) { LOG . debug ( ""Logout by session timeout. Notify sso server about client {} - {} - {} logout"" , principal . getName ( ) , principal . getClientUrl ( ) , principal . getToken ( ) ) ; client . unregisterClient ( principal . getToken ( ) , principal . getClientUrl ( ) ) ; } } sessionStore . removeSessionById ( se . getSession ( ) . getId ( ) ) ; } } ","public void sessionDestroyed ( HttpSessionEvent se ) { LOG . debug ( ""Removing session {} from SSO client session store"" , se . getSession ( ) . getId ( ) ) ; ServletContext servletContext = se . getSession ( ) . getServletContext ( ) ; SessionStore sessionStore = getInstance ( SessionStore . class , servletContext ) ; if ( sessionStore == null ) { LOG . error ( ""Unable to remove session from SSO Store. Session store is not configured in servlet context."" ) ; } else { SsoClientPrincipal principal = ( SsoClientPrincipal ) se . getSession ( ) . getAttribute ( ""principal"" ) ; if ( principal != null ) { ServerClient client = getInstance ( ServerClient . class , servletContext ) ; if ( client != null ) { LOG . debug ( ""Logout by session timeout. Notify sso server about client {} - {} - {} logout"" , principal . getName ( ) , principal . getClientUrl ( ) , principal . getToken ( ) ) ; client . unregisterClient ( principal . getToken ( ) , principal . getClientUrl ( ) ) ; } } sessionStore . removeSessionById ( se . getSession ( ) . getId ( ) ) ; } } " 447,"public void sessionDestroyed ( HttpSessionEvent se ) { LOG . debug ( ""Removing session {} from SSO client session store"" , se . getSession ( ) . getId ( ) ) ; ServletContext servletContext = se . getSession ( ) . getServletContext ( ) ; SessionStore sessionStore = getInstance ( SessionStore . class , servletContext ) ; if ( sessionStore == null ) { LOG . error ( ""Unable to remove session from SSO Store. Session store is not configured in servlet context."" ) ; } else { SsoClientPrincipal principal = ( SsoClientPrincipal ) se . getSession ( ) . getAttribute ( ""principal"" ) ; if ( principal != null ) { ServerClient client = getInstance ( ServerClient . class , servletContext ) ; if ( client != null ) { client . unregisterClient ( principal . getToken ( ) , principal . getClientUrl ( ) ) ; } } sessionStore . removeSessionById ( se . getSession ( ) . getId ( ) ) ; } } ","public void sessionDestroyed ( HttpSessionEvent se ) { LOG . debug ( ""Removing session {} from SSO client session store"" , se . getSession ( ) . getId ( ) ) ; ServletContext servletContext = se . getSession ( ) . getServletContext ( ) ; SessionStore sessionStore = getInstance ( SessionStore . class , servletContext ) ; if ( sessionStore == null ) { LOG . error ( ""Unable to remove session from SSO Store. Session store is not configured in servlet context."" ) ; } else { SsoClientPrincipal principal = ( SsoClientPrincipal ) se . getSession ( ) . getAttribute ( ""principal"" ) ; if ( principal != null ) { ServerClient client = getInstance ( ServerClient . class , servletContext ) ; if ( client != null ) { LOG . debug ( ""Logout by session timeout. Notify sso server about client {} - {} - {} logout"" , principal . getName ( ) , principal . getClientUrl ( ) , principal . getToken ( ) ) ; client . unregisterClient ( principal . getToken ( ) , principal . getClientUrl ( ) ) ; } } sessionStore . removeSessionById ( se . getSession ( ) . getId ( ) ) ; } } " 448,"protected Set < String > invokeMBean ( ) { Set < String > list = new HashSet < > ( ) ; try { @ SuppressWarnings ( ""unchecked"" ) List < Map < String , Object > > containers = ( List < Map < String , Object > > ) mBeanServer . invoke ( fabricMBean , ""containers"" , new Object [ ] { Arrays . asList ( ""localHostname"" , ""localIp"" , ""manualIp"" , ""publicHostname"" , ""publicIp"" ) } , new String [ ] { List . class . getName ( ) } ) ; for ( Map < String , Object > container : containers ) { for ( Object value : container . values ( ) ) { if ( value != null && Strings . isNotBlank ( value . toString ( ) ) ) { list . add ( value . toString ( ) ) ; } } } LOG . debug ( ""Extracted allowlist: {}"" , list ) ; } catch ( InstanceNotFoundException | MBeanException | ReflectionException e ) { LOG . error ( ""Invocation to allowlist MBean failed: "" + e . getMessage ( ) , e ) ; } return list ; } ","protected Set < String > invokeMBean ( ) { Set < String > list = new HashSet < > ( ) ; try { @ SuppressWarnings ( ""unchecked"" ) List < Map < String , Object > > containers = ( List < Map < String , Object > > ) mBeanServer . invoke ( fabricMBean , ""containers"" , new Object [ ] { Arrays . asList ( ""localHostname"" , ""localIp"" , ""manualIp"" , ""publicHostname"" , ""publicIp"" ) } , new String [ ] { List . class . getName ( ) } ) ; LOG . debug ( ""Returned containers from MBean: {}"" , containers ) ; for ( Map < String , Object > container : containers ) { for ( Object value : container . values ( ) ) { if ( value != null && Strings . isNotBlank ( value . toString ( ) ) ) { list . add ( value . toString ( ) ) ; } } } LOG . debug ( ""Extracted allowlist: {}"" , list ) ; } catch ( InstanceNotFoundException | MBeanException | ReflectionException e ) { LOG . error ( ""Invocation to allowlist MBean failed: "" + e . getMessage ( ) , e ) ; } return list ; } " 449,"protected Set < String > invokeMBean ( ) { Set < String > list = new HashSet < > ( ) ; try { @ SuppressWarnings ( ""unchecked"" ) List < Map < String , Object > > containers = ( List < Map < String , Object > > ) mBeanServer . invoke ( fabricMBean , ""containers"" , new Object [ ] { Arrays . asList ( ""localHostname"" , ""localIp"" , ""manualIp"" , ""publicHostname"" , ""publicIp"" ) } , new String [ ] { List . class . getName ( ) } ) ; LOG . debug ( ""Returned containers from MBean: {}"" , containers ) ; for ( Map < String , Object > container : containers ) { for ( Object value : container . values ( ) ) { if ( value != null && Strings . isNotBlank ( value . toString ( ) ) ) { list . add ( value . toString ( ) ) ; } } } } catch ( InstanceNotFoundException | MBeanException | ReflectionException e ) { LOG . error ( ""Invocation to allowlist MBean failed: "" + e . getMessage ( ) , e ) ; } return list ; } ","protected Set < String > invokeMBean ( ) { Set < String > list = new HashSet < > ( ) ; try { @ SuppressWarnings ( ""unchecked"" ) List < Map < String , Object > > containers = ( List < Map < String , Object > > ) mBeanServer . invoke ( fabricMBean , ""containers"" , new Object [ ] { Arrays . asList ( ""localHostname"" , ""localIp"" , ""manualIp"" , ""publicHostname"" , ""publicIp"" ) } , new String [ ] { List . class . getName ( ) } ) ; LOG . debug ( ""Returned containers from MBean: {}"" , containers ) ; for ( Map < String , Object > container : containers ) { for ( Object value : container . values ( ) ) { if ( value != null && Strings . isNotBlank ( value . toString ( ) ) ) { list . add ( value . toString ( ) ) ; } } } LOG . debug ( ""Extracted allowlist: {}"" , list ) ; } catch ( InstanceNotFoundException | MBeanException | ReflectionException e ) { LOG . error ( ""Invocation to allowlist MBean failed: "" + e . getMessage ( ) , e ) ; } return list ; } " 450,"protected Set < String > invokeMBean ( ) { Set < String > list = new HashSet < > ( ) ; try { @ SuppressWarnings ( ""unchecked"" ) List < Map < String , Object > > containers = ( List < Map < String , Object > > ) mBeanServer . invoke ( fabricMBean , ""containers"" , new Object [ ] { Arrays . asList ( ""localHostname"" , ""localIp"" , ""manualIp"" , ""publicHostname"" , ""publicIp"" ) } , new String [ ] { List . class . getName ( ) } ) ; LOG . debug ( ""Returned containers from MBean: {}"" , containers ) ; for ( Map < String , Object > container : containers ) { for ( Object value : container . values ( ) ) { if ( value != null && Strings . isNotBlank ( value . toString ( ) ) ) { list . add ( value . toString ( ) ) ; } } } LOG . debug ( ""Extracted allowlist: {}"" , list ) ; } catch ( InstanceNotFoundException | MBeanException | ReflectionException e ) { } return list ; } ","protected Set < String > invokeMBean ( ) { Set < String > list = new HashSet < > ( ) ; try { @ SuppressWarnings ( ""unchecked"" ) List < Map < String , Object > > containers = ( List < Map < String , Object > > ) mBeanServer . invoke ( fabricMBean , ""containers"" , new Object [ ] { Arrays . asList ( ""localHostname"" , ""localIp"" , ""manualIp"" , ""publicHostname"" , ""publicIp"" ) } , new String [ ] { List . class . getName ( ) } ) ; LOG . debug ( ""Returned containers from MBean: {}"" , containers ) ; for ( Map < String , Object > container : containers ) { for ( Object value : container . values ( ) ) { if ( value != null && Strings . isNotBlank ( value . toString ( ) ) ) { list . add ( value . toString ( ) ) ; } } } LOG . debug ( ""Extracted allowlist: {}"" , list ) ; } catch ( InstanceNotFoundException | MBeanException | ReflectionException e ) { LOG . error ( ""Invocation to allowlist MBean failed: "" + e . getMessage ( ) , e ) ; } return list ; } " 451,"private void prepareSalt ( PasswordSaltExtensionMessage msg ) { msg . setSalt ( chooser . getConfig ( ) . getDefaultServerPWDSalt ( ) ) ; } ","private void prepareSalt ( PasswordSaltExtensionMessage msg ) { msg . setSalt ( chooser . getConfig ( ) . getDefaultServerPWDSalt ( ) ) ; LOGGER . debug ( ""Salt: "" + ArrayConverter . bytesToHexString ( msg . getSalt ( ) ) ) ; } " 452,"protected final void dispatchWriteEvent ( SelectionKey key ) { Session session = ( Session ) key . attachment ( ) ; if ( session != null ) { ( ( NioSession ) session ) . onEvent ( EventType . WRITEABLE , key . selector ( ) ) ; } else { } } ","protected final void dispatchWriteEvent ( SelectionKey key ) { Session session = ( Session ) key . attachment ( ) ; if ( session != null ) { ( ( NioSession ) session ) . onEvent ( EventType . WRITEABLE , key . selector ( ) ) ; } else { log . warn ( ""Could not find session for writable event,maybe it is closed"" ) ; } } " 453,"public synchronized void writeConfigurationFile ( Path xmlFilePath ) { xmlDatenSchreiben ( xmlFilePath ) ; } ","public synchronized void writeConfigurationFile ( Path xmlFilePath ) { logger . info ( ""Daten Schreiben nach: {}"" , xmlFilePath . toString ( ) ) ; xmlDatenSchreiben ( xmlFilePath ) ; } " 454,"private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } ","private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } " 455,"private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } ","private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } " 456,"private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } ","private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } " 457,"private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } ","private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } " 458,"private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } ","private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } " 459,"private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { return false ; } return true ; } ","private boolean isReachableAndValidHueBridge ( BridgeJsonParameters bridge ) { String host = bridge . getInternalIpAddress ( ) ; String id = bridge . getId ( ) ; String description ; if ( host == null ) { logger . debug ( ""Bridge not discovered: ip is null"" ) ; return false ; } if ( id == null ) { logger . debug ( ""Bridge not discovered: id is null"" ) ; return false ; } if ( id . length ( ) < 10 ) { logger . debug ( ""Bridge not discovered: id {} is shorter then 10."" , id ) ; return false ; } if ( ! id . substring ( 6 , 10 ) . equals ( BRIDGE_INDICATOR ) ) { logger . debug ( ""Bridge not discovered: id {} does not contain bridge indicator {} or its at the wrong position."" , id , BRIDGE_INDICATOR ) ; return false ; } try { description = doGetRequest ( DESC_URL_PATTERN . replace ( ""HOST"" , host ) ) ; } catch ( IOException e ) { logger . debug ( ""Bridge not discovered: Failure accessing description file for ip: {}"" , host ) ; return false ; } if ( ! description . contains ( MODEL_NAME_PHILIPS_HUE ) ) { logger . debug ( ""Bridge not discovered: Description does not containing the model name: {}"" , description ) ; return false ; } return true ; } " 460,"public void addDomain ( final String domainId , final RepositoryFile child ) { final Map < String , RepositoryFile > details = getDetails ( domainId , true ) ; if ( details . get ( DOMAIN_ID_KEY ) != null ) { } details . put ( DOMAIN_ID_KEY , child ) ; } ","public void addDomain ( final String domainId , final RepositoryFile child ) { final Map < String , RepositoryFile > details = getDetails ( domainId , true ) ; if ( details . get ( DOMAIN_ID_KEY ) != null ) { log . warn ( ""Adding domain when one already exists"" ) ; } details . put ( DOMAIN_ID_KEY , child ) ; } " 461,"private Object getSingleton ( final Method method ) throws IllegalArgumentException { final Class < ? > typeRef = method . getReturnType ( ) ; final Singleton singleton = method . getAnnotation ( Singleton . class ) ; final URI uri = buildEntitySetURI ( singleton . name ( ) , service ) . build ( ) ; final EntityUUID uuid = new EntityUUID ( uri , typeRef ) ; EntityInvocationHandler handler = getContext ( ) . entityContext ( ) . getEntity ( uuid ) ; if ( handler == null ) { final ClientEntity entity = getClient ( ) . getObjectFactory ( ) . newEntity ( new FullQualifiedName ( typeRef . getAnnotation ( Namespace . class ) . value ( ) , ClassUtils . getEntityTypeName ( typeRef ) ) ) ; handler = EntityInvocationHandler . getInstance ( entity , uri , uri , typeRef , service ) ; } else if ( isDeleted ( handler ) ) { LOG . debug ( ""Singleton '{}' has been deleted"" , typeRef . getSimpleName ( ) ) ; handler = null ; } return handler == null ? null : Proxy . newProxyInstance ( Thread . currentThread ( ) . getContextClassLoader ( ) , new Class < ? > [ ] { typeRef } , handler ) ; } ","private Object getSingleton ( final Method method ) throws IllegalArgumentException { final Class < ? > typeRef = method . getReturnType ( ) ; final Singleton singleton = method . getAnnotation ( Singleton . class ) ; final URI uri = buildEntitySetURI ( singleton . name ( ) , service ) . build ( ) ; final EntityUUID uuid = new EntityUUID ( uri , typeRef ) ; LOG . debug ( ""Ask for singleton '{}'"" , typeRef . getSimpleName ( ) ) ; EntityInvocationHandler handler = getContext ( ) . entityContext ( ) . getEntity ( uuid ) ; if ( handler == null ) { final ClientEntity entity = getClient ( ) . getObjectFactory ( ) . newEntity ( new FullQualifiedName ( typeRef . getAnnotation ( Namespace . class ) . value ( ) , ClassUtils . getEntityTypeName ( typeRef ) ) ) ; handler = EntityInvocationHandler . getInstance ( entity , uri , uri , typeRef , service ) ; } else if ( isDeleted ( handler ) ) { LOG . debug ( ""Singleton '{}' has been deleted"" , typeRef . getSimpleName ( ) ) ; handler = null ; } return handler == null ? null : Proxy . newProxyInstance ( Thread . currentThread ( ) . getContextClassLoader ( ) , new Class < ? > [ ] { typeRef } , handler ) ; } " 462,"private Object getSingleton ( final Method method ) throws IllegalArgumentException { final Class < ? > typeRef = method . getReturnType ( ) ; final Singleton singleton = method . getAnnotation ( Singleton . class ) ; final URI uri = buildEntitySetURI ( singleton . name ( ) , service ) . build ( ) ; final EntityUUID uuid = new EntityUUID ( uri , typeRef ) ; LOG . debug ( ""Ask for singleton '{}'"" , typeRef . getSimpleName ( ) ) ; EntityInvocationHandler handler = getContext ( ) . entityContext ( ) . getEntity ( uuid ) ; if ( handler == null ) { final ClientEntity entity = getClient ( ) . getObjectFactory ( ) . newEntity ( new FullQualifiedName ( typeRef . getAnnotation ( Namespace . class ) . value ( ) , ClassUtils . getEntityTypeName ( typeRef ) ) ) ; handler = EntityInvocationHandler . getInstance ( entity , uri , uri , typeRef , service ) ; } else if ( isDeleted ( handler ) ) { handler = null ; } return handler == null ? null : Proxy . newProxyInstance ( Thread . currentThread ( ) . getContextClassLoader ( ) , new Class < ? > [ ] { typeRef } , handler ) ; } ","private Object getSingleton ( final Method method ) throws IllegalArgumentException { final Class < ? > typeRef = method . getReturnType ( ) ; final Singleton singleton = method . getAnnotation ( Singleton . class ) ; final URI uri = buildEntitySetURI ( singleton . name ( ) , service ) . build ( ) ; final EntityUUID uuid = new EntityUUID ( uri , typeRef ) ; LOG . debug ( ""Ask for singleton '{}'"" , typeRef . getSimpleName ( ) ) ; EntityInvocationHandler handler = getContext ( ) . entityContext ( ) . getEntity ( uuid ) ; if ( handler == null ) { final ClientEntity entity = getClient ( ) . getObjectFactory ( ) . newEntity ( new FullQualifiedName ( typeRef . getAnnotation ( Namespace . class ) . value ( ) , ClassUtils . getEntityTypeName ( typeRef ) ) ) ; handler = EntityInvocationHandler . getInstance ( entity , uri , uri , typeRef , service ) ; } else if ( isDeleted ( handler ) ) { LOG . debug ( ""Singleton '{}' has been deleted"" , typeRef . getSimpleName ( ) ) ; handler = null ; } return handler == null ? null : Proxy . newProxyInstance ( Thread . currentThread ( ) . getContextClassLoader ( ) , new Class < ? > [ ] { typeRef } , handler ) ; } " 463,"protected CloseableHttpResponse postOverHttp ( Object dataToPost , String pathSuffix ) { CloseableHttpResponse httpResponse = null ; HttpPost httpPostRequest ; httpPostRequest = new HttpPost ( fluxEndpoint + pathSuffix ) ; try { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; objectMapper . writeValue ( byteArrayOutputStream , dataToPost ) ; httpPostRequest . setEntity ( new ByteArrayEntity ( byteArrayOutputStream . toByteArray ( ) , ContentType . APPLICATION_JSON ) ) ; httpResponse = closeableHttpClient . execute ( httpPostRequest ) ; final int statusCode = httpResponse . getStatusLine ( ) . getStatusCode ( ) ; if ( statusCode >= Response . Status . OK . getStatusCode ( ) && statusCode < Response . Status . MOVED_PERMANENTLY . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.2xx"" ) . toString ( ) ) . mark ( ) ; } else { logger . error ( ""Did not receive a valid response from Flux core. Status code: {}, message: {}"" , statusCode , EntityUtils . toString ( httpResponse . getEntity ( ) ) ) ; if ( statusCode >= Response . Status . BAD_REQUEST . getStatusCode ( ) && statusCode < Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.4xx"" ) . toString ( ) ) . mark ( ) ; } else if ( statusCode >= Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) && statusCode < Response . Status . HTTP_VERSION_NOT_SUPPORTED . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.5xx"" ) . toString ( ) ) . mark ( ) ; } HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Did not receive a valid response from Flux core"" ) ; } } catch ( IOException e ) { logger . error ( ""Posting over http errored. Message: {}"" , e . getMessage ( ) , e ) ; HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Could not communicate with Flux runtime: "" + fluxEndpoint ) ; } return httpResponse ; } ","protected CloseableHttpResponse postOverHttp ( Object dataToPost , String pathSuffix ) { CloseableHttpResponse httpResponse = null ; HttpPost httpPostRequest ; httpPostRequest = new HttpPost ( fluxEndpoint + pathSuffix ) ; try { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; objectMapper . writeValue ( byteArrayOutputStream , dataToPost ) ; httpPostRequest . setEntity ( new ByteArrayEntity ( byteArrayOutputStream . toByteArray ( ) , ContentType . APPLICATION_JSON ) ) ; httpResponse = closeableHttpClient . execute ( httpPostRequest ) ; final int statusCode = httpResponse . getStatusLine ( ) . getStatusCode ( ) ; if ( statusCode >= Response . Status . OK . getStatusCode ( ) && statusCode < Response . Status . MOVED_PERMANENTLY . getStatusCode ( ) ) { logger . trace ( ""Posting over http is successful. Status code: {}"" , statusCode ) ; metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.2xx"" ) . toString ( ) ) . mark ( ) ; } else { logger . error ( ""Did not receive a valid response from Flux core. Status code: {}, message: {}"" , statusCode , EntityUtils . toString ( httpResponse . getEntity ( ) ) ) ; if ( statusCode >= Response . Status . BAD_REQUEST . getStatusCode ( ) && statusCode < Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.4xx"" ) . toString ( ) ) . mark ( ) ; } else if ( statusCode >= Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) && statusCode < Response . Status . HTTP_VERSION_NOT_SUPPORTED . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.5xx"" ) . toString ( ) ) . mark ( ) ; } HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Did not receive a valid response from Flux core"" ) ; } } catch ( IOException e ) { logger . error ( ""Posting over http errored. Message: {}"" , e . getMessage ( ) , e ) ; HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Could not communicate with Flux runtime: "" + fluxEndpoint ) ; } return httpResponse ; } " 464,"protected CloseableHttpResponse postOverHttp ( Object dataToPost , String pathSuffix ) { CloseableHttpResponse httpResponse = null ; HttpPost httpPostRequest ; httpPostRequest = new HttpPost ( fluxEndpoint + pathSuffix ) ; try { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; objectMapper . writeValue ( byteArrayOutputStream , dataToPost ) ; httpPostRequest . setEntity ( new ByteArrayEntity ( byteArrayOutputStream . toByteArray ( ) , ContentType . APPLICATION_JSON ) ) ; httpResponse = closeableHttpClient . execute ( httpPostRequest ) ; final int statusCode = httpResponse . getStatusLine ( ) . getStatusCode ( ) ; if ( statusCode >= Response . Status . OK . getStatusCode ( ) && statusCode < Response . Status . MOVED_PERMANENTLY . getStatusCode ( ) ) { logger . trace ( ""Posting over http is successful. Status code: {}"" , statusCode ) ; metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.2xx"" ) . toString ( ) ) . mark ( ) ; } else { if ( statusCode >= Response . Status . BAD_REQUEST . getStatusCode ( ) && statusCode < Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.4xx"" ) . toString ( ) ) . mark ( ) ; } else if ( statusCode >= Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) && statusCode < Response . Status . HTTP_VERSION_NOT_SUPPORTED . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.5xx"" ) . toString ( ) ) . mark ( ) ; } HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Did not receive a valid response from Flux core"" ) ; } } catch ( IOException e ) { logger . error ( ""Posting over http errored. Message: {}"" , e . getMessage ( ) , e ) ; HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Could not communicate with Flux runtime: "" + fluxEndpoint ) ; } return httpResponse ; } ","protected CloseableHttpResponse postOverHttp ( Object dataToPost , String pathSuffix ) { CloseableHttpResponse httpResponse = null ; HttpPost httpPostRequest ; httpPostRequest = new HttpPost ( fluxEndpoint + pathSuffix ) ; try { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; objectMapper . writeValue ( byteArrayOutputStream , dataToPost ) ; httpPostRequest . setEntity ( new ByteArrayEntity ( byteArrayOutputStream . toByteArray ( ) , ContentType . APPLICATION_JSON ) ) ; httpResponse = closeableHttpClient . execute ( httpPostRequest ) ; final int statusCode = httpResponse . getStatusLine ( ) . getStatusCode ( ) ; if ( statusCode >= Response . Status . OK . getStatusCode ( ) && statusCode < Response . Status . MOVED_PERMANENTLY . getStatusCode ( ) ) { logger . trace ( ""Posting over http is successful. Status code: {}"" , statusCode ) ; metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.2xx"" ) . toString ( ) ) . mark ( ) ; } else { logger . error ( ""Did not receive a valid response from Flux core. Status code: {}, message: {}"" , statusCode , EntityUtils . toString ( httpResponse . getEntity ( ) ) ) ; if ( statusCode >= Response . Status . BAD_REQUEST . getStatusCode ( ) && statusCode < Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.4xx"" ) . toString ( ) ) . mark ( ) ; } else if ( statusCode >= Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) && statusCode < Response . Status . HTTP_VERSION_NOT_SUPPORTED . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.5xx"" ) . toString ( ) ) . mark ( ) ; } HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Did not receive a valid response from Flux core"" ) ; } } catch ( IOException e ) { logger . error ( ""Posting over http errored. Message: {}"" , e . getMessage ( ) , e ) ; HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Could not communicate with Flux runtime: "" + fluxEndpoint ) ; } return httpResponse ; } " 465,"protected CloseableHttpResponse postOverHttp ( Object dataToPost , String pathSuffix ) { CloseableHttpResponse httpResponse = null ; HttpPost httpPostRequest ; httpPostRequest = new HttpPost ( fluxEndpoint + pathSuffix ) ; try { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; objectMapper . writeValue ( byteArrayOutputStream , dataToPost ) ; httpPostRequest . setEntity ( new ByteArrayEntity ( byteArrayOutputStream . toByteArray ( ) , ContentType . APPLICATION_JSON ) ) ; httpResponse = closeableHttpClient . execute ( httpPostRequest ) ; final int statusCode = httpResponse . getStatusLine ( ) . getStatusCode ( ) ; if ( statusCode >= Response . Status . OK . getStatusCode ( ) && statusCode < Response . Status . MOVED_PERMANENTLY . getStatusCode ( ) ) { logger . trace ( ""Posting over http is successful. Status code: {}"" , statusCode ) ; metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.2xx"" ) . toString ( ) ) . mark ( ) ; } else { logger . error ( ""Did not receive a valid response from Flux core. Status code: {}, message: {}"" , statusCode , EntityUtils . toString ( httpResponse . getEntity ( ) ) ) ; if ( statusCode >= Response . Status . BAD_REQUEST . getStatusCode ( ) && statusCode < Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.4xx"" ) . toString ( ) ) . mark ( ) ; } else if ( statusCode >= Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) && statusCode < Response . Status . HTTP_VERSION_NOT_SUPPORTED . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.5xx"" ) . toString ( ) ) . mark ( ) ; } HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Did not receive a valid response from Flux core"" ) ; } } catch ( IOException e ) { HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Could not communicate with Flux runtime: "" + fluxEndpoint ) ; } return httpResponse ; } ","protected CloseableHttpResponse postOverHttp ( Object dataToPost , String pathSuffix ) { CloseableHttpResponse httpResponse = null ; HttpPost httpPostRequest ; httpPostRequest = new HttpPost ( fluxEndpoint + pathSuffix ) ; try { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; objectMapper . writeValue ( byteArrayOutputStream , dataToPost ) ; httpPostRequest . setEntity ( new ByteArrayEntity ( byteArrayOutputStream . toByteArray ( ) , ContentType . APPLICATION_JSON ) ) ; httpResponse = closeableHttpClient . execute ( httpPostRequest ) ; final int statusCode = httpResponse . getStatusLine ( ) . getStatusCode ( ) ; if ( statusCode >= Response . Status . OK . getStatusCode ( ) && statusCode < Response . Status . MOVED_PERMANENTLY . getStatusCode ( ) ) { logger . trace ( ""Posting over http is successful. Status code: {}"" , statusCode ) ; metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.2xx"" ) . toString ( ) ) . mark ( ) ; } else { logger . error ( ""Did not receive a valid response from Flux core. Status code: {}, message: {}"" , statusCode , EntityUtils . toString ( httpResponse . getEntity ( ) ) ) ; if ( statusCode >= Response . Status . BAD_REQUEST . getStatusCode ( ) && statusCode < Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.4xx"" ) . toString ( ) ) . mark ( ) ; } else if ( statusCode >= Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) && statusCode < Response . Status . HTTP_VERSION_NOT_SUPPORTED . getStatusCode ( ) ) { metricRegistry . meter ( new StringBuilder ( ) . append ( ""stateMachines.forwardToOrchestrator.5xx"" ) . toString ( ) ) . mark ( ) ; } HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Did not receive a valid response from Flux core"" ) ; } } catch ( IOException e ) { logger . error ( ""Posting over http errored. Message: {}"" , e . getMessage ( ) , e ) ; HttpClientUtils . closeQuietly ( httpResponse ) ; throw new RuntimeCommunicationException ( ""Could not communicate with Flux runtime: "" + fluxEndpoint ) ; } return httpResponse ; } " 466,"protected void synchronizePage ( int page , int pageSize ) { Events events = eventService . getAnonymousEventsForSync ( pageSize , skipChangedBefore , psdesWithSkipSyncTrue ) ; filterOutDataValuesMarkedWithSkipSynchronizationFlag ( events ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Events that are going to be synchronized are: "" + events ) ; } if ( sendSyncRequest ( events ) ) { List < String > eventsUIDs = events . getEvents ( ) . stream ( ) . map ( Event :: getEvent ) . collect ( Collectors . toList ( ) ) ; log . info ( ""The lastSynchronized flag of these Events will be updated: "" + eventsUIDs ) ; eventService . updateEventsSyncTimestamp ( eventsUIDs , new Date ( clock . getStartTime ( ) ) ) ; } else { syncResult = false ; } } ","protected void synchronizePage ( int page , int pageSize ) { Events events = eventService . getAnonymousEventsForSync ( pageSize , skipChangedBefore , psdesWithSkipSyncTrue ) ; filterOutDataValuesMarkedWithSkipSynchronizationFlag ( events ) ; log . info ( String . format ( ""Synchronizing page %d with page size %d"" , page , pageSize ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Events that are going to be synchronized are: "" + events ) ; } if ( sendSyncRequest ( events ) ) { List < String > eventsUIDs = events . getEvents ( ) . stream ( ) . map ( Event :: getEvent ) . collect ( Collectors . toList ( ) ) ; log . info ( ""The lastSynchronized flag of these Events will be updated: "" + eventsUIDs ) ; eventService . updateEventsSyncTimestamp ( eventsUIDs , new Date ( clock . getStartTime ( ) ) ) ; } else { syncResult = false ; } } " 467,"protected void synchronizePage ( int page , int pageSize ) { Events events = eventService . getAnonymousEventsForSync ( pageSize , skipChangedBefore , psdesWithSkipSyncTrue ) ; filterOutDataValuesMarkedWithSkipSynchronizationFlag ( events ) ; log . info ( String . format ( ""Synchronizing page %d with page size %d"" , page , pageSize ) ) ; if ( log . isDebugEnabled ( ) ) { } if ( sendSyncRequest ( events ) ) { List < String > eventsUIDs = events . getEvents ( ) . stream ( ) . map ( Event :: getEvent ) . collect ( Collectors . toList ( ) ) ; log . info ( ""The lastSynchronized flag of these Events will be updated: "" + eventsUIDs ) ; eventService . updateEventsSyncTimestamp ( eventsUIDs , new Date ( clock . getStartTime ( ) ) ) ; } else { syncResult = false ; } } ","protected void synchronizePage ( int page , int pageSize ) { Events events = eventService . getAnonymousEventsForSync ( pageSize , skipChangedBefore , psdesWithSkipSyncTrue ) ; filterOutDataValuesMarkedWithSkipSynchronizationFlag ( events ) ; log . info ( String . format ( ""Synchronizing page %d with page size %d"" , page , pageSize ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Events that are going to be synchronized are: "" + events ) ; } if ( sendSyncRequest ( events ) ) { List < String > eventsUIDs = events . getEvents ( ) . stream ( ) . map ( Event :: getEvent ) . collect ( Collectors . toList ( ) ) ; log . info ( ""The lastSynchronized flag of these Events will be updated: "" + eventsUIDs ) ; eventService . updateEventsSyncTimestamp ( eventsUIDs , new Date ( clock . getStartTime ( ) ) ) ; } else { syncResult = false ; } } " 468,"protected void synchronizePage ( int page , int pageSize ) { Events events = eventService . getAnonymousEventsForSync ( pageSize , skipChangedBefore , psdesWithSkipSyncTrue ) ; filterOutDataValuesMarkedWithSkipSynchronizationFlag ( events ) ; log . info ( String . format ( ""Synchronizing page %d with page size %d"" , page , pageSize ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Events that are going to be synchronized are: "" + events ) ; } if ( sendSyncRequest ( events ) ) { List < String > eventsUIDs = events . getEvents ( ) . stream ( ) . map ( Event :: getEvent ) . collect ( Collectors . toList ( ) ) ; eventService . updateEventsSyncTimestamp ( eventsUIDs , new Date ( clock . getStartTime ( ) ) ) ; } else { syncResult = false ; } } ","protected void synchronizePage ( int page , int pageSize ) { Events events = eventService . getAnonymousEventsForSync ( pageSize , skipChangedBefore , psdesWithSkipSyncTrue ) ; filterOutDataValuesMarkedWithSkipSynchronizationFlag ( events ) ; log . info ( String . format ( ""Synchronizing page %d with page size %d"" , page , pageSize ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Events that are going to be synchronized are: "" + events ) ; } if ( sendSyncRequest ( events ) ) { List < String > eventsUIDs = events . getEvents ( ) . stream ( ) . map ( Event :: getEvent ) . collect ( Collectors . toList ( ) ) ; log . info ( ""The lastSynchronized flag of these Events will be updated: "" + eventsUIDs ) ; eventService . updateEventsSyncTimestamp ( eventsUIDs , new Date ( clock . getStartTime ( ) ) ) ; } else { syncResult = false ; } } " 469,"@ Test public void testWithGeometryCollection ( ) throws CatalogTransformerException , IOException , ParseException { Date now = new Date ( ) ; MetacardImpl metacard = new MetacardImpl ( ) ; metacard . setLocation ( ""GEOMETRYCOLLECTION(POINT(4 6),LINESTRING(4 6,7 10))"" ) ; setupBasicMetacard ( now , metacard ) ; GeoJsonMetacardTransformer transformer = new GeoJsonMetacardTransformer ( ) ; BinaryContent content = transformer . transform ( metacard , null ) ; assertEquals ( content . getMimeTypeValue ( ) , GeoJsonMetacardTransformer . DEFAULT_MIME_TYPE . getBaseType ( ) ) ; String jsonText = new String ( content . getByteArray ( ) ) ; Object object = PARSER . parse ( jsonText ) ; JSONObject obj2 = ( JSONObject ) object ; Map geometryMap = ( Map ) obj2 . get ( ""geometry"" ) ; assertThat ( geometryMap . get ( CompositeGeometry . TYPE_KEY ) . toString ( ) , is ( GeometryCollection . TYPE ) ) ; assertThat ( geometryMap . get ( CompositeGeometry . GEOMETRIES_KEY ) , notNullValue ( ) ) ; verifyBasicMetacardJson ( now , obj2 ) ; } ","@ Test public void testWithGeometryCollection ( ) throws CatalogTransformerException , IOException , ParseException { Date now = new Date ( ) ; MetacardImpl metacard = new MetacardImpl ( ) ; metacard . setLocation ( ""GEOMETRYCOLLECTION(POINT(4 6),LINESTRING(4 6,7 10))"" ) ; setupBasicMetacard ( now , metacard ) ; GeoJsonMetacardTransformer transformer = new GeoJsonMetacardTransformer ( ) ; BinaryContent content = transformer . transform ( metacard , null ) ; assertEquals ( content . getMimeTypeValue ( ) , GeoJsonMetacardTransformer . DEFAULT_MIME_TYPE . getBaseType ( ) ) ; String jsonText = new String ( content . getByteArray ( ) ) ; LOGGER . debug ( jsonText ) ; Object object = PARSER . parse ( jsonText ) ; JSONObject obj2 = ( JSONObject ) object ; Map geometryMap = ( Map ) obj2 . get ( ""geometry"" ) ; assertThat ( geometryMap . get ( CompositeGeometry . TYPE_KEY ) . toString ( ) , is ( GeometryCollection . TYPE ) ) ; assertThat ( geometryMap . get ( CompositeGeometry . GEOMETRIES_KEY ) , notNullValue ( ) ) ; verifyBasicMetacardJson ( now , obj2 ) ; } " 470,"public static ResponseEntity < Object > httpResponseForInternalServerError ( ) { logger . entry ( ""AppUtil - httpResponseForInternalServerError() :: starts"" ) ; ErrorBean errorBean = null ; try { errorBean = new ErrorBean ( ) . setCode ( ErrorCode . EC_500 . code ( ) ) . setMessage ( ErrorCode . EC_500 . errorMessage ( ) ) ; } catch ( Exception e ) { } logger . exit ( ""AppUtil - httpResponseForInternalServerError() :: ends"" ) ; return new ResponseEntity < > ( errorBean , HttpStatus . INTERNAL_SERVER_ERROR ) ; } ","public static ResponseEntity < Object > httpResponseForInternalServerError ( ) { logger . entry ( ""AppUtil - httpResponseForInternalServerError() :: starts"" ) ; ErrorBean errorBean = null ; try { errorBean = new ErrorBean ( ) . setCode ( ErrorCode . EC_500 . code ( ) ) . setMessage ( ErrorCode . EC_500 . errorMessage ( ) ) ; } catch ( Exception e ) { logger . error ( ""ERROR: AppUtil - httpResponseForInternalServerError()"" , e ) ; } logger . exit ( ""AppUtil - httpResponseForInternalServerError() :: ends"" ) ; return new ResponseEntity < > ( errorBean , HttpStatus . INTERNAL_SERVER_ERROR ) ; } " 471,"private void doTestDeadlock ( boolean near0 , boolean near1 ) throws Exception { IgniteCache < Integer , Integer > cache0 = null ; IgniteCache < Integer , Integer > cache1 = null ; try { cache0 = getCache ( ignite ( 0 ) , ""cache0"" , near0 ) ; cache1 = getCache ( ignite ( 0 ) , ""cache1"" , near1 ) ; awaitPartitionMapExchange ( ) ; final CyclicBarrier barrier = new CyclicBarrier ( 2 ) ; final AtomicInteger threadCnt = new AtomicInteger ( ) ; final AtomicBoolean deadlock = new AtomicBoolean ( ) ; IgniteInternalFuture < Long > fut = GridTestUtils . runMultiThreadedAsync ( new Runnable ( ) { @ Override public void run ( ) { int threadNum = threadCnt . getAndIncrement ( ) ; Ignite ignite = ignite ( 0 ) ; IgniteCache < Integer , Integer > cache1 = ignite . cache ( ""cache"" + ( threadNum == 0 ? 0 : 1 ) ) ; IgniteCache < Integer , Integer > cache2 = ignite . cache ( ""cache"" + ( threadNum == 0 ? 1 : 0 ) ) ; try ( Transaction tx = ignite . transactions ( ) . txStart ( PESSIMISTIC , REPEATABLE_READ , 500 , 0 ) ) { int key1 = primaryKey ( cache1 ) ; cache1 . put ( key1 , 0 ) ; barrier . await ( ) ; int key2 = primaryKey ( cache2 ) ; log . info ( "">>> Performs put [node="" + ( ( IgniteKernal ) ignite ) . localNode ( ) + "", tx="" + tx + "", key="" + key2 + "", cache="" + cache2 . getName ( ) + ']' ) ; cache2 . put ( key2 , 1 ) ; tx . commit ( ) ; } catch ( Throwable e ) { if ( hasCause ( e , TransactionTimeoutException . class ) && hasCause ( e , TransactionDeadlockException . class ) ) { if ( deadlock . compareAndSet ( false , true ) ) U . error ( log , ""At least one stack trace should contain "" + TransactionDeadlockException . class . getSimpleName ( ) , e ) ; } } } } , 2 , ""tx-thread"" ) ; fut . get ( ) ; assertTrue ( deadlock . get ( ) ) ; for ( int i = 0 ; i < NODES_CNT ; i ++ ) { Ignite ignite = ignite ( i ) ; IgniteTxManager txMgr = ( ( IgniteKernal ) ignite ) . context ( ) . cache ( ) . context ( ) . tm ( ) ; Collection < IgniteInternalFuture < ? > > futs = txMgr . deadlockDetectionFutures ( ) ; assertTrue ( futs . isEmpty ( ) ) ; } } finally { if ( cache0 != null ) cache0 . destroy ( ) ; if ( cache1 != null ) cache1 . destroy ( ) ; } } ","private void doTestDeadlock ( boolean near0 , boolean near1 ) throws Exception { IgniteCache < Integer , Integer > cache0 = null ; IgniteCache < Integer , Integer > cache1 = null ; try { cache0 = getCache ( ignite ( 0 ) , ""cache0"" , near0 ) ; cache1 = getCache ( ignite ( 0 ) , ""cache1"" , near1 ) ; awaitPartitionMapExchange ( ) ; final CyclicBarrier barrier = new CyclicBarrier ( 2 ) ; final AtomicInteger threadCnt = new AtomicInteger ( ) ; final AtomicBoolean deadlock = new AtomicBoolean ( ) ; IgniteInternalFuture < Long > fut = GridTestUtils . runMultiThreadedAsync ( new Runnable ( ) { @ Override public void run ( ) { int threadNum = threadCnt . getAndIncrement ( ) ; Ignite ignite = ignite ( 0 ) ; IgniteCache < Integer , Integer > cache1 = ignite . cache ( ""cache"" + ( threadNum == 0 ? 0 : 1 ) ) ; IgniteCache < Integer , Integer > cache2 = ignite . cache ( ""cache"" + ( threadNum == 0 ? 1 : 0 ) ) ; try ( Transaction tx = ignite . transactions ( ) . txStart ( PESSIMISTIC , REPEATABLE_READ , 500 , 0 ) ) { int key1 = primaryKey ( cache1 ) ; log . info ( "">>> Performs put [node="" + ( ( IgniteKernal ) ignite ) . localNode ( ) + "", tx="" + tx + "", key="" + key1 + "", cache="" + cache1 . getName ( ) + ']' ) ; cache1 . put ( key1 , 0 ) ; barrier . await ( ) ; int key2 = primaryKey ( cache2 ) ; log . info ( "">>> Performs put [node="" + ( ( IgniteKernal ) ignite ) . localNode ( ) + "", tx="" + tx + "", key="" + key2 + "", cache="" + cache2 . getName ( ) + ']' ) ; cache2 . put ( key2 , 1 ) ; tx . commit ( ) ; } catch ( Throwable e ) { if ( hasCause ( e , TransactionTimeoutException . class ) && hasCause ( e , TransactionDeadlockException . class ) ) { if ( deadlock . compareAndSet ( false , true ) ) U . error ( log , ""At least one stack trace should contain "" + TransactionDeadlockException . class . getSimpleName ( ) , e ) ; } } } } , 2 , ""tx-thread"" ) ; fut . get ( ) ; assertTrue ( deadlock . get ( ) ) ; for ( int i = 0 ; i < NODES_CNT ; i ++ ) { Ignite ignite = ignite ( i ) ; IgniteTxManager txMgr = ( ( IgniteKernal ) ignite ) . context ( ) . cache ( ) . context ( ) . tm ( ) ; Collection < IgniteInternalFuture < ? > > futs = txMgr . deadlockDetectionFutures ( ) ; assertTrue ( futs . isEmpty ( ) ) ; } } finally { if ( cache0 != null ) cache0 . destroy ( ) ; if ( cache1 != null ) cache1 . destroy ( ) ; } } " 472,"private void doTestDeadlock ( boolean near0 , boolean near1 ) throws Exception { IgniteCache < Integer , Integer > cache0 = null ; IgniteCache < Integer , Integer > cache1 = null ; try { cache0 = getCache ( ignite ( 0 ) , ""cache0"" , near0 ) ; cache1 = getCache ( ignite ( 0 ) , ""cache1"" , near1 ) ; awaitPartitionMapExchange ( ) ; final CyclicBarrier barrier = new CyclicBarrier ( 2 ) ; final AtomicInteger threadCnt = new AtomicInteger ( ) ; final AtomicBoolean deadlock = new AtomicBoolean ( ) ; IgniteInternalFuture < Long > fut = GridTestUtils . runMultiThreadedAsync ( new Runnable ( ) { @ Override public void run ( ) { int threadNum = threadCnt . getAndIncrement ( ) ; Ignite ignite = ignite ( 0 ) ; IgniteCache < Integer , Integer > cache1 = ignite . cache ( ""cache"" + ( threadNum == 0 ? 0 : 1 ) ) ; IgniteCache < Integer , Integer > cache2 = ignite . cache ( ""cache"" + ( threadNum == 0 ? 1 : 0 ) ) ; try ( Transaction tx = ignite . transactions ( ) . txStart ( PESSIMISTIC , REPEATABLE_READ , 500 , 0 ) ) { int key1 = primaryKey ( cache1 ) ; log . info ( "">>> Performs put [node="" + ( ( IgniteKernal ) ignite ) . localNode ( ) + "", tx="" + tx + "", key="" + key1 + "", cache="" + cache1 . getName ( ) + ']' ) ; cache1 . put ( key1 , 0 ) ; barrier . await ( ) ; int key2 = primaryKey ( cache2 ) ; cache2 . put ( key2 , 1 ) ; tx . commit ( ) ; } catch ( Throwable e ) { if ( hasCause ( e , TransactionTimeoutException . class ) && hasCause ( e , TransactionDeadlockException . class ) ) { if ( deadlock . compareAndSet ( false , true ) ) U . error ( log , ""At least one stack trace should contain "" + TransactionDeadlockException . class . getSimpleName ( ) , e ) ; } } } } , 2 , ""tx-thread"" ) ; fut . get ( ) ; assertTrue ( deadlock . get ( ) ) ; for ( int i = 0 ; i < NODES_CNT ; i ++ ) { Ignite ignite = ignite ( i ) ; IgniteTxManager txMgr = ( ( IgniteKernal ) ignite ) . context ( ) . cache ( ) . context ( ) . tm ( ) ; Collection < IgniteInternalFuture < ? > > futs = txMgr . deadlockDetectionFutures ( ) ; assertTrue ( futs . isEmpty ( ) ) ; } } finally { if ( cache0 != null ) cache0 . destroy ( ) ; if ( cache1 != null ) cache1 . destroy ( ) ; } } ","private void doTestDeadlock ( boolean near0 , boolean near1 ) throws Exception { IgniteCache < Integer , Integer > cache0 = null ; IgniteCache < Integer , Integer > cache1 = null ; try { cache0 = getCache ( ignite ( 0 ) , ""cache0"" , near0 ) ; cache1 = getCache ( ignite ( 0 ) , ""cache1"" , near1 ) ; awaitPartitionMapExchange ( ) ; final CyclicBarrier barrier = new CyclicBarrier ( 2 ) ; final AtomicInteger threadCnt = new AtomicInteger ( ) ; final AtomicBoolean deadlock = new AtomicBoolean ( ) ; IgniteInternalFuture < Long > fut = GridTestUtils . runMultiThreadedAsync ( new Runnable ( ) { @ Override public void run ( ) { int threadNum = threadCnt . getAndIncrement ( ) ; Ignite ignite = ignite ( 0 ) ; IgniteCache < Integer , Integer > cache1 = ignite . cache ( ""cache"" + ( threadNum == 0 ? 0 : 1 ) ) ; IgniteCache < Integer , Integer > cache2 = ignite . cache ( ""cache"" + ( threadNum == 0 ? 1 : 0 ) ) ; try ( Transaction tx = ignite . transactions ( ) . txStart ( PESSIMISTIC , REPEATABLE_READ , 500 , 0 ) ) { int key1 = primaryKey ( cache1 ) ; log . info ( "">>> Performs put [node="" + ( ( IgniteKernal ) ignite ) . localNode ( ) + "", tx="" + tx + "", key="" + key1 + "", cache="" + cache1 . getName ( ) + ']' ) ; cache1 . put ( key1 , 0 ) ; barrier . await ( ) ; int key2 = primaryKey ( cache2 ) ; log . info ( "">>> Performs put [node="" + ( ( IgniteKernal ) ignite ) . localNode ( ) + "", tx="" + tx + "", key="" + key2 + "", cache="" + cache2 . getName ( ) + ']' ) ; cache2 . put ( key2 , 1 ) ; tx . commit ( ) ; } catch ( Throwable e ) { if ( hasCause ( e , TransactionTimeoutException . class ) && hasCause ( e , TransactionDeadlockException . class ) ) { if ( deadlock . compareAndSet ( false , true ) ) U . error ( log , ""At least one stack trace should contain "" + TransactionDeadlockException . class . getSimpleName ( ) , e ) ; } } } } , 2 , ""tx-thread"" ) ; fut . get ( ) ; assertTrue ( deadlock . get ( ) ) ; for ( int i = 0 ; i < NODES_CNT ; i ++ ) { Ignite ignite = ignite ( i ) ; IgniteTxManager txMgr = ( ( IgniteKernal ) ignite ) . context ( ) . cache ( ) . context ( ) . tm ( ) ; Collection < IgniteInternalFuture < ? > > futs = txMgr . deadlockDetectionFutures ( ) ; assertTrue ( futs . isEmpty ( ) ) ; } } finally { if ( cache0 != null ) cache0 . destroy ( ) ; if ( cache1 != null ) cache1 . destroy ( ) ; } } " 473,"public Iterator iterator ( ) { final App app = StructrApp . getInstance ( fs . getSecurityContext ( ) ) ; final List < StructrPath > nodes = new LinkedList < > ( ) ; try ( final Tx tx = app . tx ( ) ) { for ( final SchemaMethod schemaMethod : schemaNode . getProperty ( SchemaNode . schemaMethods ) ) { String name = schemaMethod . getProperty ( SchemaMethod . virtualFileName ) ; if ( name == null ) { name = schemaMethod . getName ( ) ; } nodes . add ( new StructrSchemaMethodPath ( fs , StructrSchemaMethodsPath . this , schemaNode , name ) ) ; } tx . success ( ) ; } catch ( FrameworkException fex ) { } return nodes . iterator ( ) ; } ","public Iterator iterator ( ) { final App app = StructrApp . getInstance ( fs . getSecurityContext ( ) ) ; final List < StructrPath > nodes = new LinkedList < > ( ) ; try ( final Tx tx = app . tx ( ) ) { for ( final SchemaMethod schemaMethod : schemaNode . getProperty ( SchemaNode . schemaMethods ) ) { String name = schemaMethod . getProperty ( SchemaMethod . virtualFileName ) ; if ( name == null ) { name = schemaMethod . getName ( ) ; } nodes . add ( new StructrSchemaMethodPath ( fs , StructrSchemaMethodsPath . this , schemaNode , name ) ) ; } tx . success ( ) ; } catch ( FrameworkException fex ) { logger . warn ( """" , fex ) ; } return nodes . iterator ( ) ; } " 474,"public static Optional < Geometry > wktToGeometry ( String wkt , WKTReader wktReader ) { try { return Optional . of ( wktReader . read ( wkt ) ) ; } catch ( ParseException e ) { } return Optional . empty ( ) ; } ","public static Optional < Geometry > wktToGeometry ( String wkt , WKTReader wktReader ) { try { return Optional . of ( wktReader . read ( wkt ) ) ; } catch ( ParseException e ) { LOGGER . debug ( ""unable to convert WKT to a Geometry object: wkt={}"" , wkt , e ) ; } return Optional . empty ( ) ; } " 475,"public void waitElement ( Integer index ) { final String locator = getLocatorWithParameters ( getElementMap ( ) . locator ( ) [ index ] . toString ( ) ) ; final By by = ByConverter . convert ( getElementMap ( ) . locatorType ( ) , locator ) ; final long startedTime = GregorianCalendar . getInstance ( ) . getTimeInMillis ( ) ; Date startWaitTotal = GregorianCalendar . getInstance ( ) . getTime ( ) ; while ( true ) { try { waitThreadSleep ( BehaveConfig . getRunner_ScreenMinWait ( ) ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitLoading ( ) ; Date endLoading = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffLoading = endLoading . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o LOADING foi de ["" + diffLoading + ""ms]"" ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitClickable ( by ) ; Date endClickable = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffClickable = endClickable . getTime ( ) - endLoading . getTime ( ) ; Long diffTotal = endClickable . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o CLICKABLE foi de ["" + diffClickable + ""ms] e total foi de ["" + diffTotal + ""ms]"" ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitVisibility ( by ) ; Date endVisibility = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffVisibility = endVisibility . getTime ( ) - endClickable . getTime ( ) ; diffTotal = endVisibility . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o VISIBILITY foi de ["" + diffVisibility + ""ms] e total foi de ["" + diffTotal + ""ms]"" ) ; break ; } catch ( Exception e ) { log . warn ( e ) ; } finally { getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( BehaveConfig . getRunner_ScreenMaxWait ( ) , TimeUnit . MILLISECONDS ) ; if ( GregorianCalendar . getInstance ( ) . getTimeInMillis ( ) - startedTime > BehaveConfig . getRunner_ScreenMaxWait ( ) ) { throw new BehaveException ( message . getString ( ""exception-element-not-found"" , getElementMap ( ) . name ( ) ) ) ; } } } } ","public void waitElement ( Integer index ) { final String locator = getLocatorWithParameters ( getElementMap ( ) . locator ( ) [ index ] . toString ( ) ) ; final By by = ByConverter . convert ( getElementMap ( ) . locatorType ( ) , locator ) ; final long startedTime = GregorianCalendar . getInstance ( ) . getTimeInMillis ( ) ; Date startWaitTotal = GregorianCalendar . getInstance ( ) . getTime ( ) ; while ( true ) { try { waitThreadSleep ( BehaveConfig . getRunner_ScreenMinWait ( ) ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitLoading ( ) ; Date endLoading = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffLoading = endLoading . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o LOADING foi de ["" + diffLoading + ""ms]"" ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitClickable ( by ) ; Date endClickable = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffClickable = endClickable . getTime ( ) - endLoading . getTime ( ) ; Long diffTotal = endClickable . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o CLICKABLE foi de ["" + diffClickable + ""ms] e total foi de ["" + diffTotal + ""ms]"" ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitVisibility ( by ) ; Date endVisibility = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffVisibility = endVisibility . getTime ( ) - endClickable . getTime ( ) ; diffTotal = endVisibility . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o VISIBILITY foi de ["" + diffVisibility + ""ms] e total foi de ["" + diffTotal + ""ms]"" ) ; break ; } catch ( Exception e ) { log . warn ( ""Erro no Wait Element"" ) ; log . warn ( e ) ; } finally { getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( BehaveConfig . getRunner_ScreenMaxWait ( ) , TimeUnit . MILLISECONDS ) ; if ( GregorianCalendar . getInstance ( ) . getTimeInMillis ( ) - startedTime > BehaveConfig . getRunner_ScreenMaxWait ( ) ) { throw new BehaveException ( message . getString ( ""exception-element-not-found"" , getElementMap ( ) . name ( ) ) ) ; } } } } " 476,"public void waitElement ( Integer index ) { final String locator = getLocatorWithParameters ( getElementMap ( ) . locator ( ) [ index ] . toString ( ) ) ; final By by = ByConverter . convert ( getElementMap ( ) . locatorType ( ) , locator ) ; final long startedTime = GregorianCalendar . getInstance ( ) . getTimeInMillis ( ) ; Date startWaitTotal = GregorianCalendar . getInstance ( ) . getTime ( ) ; while ( true ) { try { waitThreadSleep ( BehaveConfig . getRunner_ScreenMinWait ( ) ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitLoading ( ) ; Date endLoading = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffLoading = endLoading . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o LOADING foi de ["" + diffLoading + ""ms]"" ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitClickable ( by ) ; Date endClickable = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffClickable = endClickable . getTime ( ) - endLoading . getTime ( ) ; Long diffTotal = endClickable . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o CLICKABLE foi de ["" + diffClickable + ""ms] e total foi de ["" + diffTotal + ""ms]"" ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitVisibility ( by ) ; Date endVisibility = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffVisibility = endVisibility . getTime ( ) - endClickable . getTime ( ) ; diffTotal = endVisibility . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o VISIBILITY foi de ["" + diffVisibility + ""ms] e total foi de ["" + diffTotal + ""ms]"" ) ; break ; } catch ( Exception e ) { log . warn ( ""Erro no Wait Element"" ) ; } finally { getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( BehaveConfig . getRunner_ScreenMaxWait ( ) , TimeUnit . MILLISECONDS ) ; if ( GregorianCalendar . getInstance ( ) . getTimeInMillis ( ) - startedTime > BehaveConfig . getRunner_ScreenMaxWait ( ) ) { throw new BehaveException ( message . getString ( ""exception-element-not-found"" , getElementMap ( ) . name ( ) ) ) ; } } } } ","public void waitElement ( Integer index ) { final String locator = getLocatorWithParameters ( getElementMap ( ) . locator ( ) [ index ] . toString ( ) ) ; final By by = ByConverter . convert ( getElementMap ( ) . locatorType ( ) , locator ) ; final long startedTime = GregorianCalendar . getInstance ( ) . getTimeInMillis ( ) ; Date startWaitTotal = GregorianCalendar . getInstance ( ) . getTime ( ) ; while ( true ) { try { waitThreadSleep ( BehaveConfig . getRunner_ScreenMinWait ( ) ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitLoading ( ) ; Date endLoading = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffLoading = endLoading . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o LOADING foi de ["" + diffLoading + ""ms]"" ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitClickable ( by ) ; Date endClickable = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffClickable = endClickable . getTime ( ) - endLoading . getTime ( ) ; Long diffTotal = endClickable . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o CLICKABLE foi de ["" + diffClickable + ""ms] e total foi de ["" + diffTotal + ""ms]"" ) ; getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( getImplicitlyWaitTimeoutInMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; waitVisibility ( by ) ; Date endVisibility = GregorianCalendar . getInstance ( ) . getTime ( ) ; Long diffVisibility = endVisibility . getTime ( ) - endClickable . getTime ( ) ; diffTotal = endVisibility . getTime ( ) - startWaitTotal . getTime ( ) ; logStatistics ( ""O tempo para esperar o VISIBILITY foi de ["" + diffVisibility + ""ms] e total foi de ["" + diffTotal + ""ms]"" ) ; break ; } catch ( Exception e ) { log . warn ( ""Erro no Wait Element"" ) ; log . warn ( e ) ; } finally { getDriver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( BehaveConfig . getRunner_ScreenMaxWait ( ) , TimeUnit . MILLISECONDS ) ; if ( GregorianCalendar . getInstance ( ) . getTimeInMillis ( ) - startedTime > BehaveConfig . getRunner_ScreenMaxWait ( ) ) { throw new BehaveException ( message . getString ( ""exception-element-not-found"" , getElementMap ( ) . name ( ) ) ) ; } } } } " 477,"public void clearExpiredSites ( ) { Collection < ApprovedSite > expiredSites = getExpired ( ) ; if ( expiredSites . size ( ) > 0 ) { logger . info ( ""Found "" + expiredSites . size ( ) + "" expired approved sites."" ) ; } if ( expiredSites != null ) { for ( ApprovedSite expired : expiredSites ) { remove ( expired ) ; } } } ","public void clearExpiredSites ( ) { logger . debug ( ""Clearing expired approved sites"" ) ; Collection < ApprovedSite > expiredSites = getExpired ( ) ; if ( expiredSites . size ( ) > 0 ) { logger . info ( ""Found "" + expiredSites . size ( ) + "" expired approved sites."" ) ; } if ( expiredSites != null ) { for ( ApprovedSite expired : expiredSites ) { remove ( expired ) ; } } } " 478,"public void clearExpiredSites ( ) { logger . debug ( ""Clearing expired approved sites"" ) ; Collection < ApprovedSite > expiredSites = getExpired ( ) ; if ( expiredSites . size ( ) > 0 ) { } if ( expiredSites != null ) { for ( ApprovedSite expired : expiredSites ) { remove ( expired ) ; } } } ","public void clearExpiredSites ( ) { logger . debug ( ""Clearing expired approved sites"" ) ; Collection < ApprovedSite > expiredSites = getExpired ( ) ; if ( expiredSites . size ( ) > 0 ) { logger . info ( ""Found "" + expiredSites . size ( ) + "" expired approved sites."" ) ; } if ( expiredSites != null ) { for ( ApprovedSite expired : expiredSites ) { remove ( expired ) ; } } } " 479,"public void removeTaskManager ( InstanceID instanceId ) { Preconditions . checkNotNull ( instanceId ) ; final FineGrainedTaskManagerRegistration taskManager = Preconditions . checkNotNull ( taskManagerRegistrations . remove ( instanceId ) ) ; totalRegisteredResource = totalRegisteredResource . subtract ( taskManager . getTotalResource ( ) ) ; for ( AllocationID allocationId : taskManager . getAllocatedSlots ( ) . keySet ( ) ) { slots . remove ( allocationId ) ; } } ","public void removeTaskManager ( InstanceID instanceId ) { Preconditions . checkNotNull ( instanceId ) ; final FineGrainedTaskManagerRegistration taskManager = Preconditions . checkNotNull ( taskManagerRegistrations . remove ( instanceId ) ) ; totalRegisteredResource = totalRegisteredResource . subtract ( taskManager . getTotalResource ( ) ) ; LOG . debug ( ""Remove task manager {}."" , instanceId ) ; for ( AllocationID allocationId : taskManager . getAllocatedSlots ( ) . keySet ( ) ) { slots . remove ( allocationId ) ; } } " 480,"public void createFolder ( ITransaction transaction , String folderUri ) { folderUri = removeTrailingSlash ( folderUri ) ; int ind = folderUri . lastIndexOf ( '/' ) ; String parentUri = folderUri . substring ( 0 , ind + 1 ) ; String resourceName = folderUri . substring ( ind + 1 ) ; try { ResolvedRequest resolvedParent = resolveRequest ( parentUri ) ; logger . debug ( ""WebDAV create folder at: "" + resolvedParent ) ; if ( resolvedParent . getPath ( ) == null ) { if ( resolvedParent . getRepositoryName ( ) == null ) { throw new WebdavException ( WebdavI18n . cannotCreateRepository . text ( resourceName ) ) ; } if ( resolvedParent . getWorkspaceName ( ) != null ) { resolvedParent = resolvedParent . withPath ( ""/"" ) ; } else { I18n msg = WebdavI18n . cannotCreateWorkspaceInRepository ; throw new WebdavException ( msg . text ( resourceName , resolvedParent . getRepositoryName ( ) ) ) ; } } Node parentNode = nodeFor ( transaction , resolvedParent ) ; contentMapper . createFolder ( parentNode , resourceName ) ; } catch ( RepositoryException re ) { throw translate ( re ) ; } } ","public void createFolder ( ITransaction transaction , String folderUri ) { folderUri = removeTrailingSlash ( folderUri ) ; int ind = folderUri . lastIndexOf ( '/' ) ; String parentUri = folderUri . substring ( 0 , ind + 1 ) ; String resourceName = folderUri . substring ( ind + 1 ) ; try { logger . debug ( ""WebDAV create folder at: "" + parentUri ) ; ResolvedRequest resolvedParent = resolveRequest ( parentUri ) ; logger . debug ( ""WebDAV create folder at: "" + resolvedParent ) ; if ( resolvedParent . getPath ( ) == null ) { if ( resolvedParent . getRepositoryName ( ) == null ) { throw new WebdavException ( WebdavI18n . cannotCreateRepository . text ( resourceName ) ) ; } if ( resolvedParent . getWorkspaceName ( ) != null ) { resolvedParent = resolvedParent . withPath ( ""/"" ) ; } else { I18n msg = WebdavI18n . cannotCreateWorkspaceInRepository ; throw new WebdavException ( msg . text ( resourceName , resolvedParent . getRepositoryName ( ) ) ) ; } } Node parentNode = nodeFor ( transaction , resolvedParent ) ; contentMapper . createFolder ( parentNode , resourceName ) ; } catch ( RepositoryException re ) { throw translate ( re ) ; } } " 481,"public void createFolder ( ITransaction transaction , String folderUri ) { folderUri = removeTrailingSlash ( folderUri ) ; int ind = folderUri . lastIndexOf ( '/' ) ; String parentUri = folderUri . substring ( 0 , ind + 1 ) ; String resourceName = folderUri . substring ( ind + 1 ) ; try { logger . debug ( ""WebDAV create folder at: "" + parentUri ) ; ResolvedRequest resolvedParent = resolveRequest ( parentUri ) ; if ( resolvedParent . getPath ( ) == null ) { if ( resolvedParent . getRepositoryName ( ) == null ) { throw new WebdavException ( WebdavI18n . cannotCreateRepository . text ( resourceName ) ) ; } if ( resolvedParent . getWorkspaceName ( ) != null ) { resolvedParent = resolvedParent . withPath ( ""/"" ) ; } else { I18n msg = WebdavI18n . cannotCreateWorkspaceInRepository ; throw new WebdavException ( msg . text ( resourceName , resolvedParent . getRepositoryName ( ) ) ) ; } } Node parentNode = nodeFor ( transaction , resolvedParent ) ; contentMapper . createFolder ( parentNode , resourceName ) ; } catch ( RepositoryException re ) { throw translate ( re ) ; } } ","public void createFolder ( ITransaction transaction , String folderUri ) { folderUri = removeTrailingSlash ( folderUri ) ; int ind = folderUri . lastIndexOf ( '/' ) ; String parentUri = folderUri . substring ( 0 , ind + 1 ) ; String resourceName = folderUri . substring ( ind + 1 ) ; try { logger . debug ( ""WebDAV create folder at: "" + parentUri ) ; ResolvedRequest resolvedParent = resolveRequest ( parentUri ) ; logger . debug ( ""WebDAV create folder at: "" + resolvedParent ) ; if ( resolvedParent . getPath ( ) == null ) { if ( resolvedParent . getRepositoryName ( ) == null ) { throw new WebdavException ( WebdavI18n . cannotCreateRepository . text ( resourceName ) ) ; } if ( resolvedParent . getWorkspaceName ( ) != null ) { resolvedParent = resolvedParent . withPath ( ""/"" ) ; } else { I18n msg = WebdavI18n . cannotCreateWorkspaceInRepository ; throw new WebdavException ( msg . text ( resourceName , resolvedParent . getRepositoryName ( ) ) ) ; } } Node parentNode = nodeFor ( transaction , resolvedParent ) ; contentMapper . createFolder ( parentNode , resourceName ) ; } catch ( RepositoryException re ) { throw translate ( re ) ; } } " 482,"public synchronized void unbindHook ( ServiceReference < DeploymentHook > hook ) { final Object rawHookId = hook . getProperty ( ConfigurationService . KURA_SERVICE_PID ) ; if ( ! ( rawHookId instanceof String ) ) { return ; } final String hookId = ( String ) rawHookId ; final DeploymentHook removedHook = this . registeredHooks . remove ( hookId ) ; updateAssociations ( ) ; if ( removedHook != null ) { getBundleContext ( ) . ungetService ( hook ) ; } } ","public synchronized void unbindHook ( ServiceReference < DeploymentHook > hook ) { final Object rawHookId = hook . getProperty ( ConfigurationService . KURA_SERVICE_PID ) ; if ( ! ( rawHookId instanceof String ) ) { return ; } final String hookId = ( String ) rawHookId ; final DeploymentHook removedHook = this . registeredHooks . remove ( hookId ) ; updateAssociations ( ) ; if ( removedHook != null ) { getBundleContext ( ) . ungetService ( hook ) ; logger . info ( ""Hook unregistered: {}"" , hookId ) ; } } " 483,"@ Test public void testProperties ( ) throws Exception { Logger logger = LogManager . getLogger ( ""test"" ) ; File file = new File ( ""target/temp.A1"" ) ; assertTrue ( ""File A1 was not created"" , file . exists ( ) ) ; assertTrue ( ""File A1 is empty"" , file . length ( ) > 0 ) ; file = new File ( ""target/temp.A2"" ) ; assertTrue ( ""File A2 was not created"" , file . exists ( ) ) ; assertTrue ( ""File A2 is empty"" , file . length ( ) > 0 ) ; } ","@ Test public void testProperties ( ) throws Exception { Logger logger = LogManager . getLogger ( ""test"" ) ; logger . debug ( ""This is a test of the root logger"" ) ; File file = new File ( ""target/temp.A1"" ) ; assertTrue ( ""File A1 was not created"" , file . exists ( ) ) ; assertTrue ( ""File A1 is empty"" , file . length ( ) > 0 ) ; file = new File ( ""target/temp.A2"" ) ; assertTrue ( ""File A2 was not created"" , file . exists ( ) ) ; assertTrue ( ""File A2 is empty"" , file . length ( ) > 0 ) ; } " 484,"private void addStandbySession ( Session session , InetSocketAddress mainNodeAddress , InetSocketAddress lastResolvedMainAddr , InetSocketAddressWrapper addrWrapper ) { InetSocketAddress remoteSocketAddress = session . getRemoteSocketAddress ( ) ; if ( lastResolvedMainAddr != null && ! lastResolvedMainAddr . equals ( remoteSocketAddress ) ) { log . warn ( ""Memcached node {} is resolved into {}."" , lastResolvedMainAddr , remoteSocketAddress ) ; List < Session > sessions = standbySessionMap . remove ( lastResolvedMainAddr ) ; if ( sessions != null ) { for ( Session s : sessions ) { ( ( MemcachedSession ) s ) . setAllowReconnect ( false ) ; s . close ( ) ; } } addrWrapper . setResolvedMainNodeSocketAddress ( remoteSocketAddress ) ; } List < Session > sessions = this . standbySessionMap . get ( mainNodeAddress ) ; if ( sessions == null ) { sessions = new CopyOnWriteArrayList < Session > ( ) ; List < Session > oldSessions = this . standbySessionMap . putIfAbsent ( mainNodeAddress , sessions ) ; if ( null != oldSessions ) { sessions = oldSessions ; } } sessions . add ( session ) ; } ","private void addStandbySession ( Session session , InetSocketAddress mainNodeAddress , InetSocketAddress lastResolvedMainAddr , InetSocketAddressWrapper addrWrapper ) { InetSocketAddress remoteSocketAddress = session . getRemoteSocketAddress ( ) ; log . info ( ""Add a standby session: "" + SystemUtils . getRawAddress ( remoteSocketAddress ) + "":"" + remoteSocketAddress . getPort ( ) + "" for "" + SystemUtils . getRawAddress ( mainNodeAddress ) + "":"" + mainNodeAddress . getPort ( ) ) ; if ( lastResolvedMainAddr != null && ! lastResolvedMainAddr . equals ( remoteSocketAddress ) ) { log . warn ( ""Memcached node {} is resolved into {}."" , lastResolvedMainAddr , remoteSocketAddress ) ; List < Session > sessions = standbySessionMap . remove ( lastResolvedMainAddr ) ; if ( sessions != null ) { for ( Session s : sessions ) { ( ( MemcachedSession ) s ) . setAllowReconnect ( false ) ; s . close ( ) ; } } addrWrapper . setResolvedMainNodeSocketAddress ( remoteSocketAddress ) ; } List < Session > sessions = this . standbySessionMap . get ( mainNodeAddress ) ; if ( sessions == null ) { sessions = new CopyOnWriteArrayList < Session > ( ) ; List < Session > oldSessions = this . standbySessionMap . putIfAbsent ( mainNodeAddress , sessions ) ; if ( null != oldSessions ) { sessions = oldSessions ; } } sessions . add ( session ) ; } " 485,"private void addStandbySession ( Session session , InetSocketAddress mainNodeAddress , InetSocketAddress lastResolvedMainAddr , InetSocketAddressWrapper addrWrapper ) { InetSocketAddress remoteSocketAddress = session . getRemoteSocketAddress ( ) ; log . info ( ""Add a standby session: "" + SystemUtils . getRawAddress ( remoteSocketAddress ) + "":"" + remoteSocketAddress . getPort ( ) + "" for "" + SystemUtils . getRawAddress ( mainNodeAddress ) + "":"" + mainNodeAddress . getPort ( ) ) ; if ( lastResolvedMainAddr != null && ! lastResolvedMainAddr . equals ( remoteSocketAddress ) ) { List < Session > sessions = standbySessionMap . remove ( lastResolvedMainAddr ) ; if ( sessions != null ) { for ( Session s : sessions ) { ( ( MemcachedSession ) s ) . setAllowReconnect ( false ) ; s . close ( ) ; } } addrWrapper . setResolvedMainNodeSocketAddress ( remoteSocketAddress ) ; } List < Session > sessions = this . standbySessionMap . get ( mainNodeAddress ) ; if ( sessions == null ) { sessions = new CopyOnWriteArrayList < Session > ( ) ; List < Session > oldSessions = this . standbySessionMap . putIfAbsent ( mainNodeAddress , sessions ) ; if ( null != oldSessions ) { sessions = oldSessions ; } } sessions . add ( session ) ; } ","private void addStandbySession ( Session session , InetSocketAddress mainNodeAddress , InetSocketAddress lastResolvedMainAddr , InetSocketAddressWrapper addrWrapper ) { InetSocketAddress remoteSocketAddress = session . getRemoteSocketAddress ( ) ; log . info ( ""Add a standby session: "" + SystemUtils . getRawAddress ( remoteSocketAddress ) + "":"" + remoteSocketAddress . getPort ( ) + "" for "" + SystemUtils . getRawAddress ( mainNodeAddress ) + "":"" + mainNodeAddress . getPort ( ) ) ; if ( lastResolvedMainAddr != null && ! lastResolvedMainAddr . equals ( remoteSocketAddress ) ) { log . warn ( ""Memcached node {} is resolved into {}."" , lastResolvedMainAddr , remoteSocketAddress ) ; List < Session > sessions = standbySessionMap . remove ( lastResolvedMainAddr ) ; if ( sessions != null ) { for ( Session s : sessions ) { ( ( MemcachedSession ) s ) . setAllowReconnect ( false ) ; s . close ( ) ; } } addrWrapper . setResolvedMainNodeSocketAddress ( remoteSocketAddress ) ; } List < Session > sessions = this . standbySessionMap . get ( mainNodeAddress ) ; if ( sessions == null ) { sessions = new CopyOnWriteArrayList < Session > ( ) ; List < Session > oldSessions = this . standbySessionMap . putIfAbsent ( mainNodeAddress , sessions ) ; if ( null != oldSessions ) { sessions = oldSessions ; } } sessions . add ( session ) ; } " 486,"public String getReplicationConnectionURI ( ) { try { return getConfigConnectionURI ( replicationMysql ) ; } catch ( URISyntaxException e ) { throw new RuntimeException ( ""Unable to generate bootstrap's replication jdbc connection URI"" , e ) ; } } ","public String getReplicationConnectionURI ( ) { try { return getConfigConnectionURI ( replicationMysql ) ; } catch ( URISyntaxException e ) { LOGGER . error ( e . getMessage ( ) , e ) ; throw new RuntimeException ( ""Unable to generate bootstrap's replication jdbc connection URI"" , e ) ; } } " 487,"public static com . liferay . commerce . model . CommerceOrderItemSoap updateCommerceOrderItemUnitPrice ( long commerceOrderItemId , int quantity , java . math . BigDecimal unitPrice ) throws RemoteException { try { com . liferay . commerce . model . CommerceOrderItem returnValue = CommerceOrderItemServiceUtil . updateCommerceOrderItemUnitPrice ( commerceOrderItemId , quantity , unitPrice ) ; return com . liferay . commerce . model . CommerceOrderItemSoap . toSoapModel ( returnValue ) ; } catch ( Exception exception ) { throw new RemoteException ( exception . getMessage ( ) ) ; } } ","public static com . liferay . commerce . model . CommerceOrderItemSoap updateCommerceOrderItemUnitPrice ( long commerceOrderItemId , int quantity , java . math . BigDecimal unitPrice ) throws RemoteException { try { com . liferay . commerce . model . CommerceOrderItem returnValue = CommerceOrderItemServiceUtil . updateCommerceOrderItemUnitPrice ( commerceOrderItemId , quantity , unitPrice ) ; return com . liferay . commerce . model . CommerceOrderItemSoap . toSoapModel ( returnValue ) ; } catch ( Exception exception ) { _log . error ( exception , exception ) ; throw new RemoteException ( exception . getMessage ( ) ) ; } } " 488,"public void setServiceDef ( RangerServiceDef serviceDef ) { if ( isInitialized ) { } this . serviceDef = serviceDef ; } ","public void setServiceDef ( RangerServiceDef serviceDef ) { if ( isInitialized ) { LOG . warn ( ""RangerDefaultPolicyResourceMatcher is already initialized. init() must be done again after updating serviceDef"" ) ; } this . serviceDef = serviceDef ; } " 489,"protected Properties createUserFilterProperties ( ) throws ApsSystemException { String filterKey = this . getUserFilterKey ( ) ; if ( null == filterKey ) { return null ; } Properties properties = new Properties ( ) ; try { if ( filterKey . equals ( UserFilterOptionBean . KEY_FULLTEXT ) ) { properties . put ( UserFilterOptionBean . PARAM_KEY , filterKey ) ; properties . put ( UserFilterOptionBean . PARAM_IS_ATTRIBUTE_FILTER , String . valueOf ( false ) ) ; } else if ( filterKey . equals ( UserFilterOptionBean . KEY_CATEGORY ) ) { properties . put ( UserFilterOptionBean . PARAM_KEY , filterKey ) ; properties . put ( UserFilterOptionBean . PARAM_IS_ATTRIBUTE_FILTER , String . valueOf ( false ) ) ; if ( null != this . getUserFilterCategoryCode ( ) && this . getUserFilterCategoryCode ( ) . trim ( ) . length ( ) > 0 ) { properties . put ( UserFilterOptionBean . PARAM_CATEGORY_CODE , this . getUserFilterCategoryCode ( ) ) ; } } else if ( filterKey . startsWith ( UserFilterOptionBean . TYPE_ATTRIBUTE + ""_"" ) ) { properties . put ( UserFilterOptionBean . PARAM_KEY , filterKey . substring ( ( UserFilterOptionBean . TYPE_ATTRIBUTE + ""_"" ) . length ( ) ) ) ; properties . put ( UserFilterOptionBean . PARAM_IS_ATTRIBUTE_FILTER , String . valueOf ( true ) ) ; } if ( properties . isEmpty ( ) ) { return null ; } } catch ( Throwable t ) { throw new ApsSystemException ( ""Error creating user filter"" , t ) ; } return properties ; } ","protected Properties createUserFilterProperties ( ) throws ApsSystemException { String filterKey = this . getUserFilterKey ( ) ; if ( null == filterKey ) { return null ; } Properties properties = new Properties ( ) ; try { if ( filterKey . equals ( UserFilterOptionBean . KEY_FULLTEXT ) ) { properties . put ( UserFilterOptionBean . PARAM_KEY , filterKey ) ; properties . put ( UserFilterOptionBean . PARAM_IS_ATTRIBUTE_FILTER , String . valueOf ( false ) ) ; } else if ( filterKey . equals ( UserFilterOptionBean . KEY_CATEGORY ) ) { properties . put ( UserFilterOptionBean . PARAM_KEY , filterKey ) ; properties . put ( UserFilterOptionBean . PARAM_IS_ATTRIBUTE_FILTER , String . valueOf ( false ) ) ; if ( null != this . getUserFilterCategoryCode ( ) && this . getUserFilterCategoryCode ( ) . trim ( ) . length ( ) > 0 ) { properties . put ( UserFilterOptionBean . PARAM_CATEGORY_CODE , this . getUserFilterCategoryCode ( ) ) ; } } else if ( filterKey . startsWith ( UserFilterOptionBean . TYPE_ATTRIBUTE + ""_"" ) ) { properties . put ( UserFilterOptionBean . PARAM_KEY , filterKey . substring ( ( UserFilterOptionBean . TYPE_ATTRIBUTE + ""_"" ) . length ( ) ) ) ; properties . put ( UserFilterOptionBean . PARAM_IS_ATTRIBUTE_FILTER , String . valueOf ( true ) ) ; } if ( properties . isEmpty ( ) ) { return null ; } } catch ( Throwable t ) { _logger . error ( ""Error creating user filter"" , t ) ; throw new ApsSystemException ( ""Error creating user filter"" , t ) ; } return properties ; } " 490,"private Position toPosition ( double x , double y , String fromSrsId , String toSrsId ) { try { DirectPosition src = new DirectPosition2D ( x , y ) ; MathTransform transform = getOrCreateTransform ( fromSrsId , toSrsId ) ; if ( transform == null ) { return new DirectPosition2D ( 0 , 0 ) ; } DirectPosition directPosition = transform . transform ( src , null ) ; return directPosition ; } catch ( Throwable t ) { LOG . error ( ""Error converting: x="" + x + "" y="" + y + "" srs="" + fromSrsId , t ) ; return new DirectPosition2D ( 0 , 0 ) ; } } ","private Position toPosition ( double x , double y , String fromSrsId , String toSrsId ) { try { DirectPosition src = new DirectPosition2D ( x , y ) ; MathTransform transform = getOrCreateTransform ( fromSrsId , toSrsId ) ; if ( transform == null ) { LOG . error ( String . format ( ""Cannot find transform from %s to %s"" , fromSrsId , toSrsId ) ) ; return new DirectPosition2D ( 0 , 0 ) ; } DirectPosition directPosition = transform . transform ( src , null ) ; return directPosition ; } catch ( Throwable t ) { LOG . error ( ""Error converting: x="" + x + "" y="" + y + "" srs="" + fromSrsId , t ) ; return new DirectPosition2D ( 0 , 0 ) ; } } " 491,"private Position toPosition ( double x , double y , String fromSrsId , String toSrsId ) { try { DirectPosition src = new DirectPosition2D ( x , y ) ; MathTransform transform = getOrCreateTransform ( fromSrsId , toSrsId ) ; if ( transform == null ) { LOG . error ( String . format ( ""Cannot find transform from %s to %s"" , fromSrsId , toSrsId ) ) ; return new DirectPosition2D ( 0 , 0 ) ; } DirectPosition directPosition = transform . transform ( src , null ) ; return directPosition ; } catch ( Throwable t ) { return new DirectPosition2D ( 0 , 0 ) ; } } ","private Position toPosition ( double x , double y , String fromSrsId , String toSrsId ) { try { DirectPosition src = new DirectPosition2D ( x , y ) ; MathTransform transform = getOrCreateTransform ( fromSrsId , toSrsId ) ; if ( transform == null ) { LOG . error ( String . format ( ""Cannot find transform from %s to %s"" , fromSrsId , toSrsId ) ) ; return new DirectPosition2D ( 0 , 0 ) ; } DirectPosition directPosition = transform . transform ( src , null ) ; return directPosition ; } catch ( Throwable t ) { LOG . error ( ""Error converting: x="" + x + "" y="" + y + "" srs="" + fromSrsId , t ) ; return new DirectPosition2D ( 0 , 0 ) ; } } " 492,"public void run ( MessageReply reply ) { if ( ! reply . isSuccess ( ) ) { } completion . fail ( operr ( ""Failed because management node restarted."" ) ) ; } ","public void run ( MessageReply reply ) { if ( ! reply . isSuccess ( ) ) { logger . warn ( String . format ( ""delete image [%s] failed after management node restarted"" , msg . getResourceUuid ( ) ) ) ; } completion . fail ( operr ( ""Failed because management node restarted."" ) ) ; } " 493,"private long getBundleTime ( Bundle bundle ) { long bundleTime = JitterClock . globalTime ( ) ; if ( timeField != null ) { ValueObject vo = timeField . getField ( ) . getValue ( bundle ) ; if ( vo == null ) { } else { bundleTime = timeField . toUnix ( vo ) ; } } return bundleTime ; } ","private long getBundleTime ( Bundle bundle ) { long bundleTime = JitterClock . globalTime ( ) ; if ( timeField != null ) { ValueObject vo = timeField . getField ( ) . getValue ( bundle ) ; if ( vo == null ) { log . debug ( ""missing time {} in [{}] --> {}"" , timeField . getField ( ) , bundle . getCount ( ) , bundle ) ; } else { bundleTime = timeField . toUnix ( vo ) ; } } return bundleTime ; } " 494,"public synchronized void xaSuspend ( ) throws Exception { if ( logger . isTraceEnabled ( ) ) { } if ( tx == null ) { final String msg = ""Cannot suspend, session is not doing work in a transaction "" ; throw new ActiveMQXAException ( XAException . XAER_PROTO , msg ) ; } else { if ( tx . getState ( ) == Transaction . State . SUSPENDED ) { final String msg = ""Cannot suspend, transaction is already suspended "" + tx . getXid ( ) ; throw new ActiveMQXAException ( XAException . XAER_PROTO , msg ) ; } else { tx . suspend ( ) ; tx = null ; } } } ","public synchronized void xaSuspend ( ) throws Exception { if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""xasuspend on "" + this . tx ) ; } if ( tx == null ) { final String msg = ""Cannot suspend, session is not doing work in a transaction "" ; throw new ActiveMQXAException ( XAException . XAER_PROTO , msg ) ; } else { if ( tx . getState ( ) == Transaction . State . SUSPENDED ) { final String msg = ""Cannot suspend, transaction is already suspended "" + tx . getXid ( ) ; throw new ActiveMQXAException ( XAException . XAER_PROTO , msg ) ; } else { tx . suspend ( ) ; tx = null ; } } } " 495,"private boolean hasPropagateRepoPermission ( String repo ) { if ( ! accessEvaluator . isAllowedPropagationRepo ( repo ) ) { InApplicationMonitor . getInstance ( ) . incrementCounter ( APPMON_ACCESS_PREVENTION ) ; return false ; } return true ; } ","private boolean hasPropagateRepoPermission ( String repo ) { if ( ! accessEvaluator . isAllowedPropagationRepo ( repo ) ) { InApplicationMonitor . getInstance ( ) . incrementCounter ( APPMON_ACCESS_PREVENTION ) ; LOGGER . warn ( ""preventing access to {}"" , repo ) ; return false ; } return true ; } " 496,"private void commitOffsets ( ) { try { consumer . commitSync ( offsets ) ; } catch ( Exception e ) { } finally { logger . trace ( ""About to clear offsets map."" ) ; offsets . clear ( ) ; } } ","private void commitOffsets ( ) { try { consumer . commitSync ( offsets ) ; } catch ( Exception e ) { logger . info ( ""Error committing offsets."" , e ) ; } finally { logger . trace ( ""About to clear offsets map."" ) ; offsets . clear ( ) ; } } " 497,"private void commitOffsets ( ) { try { consumer . commitSync ( offsets ) ; } catch ( Exception e ) { logger . info ( ""Error committing offsets."" , e ) ; } finally { offsets . clear ( ) ; } } ","private void commitOffsets ( ) { try { consumer . commitSync ( offsets ) ; } catch ( Exception e ) { logger . info ( ""Error committing offsets."" , e ) ; } finally { logger . trace ( ""About to clear offsets map."" ) ; offsets . clear ( ) ; } } " 498,"public static PlanInstance createPlanInstance ( final Csar csar , final QName serviceTemplateId , final long serviceTemplateInstanceId , final QName planId , final String operationName , final String correlationId , final String chorCorrelationId , final String choreographyPartners , final Object input ) throws CorrelationIdAlreadySetException { if ( Objects . isNull ( planId ) ) { return null ; } final TPlan storedPlan ; try { storedPlan = ToscaEngine . resolvePlanReference ( csar , planId ) ; } catch ( NotFoundException e ) { LOG . error ( ""Plan with ID {} does not exist in CSAR {}!"" , planId , csar . id ( ) . csarName ( ) ) ; return null ; } final PlanInstance plan = new PlanInstance ( ) ; plan . setCorrelationId ( correlationId ) ; plan . setChoreographyCorrelationId ( chorCorrelationId ) ; plan . setChoreographyPartners ( choreographyPartners ) ; plan . setLanguage ( PlanLanguage . fromString ( storedPlan . getPlanLanguage ( ) ) ) ; plan . setType ( PlanType . fromString ( storedPlan . getPlanType ( ) ) ) ; plan . setState ( PlanInstanceState . RUNNING ) ; plan . setTemplateId ( planId ) ; final Optional < PlanInstance > planOptional = planRepo . findAll ( ) . stream ( ) . filter ( p -> p . getCorrelationId ( ) . equals ( correlationId ) ) . findFirst ( ) ; if ( planOptional . isPresent ( ) ) { throw new CorrelationIdAlreadySetException ( ""Plan instance with correlation ID "" + correlationId + "" is already existing."" ) ; } Map < String , String > inputMap = new HashMap < > ( ) ; if ( input instanceof HashMap ) { inputMap = ( HashMap < String , String > ) input ; } for ( final TParameter param : storedPlan . getInputParameters ( ) . getInputParameter ( ) ) { new PlanInstanceInput ( param . getName ( ) , inputMap . getOrDefault ( param . getName ( ) , """" ) , param . getType ( ) ) . setPlanInstance ( plan ) ; } stiRepo . find ( serviceTemplateInstanceId ) . ifPresent ( serviceTemplateInstance -> plan . setServiceTemplateInstance ( serviceTemplateInstance ) ) ; planRepo . add ( plan ) ; return plan ; } ","public static PlanInstance createPlanInstance ( final Csar csar , final QName serviceTemplateId , final long serviceTemplateInstanceId , final QName planId , final String operationName , final String correlationId , final String chorCorrelationId , final String choreographyPartners , final Object input ) throws CorrelationIdAlreadySetException { if ( Objects . isNull ( planId ) ) { LOG . error ( ""Plan ID is null! Unable to create PlanInstance!"" ) ; return null ; } final TPlan storedPlan ; try { storedPlan = ToscaEngine . resolvePlanReference ( csar , planId ) ; } catch ( NotFoundException e ) { LOG . error ( ""Plan with ID {} does not exist in CSAR {}!"" , planId , csar . id ( ) . csarName ( ) ) ; return null ; } final PlanInstance plan = new PlanInstance ( ) ; plan . setCorrelationId ( correlationId ) ; plan . setChoreographyCorrelationId ( chorCorrelationId ) ; plan . setChoreographyPartners ( choreographyPartners ) ; plan . setLanguage ( PlanLanguage . fromString ( storedPlan . getPlanLanguage ( ) ) ) ; plan . setType ( PlanType . fromString ( storedPlan . getPlanType ( ) ) ) ; plan . setState ( PlanInstanceState . RUNNING ) ; plan . setTemplateId ( planId ) ; final Optional < PlanInstance > planOptional = planRepo . findAll ( ) . stream ( ) . filter ( p -> p . getCorrelationId ( ) . equals ( correlationId ) ) . findFirst ( ) ; if ( planOptional . isPresent ( ) ) { throw new CorrelationIdAlreadySetException ( ""Plan instance with correlation ID "" + correlationId + "" is already existing."" ) ; } Map < String , String > inputMap = new HashMap < > ( ) ; if ( input instanceof HashMap ) { inputMap = ( HashMap < String , String > ) input ; } for ( final TParameter param : storedPlan . getInputParameters ( ) . getInputParameter ( ) ) { new PlanInstanceInput ( param . getName ( ) , inputMap . getOrDefault ( param . getName ( ) , """" ) , param . getType ( ) ) . setPlanInstance ( plan ) ; } stiRepo . find ( serviceTemplateInstanceId ) . ifPresent ( serviceTemplateInstance -> plan . setServiceTemplateInstance ( serviceTemplateInstance ) ) ; planRepo . add ( plan ) ; return plan ; } " 499,"public static PlanInstance createPlanInstance ( final Csar csar , final QName serviceTemplateId , final long serviceTemplateInstanceId , final QName planId , final String operationName , final String correlationId , final String chorCorrelationId , final String choreographyPartners , final Object input ) throws CorrelationIdAlreadySetException { if ( Objects . isNull ( planId ) ) { LOG . error ( ""Plan ID is null! Unable to create PlanInstance!"" ) ; return null ; } final TPlan storedPlan ; try { storedPlan = ToscaEngine . resolvePlanReference ( csar , planId ) ; } catch ( NotFoundException e ) { return null ; } final PlanInstance plan = new PlanInstance ( ) ; plan . setCorrelationId ( correlationId ) ; plan . setChoreographyCorrelationId ( chorCorrelationId ) ; plan . setChoreographyPartners ( choreographyPartners ) ; plan . setLanguage ( PlanLanguage . fromString ( storedPlan . getPlanLanguage ( ) ) ) ; plan . setType ( PlanType . fromString ( storedPlan . getPlanType ( ) ) ) ; plan . setState ( PlanInstanceState . RUNNING ) ; plan . setTemplateId ( planId ) ; final Optional < PlanInstance > planOptional = planRepo . findAll ( ) . stream ( ) . filter ( p -> p . getCorrelationId ( ) . equals ( correlationId ) ) . findFirst ( ) ; if ( planOptional . isPresent ( ) ) { throw new CorrelationIdAlreadySetException ( ""Plan instance with correlation ID "" + correlationId + "" is already existing."" ) ; } Map < String , String > inputMap = new HashMap < > ( ) ; if ( input instanceof HashMap ) { inputMap = ( HashMap < String , String > ) input ; } for ( final TParameter param : storedPlan . getInputParameters ( ) . getInputParameter ( ) ) { new PlanInstanceInput ( param . getName ( ) , inputMap . getOrDefault ( param . getName ( ) , """" ) , param . getType ( ) ) . setPlanInstance ( plan ) ; } stiRepo . find ( serviceTemplateInstanceId ) . ifPresent ( serviceTemplateInstance -> plan . setServiceTemplateInstance ( serviceTemplateInstance ) ) ; planRepo . add ( plan ) ; return plan ; } ","public static PlanInstance createPlanInstance ( final Csar csar , final QName serviceTemplateId , final long serviceTemplateInstanceId , final QName planId , final String operationName , final String correlationId , final String chorCorrelationId , final String choreographyPartners , final Object input ) throws CorrelationIdAlreadySetException { if ( Objects . isNull ( planId ) ) { LOG . error ( ""Plan ID is null! Unable to create PlanInstance!"" ) ; return null ; } final TPlan storedPlan ; try { storedPlan = ToscaEngine . resolvePlanReference ( csar , planId ) ; } catch ( NotFoundException e ) { LOG . error ( ""Plan with ID {} does not exist in CSAR {}!"" , planId , csar . id ( ) . csarName ( ) ) ; return null ; } final PlanInstance plan = new PlanInstance ( ) ; plan . setCorrelationId ( correlationId ) ; plan . setChoreographyCorrelationId ( chorCorrelationId ) ; plan . setChoreographyPartners ( choreographyPartners ) ; plan . setLanguage ( PlanLanguage . fromString ( storedPlan . getPlanLanguage ( ) ) ) ; plan . setType ( PlanType . fromString ( storedPlan . getPlanType ( ) ) ) ; plan . setState ( PlanInstanceState . RUNNING ) ; plan . setTemplateId ( planId ) ; final Optional < PlanInstance > planOptional = planRepo . findAll ( ) . stream ( ) . filter ( p -> p . getCorrelationId ( ) . equals ( correlationId ) ) . findFirst ( ) ; if ( planOptional . isPresent ( ) ) { throw new CorrelationIdAlreadySetException ( ""Plan instance with correlation ID "" + correlationId + "" is already existing."" ) ; } Map < String , String > inputMap = new HashMap < > ( ) ; if ( input instanceof HashMap ) { inputMap = ( HashMap < String , String > ) input ; } for ( final TParameter param : storedPlan . getInputParameters ( ) . getInputParameter ( ) ) { new PlanInstanceInput ( param . getName ( ) , inputMap . getOrDefault ( param . getName ( ) , """" ) , param . getType ( ) ) . setPlanInstance ( plan ) ; } stiRepo . find ( serviceTemplateInstanceId ) . ifPresent ( serviceTemplateInstance -> plan . setServiceTemplateInstance ( serviceTemplateInstance ) ) ; planRepo . add ( plan ) ; return plan ; } " 500,"private Either < Boolean , ResponseFormat > extractHeatParameters ( ArtifactDefinition artifactInfo ) { if ( artifactInfo . getPayloadData ( ) != null ) { String heatDecodedPayload = new String ( Base64 . decodeBase64 ( artifactInfo . getPayloadData ( ) ) ) ; Either < List < HeatParameterDefinition > , ResultStatusEnum > heatParameters = ImportUtils . getHeatParamsWithoutImplicitTypes ( heatDecodedPayload , artifactInfo . getArtifactType ( ) ) ; if ( heatParameters . isRight ( ) && ( heatParameters . right ( ) . value ( ) != ResultStatusEnum . ELEMENT_NOT_FOUND ) ) { ResponseFormat responseFormat = componentsUtils . getResponseFormat ( ActionStatus . INVALID_DEPLOYMENT_ARTIFACT_HEAT , artifactInfo . getArtifactType ( ) ) ; return Either . right ( responseFormat ) ; } else if ( heatParameters . isLeft ( ) && heatParameters . left ( ) . value ( ) != null ) { artifactInfo . setListHeatParameters ( heatParameters . left ( ) . value ( ) ) ; } } return Either . left ( true ) ; } ","private Either < Boolean , ResponseFormat > extractHeatParameters ( ArtifactDefinition artifactInfo ) { if ( artifactInfo . getPayloadData ( ) != null ) { String heatDecodedPayload = new String ( Base64 . decodeBase64 ( artifactInfo . getPayloadData ( ) ) ) ; Either < List < HeatParameterDefinition > , ResultStatusEnum > heatParameters = ImportUtils . getHeatParamsWithoutImplicitTypes ( heatDecodedPayload , artifactInfo . getArtifactType ( ) ) ; if ( heatParameters . isRight ( ) && ( heatParameters . right ( ) . value ( ) != ResultStatusEnum . ELEMENT_NOT_FOUND ) ) { log . info ( ""failed to parse heat parameters "" ) ; ResponseFormat responseFormat = componentsUtils . getResponseFormat ( ActionStatus . INVALID_DEPLOYMENT_ARTIFACT_HEAT , artifactInfo . getArtifactType ( ) ) ; return Either . right ( responseFormat ) ; } else if ( heatParameters . isLeft ( ) && heatParameters . left ( ) . value ( ) != null ) { artifactInfo . setListHeatParameters ( heatParameters . left ( ) . value ( ) ) ; } } return Either . left ( true ) ; } " 501,"public String getTextContent ( String path ) throws RemoteException , ResourceAdminServiceExceptionException { String content = null ; try { content = resourceAdminServiceStub . getTextContent ( path ) ; } catch ( RemoteException e ) { throw new RemoteException ( ""Restore version error : "" , e ) ; } catch ( ResourceAdminServiceExceptionException e ) { log . error ( ""GetTextContent Error : "" + e . getMessage ( ) ) ; throw new ResourceAdminServiceExceptionException ( ""GetTextContent Error : "" , e ) ; } return content ; } ","public String getTextContent ( String path ) throws RemoteException , ResourceAdminServiceExceptionException { String content = null ; try { content = resourceAdminServiceStub . getTextContent ( path ) ; } catch ( RemoteException e ) { log . error ( ""Unable get content : "" + e . getMessage ( ) ) ; throw new RemoteException ( ""Restore version error : "" , e ) ; } catch ( ResourceAdminServiceExceptionException e ) { log . error ( ""GetTextContent Error : "" + e . getMessage ( ) ) ; throw new ResourceAdminServiceExceptionException ( ""GetTextContent Error : "" , e ) ; } return content ; } " 502,"public String getTextContent ( String path ) throws RemoteException , ResourceAdminServiceExceptionException { String content = null ; try { content = resourceAdminServiceStub . getTextContent ( path ) ; } catch ( RemoteException e ) { log . error ( ""Unable get content : "" + e . getMessage ( ) ) ; throw new RemoteException ( ""Restore version error : "" , e ) ; } catch ( ResourceAdminServiceExceptionException e ) { throw new ResourceAdminServiceExceptionException ( ""GetTextContent Error : "" , e ) ; } return content ; } ","public String getTextContent ( String path ) throws RemoteException , ResourceAdminServiceExceptionException { String content = null ; try { content = resourceAdminServiceStub . getTextContent ( path ) ; } catch ( RemoteException e ) { log . error ( ""Unable get content : "" + e . getMessage ( ) ) ; throw new RemoteException ( ""Restore version error : "" , e ) ; } catch ( ResourceAdminServiceExceptionException e ) { log . error ( ""GetTextContent Error : "" + e . getMessage ( ) ) ; throw new ResourceAdminServiceExceptionException ( ""GetTextContent Error : "" , e ) ; } return content ; } " 503,"public StgNmbZusatz merge ( StgNmbZusatz detachedInstance ) { try { StgNmbZusatz result = ( StgNmbZusatz ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; log . debug ( ""merge successful"" ) ; return result ; } catch ( RuntimeException re ) { log . error ( ""merge failed"" , re ) ; throw re ; } } ","public StgNmbZusatz merge ( StgNmbZusatz detachedInstance ) { log . debug ( ""merging StgNmbZusatz instance"" ) ; try { StgNmbZusatz result = ( StgNmbZusatz ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; log . debug ( ""merge successful"" ) ; return result ; } catch ( RuntimeException re ) { log . error ( ""merge failed"" , re ) ; throw re ; } } " 504,"public StgNmbZusatz merge ( StgNmbZusatz detachedInstance ) { log . debug ( ""merging StgNmbZusatz instance"" ) ; try { StgNmbZusatz result = ( StgNmbZusatz ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; return result ; } catch ( RuntimeException re ) { log . error ( ""merge failed"" , re ) ; throw re ; } } ","public StgNmbZusatz merge ( StgNmbZusatz detachedInstance ) { log . debug ( ""merging StgNmbZusatz instance"" ) ; try { StgNmbZusatz result = ( StgNmbZusatz ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; log . debug ( ""merge successful"" ) ; return result ; } catch ( RuntimeException re ) { log . error ( ""merge failed"" , re ) ; throw re ; } } " 505,"public StgNmbZusatz merge ( StgNmbZusatz detachedInstance ) { log . debug ( ""merging StgNmbZusatz instance"" ) ; try { StgNmbZusatz result = ( StgNmbZusatz ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; log . debug ( ""merge successful"" ) ; return result ; } catch ( RuntimeException re ) { throw re ; } } ","public StgNmbZusatz merge ( StgNmbZusatz detachedInstance ) { log . debug ( ""merging StgNmbZusatz instance"" ) ; try { StgNmbZusatz result = ( StgNmbZusatz ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; log . debug ( ""merge successful"" ) ; return result ; } catch ( RuntimeException re ) { log . error ( ""merge failed"" , re ) ; throw re ; } } " 506,"private void createTemplateFromRootVolume ( final CreateTemplateFromVmRootVolumeMsg msg , final SyncTaskChain chain ) { boolean callNext = true ; try { refreshVO ( ) ; ErrorCode allowed = validateOperationByState ( msg , self . getState ( ) , SysErrors . OPERATION_ERROR ) ; if ( allowed != null ) { bus . replyErrorByMessageType ( msg , allowed ) ; return ; } final CreateTemplateFromVmRootVolumeReply reply = new CreateTemplateFromVmRootVolumeReply ( ) ; CreateTemplateFromVolumeOnPrimaryStorageMsg cmsg = new CreateTemplateFromVolumeOnPrimaryStorageMsg ( ) ; cmsg . setVolumeInventory ( msg . getRootVolumeInventory ( ) ) ; cmsg . setBackupStorageUuid ( msg . getBackupStorageUuid ( ) ) ; cmsg . setImageInventory ( msg . getImageInventory ( ) ) ; bus . makeTargetServiceIdByResourceUuid ( cmsg , PrimaryStorageConstant . SERVICE_ID , msg . getRootVolumeInventory ( ) . getPrimaryStorageUuid ( ) ) ; bus . send ( cmsg , new CloudBusCallBack ( chain ) { private void fail ( ErrorCode errorCode ) { reply . setError ( operr ( errorCode , ""failed to create template from root volume[uuid:%s] on primary storage[uuid:%s]"" , msg . getRootVolumeInventory ( ) . getUuid ( ) , msg . getRootVolumeInventory ( ) . getPrimaryStorageUuid ( ) ) ) ; bus . reply ( msg , reply ) ; } @ Override public void run ( MessageReply r ) { if ( ! r . isSuccess ( ) ) { fail ( r . getError ( ) ) ; } else { CreateTemplateFromVolumeOnPrimaryStorageReply creply = ( CreateTemplateFromVolumeOnPrimaryStorageReply ) r ; reply . setInstallPath ( creply . getTemplateBackupStorageInstallPath ( ) ) ; reply . setFormat ( creply . getFormat ( ) ) ; bus . reply ( msg , reply ) ; } chain . next ( ) ; } } ) ; callNext = false ; } finally { if ( callNext ) { chain . next ( ) ; } } } ","private void createTemplateFromRootVolume ( final CreateTemplateFromVmRootVolumeMsg msg , final SyncTaskChain chain ) { boolean callNext = true ; try { refreshVO ( ) ; ErrorCode allowed = validateOperationByState ( msg , self . getState ( ) , SysErrors . OPERATION_ERROR ) ; if ( allowed != null ) { bus . replyErrorByMessageType ( msg , allowed ) ; return ; } final CreateTemplateFromVmRootVolumeReply reply = new CreateTemplateFromVmRootVolumeReply ( ) ; CreateTemplateFromVolumeOnPrimaryStorageMsg cmsg = new CreateTemplateFromVolumeOnPrimaryStorageMsg ( ) ; cmsg . setVolumeInventory ( msg . getRootVolumeInventory ( ) ) ; cmsg . setBackupStorageUuid ( msg . getBackupStorageUuid ( ) ) ; cmsg . setImageInventory ( msg . getImageInventory ( ) ) ; bus . makeTargetServiceIdByResourceUuid ( cmsg , PrimaryStorageConstant . SERVICE_ID , msg . getRootVolumeInventory ( ) . getPrimaryStorageUuid ( ) ) ; bus . send ( cmsg , new CloudBusCallBack ( chain ) { private void fail ( ErrorCode errorCode ) { reply . setError ( operr ( errorCode , ""failed to create template from root volume[uuid:%s] on primary storage[uuid:%s]"" , msg . getRootVolumeInventory ( ) . getUuid ( ) , msg . getRootVolumeInventory ( ) . getPrimaryStorageUuid ( ) ) ) ; logger . warn ( reply . getError ( ) . getDetails ( ) ) ; bus . reply ( msg , reply ) ; } @ Override public void run ( MessageReply r ) { if ( ! r . isSuccess ( ) ) { fail ( r . getError ( ) ) ; } else { CreateTemplateFromVolumeOnPrimaryStorageReply creply = ( CreateTemplateFromVolumeOnPrimaryStorageReply ) r ; reply . setInstallPath ( creply . getTemplateBackupStorageInstallPath ( ) ) ; reply . setFormat ( creply . getFormat ( ) ) ; bus . reply ( msg , reply ) ; } chain . next ( ) ; } } ) ; callNext = false ; } finally { if ( callNext ) { chain . next ( ) ; } } } " 507,"protected void afterStart ( ClusterActionEvent event ) throws IOException { ClusterSpec clusterSpec = event . getClusterSpec ( ) ; Cluster cluster = event . getCluster ( ) ; Configuration config = getConfiguration ( clusterSpec , SOLR_DEFAULT_CONFIG ) ; int jettyPort = config . getInt ( SOLR_JETTY_PORT ) ; LOG . info ( ""Solr Hosts: {}"" , getHosts ( cluster . getInstancesMatching ( role ( SOLR_ROLE ) ) , jettyPort ) ) ; } ","protected void afterStart ( ClusterActionEvent event ) throws IOException { ClusterSpec clusterSpec = event . getClusterSpec ( ) ; Cluster cluster = event . getCluster ( ) ; Configuration config = getConfiguration ( clusterSpec , SOLR_DEFAULT_CONFIG ) ; int jettyPort = config . getInt ( SOLR_JETTY_PORT ) ; LOG . info ( ""Completed configuration of {}"" , clusterSpec . getClusterName ( ) ) ; LOG . info ( ""Solr Hosts: {}"" , getHosts ( cluster . getInstancesMatching ( role ( SOLR_ROLE ) ) , jettyPort ) ) ; } " 508,"protected void afterStart ( ClusterActionEvent event ) throws IOException { ClusterSpec clusterSpec = event . getClusterSpec ( ) ; Cluster cluster = event . getCluster ( ) ; Configuration config = getConfiguration ( clusterSpec , SOLR_DEFAULT_CONFIG ) ; int jettyPort = config . getInt ( SOLR_JETTY_PORT ) ; LOG . info ( ""Completed configuration of {}"" , clusterSpec . getClusterName ( ) ) ; } ","protected void afterStart ( ClusterActionEvent event ) throws IOException { ClusterSpec clusterSpec = event . getClusterSpec ( ) ; Cluster cluster = event . getCluster ( ) ; Configuration config = getConfiguration ( clusterSpec , SOLR_DEFAULT_CONFIG ) ; int jettyPort = config . getInt ( SOLR_JETTY_PORT ) ; LOG . info ( ""Completed configuration of {}"" , clusterSpec . getClusterName ( ) ) ; LOG . info ( ""Solr Hosts: {}"" , getHosts ( cluster . getInstancesMatching ( role ( SOLR_ROLE ) ) , jettyPort ) ) ; } " 509,"public final void searchUpdate ( ) { final UpdaterConfig config = new UpdaterConfig ( ) ; if ( ! config . enabled ) { return ; } final long currentTime = new Date ( ) . getTime ( ) ; if ( lastCheck + CHECK_DELAY > currentTime ) { return ; } lastCheck = currentTime ; Bukkit . getScheduler ( ) . runTaskAsynchronously ( BetonQuest . getInstance ( ) , ( ) -> { searchUpdateTask ( config ) ; if ( latest . getValue ( ) != null ) { if ( config . automatic ) { update ( Bukkit . getConsoleSender ( ) ) ; } } } ) ; } ","public final void searchUpdate ( ) { final UpdaterConfig config = new UpdaterConfig ( ) ; if ( ! config . enabled ) { return ; } final long currentTime = new Date ( ) . getTime ( ) ; if ( lastCheck + CHECK_DELAY > currentTime ) { return ; } lastCheck = currentTime ; Bukkit . getScheduler ( ) . runTaskAsynchronously ( BetonQuest . getInstance ( ) , ( ) -> { searchUpdateTask ( config ) ; if ( latest . getValue ( ) != null ) { LOG . info ( null , getUpdateNotification ( config ) ) ; if ( config . automatic ) { update ( Bukkit . getConsoleSender ( ) ) ; } } } ) ; } " 510,"@ Test public void logInfo_shouldLogInfo ( ) { verify ( mockLogger , times ( 1 ) ) . logIfEnabled ( LOGGER_NAME , INFO , null , MESSAGE ) ; } ","@ Test public void logInfo_shouldLogInfo ( ) { hazelcastLogger . info ( MESSAGE ) ; verify ( mockLogger , times ( 1 ) ) . logIfEnabled ( LOGGER_NAME , INFO , null , MESSAGE ) ; } " 511,"public boolean SaveVectorImageAsLocalFile ( JavaPairRDD < Integer , String > distributedImage , String outputPath , ImageType imageType ) throws Exception { JavaRDD < String > distributedVectorImageNoKey = distributedImage . map ( new Function < Tuple2 < Integer , String > , String > ( ) { @ Override public String call ( Tuple2 < Integer , String > vectorObject ) throws Exception { return vectorObject . _2 ( ) ; } } ) ; this . SaveVectorImageAsLocalFile ( distributedVectorImageNoKey . collect ( ) , outputPath , imageType ) ; logger . info ( ""[Sedona-Viz][SaveVectormageAsLocalFile][Stop]"" ) ; return true ; } ","public boolean SaveVectorImageAsLocalFile ( JavaPairRDD < Integer , String > distributedImage , String outputPath , ImageType imageType ) throws Exception { logger . info ( ""[Sedona-Viz][SaveVectormageAsLocalFile][Start]"" ) ; JavaRDD < String > distributedVectorImageNoKey = distributedImage . map ( new Function < Tuple2 < Integer , String > , String > ( ) { @ Override public String call ( Tuple2 < Integer , String > vectorObject ) throws Exception { return vectorObject . _2 ( ) ; } } ) ; this . SaveVectorImageAsLocalFile ( distributedVectorImageNoKey . collect ( ) , outputPath , imageType ) ; logger . info ( ""[Sedona-Viz][SaveVectormageAsLocalFile][Stop]"" ) ; return true ; } " 512,"public boolean SaveVectorImageAsLocalFile ( JavaPairRDD < Integer , String > distributedImage , String outputPath , ImageType imageType ) throws Exception { logger . info ( ""[Sedona-Viz][SaveVectormageAsLocalFile][Start]"" ) ; JavaRDD < String > distributedVectorImageNoKey = distributedImage . map ( new Function < Tuple2 < Integer , String > , String > ( ) { @ Override public String call ( Tuple2 < Integer , String > vectorObject ) throws Exception { return vectorObject . _2 ( ) ; } } ) ; this . SaveVectorImageAsLocalFile ( distributedVectorImageNoKey . collect ( ) , outputPath , imageType ) ; return true ; } ","public boolean SaveVectorImageAsLocalFile ( JavaPairRDD < Integer , String > distributedImage , String outputPath , ImageType imageType ) throws Exception { logger . info ( ""[Sedona-Viz][SaveVectormageAsLocalFile][Start]"" ) ; JavaRDD < String > distributedVectorImageNoKey = distributedImage . map ( new Function < Tuple2 < Integer , String > , String > ( ) { @ Override public String call ( Tuple2 < Integer , String > vectorObject ) throws Exception { return vectorObject . _2 ( ) ; } } ) ; this . SaveVectorImageAsLocalFile ( distributedVectorImageNoKey . collect ( ) , outputPath , imageType ) ; logger . info ( ""[Sedona-Viz][SaveVectormageAsLocalFile][Stop]"" ) ; return true ; } " 513,"protected void writeDigestFile ( TaskCache taskCache , String digest ) { Task task = taskCache . getTask ( ) ; Logger logger = task . getLogger ( ) ; File digestFile = new File ( taskCache . getCacheDir ( ) , DIGEST_FILE_NAME ) ; try { Files . write ( digestFile . toPath ( ) , digest . getBytes ( StandardCharsets . UTF_8 ) ) ; if ( logger . isInfoEnabled ( ) ) { } } catch ( IOException ioException ) { throw new GradleException ( ""Unable to write digest file"" , ioException ) ; } } ","protected void writeDigestFile ( TaskCache taskCache , String digest ) { Task task = taskCache . getTask ( ) ; Logger logger = task . getLogger ( ) ; File digestFile = new File ( taskCache . getCacheDir ( ) , DIGEST_FILE_NAME ) ; try { Files . write ( digestFile . toPath ( ) , digest . getBytes ( StandardCharsets . UTF_8 ) ) ; if ( logger . isInfoEnabled ( ) ) { logger . info ( ""Updated digest file to "" + digest ) ; } } catch ( IOException ioException ) { throw new GradleException ( ""Unable to write digest file"" , ioException ) ; } } " 514,"public void doWork ( ) throws IOException { mqConsumer . processMessage ( new RabbitMQConsumer . MessageListener ( ) { @ Override public boolean onMessage ( String message ) throws Exception { @ SuppressWarnings ( ""unchecked"" ) Map < String , Object > msgMap = ( HashMap < String , Object > ) ( new Gson ( ) ) . fromJson ( message , new TypeToken < HashMap < String , Object > > ( ) { } . getType ( ) ) ; boolean finished = ( Boolean ) msgMap . get ( Constants . FINISH_FIELD ) ; if ( finished ) { success = ( Boolean ) msgMap . get ( Constants . SUCCEED_FIELD ) ; if ( ! success ) { errorMessage = ( String ) msgMap . get ( Constants . ERROR_MSG_FIELD ) ; } } if ( ! success && messageHandler != null ) { double progress = ( Double ) msgMap . get ( Constants . PROGRESS_FIELD ) / 100 ; messageHandler . setProgress ( progress ) ; } if ( messageHandler != null ) { messageHandler . onMessage ( msgMap ) ; } return ! finished ; } } ) ; } ","public void doWork ( ) throws IOException { mqConsumer . processMessage ( new RabbitMQConsumer . MessageListener ( ) { @ Override public boolean onMessage ( String message ) throws Exception { logger . info ( ""processing message: "" + message ) ; @ SuppressWarnings ( ""unchecked"" ) Map < String , Object > msgMap = ( HashMap < String , Object > ) ( new Gson ( ) ) . fromJson ( message , new TypeToken < HashMap < String , Object > > ( ) { } . getType ( ) ) ; boolean finished = ( Boolean ) msgMap . get ( Constants . FINISH_FIELD ) ; if ( finished ) { success = ( Boolean ) msgMap . get ( Constants . SUCCEED_FIELD ) ; if ( ! success ) { errorMessage = ( String ) msgMap . get ( Constants . ERROR_MSG_FIELD ) ; } } if ( ! success && messageHandler != null ) { double progress = ( Double ) msgMap . get ( Constants . PROGRESS_FIELD ) / 100 ; messageHandler . setProgress ( progress ) ; } if ( messageHandler != null ) { messageHandler . onMessage ( msgMap ) ; } return ! finished ; } } ) ; } " 515,"@ Test public void testNullFactory ( ) throws Exception { factory = null ; startGrids ( ) ; for ( final Integer key : keys ( ) ) { eternal ( key ) ; } } ","@ Test public void testNullFactory ( ) throws Exception { factory = null ; startGrids ( ) ; for ( final Integer key : keys ( ) ) { log . info ( ""Test eternalPolicy, key: "" + key ) ; eternal ( key ) ; } } " 516,"@ RuleAction ( label = ""@text/sendMessageToDeviceActionLabel"" , description = ""@text/sendMessageToDeviceActionDescription"" ) public @ ActionOutput ( name = ""sent"" , label = ""@text/sendMessageActionOutputLabel"" , description = ""@text/sendMessageActionOutputDescription"" , type = ""java.lang.Boolean"" ) Boolean sendMessageToDevice ( @ ActionInput ( name = ""device"" , label = ""@text/sendMessageActionInputDeviceLabel"" , description = ""@text/sendMessageActionInputDeviceDescription"" , type = ""java.lang.String"" , required = true ) String device , @ ActionInput ( name = ""message"" , label = ""@text/sendMessageActionInputMessageLabel"" , description = ""@text/sendMessageActionInputMessageDescription"" , type = ""java.lang.String"" , required = true ) String message , @ ActionInput ( name = ""title"" , label = ""@text/sendMessageActionInputTitleLabel"" , description = ""@text/sendMessageActionInputTitleDescription"" , type = ""java.lang.String"" , defaultValue = DEFAULT_TITLE ) @ Nullable String title ) { if ( device == null ) { throw new IllegalArgumentException ( ""Skip sending message as 'device' is null."" ) ; } return send ( getDefaultPushoverMessageBuilder ( message ) . withDevice ( device ) , title ) ; } ","@ RuleAction ( label = ""@text/sendMessageToDeviceActionLabel"" , description = ""@text/sendMessageToDeviceActionDescription"" ) public @ ActionOutput ( name = ""sent"" , label = ""@text/sendMessageActionOutputLabel"" , description = ""@text/sendMessageActionOutputDescription"" , type = ""java.lang.Boolean"" ) Boolean sendMessageToDevice ( @ ActionInput ( name = ""device"" , label = ""@text/sendMessageActionInputDeviceLabel"" , description = ""@text/sendMessageActionInputDeviceDescription"" , type = ""java.lang.String"" , required = true ) String device , @ ActionInput ( name = ""message"" , label = ""@text/sendMessageActionInputMessageLabel"" , description = ""@text/sendMessageActionInputMessageDescription"" , type = ""java.lang.String"" , required = true ) String message , @ ActionInput ( name = ""title"" , label = ""@text/sendMessageActionInputTitleLabel"" , description = ""@text/sendMessageActionInputTitleDescription"" , type = ""java.lang.String"" , defaultValue = DEFAULT_TITLE ) @ Nullable String title ) { logger . trace ( ""ThingAction 'sendMessageToDevice' called with value(s): device='{}', message='{}', title='{}'"" , device , message , title ) ; if ( device == null ) { throw new IllegalArgumentException ( ""Skip sending message as 'device' is null."" ) ; } return send ( getDefaultPushoverMessageBuilder ( message ) . withDevice ( device ) , title ) ; } " 517,"public PatchStatus applyPatch ( TypeDefPatch patch ) throws AtlasBaseException { String typeName = patch . getTypeName ( ) ; AtlasBaseTypeDef typeDef = typeRegistry . getTypeDefByName ( typeName ) ; PatchStatus ret ; if ( typeDef == null ) { throw new AtlasBaseException ( AtlasErrorCode . PATCH_FOR_UNKNOWN_TYPE , patch . getAction ( ) , typeName ) ; } if ( isPatchApplicable ( patch , typeDef ) ) { if ( typeDef . getClass ( ) . equals ( AtlasEntityDef . class ) ) { AtlasEntityDef updatedDef = new AtlasEntityDef ( ( AtlasEntityDef ) typeDef ) ; addOrUpdateAttributes ( updatedDef , patch . getAttributeDefs ( ) ) ; updatedDef . setTypeVersion ( patch . getUpdateToVersion ( ) ) ; typeDefStore . updateEntityDefByName ( typeName , updatedDef ) ; ret = APPLIED ; } else if ( typeDef . getClass ( ) . equals ( AtlasClassificationDef . class ) ) { AtlasClassificationDef updatedDef = new AtlasClassificationDef ( ( AtlasClassificationDef ) typeDef ) ; addOrUpdateAttributes ( updatedDef , patch . getAttributeDefs ( ) ) ; updatedDef . setTypeVersion ( patch . getUpdateToVersion ( ) ) ; typeDefStore . updateClassificationDefByName ( typeName , updatedDef ) ; ret = APPLIED ; } else if ( typeDef . getClass ( ) . equals ( AtlasStructDef . class ) ) { AtlasStructDef updatedDef = new AtlasStructDef ( ( AtlasStructDef ) typeDef ) ; addOrUpdateAttributes ( updatedDef , patch . getAttributeDefs ( ) ) ; updatedDef . setTypeVersion ( patch . getUpdateToVersion ( ) ) ; typeDefStore . updateStructDefByName ( typeName , updatedDef ) ; ret = APPLIED ; } else { throw new AtlasBaseException ( AtlasErrorCode . PATCH_NOT_APPLICABLE_FOR_TYPE , patch . getAction ( ) , typeDef . getClass ( ) . getSimpleName ( ) ) ; } } else { ret = SKIPPED ; } return ret ; } ","public PatchStatus applyPatch ( TypeDefPatch patch ) throws AtlasBaseException { String typeName = patch . getTypeName ( ) ; AtlasBaseTypeDef typeDef = typeRegistry . getTypeDefByName ( typeName ) ; PatchStatus ret ; if ( typeDef == null ) { throw new AtlasBaseException ( AtlasErrorCode . PATCH_FOR_UNKNOWN_TYPE , patch . getAction ( ) , typeName ) ; } if ( isPatchApplicable ( patch , typeDef ) ) { if ( typeDef . getClass ( ) . equals ( AtlasEntityDef . class ) ) { AtlasEntityDef updatedDef = new AtlasEntityDef ( ( AtlasEntityDef ) typeDef ) ; addOrUpdateAttributes ( updatedDef , patch . getAttributeDefs ( ) ) ; updatedDef . setTypeVersion ( patch . getUpdateToVersion ( ) ) ; typeDefStore . updateEntityDefByName ( typeName , updatedDef ) ; ret = APPLIED ; } else if ( typeDef . getClass ( ) . equals ( AtlasClassificationDef . class ) ) { AtlasClassificationDef updatedDef = new AtlasClassificationDef ( ( AtlasClassificationDef ) typeDef ) ; addOrUpdateAttributes ( updatedDef , patch . getAttributeDefs ( ) ) ; updatedDef . setTypeVersion ( patch . getUpdateToVersion ( ) ) ; typeDefStore . updateClassificationDefByName ( typeName , updatedDef ) ; ret = APPLIED ; } else if ( typeDef . getClass ( ) . equals ( AtlasStructDef . class ) ) { AtlasStructDef updatedDef = new AtlasStructDef ( ( AtlasStructDef ) typeDef ) ; addOrUpdateAttributes ( updatedDef , patch . getAttributeDefs ( ) ) ; updatedDef . setTypeVersion ( patch . getUpdateToVersion ( ) ) ; typeDefStore . updateStructDefByName ( typeName , updatedDef ) ; ret = APPLIED ; } else { throw new AtlasBaseException ( AtlasErrorCode . PATCH_NOT_APPLICABLE_FOR_TYPE , patch . getAction ( ) , typeDef . getClass ( ) . getSimpleName ( ) ) ; } } else { LOG . info ( ""patch skipped: typeName={}; applyToVersion={}; updateToVersion={}"" , patch . getTypeName ( ) , patch . getApplyToVersion ( ) , patch . getUpdateToVersion ( ) ) ; ret = SKIPPED ; } return ret ; } " 518,"@ Test public void testContainerSpecSerialization ( ) { final ContainerSpec spec = new ContainerSpec ( ) ; spec . setId ( ""id"" ) ; spec . setContainerName ( ""name"" ) ; spec . setStatus ( KieContainerStatus . STARTED ) ; spec . setReleasedId ( new ReleaseId ( ""groupId"" , ""artifactId"" , ""1.0"" ) ) ; final ProcessConfig processConfig = new ProcessConfig ( ""runtimeStrategy"" , ""kBase"" , ""kSession"" , ""mergeMode"" ) ; spec . addConfig ( Capability . PROCESS , processConfig ) ; final RuleConfig ruleConfig = new RuleConfig ( 1L , KieScannerStatus . SCANNING ) ; spec . addConfig ( Capability . RULE , ruleConfig ) ; final String specContent = WebSocketUtils . marshal ( spec ) ; final ContainerSpec specResult = WebSocketUtils . unmarshal ( specContent , ContainerSpec . class ) ; assertNotNull ( specResult ) ; assertEquals ( spec , specResult ) ; assertEquals ( spec . getId ( ) , specResult . getId ( ) ) ; assertEquals ( spec . getStatus ( ) , specResult . getStatus ( ) ) ; assertEquals ( spec . getContainerName ( ) , specResult . getContainerName ( ) ) ; assertEquals ( spec . getReleasedId ( ) , specResult . getReleasedId ( ) ) ; assertNotNull ( specResult . getConfigs ( ) ) ; assertEquals ( spec . getConfigs ( ) . size ( ) , specResult . getConfigs ( ) . size ( ) ) ; final ContainerConfig processConfigResult = specResult . getConfigs ( ) . get ( Capability . PROCESS ) ; assertNotNull ( processConfigResult ) ; assertTrue ( processConfigResult instanceof ProcessConfig ) ; assertEquals ( processConfig , processConfigResult ) ; final ContainerConfig ruleConfigResult = specResult . getConfigs ( ) . get ( Capability . RULE ) ; assertNotNull ( ruleConfigResult ) ; assertTrue ( ruleConfigResult instanceof RuleConfig ) ; assertEquals ( ruleConfig , ruleConfigResult ) ; } ","@ Test public void testContainerSpecSerialization ( ) { final ContainerSpec spec = new ContainerSpec ( ) ; spec . setId ( ""id"" ) ; spec . setContainerName ( ""name"" ) ; spec . setStatus ( KieContainerStatus . STARTED ) ; spec . setReleasedId ( new ReleaseId ( ""groupId"" , ""artifactId"" , ""1.0"" ) ) ; final ProcessConfig processConfig = new ProcessConfig ( ""runtimeStrategy"" , ""kBase"" , ""kSession"" , ""mergeMode"" ) ; spec . addConfig ( Capability . PROCESS , processConfig ) ; final RuleConfig ruleConfig = new RuleConfig ( 1L , KieScannerStatus . SCANNING ) ; spec . addConfig ( Capability . RULE , ruleConfig ) ; final String specContent = WebSocketUtils . marshal ( spec ) ; LOGGER . info ( ""JSON content\n{}"" , specContent ) ; final ContainerSpec specResult = WebSocketUtils . unmarshal ( specContent , ContainerSpec . class ) ; assertNotNull ( specResult ) ; assertEquals ( spec , specResult ) ; assertEquals ( spec . getId ( ) , specResult . getId ( ) ) ; assertEquals ( spec . getStatus ( ) , specResult . getStatus ( ) ) ; assertEquals ( spec . getContainerName ( ) , specResult . getContainerName ( ) ) ; assertEquals ( spec . getReleasedId ( ) , specResult . getReleasedId ( ) ) ; assertNotNull ( specResult . getConfigs ( ) ) ; assertEquals ( spec . getConfigs ( ) . size ( ) , specResult . getConfigs ( ) . size ( ) ) ; final ContainerConfig processConfigResult = specResult . getConfigs ( ) . get ( Capability . PROCESS ) ; assertNotNull ( processConfigResult ) ; assertTrue ( processConfigResult instanceof ProcessConfig ) ; assertEquals ( processConfig , processConfigResult ) ; final ContainerConfig ruleConfigResult = specResult . getConfigs ( ) . get ( Capability . RULE ) ; assertNotNull ( ruleConfigResult ) ; assertTrue ( ruleConfigResult instanceof RuleConfig ) ; assertEquals ( ruleConfig , ruleConfigResult ) ; } " 519,"public void persist ( StgSysExportItv transientInstance ) { try { sessionFactory . getCurrentSession ( ) . persist ( transientInstance ) ; log . debug ( ""persist successful"" ) ; } catch ( RuntimeException re ) { log . error ( ""persist failed"" , re ) ; throw re ; } } ","public void persist ( StgSysExportItv transientInstance ) { log . debug ( ""persisting StgSysExportItv instance"" ) ; try { sessionFactory . getCurrentSession ( ) . persist ( transientInstance ) ; log . debug ( ""persist successful"" ) ; } catch ( RuntimeException re ) { log . error ( ""persist failed"" , re ) ; throw re ; } } " 520,"public void persist ( StgSysExportItv transientInstance ) { log . debug ( ""persisting StgSysExportItv instance"" ) ; try { sessionFactory . getCurrentSession ( ) . persist ( transientInstance ) ; } catch ( RuntimeException re ) { log . error ( ""persist failed"" , re ) ; throw re ; } } ","public void persist ( StgSysExportItv transientInstance ) { log . debug ( ""persisting StgSysExportItv instance"" ) ; try { sessionFactory . getCurrentSession ( ) . persist ( transientInstance ) ; log . debug ( ""persist successful"" ) ; } catch ( RuntimeException re ) { log . error ( ""persist failed"" , re ) ; throw re ; } } " 521,"public void persist ( StgSysExportItv transientInstance ) { log . debug ( ""persisting StgSysExportItv instance"" ) ; try { sessionFactory . getCurrentSession ( ) . persist ( transientInstance ) ; log . debug ( ""persist successful"" ) ; } catch ( RuntimeException re ) { throw re ; } } ","public void persist ( StgSysExportItv transientInstance ) { log . debug ( ""persisting StgSysExportItv instance"" ) ; try { sessionFactory . getCurrentSession ( ) . persist ( transientInstance ) ; log . debug ( ""persist successful"" ) ; } catch ( RuntimeException re ) { log . error ( ""persist failed"" , re ) ; throw re ; } } " 522,"private static Date parseDate ( String dateString ) { if ( dateString != null ) { try { Instant instant = parseInstant ( dateString ) ; return Date . from ( instant ) ; } catch ( DateTimeParseException e ) { } } return null ; } ","private static Date parseDate ( String dateString ) { if ( dateString != null ) { try { Instant instant = parseInstant ( dateString ) ; return Date . from ( instant ) ; } catch ( DateTimeParseException e ) { LOGGER . warn ( MessageFormat . format ( ""Could not parse date string: \""{0}\"""" , dateString ) , e ) ; } } return null ; } " 523,"public FileTransformStats generateDomain ( DatasourceDTO datasourceDto ) throws Exception { checkPermissions ( ) ; synchronized ( lock ) { ModelInfo modelInfo = datasourceDto . getCsvModelInfo ( ) ; IPentahoSession pentahoSession = null ; try { pentahoSession = PentahoSessionHolder . getSession ( ) ; KettleSystemListener . environmentInit ( pentahoSession ) ; String statsKey = FileTransformStats . class . getSimpleName ( ) + ""_"" + modelInfo . getFileInfo ( ) . getTmpFilename ( ) ; FileTransformStats stats = new FileTransformStats ( ) ; pentahoSession . setAttribute ( statsKey , stats ) ; CsvTransformGenerator csvTransformGenerator = new CsvTransformGenerator ( modelInfo , AgileHelper . getDatabaseMeta ( ) ) ; csvTransformGenerator . setTransformStats ( stats ) ; try { csvTransformGenerator . dropTable ( modelInfo . getStageTableName ( ) ) ; } catch ( CsvTransformGeneratorException e ) { } csvTransformGenerator . createOrModifyTable ( pentahoSession ) ; csvTransformGenerator . loadTable ( false , pentahoSession , true ) ; ArrayList < String > combinedErrors = new ArrayList < String > ( modelInfo . getCsvInputErrors ( ) ) ; combinedErrors . addAll ( modelInfo . getTableOutputErrors ( ) ) ; if ( stats . getErrors ( ) != null && stats . getErrors ( ) . size ( ) > 0 ) { stats . getErrors ( ) . addAll ( combinedErrors ) ; } else { stats . setErrors ( combinedErrors ) ; } while ( ! stats . isRowsFinished ( ) ) { Thread . sleep ( 200 ) ; } modelerWorkspace . setDomain ( modelerService . generateCSVDomain ( modelInfo ) ) ; modelerWorkspace . getWorkspaceHelper ( ) . autoModelFlat ( modelerWorkspace ) ; modelerWorkspace . getWorkspaceHelper ( ) . autoModelRelationalFlat ( modelerWorkspace ) ; modelerWorkspace . setModelName ( modelInfo . getDatasourceName ( ) ) ; modelerWorkspace . getWorkspaceHelper ( ) . populateDomain ( modelerWorkspace ) ; Domain workspaceDomain = modelerWorkspace . getDomain ( ) ; XStream xstream = new XStream ( ) ; String serializedDto = xstream . toXML ( datasourceDto ) ; workspaceDomain . getLogicalModels ( ) . get ( 0 ) . setProperty ( ""datasourceModel"" , serializedDto ) ; workspaceDomain . getLogicalModels ( ) . get ( 0 ) . setProperty ( ""DatasourceType"" , ""CSV"" ) ; prepareForSerialization ( workspaceDomain ) ; modelerService . serializeModels ( workspaceDomain , modelerWorkspace . getModelName ( ) ) ; stats . setDomain ( modelerWorkspace . getDomain ( ) ) ; return stats ; } catch ( Exception e ) { logger . error ( e . getMessage ( ) ) ; throw e ; } finally { if ( pentahoSession != null ) { pentahoSession . destroy ( ) ; } } } } ","public FileTransformStats generateDomain ( DatasourceDTO datasourceDto ) throws Exception { checkPermissions ( ) ; synchronized ( lock ) { ModelInfo modelInfo = datasourceDto . getCsvModelInfo ( ) ; IPentahoSession pentahoSession = null ; try { pentahoSession = PentahoSessionHolder . getSession ( ) ; KettleSystemListener . environmentInit ( pentahoSession ) ; String statsKey = FileTransformStats . class . getSimpleName ( ) + ""_"" + modelInfo . getFileInfo ( ) . getTmpFilename ( ) ; FileTransformStats stats = new FileTransformStats ( ) ; pentahoSession . setAttribute ( statsKey , stats ) ; CsvTransformGenerator csvTransformGenerator = new CsvTransformGenerator ( modelInfo , AgileHelper . getDatabaseMeta ( ) ) ; csvTransformGenerator . setTransformStats ( stats ) ; try { csvTransformGenerator . dropTable ( modelInfo . getStageTableName ( ) ) ; } catch ( CsvTransformGeneratorException e ) { logger . info ( ""Could not drop table before staging"" ) ; } csvTransformGenerator . createOrModifyTable ( pentahoSession ) ; csvTransformGenerator . loadTable ( false , pentahoSession , true ) ; ArrayList < String > combinedErrors = new ArrayList < String > ( modelInfo . getCsvInputErrors ( ) ) ; combinedErrors . addAll ( modelInfo . getTableOutputErrors ( ) ) ; if ( stats . getErrors ( ) != null && stats . getErrors ( ) . size ( ) > 0 ) { stats . getErrors ( ) . addAll ( combinedErrors ) ; } else { stats . setErrors ( combinedErrors ) ; } while ( ! stats . isRowsFinished ( ) ) { Thread . sleep ( 200 ) ; } modelerWorkspace . setDomain ( modelerService . generateCSVDomain ( modelInfo ) ) ; modelerWorkspace . getWorkspaceHelper ( ) . autoModelFlat ( modelerWorkspace ) ; modelerWorkspace . getWorkspaceHelper ( ) . autoModelRelationalFlat ( modelerWorkspace ) ; modelerWorkspace . setModelName ( modelInfo . getDatasourceName ( ) ) ; modelerWorkspace . getWorkspaceHelper ( ) . populateDomain ( modelerWorkspace ) ; Domain workspaceDomain = modelerWorkspace . getDomain ( ) ; XStream xstream = new XStream ( ) ; String serializedDto = xstream . toXML ( datasourceDto ) ; workspaceDomain . getLogicalModels ( ) . get ( 0 ) . setProperty ( ""datasourceModel"" , serializedDto ) ; workspaceDomain . getLogicalModels ( ) . get ( 0 ) . setProperty ( ""DatasourceType"" , ""CSV"" ) ; prepareForSerialization ( workspaceDomain ) ; modelerService . serializeModels ( workspaceDomain , modelerWorkspace . getModelName ( ) ) ; stats . setDomain ( modelerWorkspace . getDomain ( ) ) ; return stats ; } catch ( Exception e ) { logger . error ( e . getMessage ( ) ) ; throw e ; } finally { if ( pentahoSession != null ) { pentahoSession . destroy ( ) ; } } } } " 524,"public FileTransformStats generateDomain ( DatasourceDTO datasourceDto ) throws Exception { checkPermissions ( ) ; synchronized ( lock ) { ModelInfo modelInfo = datasourceDto . getCsvModelInfo ( ) ; IPentahoSession pentahoSession = null ; try { pentahoSession = PentahoSessionHolder . getSession ( ) ; KettleSystemListener . environmentInit ( pentahoSession ) ; String statsKey = FileTransformStats . class . getSimpleName ( ) + ""_"" + modelInfo . getFileInfo ( ) . getTmpFilename ( ) ; FileTransformStats stats = new FileTransformStats ( ) ; pentahoSession . setAttribute ( statsKey , stats ) ; CsvTransformGenerator csvTransformGenerator = new CsvTransformGenerator ( modelInfo , AgileHelper . getDatabaseMeta ( ) ) ; csvTransformGenerator . setTransformStats ( stats ) ; try { csvTransformGenerator . dropTable ( modelInfo . getStageTableName ( ) ) ; } catch ( CsvTransformGeneratorException e ) { logger . info ( ""Could not drop table before staging"" ) ; } csvTransformGenerator . createOrModifyTable ( pentahoSession ) ; csvTransformGenerator . loadTable ( false , pentahoSession , true ) ; ArrayList < String > combinedErrors = new ArrayList < String > ( modelInfo . getCsvInputErrors ( ) ) ; combinedErrors . addAll ( modelInfo . getTableOutputErrors ( ) ) ; if ( stats . getErrors ( ) != null && stats . getErrors ( ) . size ( ) > 0 ) { stats . getErrors ( ) . addAll ( combinedErrors ) ; } else { stats . setErrors ( combinedErrors ) ; } while ( ! stats . isRowsFinished ( ) ) { Thread . sleep ( 200 ) ; } modelerWorkspace . setDomain ( modelerService . generateCSVDomain ( modelInfo ) ) ; modelerWorkspace . getWorkspaceHelper ( ) . autoModelFlat ( modelerWorkspace ) ; modelerWorkspace . getWorkspaceHelper ( ) . autoModelRelationalFlat ( modelerWorkspace ) ; modelerWorkspace . setModelName ( modelInfo . getDatasourceName ( ) ) ; modelerWorkspace . getWorkspaceHelper ( ) . populateDomain ( modelerWorkspace ) ; Domain workspaceDomain = modelerWorkspace . getDomain ( ) ; XStream xstream = new XStream ( ) ; String serializedDto = xstream . toXML ( datasourceDto ) ; workspaceDomain . getLogicalModels ( ) . get ( 0 ) . setProperty ( ""datasourceModel"" , serializedDto ) ; workspaceDomain . getLogicalModels ( ) . get ( 0 ) . setProperty ( ""DatasourceType"" , ""CSV"" ) ; prepareForSerialization ( workspaceDomain ) ; modelerService . serializeModels ( workspaceDomain , modelerWorkspace . getModelName ( ) ) ; stats . setDomain ( modelerWorkspace . getDomain ( ) ) ; return stats ; } catch ( Exception e ) { throw e ; } finally { if ( pentahoSession != null ) { pentahoSession . destroy ( ) ; } } } } ","public FileTransformStats generateDomain ( DatasourceDTO datasourceDto ) throws Exception { checkPermissions ( ) ; synchronized ( lock ) { ModelInfo modelInfo = datasourceDto . getCsvModelInfo ( ) ; IPentahoSession pentahoSession = null ; try { pentahoSession = PentahoSessionHolder . getSession ( ) ; KettleSystemListener . environmentInit ( pentahoSession ) ; String statsKey = FileTransformStats . class . getSimpleName ( ) + ""_"" + modelInfo . getFileInfo ( ) . getTmpFilename ( ) ; FileTransformStats stats = new FileTransformStats ( ) ; pentahoSession . setAttribute ( statsKey , stats ) ; CsvTransformGenerator csvTransformGenerator = new CsvTransformGenerator ( modelInfo , AgileHelper . getDatabaseMeta ( ) ) ; csvTransformGenerator . setTransformStats ( stats ) ; try { csvTransformGenerator . dropTable ( modelInfo . getStageTableName ( ) ) ; } catch ( CsvTransformGeneratorException e ) { logger . info ( ""Could not drop table before staging"" ) ; } csvTransformGenerator . createOrModifyTable ( pentahoSession ) ; csvTransformGenerator . loadTable ( false , pentahoSession , true ) ; ArrayList < String > combinedErrors = new ArrayList < String > ( modelInfo . getCsvInputErrors ( ) ) ; combinedErrors . addAll ( modelInfo . getTableOutputErrors ( ) ) ; if ( stats . getErrors ( ) != null && stats . getErrors ( ) . size ( ) > 0 ) { stats . getErrors ( ) . addAll ( combinedErrors ) ; } else { stats . setErrors ( combinedErrors ) ; } while ( ! stats . isRowsFinished ( ) ) { Thread . sleep ( 200 ) ; } modelerWorkspace . setDomain ( modelerService . generateCSVDomain ( modelInfo ) ) ; modelerWorkspace . getWorkspaceHelper ( ) . autoModelFlat ( modelerWorkspace ) ; modelerWorkspace . getWorkspaceHelper ( ) . autoModelRelationalFlat ( modelerWorkspace ) ; modelerWorkspace . setModelName ( modelInfo . getDatasourceName ( ) ) ; modelerWorkspace . getWorkspaceHelper ( ) . populateDomain ( modelerWorkspace ) ; Domain workspaceDomain = modelerWorkspace . getDomain ( ) ; XStream xstream = new XStream ( ) ; String serializedDto = xstream . toXML ( datasourceDto ) ; workspaceDomain . getLogicalModels ( ) . get ( 0 ) . setProperty ( ""datasourceModel"" , serializedDto ) ; workspaceDomain . getLogicalModels ( ) . get ( 0 ) . setProperty ( ""DatasourceType"" , ""CSV"" ) ; prepareForSerialization ( workspaceDomain ) ; modelerService . serializeModels ( workspaceDomain , modelerWorkspace . getModelName ( ) ) ; stats . setDomain ( modelerWorkspace . getDomain ( ) ) ; return stats ; } catch ( Exception e ) { logger . error ( e . getMessage ( ) ) ; throw e ; } finally { if ( pentahoSession != null ) { pentahoSession . destroy ( ) ; } } } } " 525,"public Void call ( ) throws Exception { Thread . currentThread ( ) . setName ( ""restart-thread"" ) ; U . sleep ( random ( 5000 , 10_000 ) ) ; stopGrid ( GRIDS_COUNT ) ; IgniteEx ig0 = grid ( 0 ) ; ig0 . cluster ( ) . setBaselineTopology ( baselineNodes ( ig0 . cluster ( ) . forServers ( ) . nodes ( ) ) ) ; while ( ! stop . get ( ) ) { CyclicBarrier barrier = cmp . get ( ) ; if ( barrier != null ) { log . info ( ""Wait data check."" ) ; barrier . await ( 60_000 , TimeUnit . MILLISECONDS ) ; log . info ( ""Finished wait data check."" ) ; } } return null ; } ","public Void call ( ) throws Exception { Thread . currentThread ( ) . setName ( ""restart-thread"" ) ; U . sleep ( random ( 5000 , 10_000 ) ) ; log . info ( ""Stopping node "" + GRIDS_COUNT ) ; stopGrid ( GRIDS_COUNT ) ; IgniteEx ig0 = grid ( 0 ) ; ig0 . cluster ( ) . setBaselineTopology ( baselineNodes ( ig0 . cluster ( ) . forServers ( ) . nodes ( ) ) ) ; while ( ! stop . get ( ) ) { CyclicBarrier barrier = cmp . get ( ) ; if ( barrier != null ) { log . info ( ""Wait data check."" ) ; barrier . await ( 60_000 , TimeUnit . MILLISECONDS ) ; log . info ( ""Finished wait data check."" ) ; } } return null ; } " 526,"public Void call ( ) throws Exception { Thread . currentThread ( ) . setName ( ""restart-thread"" ) ; U . sleep ( random ( 5000 , 10_000 ) ) ; log . info ( ""Stopping node "" + GRIDS_COUNT ) ; stopGrid ( GRIDS_COUNT ) ; IgniteEx ig0 = grid ( 0 ) ; ig0 . cluster ( ) . setBaselineTopology ( baselineNodes ( ig0 . cluster ( ) . forServers ( ) . nodes ( ) ) ) ; while ( ! stop . get ( ) ) { CyclicBarrier barrier = cmp . get ( ) ; if ( barrier != null ) { barrier . await ( 60_000 , TimeUnit . MILLISECONDS ) ; log . info ( ""Finished wait data check."" ) ; } } return null ; } ","public Void call ( ) throws Exception { Thread . currentThread ( ) . setName ( ""restart-thread"" ) ; U . sleep ( random ( 5000 , 10_000 ) ) ; log . info ( ""Stopping node "" + GRIDS_COUNT ) ; stopGrid ( GRIDS_COUNT ) ; IgniteEx ig0 = grid ( 0 ) ; ig0 . cluster ( ) . setBaselineTopology ( baselineNodes ( ig0 . cluster ( ) . forServers ( ) . nodes ( ) ) ) ; while ( ! stop . get ( ) ) { CyclicBarrier barrier = cmp . get ( ) ; if ( barrier != null ) { log . info ( ""Wait data check."" ) ; barrier . await ( 60_000 , TimeUnit . MILLISECONDS ) ; log . info ( ""Finished wait data check."" ) ; } } return null ; } " 527,"public Void call ( ) throws Exception { Thread . currentThread ( ) . setName ( ""restart-thread"" ) ; U . sleep ( random ( 5000 , 10_000 ) ) ; log . info ( ""Stopping node "" + GRIDS_COUNT ) ; stopGrid ( GRIDS_COUNT ) ; IgniteEx ig0 = grid ( 0 ) ; ig0 . cluster ( ) . setBaselineTopology ( baselineNodes ( ig0 . cluster ( ) . forServers ( ) . nodes ( ) ) ) ; while ( ! stop . get ( ) ) { CyclicBarrier barrier = cmp . get ( ) ; if ( barrier != null ) { log . info ( ""Wait data check."" ) ; barrier . await ( 60_000 , TimeUnit . MILLISECONDS ) ; } } return null ; } ","public Void call ( ) throws Exception { Thread . currentThread ( ) . setName ( ""restart-thread"" ) ; U . sleep ( random ( 5000 , 10_000 ) ) ; log . info ( ""Stopping node "" + GRIDS_COUNT ) ; stopGrid ( GRIDS_COUNT ) ; IgniteEx ig0 = grid ( 0 ) ; ig0 . cluster ( ) . setBaselineTopology ( baselineNodes ( ig0 . cluster ( ) . forServers ( ) . nodes ( ) ) ) ; while ( ! stop . get ( ) ) { CyclicBarrier barrier = cmp . get ( ) ; if ( barrier != null ) { log . info ( ""Wait data check."" ) ; barrier . await ( 60_000 , TimeUnit . MILLISECONDS ) ; log . info ( ""Finished wait data check."" ) ; } } return null ; } " 528,"public void receivedValue ( Destination type , String dataId , Object object , List < DataRequest > achievedRequests ) { if ( type == Transfer . Destination . OBJECT ) { this . dataManager . storeValue ( dataId , object ) ; } else { String nameId = ( new File ( dataId ) ) . getName ( ) ; WORKER_LOGGER . info ( ""Received data "" + nameId + "" with path "" + dataId ) ; this . dataManager . storeFile ( nameId , dataId ) ; } for ( DataRequest dr : achievedRequests ) { WorkerDataRequest wdr = ( WorkerDataRequest ) dr ; wdr . getListener ( ) . fetchedValue ( dataId ) ; if ( NIOTracer . extraeEnabled ( ) ) { NIOTracer . emitDataTransferEvent ( NIOTracer . TRANSFER_END ) ; } if ( WORKER_LOGGER_DEBUG ) { WORKER_LOGGER . debug ( ""Pending parameters: "" + ( ( MultiOperationFetchListener ) wdr . getListener ( ) ) . getMissingOperations ( ) ) ; } } } ","public void receivedValue ( Destination type , String dataId , Object object , List < DataRequest > achievedRequests ) { if ( type == Transfer . Destination . OBJECT ) { WORKER_LOGGER . info ( ""Received data "" + dataId + "" with associated object "" + object ) ; this . dataManager . storeValue ( dataId , object ) ; } else { String nameId = ( new File ( dataId ) ) . getName ( ) ; WORKER_LOGGER . info ( ""Received data "" + nameId + "" with path "" + dataId ) ; this . dataManager . storeFile ( nameId , dataId ) ; } for ( DataRequest dr : achievedRequests ) { WorkerDataRequest wdr = ( WorkerDataRequest ) dr ; wdr . getListener ( ) . fetchedValue ( dataId ) ; if ( NIOTracer . extraeEnabled ( ) ) { NIOTracer . emitDataTransferEvent ( NIOTracer . TRANSFER_END ) ; } if ( WORKER_LOGGER_DEBUG ) { WORKER_LOGGER . debug ( ""Pending parameters: "" + ( ( MultiOperationFetchListener ) wdr . getListener ( ) ) . getMissingOperations ( ) ) ; } } } " 529,"public void receivedValue ( Destination type , String dataId , Object object , List < DataRequest > achievedRequests ) { if ( type == Transfer . Destination . OBJECT ) { WORKER_LOGGER . info ( ""Received data "" + dataId + "" with associated object "" + object ) ; this . dataManager . storeValue ( dataId , object ) ; } else { String nameId = ( new File ( dataId ) ) . getName ( ) ; this . dataManager . storeFile ( nameId , dataId ) ; } for ( DataRequest dr : achievedRequests ) { WorkerDataRequest wdr = ( WorkerDataRequest ) dr ; wdr . getListener ( ) . fetchedValue ( dataId ) ; if ( NIOTracer . extraeEnabled ( ) ) { NIOTracer . emitDataTransferEvent ( NIOTracer . TRANSFER_END ) ; } if ( WORKER_LOGGER_DEBUG ) { WORKER_LOGGER . debug ( ""Pending parameters: "" + ( ( MultiOperationFetchListener ) wdr . getListener ( ) ) . getMissingOperations ( ) ) ; } } } ","public void receivedValue ( Destination type , String dataId , Object object , List < DataRequest > achievedRequests ) { if ( type == Transfer . Destination . OBJECT ) { WORKER_LOGGER . info ( ""Received data "" + dataId + "" with associated object "" + object ) ; this . dataManager . storeValue ( dataId , object ) ; } else { String nameId = ( new File ( dataId ) ) . getName ( ) ; WORKER_LOGGER . info ( ""Received data "" + nameId + "" with path "" + dataId ) ; this . dataManager . storeFile ( nameId , dataId ) ; } for ( DataRequest dr : achievedRequests ) { WorkerDataRequest wdr = ( WorkerDataRequest ) dr ; wdr . getListener ( ) . fetchedValue ( dataId ) ; if ( NIOTracer . extraeEnabled ( ) ) { NIOTracer . emitDataTransferEvent ( NIOTracer . TRANSFER_END ) ; } if ( WORKER_LOGGER_DEBUG ) { WORKER_LOGGER . debug ( ""Pending parameters: "" + ( ( MultiOperationFetchListener ) wdr . getListener ( ) ) . getMissingOperations ( ) ) ; } } } " 530,"public void receivedValue ( Destination type , String dataId , Object object , List < DataRequest > achievedRequests ) { if ( type == Transfer . Destination . OBJECT ) { WORKER_LOGGER . info ( ""Received data "" + dataId + "" with associated object "" + object ) ; this . dataManager . storeValue ( dataId , object ) ; } else { String nameId = ( new File ( dataId ) ) . getName ( ) ; WORKER_LOGGER . info ( ""Received data "" + nameId + "" with path "" + dataId ) ; this . dataManager . storeFile ( nameId , dataId ) ; } for ( DataRequest dr : achievedRequests ) { WorkerDataRequest wdr = ( WorkerDataRequest ) dr ; wdr . getListener ( ) . fetchedValue ( dataId ) ; if ( NIOTracer . extraeEnabled ( ) ) { NIOTracer . emitDataTransferEvent ( NIOTracer . TRANSFER_END ) ; } if ( WORKER_LOGGER_DEBUG ) { } } } ","public void receivedValue ( Destination type , String dataId , Object object , List < DataRequest > achievedRequests ) { if ( type == Transfer . Destination . OBJECT ) { WORKER_LOGGER . info ( ""Received data "" + dataId + "" with associated object "" + object ) ; this . dataManager . storeValue ( dataId , object ) ; } else { String nameId = ( new File ( dataId ) ) . getName ( ) ; WORKER_LOGGER . info ( ""Received data "" + nameId + "" with path "" + dataId ) ; this . dataManager . storeFile ( nameId , dataId ) ; } for ( DataRequest dr : achievedRequests ) { WorkerDataRequest wdr = ( WorkerDataRequest ) dr ; wdr . getListener ( ) . fetchedValue ( dataId ) ; if ( NIOTracer . extraeEnabled ( ) ) { NIOTracer . emitDataTransferEvent ( NIOTracer . TRANSFER_END ) ; } if ( WORKER_LOGGER_DEBUG ) { WORKER_LOGGER . debug ( ""Pending parameters: "" + ( ( MultiOperationFetchListener ) wdr . getListener ( ) ) . getMissingOperations ( ) ) ; } } } " 531,"private Component getAndValidateOriginComponentOfComponentInstance ( Component containerComponent , ComponentInstance componentInstance ) { ComponentTypeEnum componentType = getComponentTypeByParentComponentType ( containerComponent . getComponentType ( ) ) ; Component component ; Either < Component , StorageOperationStatus > getComponentRes = toscaOperationFacade . getToscaFullElement ( componentInstance . getComponentUid ( ) ) ; if ( getComponentRes . isRight ( ) ) { ActionStatus actionStatus = componentsUtils . convertFromStorageResponse ( getComponentRes . right ( ) . value ( ) , componentType ) ; throw new ByActionStatusComponentException ( actionStatus , Constants . EMPTY_STRING ) ; } component = getComponentRes . left ( ) . value ( ) ; LifecycleStateEnum resourceCurrState = component . getLifecycleState ( ) ; if ( resourceCurrState == LifecycleStateEnum . NOT_CERTIFIED_CHECKOUT ) { ActionStatus actionStatus = ActionStatus . CONTAINER_CANNOT_CONTAIN_COMPONENT_IN_STATE ; throw new ByActionStatusComponentException ( actionStatus , containerComponent . getComponentType ( ) . toString ( ) , resourceCurrState . toString ( ) ) ; } if ( Boolean . TRUE . equals ( component . isArchived ( ) ) ) { ActionStatus actionStatus = ActionStatus . COMPONENT_IS_ARCHIVED ; throw new ByActionStatusComponentException ( actionStatus , component . getName ( ) ) ; } final Map < String , InterfaceDefinition > componentInterfaces = component . getInterfaces ( ) ; if ( MapUtils . isNotEmpty ( componentInterfaces ) ) { componentInterfaces . forEach ( componentInstance :: addInterface ) ; } return component ; } ","private Component getAndValidateOriginComponentOfComponentInstance ( Component containerComponent , ComponentInstance componentInstance ) { ComponentTypeEnum componentType = getComponentTypeByParentComponentType ( containerComponent . getComponentType ( ) ) ; Component component ; Either < Component , StorageOperationStatus > getComponentRes = toscaOperationFacade . getToscaFullElement ( componentInstance . getComponentUid ( ) ) ; if ( getComponentRes . isRight ( ) ) { log . debug ( ""Failed to get the component with id {} for component instance {} creation. "" , componentInstance . getComponentUid ( ) , componentInstance . getName ( ) ) ; ActionStatus actionStatus = componentsUtils . convertFromStorageResponse ( getComponentRes . right ( ) . value ( ) , componentType ) ; throw new ByActionStatusComponentException ( actionStatus , Constants . EMPTY_STRING ) ; } component = getComponentRes . left ( ) . value ( ) ; LifecycleStateEnum resourceCurrState = component . getLifecycleState ( ) ; if ( resourceCurrState == LifecycleStateEnum . NOT_CERTIFIED_CHECKOUT ) { ActionStatus actionStatus = ActionStatus . CONTAINER_CANNOT_CONTAIN_COMPONENT_IN_STATE ; throw new ByActionStatusComponentException ( actionStatus , containerComponent . getComponentType ( ) . toString ( ) , resourceCurrState . toString ( ) ) ; } if ( Boolean . TRUE . equals ( component . isArchived ( ) ) ) { ActionStatus actionStatus = ActionStatus . COMPONENT_IS_ARCHIVED ; throw new ByActionStatusComponentException ( actionStatus , component . getName ( ) ) ; } final Map < String , InterfaceDefinition > componentInterfaces = component . getInterfaces ( ) ; if ( MapUtils . isNotEmpty ( componentInterfaces ) ) { componentInterfaces . forEach ( componentInstance :: addInterface ) ; } return component ; } " 532,"protected void doSubmit ( final AjaxRequestTarget target ) { try { UserSelfRestClient . changePassword ( passwordField . getModelObject ( ) ) ; SyncopeEnduserSession . get ( ) . invalidate ( ) ; final PageParameters parameters = new PageParameters ( ) ; parameters . add ( Constants . NOTIFICATION_MSG_PARAM , getString ( ""self.pwd.change.success"" ) ) ; setResponsePage ( getApplication ( ) . getHomePage ( ) , parameters ) ; setResponsePage ( getApplication ( ) . getHomePage ( ) , parameters ) ; } catch ( Exception e ) { SyncopeEnduserSession . get ( ) . onException ( e ) ; notificationPanel . refresh ( target ) ; } } ","protected void doSubmit ( final AjaxRequestTarget target ) { try { UserSelfRestClient . changePassword ( passwordField . getModelObject ( ) ) ; SyncopeEnduserSession . get ( ) . invalidate ( ) ; final PageParameters parameters = new PageParameters ( ) ; parameters . add ( Constants . NOTIFICATION_MSG_PARAM , getString ( ""self.pwd.change.success"" ) ) ; setResponsePage ( getApplication ( ) . getHomePage ( ) , parameters ) ; setResponsePage ( getApplication ( ) . getHomePage ( ) , parameters ) ; } catch ( Exception e ) { LOG . error ( ""While changing password for {}"" , SyncopeEnduserSession . get ( ) . getSelfTO ( ) . getUsername ( ) , e ) ; SyncopeEnduserSession . get ( ) . onException ( e ) ; notificationPanel . refresh ( target ) ; } } " 533,"public static IActionSet getConnectionsActionSetService ( String name , String version ) throws ActivatorException { try { return ( IActionSet ) getServiceFromRegistry ( context , createFilterConnectionsActionSet ( name , version ) ) ; } catch ( InvalidSyntaxException e ) { throw new ActivatorException ( e ) ; } } ","public static IActionSet getConnectionsActionSetService ( String name , String version ) throws ActivatorException { try { log . debug ( ""Calling ConnectionsActionSetService"" ) ; return ( IActionSet ) getServiceFromRegistry ( context , createFilterConnectionsActionSet ( name , version ) ) ; } catch ( InvalidSyntaxException e ) { throw new ActivatorException ( e ) ; } } " 534,"public List < SecurityRuleInstance > getAllSecurityRules ( Order order , SystemUser systemUser ) throws FogbowException { CloudUser cloudUser = this . mapperPlugin . map ( systemUser ) ; LOGGER . debug ( String . format ( Messages . Log . MAPPED_USER_S , cloudUser ) ) ; List < SecurityRuleInstance > securityRuleInstances = null ; String auditableResponse = null ; try { securityRuleInstances = doGetAllSecurityRules ( order , cloudUser ) ; LOGGER . debug ( String . format ( Messages . Log . RESPONSE_RECEIVED_S , securityRuleInstances ) ) ; auditableResponse = securityRuleInstances . toString ( ) ; } catch ( Throwable e ) { LOGGER . debug ( String . format ( Messages . Exception . GENERIC_EXCEPTION_S , e + e . getMessage ( ) ) ) ; auditableResponse = e . getClass ( ) . getName ( ) ; throw e ; } finally { auditRequest ( Operation . GET_ALL , order . getType ( ) , systemUser , auditableResponse ) ; } return securityRuleInstances ; } ","public List < SecurityRuleInstance > getAllSecurityRules ( Order order , SystemUser systemUser ) throws FogbowException { LOGGER . debug ( String . format ( Messages . Log . MAPPING_USER_OP_S , GET_ALL_SECURITY_RULES_OPERATION , order ) ) ; CloudUser cloudUser = this . mapperPlugin . map ( systemUser ) ; LOGGER . debug ( String . format ( Messages . Log . MAPPED_USER_S , cloudUser ) ) ; List < SecurityRuleInstance > securityRuleInstances = null ; String auditableResponse = null ; try { securityRuleInstances = doGetAllSecurityRules ( order , cloudUser ) ; LOGGER . debug ( String . format ( Messages . Log . RESPONSE_RECEIVED_S , securityRuleInstances ) ) ; auditableResponse = securityRuleInstances . toString ( ) ; } catch ( Throwable e ) { LOGGER . debug ( String . format ( Messages . Exception . GENERIC_EXCEPTION_S , e + e . getMessage ( ) ) ) ; auditableResponse = e . getClass ( ) . getName ( ) ; throw e ; } finally { auditRequest ( Operation . GET_ALL , order . getType ( ) , systemUser , auditableResponse ) ; } return securityRuleInstances ; } " 535,"public List < SecurityRuleInstance > getAllSecurityRules ( Order order , SystemUser systemUser ) throws FogbowException { LOGGER . debug ( String . format ( Messages . Log . MAPPING_USER_OP_S , GET_ALL_SECURITY_RULES_OPERATION , order ) ) ; CloudUser cloudUser = this . mapperPlugin . map ( systemUser ) ; List < SecurityRuleInstance > securityRuleInstances = null ; String auditableResponse = null ; try { securityRuleInstances = doGetAllSecurityRules ( order , cloudUser ) ; LOGGER . debug ( String . format ( Messages . Log . RESPONSE_RECEIVED_S , securityRuleInstances ) ) ; auditableResponse = securityRuleInstances . toString ( ) ; } catch ( Throwable e ) { LOGGER . debug ( String . format ( Messages . Exception . GENERIC_EXCEPTION_S , e + e . getMessage ( ) ) ) ; auditableResponse = e . getClass ( ) . getName ( ) ; throw e ; } finally { auditRequest ( Operation . GET_ALL , order . getType ( ) , systemUser , auditableResponse ) ; } return securityRuleInstances ; } ","public List < SecurityRuleInstance > getAllSecurityRules ( Order order , SystemUser systemUser ) throws FogbowException { LOGGER . debug ( String . format ( Messages . Log . MAPPING_USER_OP_S , GET_ALL_SECURITY_RULES_OPERATION , order ) ) ; CloudUser cloudUser = this . mapperPlugin . map ( systemUser ) ; LOGGER . debug ( String . format ( Messages . Log . MAPPED_USER_S , cloudUser ) ) ; List < SecurityRuleInstance > securityRuleInstances = null ; String auditableResponse = null ; try { securityRuleInstances = doGetAllSecurityRules ( order , cloudUser ) ; LOGGER . debug ( String . format ( Messages . Log . RESPONSE_RECEIVED_S , securityRuleInstances ) ) ; auditableResponse = securityRuleInstances . toString ( ) ; } catch ( Throwable e ) { LOGGER . debug ( String . format ( Messages . Exception . GENERIC_EXCEPTION_S , e + e . getMessage ( ) ) ) ; auditableResponse = e . getClass ( ) . getName ( ) ; throw e ; } finally { auditRequest ( Operation . GET_ALL , order . getType ( ) , systemUser , auditableResponse ) ; } return securityRuleInstances ; } " 536,"public List < SecurityRuleInstance > getAllSecurityRules ( Order order , SystemUser systemUser ) throws FogbowException { LOGGER . debug ( String . format ( Messages . Log . MAPPING_USER_OP_S , GET_ALL_SECURITY_RULES_OPERATION , order ) ) ; CloudUser cloudUser = this . mapperPlugin . map ( systemUser ) ; LOGGER . debug ( String . format ( Messages . Log . MAPPED_USER_S , cloudUser ) ) ; List < SecurityRuleInstance > securityRuleInstances = null ; String auditableResponse = null ; try { securityRuleInstances = doGetAllSecurityRules ( order , cloudUser ) ; auditableResponse = securityRuleInstances . toString ( ) ; } catch ( Throwable e ) { LOGGER . debug ( String . format ( Messages . Exception . GENERIC_EXCEPTION_S , e + e . getMessage ( ) ) ) ; auditableResponse = e . getClass ( ) . getName ( ) ; throw e ; } finally { auditRequest ( Operation . GET_ALL , order . getType ( ) , systemUser , auditableResponse ) ; } return securityRuleInstances ; } ","public List < SecurityRuleInstance > getAllSecurityRules ( Order order , SystemUser systemUser ) throws FogbowException { LOGGER . debug ( String . format ( Messages . Log . MAPPING_USER_OP_S , GET_ALL_SECURITY_RULES_OPERATION , order ) ) ; CloudUser cloudUser = this . mapperPlugin . map ( systemUser ) ; LOGGER . debug ( String . format ( Messages . Log . MAPPED_USER_S , cloudUser ) ) ; List < SecurityRuleInstance > securityRuleInstances = null ; String auditableResponse = null ; try { securityRuleInstances = doGetAllSecurityRules ( order , cloudUser ) ; LOGGER . debug ( String . format ( Messages . Log . RESPONSE_RECEIVED_S , securityRuleInstances ) ) ; auditableResponse = securityRuleInstances . toString ( ) ; } catch ( Throwable e ) { LOGGER . debug ( String . format ( Messages . Exception . GENERIC_EXCEPTION_S , e + e . getMessage ( ) ) ) ; auditableResponse = e . getClass ( ) . getName ( ) ; throw e ; } finally { auditRequest ( Operation . GET_ALL , order . getType ( ) , systemUser , auditableResponse ) ; } return securityRuleInstances ; } " 537,"public List < SecurityRuleInstance > getAllSecurityRules ( Order order , SystemUser systemUser ) throws FogbowException { LOGGER . debug ( String . format ( Messages . Log . MAPPING_USER_OP_S , GET_ALL_SECURITY_RULES_OPERATION , order ) ) ; CloudUser cloudUser = this . mapperPlugin . map ( systemUser ) ; LOGGER . debug ( String . format ( Messages . Log . MAPPED_USER_S , cloudUser ) ) ; List < SecurityRuleInstance > securityRuleInstances = null ; String auditableResponse = null ; try { securityRuleInstances = doGetAllSecurityRules ( order , cloudUser ) ; LOGGER . debug ( String . format ( Messages . Log . RESPONSE_RECEIVED_S , securityRuleInstances ) ) ; auditableResponse = securityRuleInstances . toString ( ) ; } catch ( Throwable e ) { auditableResponse = e . getClass ( ) . getName ( ) ; throw e ; } finally { auditRequest ( Operation . GET_ALL , order . getType ( ) , systemUser , auditableResponse ) ; } return securityRuleInstances ; } ","public List < SecurityRuleInstance > getAllSecurityRules ( Order order , SystemUser systemUser ) throws FogbowException { LOGGER . debug ( String . format ( Messages . Log . MAPPING_USER_OP_S , GET_ALL_SECURITY_RULES_OPERATION , order ) ) ; CloudUser cloudUser = this . mapperPlugin . map ( systemUser ) ; LOGGER . debug ( String . format ( Messages . Log . MAPPED_USER_S , cloudUser ) ) ; List < SecurityRuleInstance > securityRuleInstances = null ; String auditableResponse = null ; try { securityRuleInstances = doGetAllSecurityRules ( order , cloudUser ) ; LOGGER . debug ( String . format ( Messages . Log . RESPONSE_RECEIVED_S , securityRuleInstances ) ) ; auditableResponse = securityRuleInstances . toString ( ) ; } catch ( Throwable e ) { LOGGER . debug ( String . format ( Messages . Exception . GENERIC_EXCEPTION_S , e + e . getMessage ( ) ) ) ; auditableResponse = e . getClass ( ) . getName ( ) ; throw e ; } finally { auditRequest ( Operation . GET_ALL , order . getType ( ) , systemUser , auditableResponse ) ; } return securityRuleInstances ; } " 538,"private Map < Tuple < ActivityFacility , Double > , Map < String , Double > > sortMeasurePointsByYAndXCoord ( ) { Map < Double , List < Double > > coordMap = new TreeMap < > ( ) ; List < Double > yValues = new LinkedList < > ( ) ; for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { ActivityFacility activityFacility = tuple . getFirst ( ) ; double y = activityFacility . getCoord ( ) . getY ( ) ; if ( ! yValues . contains ( y ) ) { yValues . add ( y ) ; } } yValues . sort ( Comparator . naturalOrder ( ) ) ; for ( double yGiven : yValues ) { List < Double > xValues = new LinkedList < > ( ) ; for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { ActivityFacility activityFacility = tuple . getFirst ( ) ; double y = activityFacility . getCoord ( ) . getY ( ) ; if ( y == yGiven ) { double x = activityFacility . getCoord ( ) . getX ( ) ; if ( ! xValues . contains ( x ) ) { xValues . add ( x ) ; } } } xValues . sort ( Comparator . naturalOrder ( ) ) ; coordMap . put ( yGiven , xValues ) ; } Map < Tuple < ActivityFacility , Double > , Map < String , Double > > accessibilitiesMap2 = new LinkedHashMap < > ( ) ; for ( double y : coordMap . keySet ( ) ) { for ( double x : coordMap . get ( y ) ) { for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { Coord coord = tuple . getFirst ( ) . getCoord ( ) ; if ( coord . getX ( ) == x && coord . getY ( ) == y ) { accessibilitiesMap2 . put ( tuple , accessibilitiesMap . get ( tuple ) ) ; } } } } LOG . info ( ""Finish sorting measure points."" ) ; return accessibilitiesMap2 ; } ","private Map < Tuple < ActivityFacility , Double > , Map < String , Double > > sortMeasurePointsByYAndXCoord ( ) { LOG . info ( ""Start sorting measure points."" ) ; Map < Double , List < Double > > coordMap = new TreeMap < > ( ) ; List < Double > yValues = new LinkedList < > ( ) ; for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { ActivityFacility activityFacility = tuple . getFirst ( ) ; double y = activityFacility . getCoord ( ) . getY ( ) ; if ( ! yValues . contains ( y ) ) { yValues . add ( y ) ; } } yValues . sort ( Comparator . naturalOrder ( ) ) ; for ( double yGiven : yValues ) { List < Double > xValues = new LinkedList < > ( ) ; for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { ActivityFacility activityFacility = tuple . getFirst ( ) ; double y = activityFacility . getCoord ( ) . getY ( ) ; if ( y == yGiven ) { double x = activityFacility . getCoord ( ) . getX ( ) ; if ( ! xValues . contains ( x ) ) { xValues . add ( x ) ; } } } xValues . sort ( Comparator . naturalOrder ( ) ) ; coordMap . put ( yGiven , xValues ) ; } Map < Tuple < ActivityFacility , Double > , Map < String , Double > > accessibilitiesMap2 = new LinkedHashMap < > ( ) ; for ( double y : coordMap . keySet ( ) ) { for ( double x : coordMap . get ( y ) ) { for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { Coord coord = tuple . getFirst ( ) . getCoord ( ) ; if ( coord . getX ( ) == x && coord . getY ( ) == y ) { accessibilitiesMap2 . put ( tuple , accessibilitiesMap . get ( tuple ) ) ; } } } } LOG . info ( ""Finish sorting measure points."" ) ; return accessibilitiesMap2 ; } " 539,"private Map < Tuple < ActivityFacility , Double > , Map < String , Double > > sortMeasurePointsByYAndXCoord ( ) { LOG . info ( ""Start sorting measure points."" ) ; Map < Double , List < Double > > coordMap = new TreeMap < > ( ) ; List < Double > yValues = new LinkedList < > ( ) ; for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { ActivityFacility activityFacility = tuple . getFirst ( ) ; double y = activityFacility . getCoord ( ) . getY ( ) ; if ( ! yValues . contains ( y ) ) { yValues . add ( y ) ; } } yValues . sort ( Comparator . naturalOrder ( ) ) ; for ( double yGiven : yValues ) { List < Double > xValues = new LinkedList < > ( ) ; for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { ActivityFacility activityFacility = tuple . getFirst ( ) ; double y = activityFacility . getCoord ( ) . getY ( ) ; if ( y == yGiven ) { double x = activityFacility . getCoord ( ) . getX ( ) ; if ( ! xValues . contains ( x ) ) { xValues . add ( x ) ; } } } xValues . sort ( Comparator . naturalOrder ( ) ) ; coordMap . put ( yGiven , xValues ) ; } Map < Tuple < ActivityFacility , Double > , Map < String , Double > > accessibilitiesMap2 = new LinkedHashMap < > ( ) ; for ( double y : coordMap . keySet ( ) ) { for ( double x : coordMap . get ( y ) ) { for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { Coord coord = tuple . getFirst ( ) . getCoord ( ) ; if ( coord . getX ( ) == x && coord . getY ( ) == y ) { accessibilitiesMap2 . put ( tuple , accessibilitiesMap . get ( tuple ) ) ; } } } } return accessibilitiesMap2 ; } ","private Map < Tuple < ActivityFacility , Double > , Map < String , Double > > sortMeasurePointsByYAndXCoord ( ) { LOG . info ( ""Start sorting measure points."" ) ; Map < Double , List < Double > > coordMap = new TreeMap < > ( ) ; List < Double > yValues = new LinkedList < > ( ) ; for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { ActivityFacility activityFacility = tuple . getFirst ( ) ; double y = activityFacility . getCoord ( ) . getY ( ) ; if ( ! yValues . contains ( y ) ) { yValues . add ( y ) ; } } yValues . sort ( Comparator . naturalOrder ( ) ) ; for ( double yGiven : yValues ) { List < Double > xValues = new LinkedList < > ( ) ; for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { ActivityFacility activityFacility = tuple . getFirst ( ) ; double y = activityFacility . getCoord ( ) . getY ( ) ; if ( y == yGiven ) { double x = activityFacility . getCoord ( ) . getX ( ) ; if ( ! xValues . contains ( x ) ) { xValues . add ( x ) ; } } } xValues . sort ( Comparator . naturalOrder ( ) ) ; coordMap . put ( yGiven , xValues ) ; } Map < Tuple < ActivityFacility , Double > , Map < String , Double > > accessibilitiesMap2 = new LinkedHashMap < > ( ) ; for ( double y : coordMap . keySet ( ) ) { for ( double x : coordMap . get ( y ) ) { for ( Tuple < ActivityFacility , Double > tuple : accessibilitiesMap . keySet ( ) ) { Coord coord = tuple . getFirst ( ) . getCoord ( ) ; if ( coord . getX ( ) == x && coord . getY ( ) == y ) { accessibilitiesMap2 . put ( tuple , accessibilitiesMap . get ( tuple ) ) ; } } } } LOG . info ( ""Finish sorting measure points."" ) ; return accessibilitiesMap2 ; } " 540,"@ SuppressWarnings ( ""unchecked"" ) public static < M extends Message > M parseFrom ( Class < M > protoClass , byte [ ] messageBytes ) { try { Method parseFrom = protoClass . getMethod ( ""parseFrom"" , new Class [ ] { byte [ ] . class } ) ; return ( M ) parseFrom . invoke ( null , new Object [ ] { messageBytes } ) ; } catch ( NoSuchMethodException e ) { throw new IllegalArgumentException ( e ) ; } catch ( IllegalAccessException e ) { LOG . error ( ""Could not access method parseFrom in class "" + protoClass , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( InvocationTargetException e ) { LOG . error ( ""Error invoking method parseFrom in class "" + protoClass , e ) ; } return null ; } ","@ SuppressWarnings ( ""unchecked"" ) public static < M extends Message > M parseFrom ( Class < M > protoClass , byte [ ] messageBytes ) { try { Method parseFrom = protoClass . getMethod ( ""parseFrom"" , new Class [ ] { byte [ ] . class } ) ; return ( M ) parseFrom . invoke ( null , new Object [ ] { messageBytes } ) ; } catch ( NoSuchMethodException e ) { LOG . error ( ""Could not find method parseFrom in class "" + protoClass , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( IllegalAccessException e ) { LOG . error ( ""Could not access method parseFrom in class "" + protoClass , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( InvocationTargetException e ) { LOG . error ( ""Error invoking method parseFrom in class "" + protoClass , e ) ; } return null ; } " 541,"@ SuppressWarnings ( ""unchecked"" ) public static < M extends Message > M parseFrom ( Class < M > protoClass , byte [ ] messageBytes ) { try { Method parseFrom = protoClass . getMethod ( ""parseFrom"" , new Class [ ] { byte [ ] . class } ) ; return ( M ) parseFrom . invoke ( null , new Object [ ] { messageBytes } ) ; } catch ( NoSuchMethodException e ) { LOG . error ( ""Could not find method parseFrom in class "" + protoClass , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( IllegalAccessException e ) { throw new IllegalArgumentException ( e ) ; } catch ( InvocationTargetException e ) { LOG . error ( ""Error invoking method parseFrom in class "" + protoClass , e ) ; } return null ; } ","@ SuppressWarnings ( ""unchecked"" ) public static < M extends Message > M parseFrom ( Class < M > protoClass , byte [ ] messageBytes ) { try { Method parseFrom = protoClass . getMethod ( ""parseFrom"" , new Class [ ] { byte [ ] . class } ) ; return ( M ) parseFrom . invoke ( null , new Object [ ] { messageBytes } ) ; } catch ( NoSuchMethodException e ) { LOG . error ( ""Could not find method parseFrom in class "" + protoClass , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( IllegalAccessException e ) { LOG . error ( ""Could not access method parseFrom in class "" + protoClass , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( InvocationTargetException e ) { LOG . error ( ""Error invoking method parseFrom in class "" + protoClass , e ) ; } return null ; } " 542,"@ SuppressWarnings ( ""unchecked"" ) public static < M extends Message > M parseFrom ( Class < M > protoClass , byte [ ] messageBytes ) { try { Method parseFrom = protoClass . getMethod ( ""parseFrom"" , new Class [ ] { byte [ ] . class } ) ; return ( M ) parseFrom . invoke ( null , new Object [ ] { messageBytes } ) ; } catch ( NoSuchMethodException e ) { LOG . error ( ""Could not find method parseFrom in class "" + protoClass , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( IllegalAccessException e ) { LOG . error ( ""Could not access method parseFrom in class "" + protoClass , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( InvocationTargetException e ) { } return null ; } ","@ SuppressWarnings ( ""unchecked"" ) public static < M extends Message > M parseFrom ( Class < M > protoClass , byte [ ] messageBytes ) { try { Method parseFrom = protoClass . getMethod ( ""parseFrom"" , new Class [ ] { byte [ ] . class } ) ; return ( M ) parseFrom . invoke ( null , new Object [ ] { messageBytes } ) ; } catch ( NoSuchMethodException e ) { LOG . error ( ""Could not find method parseFrom in class "" + protoClass , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( IllegalAccessException e ) { LOG . error ( ""Could not access method parseFrom in class "" + protoClass , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( InvocationTargetException e ) { LOG . error ( ""Error invoking method parseFrom in class "" + protoClass , e ) ; } return null ; } " 543,"private String _getRootAttributeValue ( String xml , String name , String defaultValue ) { if ( ! Validator . isXml ( xml ) ) { return defaultValue ; } String value = null ; XMLStreamReader xmlStreamReader = null ; ClassLoader portalClassLoader = PortalClassLoaderUtil . getClassLoader ( ) ; Thread currentThread = Thread . currentThread ( ) ; ClassLoader contextClassLoader = currentThread . getContextClassLoader ( ) ; try { if ( contextClassLoader != portalClassLoader ) { currentThread . setContextClassLoader ( portalClassLoader ) ; } XMLInputFactory xmlInputFactory = SecureXMLFactoryProviderUtil . newXMLInputFactory ( ) ; xmlStreamReader = xmlInputFactory . createXMLStreamReader ( new UnsyncStringReader ( xml ) ) ; if ( xmlStreamReader . hasNext ( ) ) { xmlStreamReader . nextTag ( ) ; value = xmlStreamReader . getAttributeValue ( null , name ) ; } } catch ( Exception exception ) { if ( _log . isWarnEnabled ( ) ) { } } finally { if ( contextClassLoader != portalClassLoader ) { currentThread . setContextClassLoader ( contextClassLoader ) ; } if ( xmlStreamReader != null ) { try { xmlStreamReader . close ( ) ; } catch ( Exception exception ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( exception , exception ) ; } } } } if ( Validator . isNull ( value ) ) { value = defaultValue ; } return value ; } ","private String _getRootAttributeValue ( String xml , String name , String defaultValue ) { if ( ! Validator . isXml ( xml ) ) { return defaultValue ; } String value = null ; XMLStreamReader xmlStreamReader = null ; ClassLoader portalClassLoader = PortalClassLoaderUtil . getClassLoader ( ) ; Thread currentThread = Thread . currentThread ( ) ; ClassLoader contextClassLoader = currentThread . getContextClassLoader ( ) ; try { if ( contextClassLoader != portalClassLoader ) { currentThread . setContextClassLoader ( portalClassLoader ) ; } XMLInputFactory xmlInputFactory = SecureXMLFactoryProviderUtil . newXMLInputFactory ( ) ; xmlStreamReader = xmlInputFactory . createXMLStreamReader ( new UnsyncStringReader ( xml ) ) ; if ( xmlStreamReader . hasNext ( ) ) { xmlStreamReader . nextTag ( ) ; value = xmlStreamReader . getAttributeValue ( null , name ) ; } } catch ( Exception exception ) { if ( _log . isWarnEnabled ( ) ) { _log . warn ( exception , exception ) ; } } finally { if ( contextClassLoader != portalClassLoader ) { currentThread . setContextClassLoader ( contextClassLoader ) ; } if ( xmlStreamReader != null ) { try { xmlStreamReader . close ( ) ; } catch ( Exception exception ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( exception , exception ) ; } } } } if ( Validator . isNull ( value ) ) { value = defaultValue ; } return value ; } " 544,"private String _getRootAttributeValue ( String xml , String name , String defaultValue ) { if ( ! Validator . isXml ( xml ) ) { return defaultValue ; } String value = null ; XMLStreamReader xmlStreamReader = null ; ClassLoader portalClassLoader = PortalClassLoaderUtil . getClassLoader ( ) ; Thread currentThread = Thread . currentThread ( ) ; ClassLoader contextClassLoader = currentThread . getContextClassLoader ( ) ; try { if ( contextClassLoader != portalClassLoader ) { currentThread . setContextClassLoader ( portalClassLoader ) ; } XMLInputFactory xmlInputFactory = SecureXMLFactoryProviderUtil . newXMLInputFactory ( ) ; xmlStreamReader = xmlInputFactory . createXMLStreamReader ( new UnsyncStringReader ( xml ) ) ; if ( xmlStreamReader . hasNext ( ) ) { xmlStreamReader . nextTag ( ) ; value = xmlStreamReader . getAttributeValue ( null , name ) ; } } catch ( Exception exception ) { if ( _log . isWarnEnabled ( ) ) { _log . warn ( exception , exception ) ; } } finally { if ( contextClassLoader != portalClassLoader ) { currentThread . setContextClassLoader ( contextClassLoader ) ; } if ( xmlStreamReader != null ) { try { xmlStreamReader . close ( ) ; } catch ( Exception exception ) { if ( _log . isDebugEnabled ( ) ) { } } } } if ( Validator . isNull ( value ) ) { value = defaultValue ; } return value ; } ","private String _getRootAttributeValue ( String xml , String name , String defaultValue ) { if ( ! Validator . isXml ( xml ) ) { return defaultValue ; } String value = null ; XMLStreamReader xmlStreamReader = null ; ClassLoader portalClassLoader = PortalClassLoaderUtil . getClassLoader ( ) ; Thread currentThread = Thread . currentThread ( ) ; ClassLoader contextClassLoader = currentThread . getContextClassLoader ( ) ; try { if ( contextClassLoader != portalClassLoader ) { currentThread . setContextClassLoader ( portalClassLoader ) ; } XMLInputFactory xmlInputFactory = SecureXMLFactoryProviderUtil . newXMLInputFactory ( ) ; xmlStreamReader = xmlInputFactory . createXMLStreamReader ( new UnsyncStringReader ( xml ) ) ; if ( xmlStreamReader . hasNext ( ) ) { xmlStreamReader . nextTag ( ) ; value = xmlStreamReader . getAttributeValue ( null , name ) ; } } catch ( Exception exception ) { if ( _log . isWarnEnabled ( ) ) { _log . warn ( exception , exception ) ; } } finally { if ( contextClassLoader != portalClassLoader ) { currentThread . setContextClassLoader ( contextClassLoader ) ; } if ( xmlStreamReader != null ) { try { xmlStreamReader . close ( ) ; } catch ( Exception exception ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( exception , exception ) ; } } } } if ( Validator . isNull ( value ) ) { value = defaultValue ; } return value ; } " 545,"public < T extends DomainObject > T fromOid ( Object oid ) { OgmOID internalId = ( OgmOID ) oid ; if ( logger . isTraceEnabled ( ) ) { } return ( T ) transactionManager . getEntityManager ( ) . find ( internalId . getObjClass ( ) , internalId . getPrimaryKey ( ) ) ; } ","public < T extends DomainObject > T fromOid ( Object oid ) { OgmOID internalId = ( OgmOID ) oid ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""fromOid("" + internalId + "")"" ) ; } return ( T ) transactionManager . getEntityManager ( ) . find ( internalId . getObjClass ( ) , internalId . getPrimaryKey ( ) ) ; } " 546,"void perform ( ) throws IOException { TableDescriptor selected = selectTable ( enabledTables ) ; if ( selected == null ) { return ; } Admin admin = connection . getAdmin ( ) ; TableName tableName = selected . getTableName ( ) ; try ( Table table = connection . getTable ( tableName ) ) { ArrayList < RegionInfo > regionInfos = new ArrayList < > ( admin . getRegions ( selected . getTableName ( ) ) ) ; int numRegions = regionInfos . size ( ) ; int average_rows = 1 ; int numRows = average_rows * numRegions ; for ( int i = 0 ; i < numRows ; i ++ ) { byte [ ] rowKey = Bytes . toBytes ( ""row-"" + String . format ( ""%010d"" , RandomUtils . nextInt ( ) ) ) ; ColumnFamilyDescriptor cfd = selectFamily ( selected ) ; if ( cfd == null ) { return ; } byte [ ] family = cfd . getName ( ) ; byte [ ] qualifier = Bytes . toBytes ( ""col-"" + RandomUtils . nextInt ( ) % 10 ) ; byte [ ] value = Bytes . toBytes ( ""val-"" + RandomStringUtils . randomAlphanumeric ( 10 ) ) ; Put put = new Put ( rowKey ) ; put . addColumn ( family , qualifier , value ) ; table . put ( put ) ; } TableDescriptor freshTableDesc = admin . getDescriptor ( tableName ) ; Assert . assertTrue ( ""After insert, Table: "" + tableName + "" in not enabled"" , admin . isTableEnabled ( tableName ) ) ; enabledTables . put ( tableName , freshTableDesc ) ; LOG . info ( ""Added "" + numRows + "" rows to table: "" + selected ) ; } catch ( Exception e ) { LOG . warn ( ""Caught exception in action: "" + this . getClass ( ) ) ; throw e ; } finally { admin . close ( ) ; } } ","void perform ( ) throws IOException { TableDescriptor selected = selectTable ( enabledTables ) ; if ( selected == null ) { return ; } Admin admin = connection . getAdmin ( ) ; TableName tableName = selected . getTableName ( ) ; try ( Table table = connection . getTable ( tableName ) ) { ArrayList < RegionInfo > regionInfos = new ArrayList < > ( admin . getRegions ( selected . getTableName ( ) ) ) ; int numRegions = regionInfos . size ( ) ; int average_rows = 1 ; int numRows = average_rows * numRegions ; LOG . info ( ""Adding "" + numRows + "" rows to table: "" + selected ) ; for ( int i = 0 ; i < numRows ; i ++ ) { byte [ ] rowKey = Bytes . toBytes ( ""row-"" + String . format ( ""%010d"" , RandomUtils . nextInt ( ) ) ) ; ColumnFamilyDescriptor cfd = selectFamily ( selected ) ; if ( cfd == null ) { return ; } byte [ ] family = cfd . getName ( ) ; byte [ ] qualifier = Bytes . toBytes ( ""col-"" + RandomUtils . nextInt ( ) % 10 ) ; byte [ ] value = Bytes . toBytes ( ""val-"" + RandomStringUtils . randomAlphanumeric ( 10 ) ) ; Put put = new Put ( rowKey ) ; put . addColumn ( family , qualifier , value ) ; table . put ( put ) ; } TableDescriptor freshTableDesc = admin . getDescriptor ( tableName ) ; Assert . assertTrue ( ""After insert, Table: "" + tableName + "" in not enabled"" , admin . isTableEnabled ( tableName ) ) ; enabledTables . put ( tableName , freshTableDesc ) ; LOG . info ( ""Added "" + numRows + "" rows to table: "" + selected ) ; } catch ( Exception e ) { LOG . warn ( ""Caught exception in action: "" + this . getClass ( ) ) ; throw e ; } finally { admin . close ( ) ; } } " 547,"void perform ( ) throws IOException { TableDescriptor selected = selectTable ( enabledTables ) ; if ( selected == null ) { return ; } Admin admin = connection . getAdmin ( ) ; TableName tableName = selected . getTableName ( ) ; try ( Table table = connection . getTable ( tableName ) ) { ArrayList < RegionInfo > regionInfos = new ArrayList < > ( admin . getRegions ( selected . getTableName ( ) ) ) ; int numRegions = regionInfos . size ( ) ; int average_rows = 1 ; int numRows = average_rows * numRegions ; LOG . info ( ""Adding "" + numRows + "" rows to table: "" + selected ) ; for ( int i = 0 ; i < numRows ; i ++ ) { byte [ ] rowKey = Bytes . toBytes ( ""row-"" + String . format ( ""%010d"" , RandomUtils . nextInt ( ) ) ) ; ColumnFamilyDescriptor cfd = selectFamily ( selected ) ; if ( cfd == null ) { return ; } byte [ ] family = cfd . getName ( ) ; byte [ ] qualifier = Bytes . toBytes ( ""col-"" + RandomUtils . nextInt ( ) % 10 ) ; byte [ ] value = Bytes . toBytes ( ""val-"" + RandomStringUtils . randomAlphanumeric ( 10 ) ) ; Put put = new Put ( rowKey ) ; put . addColumn ( family , qualifier , value ) ; table . put ( put ) ; } TableDescriptor freshTableDesc = admin . getDescriptor ( tableName ) ; Assert . assertTrue ( ""After insert, Table: "" + tableName + "" in not enabled"" , admin . isTableEnabled ( tableName ) ) ; enabledTables . put ( tableName , freshTableDesc ) ; } catch ( Exception e ) { LOG . warn ( ""Caught exception in action: "" + this . getClass ( ) ) ; throw e ; } finally { admin . close ( ) ; } } ","void perform ( ) throws IOException { TableDescriptor selected = selectTable ( enabledTables ) ; if ( selected == null ) { return ; } Admin admin = connection . getAdmin ( ) ; TableName tableName = selected . getTableName ( ) ; try ( Table table = connection . getTable ( tableName ) ) { ArrayList < RegionInfo > regionInfos = new ArrayList < > ( admin . getRegions ( selected . getTableName ( ) ) ) ; int numRegions = regionInfos . size ( ) ; int average_rows = 1 ; int numRows = average_rows * numRegions ; LOG . info ( ""Adding "" + numRows + "" rows to table: "" + selected ) ; for ( int i = 0 ; i < numRows ; i ++ ) { byte [ ] rowKey = Bytes . toBytes ( ""row-"" + String . format ( ""%010d"" , RandomUtils . nextInt ( ) ) ) ; ColumnFamilyDescriptor cfd = selectFamily ( selected ) ; if ( cfd == null ) { return ; } byte [ ] family = cfd . getName ( ) ; byte [ ] qualifier = Bytes . toBytes ( ""col-"" + RandomUtils . nextInt ( ) % 10 ) ; byte [ ] value = Bytes . toBytes ( ""val-"" + RandomStringUtils . randomAlphanumeric ( 10 ) ) ; Put put = new Put ( rowKey ) ; put . addColumn ( family , qualifier , value ) ; table . put ( put ) ; } TableDescriptor freshTableDesc = admin . getDescriptor ( tableName ) ; Assert . assertTrue ( ""After insert, Table: "" + tableName + "" in not enabled"" , admin . isTableEnabled ( tableName ) ) ; enabledTables . put ( tableName , freshTableDesc ) ; LOG . info ( ""Added "" + numRows + "" rows to table: "" + selected ) ; } catch ( Exception e ) { LOG . warn ( ""Caught exception in action: "" + this . getClass ( ) ) ; throw e ; } finally { admin . close ( ) ; } } " 548,"void perform ( ) throws IOException { TableDescriptor selected = selectTable ( enabledTables ) ; if ( selected == null ) { return ; } Admin admin = connection . getAdmin ( ) ; TableName tableName = selected . getTableName ( ) ; try ( Table table = connection . getTable ( tableName ) ) { ArrayList < RegionInfo > regionInfos = new ArrayList < > ( admin . getRegions ( selected . getTableName ( ) ) ) ; int numRegions = regionInfos . size ( ) ; int average_rows = 1 ; int numRows = average_rows * numRegions ; LOG . info ( ""Adding "" + numRows + "" rows to table: "" + selected ) ; for ( int i = 0 ; i < numRows ; i ++ ) { byte [ ] rowKey = Bytes . toBytes ( ""row-"" + String . format ( ""%010d"" , RandomUtils . nextInt ( ) ) ) ; ColumnFamilyDescriptor cfd = selectFamily ( selected ) ; if ( cfd == null ) { return ; } byte [ ] family = cfd . getName ( ) ; byte [ ] qualifier = Bytes . toBytes ( ""col-"" + RandomUtils . nextInt ( ) % 10 ) ; byte [ ] value = Bytes . toBytes ( ""val-"" + RandomStringUtils . randomAlphanumeric ( 10 ) ) ; Put put = new Put ( rowKey ) ; put . addColumn ( family , qualifier , value ) ; table . put ( put ) ; } TableDescriptor freshTableDesc = admin . getDescriptor ( tableName ) ; Assert . assertTrue ( ""After insert, Table: "" + tableName + "" in not enabled"" , admin . isTableEnabled ( tableName ) ) ; enabledTables . put ( tableName , freshTableDesc ) ; LOG . info ( ""Added "" + numRows + "" rows to table: "" + selected ) ; } catch ( Exception e ) { throw e ; } finally { admin . close ( ) ; } } ","void perform ( ) throws IOException { TableDescriptor selected = selectTable ( enabledTables ) ; if ( selected == null ) { return ; } Admin admin = connection . getAdmin ( ) ; TableName tableName = selected . getTableName ( ) ; try ( Table table = connection . getTable ( tableName ) ) { ArrayList < RegionInfo > regionInfos = new ArrayList < > ( admin . getRegions ( selected . getTableName ( ) ) ) ; int numRegions = regionInfos . size ( ) ; int average_rows = 1 ; int numRows = average_rows * numRegions ; LOG . info ( ""Adding "" + numRows + "" rows to table: "" + selected ) ; for ( int i = 0 ; i < numRows ; i ++ ) { byte [ ] rowKey = Bytes . toBytes ( ""row-"" + String . format ( ""%010d"" , RandomUtils . nextInt ( ) ) ) ; ColumnFamilyDescriptor cfd = selectFamily ( selected ) ; if ( cfd == null ) { return ; } byte [ ] family = cfd . getName ( ) ; byte [ ] qualifier = Bytes . toBytes ( ""col-"" + RandomUtils . nextInt ( ) % 10 ) ; byte [ ] value = Bytes . toBytes ( ""val-"" + RandomStringUtils . randomAlphanumeric ( 10 ) ) ; Put put = new Put ( rowKey ) ; put . addColumn ( family , qualifier , value ) ; table . put ( put ) ; } TableDescriptor freshTableDesc = admin . getDescriptor ( tableName ) ; Assert . assertTrue ( ""After insert, Table: "" + tableName + "" in not enabled"" , admin . isTableEnabled ( tableName ) ) ; enabledTables . put ( tableName , freshTableDesc ) ; LOG . info ( ""Added "" + numRows + "" rows to table: "" + selected ) ; } catch ( Exception e ) { LOG . warn ( ""Caught exception in action: "" + this . getClass ( ) ) ; throw e ; } finally { admin . close ( ) ; } } " 549,"private void bindUser ( String dn , char [ ] password ) throws AuthenticationException { Hashtable < String , String > env = new Hashtable < > ( ) ; env . put ( Context . INITIAL_CONTEXT_FACTORY , ""com.sun.jndi.ldap.LdapCtxFactory"" ) ; env . put ( Context . PROVIDER_URL , providerUrl ) ; env . put ( ""com.sun.jndi.ldap.connect.pool"" , ""true"" ) ; env . put ( Context . SECURITY_AUTHENTICATION , ""simple"" ) ; env . put ( Context . SECURITY_PRINCIPAL , dn ) ; env . put ( Context . SECURITY_CREDENTIALS , new String ( password ) ) ; if ( tls ) { env . put ( Context . SECURITY_PROTOCOL , ""ssl"" ) ; } try { DirContext ctx = new InitialDirContext ( env ) ; ctx . close ( ) ; } catch ( javax . naming . AuthenticationException e ) { throw new AuthenticationException ( ""Invalid password"" ) ; } catch ( NamingException e ) { throw new AuthenticationException ( e ) ; } } ","private void bindUser ( String dn , char [ ] password ) throws AuthenticationException { Hashtable < String , String > env = new Hashtable < > ( ) ; env . put ( Context . INITIAL_CONTEXT_FACTORY , ""com.sun.jndi.ldap.LdapCtxFactory"" ) ; env . put ( Context . PROVIDER_URL , providerUrl ) ; env . put ( ""com.sun.jndi.ldap.connect.pool"" , ""true"" ) ; env . put ( Context . SECURITY_AUTHENTICATION , ""simple"" ) ; env . put ( Context . SECURITY_PRINCIPAL , dn ) ; env . put ( Context . SECURITY_CREDENTIALS , new String ( password ) ) ; if ( tls ) { env . put ( Context . SECURITY_PROTOCOL , ""ssl"" ) ; } try { DirContext ctx = new InitialDirContext ( env ) ; ctx . close ( ) ; } catch ( javax . naming . AuthenticationException e ) { log . warn ( ""Bind failed for dn '{}'"" , dn , e ) ; throw new AuthenticationException ( ""Invalid password"" ) ; } catch ( NamingException e ) { throw new AuthenticationException ( e ) ; } } " 550,"private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } ","private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } " 551,"private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } ","private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } " 552,"private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } ","private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } " 553,"private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } ","private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } " 554,"private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } ","private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } " 555,"private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } ","private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } " 556,"private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { return false ; } } } return true ; } ","private Boolean meetsConditions ( Session session , PlanDefinition . PlanDefinitionActionComponent action ) { for ( PlanDefinition . PlanDefinitionActionConditionComponent condition : action . getCondition ( ) ) { if ( condition . hasDescription ( ) ) { logger . info ( ""Resolving condition with description: "" + condition . getDescription ( ) ) ; } if ( condition . getKind ( ) == PlanDefinition . ActionConditionKind . APPLICABILITY ) { if ( ! condition . getLanguage ( ) . equals ( ""text/cql"" ) ) { logger . warn ( ""An action language other than CQL was found: "" + condition . getLanguage ( ) ) ; continue ; } if ( ! condition . hasExpression ( ) ) { logger . error ( ""Missing condition expression"" ) ; throw new RuntimeException ( ""Missing condition expression"" ) ; } logger . info ( ""Evaluating action condition expression "" + condition . getExpression ( ) ) ; String cql = condition . getExpression ( ) ; Object result = executionProvider . evaluateInContext ( session . getPlanDefinition ( ) , cql , session . getPatientId ( ) ) ; if ( result == null ) { logger . warn ( ""Expression Returned null"" ) ; return false ; } if ( ! ( result instanceof Boolean ) ) { logger . warn ( ""The condition returned a non-boolean value: "" + result . getClass ( ) . getSimpleName ( ) ) ; continue ; } if ( ! ( Boolean ) result ) { logger . info ( ""The result of condition expression %s is false"" , condition . getExpression ( ) ) ; return false ; } } } return true ; } " 557,"@ Operation ( name = ""$refresh-generated-content"" , type = Measure . class ) public MethodOutcome refreshGeneratedContent ( HttpServletRequest theRequest , RequestDetails theRequestDetails , @ IdParam IdType theId ) { Measure theResource = this . measureResourceProvider . getDao ( ) . read ( theId ) ; theResource . getRelatedArtifact ( ) . removeIf ( relatedArtifact -> relatedArtifact . getType ( ) . equals ( RelatedArtifact . RelatedArtifactType . DEPENDSON ) ) ; CqfMeasure cqfMeasure = this . dataRequirementsProvider . createCqfMeasure ( theResource , this . libraryResolutionProvider ) ; if ( ! cqfMeasure . getRelatedArtifact ( ) . isEmpty ( ) ) { for ( RelatedArtifact relatedArtifact : cqfMeasure . getRelatedArtifact ( ) ) { boolean artifactExists = false ; for ( RelatedArtifact resourceArtifact : theResource . getRelatedArtifact ( ) ) { if ( resourceArtifact . equalsDeep ( relatedArtifact ) ) { artifactExists = true ; break ; } } if ( ! artifactExists ) { theResource . addRelatedArtifact ( relatedArtifact . copy ( ) ) ; } } } try { Narrative n = this . narrativeProvider . getNarrative ( this . measureResourceProvider . getContext ( ) , cqfMeasure ) ; theResource . setText ( n . copy ( ) ) ; } catch ( Exception e ) { } return this . measureResourceProvider . update ( theRequest , theResource , theId , theRequestDetails . getConditionalUrl ( RestOperationTypeEnum . UPDATE ) , theRequestDetails ) ; } ","@ Operation ( name = ""$refresh-generated-content"" , type = Measure . class ) public MethodOutcome refreshGeneratedContent ( HttpServletRequest theRequest , RequestDetails theRequestDetails , @ IdParam IdType theId ) { Measure theResource = this . measureResourceProvider . getDao ( ) . read ( theId ) ; theResource . getRelatedArtifact ( ) . removeIf ( relatedArtifact -> relatedArtifact . getType ( ) . equals ( RelatedArtifact . RelatedArtifactType . DEPENDSON ) ) ; CqfMeasure cqfMeasure = this . dataRequirementsProvider . createCqfMeasure ( theResource , this . libraryResolutionProvider ) ; if ( ! cqfMeasure . getRelatedArtifact ( ) . isEmpty ( ) ) { for ( RelatedArtifact relatedArtifact : cqfMeasure . getRelatedArtifact ( ) ) { boolean artifactExists = false ; for ( RelatedArtifact resourceArtifact : theResource . getRelatedArtifact ( ) ) { if ( resourceArtifact . equalsDeep ( relatedArtifact ) ) { artifactExists = true ; break ; } } if ( ! artifactExists ) { theResource . addRelatedArtifact ( relatedArtifact . copy ( ) ) ; } } } try { Narrative n = this . narrativeProvider . getNarrative ( this . measureResourceProvider . getContext ( ) , cqfMeasure ) ; theResource . setText ( n . copy ( ) ) ; } catch ( Exception e ) { logger . info ( ""Error generating narrative"" , e ) ; } return this . measureResourceProvider . update ( theRequest , theResource , theId , theRequestDetails . getConditionalUrl ( RestOperationTypeEnum . UPDATE ) , theRequestDetails ) ; } " 558,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 559,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 560,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 561,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 562,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 563,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 564,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 565,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 566,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 567,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 568,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 569,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 570,"@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } ","@ Test public void badInputZipStrFile ( ) throws Exception { File destFile = new File ( destDir , ""badInputStrFile.zip"" ) ; try { try { ZipUtil . zip ( ( String [ ] ) null , destFile , true , 0 ) ; logger . error ( ""Zip should fail when input String array is null"" ) ; Assert . fail ( ""Zip should fail when input String array is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input File array (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , null , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename is null"" ) ; Assert . fail ( ""Zip should fail when any input filename is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , dummieFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , destFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when any input filename does not exist"" ) ; Assert . fail ( ""Zip should fail when any input filename does not exist"" ) ; } catch ( FileNotFoundException e ) { logger . debug ( ""Detecting non-existing input filename (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , ( File ) null , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination File is null"" ) ; Assert . fail ( ""Zip should fail when destination File is null"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting null destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , sampleZip , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when destination file already exists"" ) ; Assert . fail ( ""Zip should fail when destination file already exists"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting existing destination File (String, File): OK"" ) ; } try { ZipUtil . zip ( new String [ ] { srcFile . getCanonicalPath ( ) , nestedSrcFile . getCanonicalPath ( ) } , dummieFile , true , ZipUtil . NO_COMPRESSION ) ; logger . error ( ""Zip should fail when the destination File does not represent a zip file"" ) ; Assert . fail ( ""Zip should fail when the destination File does not represent a zip file"" ) ; } catch ( IllegalArgumentException e ) { logger . debug ( ""Detecting destination File not representing a valid zip file (String, File): OK"" ) ; } } catch ( Exception e ) { logger . error ( ""Another exception was expected, but got {} instead: {}"" , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; Assert . fail ( ""Another exception was expected, but got "" + e . getClass ( ) . getName ( ) + "" instead: "" + e . getMessage ( ) ) ; } } " 571,"public ASTNode readMathML ( String mathML , TreeNodeChangeListener listener ) throws XMLStreamException { if ( logger . isDebugEnabled ( ) ) { } Object object = readXMLFromString ( mathML , listener ) ; if ( object != null && object instanceof Constraint ) { ASTNode math = ( ( Constraint ) object ) . getMath ( ) ; if ( math != null ) { cleanTreeNode ( math ) ; return math ; } } return null ; } ","public ASTNode readMathML ( String mathML , TreeNodeChangeListener listener ) throws XMLStreamException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""SBMLReader.readMathML called"" ) ; } Object object = readXMLFromString ( mathML , listener ) ; if ( object != null && object instanceof Constraint ) { ASTNode math = ( ( Constraint ) object ) . getMath ( ) ; if ( math != null ) { cleanTreeNode ( math ) ; return math ; } } return null ; } " 572,"public void saveProgramAccess ( ProgramAccess pa ) { if ( pa == null ) { throw new IllegalArgumentException ( ) ; } getHibernateTemplate ( ) . saveOrUpdate ( pa ) ; programAccessListByProgramIdCache . remove ( pa . getProgramId ( ) ) ; if ( log . isDebugEnabled ( ) ) { } } ","public void saveProgramAccess ( ProgramAccess pa ) { if ( pa == null ) { throw new IllegalArgumentException ( ) ; } getHibernateTemplate ( ) . saveOrUpdate ( pa ) ; programAccessListByProgramIdCache . remove ( pa . getProgramId ( ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""saveProgramAccess:"" + pa . getId ( ) ) ; } } " 573,"@ OnScheduled public final void createClient ( ProcessContext context ) throws IOException { if ( mongoClient != null ) { closeClient ( ) ; } final SSLContextService sslService = context . getProperty ( SSL_CONTEXT_SERVICE ) . asControllerService ( SSLContextService . class ) ; final String rawClientAuth = context . getProperty ( CLIENT_AUTH ) . getValue ( ) ; final SSLContext sslContext ; if ( sslService != null ) { final SSLContextService . ClientAuth clientAuth ; if ( StringUtils . isBlank ( rawClientAuth ) ) { clientAuth = SSLContextService . ClientAuth . REQUIRED ; } else { try { clientAuth = SSLContextService . ClientAuth . valueOf ( rawClientAuth ) ; } catch ( final IllegalArgumentException iae ) { throw new ProviderCreationException ( String . format ( ""Unrecognized client auth '%s'. Possible values are [%s]"" , rawClientAuth , StringUtils . join ( SslContextFactory . ClientAuth . values ( ) , "", "" ) ) ) ; } } sslContext = sslService . createSSLContext ( clientAuth ) ; } else { sslContext = null ; } try { final String uri = context . getProperty ( URI ) . getValue ( ) ; if ( sslContext == null ) { mongoClient = new MongoClient ( new MongoClientURI ( uri ) ) ; } else { mongoClient = new MongoClient ( new MongoClientURI ( uri , getClientOptions ( sslContext ) ) ) ; } } catch ( Exception e ) { getLogger ( ) . error ( ""Failed to schedule {} due to {}"" , new Object [ ] { this . getClass ( ) . getName ( ) , e } , e ) ; throw e ; } } ","@ OnScheduled public final void createClient ( ProcessContext context ) throws IOException { if ( mongoClient != null ) { closeClient ( ) ; } getLogger ( ) . info ( ""Creating MongoClient"" ) ; final SSLContextService sslService = context . getProperty ( SSL_CONTEXT_SERVICE ) . asControllerService ( SSLContextService . class ) ; final String rawClientAuth = context . getProperty ( CLIENT_AUTH ) . getValue ( ) ; final SSLContext sslContext ; if ( sslService != null ) { final SSLContextService . ClientAuth clientAuth ; if ( StringUtils . isBlank ( rawClientAuth ) ) { clientAuth = SSLContextService . ClientAuth . REQUIRED ; } else { try { clientAuth = SSLContextService . ClientAuth . valueOf ( rawClientAuth ) ; } catch ( final IllegalArgumentException iae ) { throw new ProviderCreationException ( String . format ( ""Unrecognized client auth '%s'. Possible values are [%s]"" , rawClientAuth , StringUtils . join ( SslContextFactory . ClientAuth . values ( ) , "", "" ) ) ) ; } } sslContext = sslService . createSSLContext ( clientAuth ) ; } else { sslContext = null ; } try { final String uri = context . getProperty ( URI ) . getValue ( ) ; if ( sslContext == null ) { mongoClient = new MongoClient ( new MongoClientURI ( uri ) ) ; } else { mongoClient = new MongoClient ( new MongoClientURI ( uri , getClientOptions ( sslContext ) ) ) ; } } catch ( Exception e ) { getLogger ( ) . error ( ""Failed to schedule {} due to {}"" , new Object [ ] { this . getClass ( ) . getName ( ) , e } , e ) ; throw e ; } } " 574,"@ OnScheduled public final void createClient ( ProcessContext context ) throws IOException { if ( mongoClient != null ) { closeClient ( ) ; } getLogger ( ) . info ( ""Creating MongoClient"" ) ; final SSLContextService sslService = context . getProperty ( SSL_CONTEXT_SERVICE ) . asControllerService ( SSLContextService . class ) ; final String rawClientAuth = context . getProperty ( CLIENT_AUTH ) . getValue ( ) ; final SSLContext sslContext ; if ( sslService != null ) { final SSLContextService . ClientAuth clientAuth ; if ( StringUtils . isBlank ( rawClientAuth ) ) { clientAuth = SSLContextService . ClientAuth . REQUIRED ; } else { try { clientAuth = SSLContextService . ClientAuth . valueOf ( rawClientAuth ) ; } catch ( final IllegalArgumentException iae ) { throw new ProviderCreationException ( String . format ( ""Unrecognized client auth '%s'. Possible values are [%s]"" , rawClientAuth , StringUtils . join ( SslContextFactory . ClientAuth . values ( ) , "", "" ) ) ) ; } } sslContext = sslService . createSSLContext ( clientAuth ) ; } else { sslContext = null ; } try { final String uri = context . getProperty ( URI ) . getValue ( ) ; if ( sslContext == null ) { mongoClient = new MongoClient ( new MongoClientURI ( uri ) ) ; } else { mongoClient = new MongoClient ( new MongoClientURI ( uri , getClientOptions ( sslContext ) ) ) ; } } catch ( Exception e ) { throw e ; } } ","@ OnScheduled public final void createClient ( ProcessContext context ) throws IOException { if ( mongoClient != null ) { closeClient ( ) ; } getLogger ( ) . info ( ""Creating MongoClient"" ) ; final SSLContextService sslService = context . getProperty ( SSL_CONTEXT_SERVICE ) . asControllerService ( SSLContextService . class ) ; final String rawClientAuth = context . getProperty ( CLIENT_AUTH ) . getValue ( ) ; final SSLContext sslContext ; if ( sslService != null ) { final SSLContextService . ClientAuth clientAuth ; if ( StringUtils . isBlank ( rawClientAuth ) ) { clientAuth = SSLContextService . ClientAuth . REQUIRED ; } else { try { clientAuth = SSLContextService . ClientAuth . valueOf ( rawClientAuth ) ; } catch ( final IllegalArgumentException iae ) { throw new ProviderCreationException ( String . format ( ""Unrecognized client auth '%s'. Possible values are [%s]"" , rawClientAuth , StringUtils . join ( SslContextFactory . ClientAuth . values ( ) , "", "" ) ) ) ; } } sslContext = sslService . createSSLContext ( clientAuth ) ; } else { sslContext = null ; } try { final String uri = context . getProperty ( URI ) . getValue ( ) ; if ( sslContext == null ) { mongoClient = new MongoClient ( new MongoClientURI ( uri ) ) ; } else { mongoClient = new MongoClient ( new MongoClientURI ( uri , getClientOptions ( sslContext ) ) ) ; } } catch ( Exception e ) { getLogger ( ) . error ( ""Failed to schedule {} due to {}"" , new Object [ ] { this . getClass ( ) . getName ( ) , e } , e ) ; throw e ; } } " 575,"public void setMaxTuples ( int maxNumbers ) { this . maxTuples = maxNumbers ; } ","public void setMaxTuples ( int maxNumbers ) { LOG . debug ( ""setting max tuples to {}"" , maxNumbers ) ; this . maxTuples = maxNumbers ; } " 576,"public void run ( ) { int retries = 0 ; while ( retries ++ < 20 && totalCount != expect ) { try { QueueBrowser browser = createBrowser ( broker , dest ) ; int count = browseMessages ( browser , broker ) ; if ( consume ) { if ( count != 0 ) { MessageConsumer consumer = createSyncConsumer ( broker , dest ) ; totalCount += count ; for ( int i = 0 ; i < count ; i ++ ) { ActiveMQTextMessage message = ( ActiveMQTextMessage ) consumer . receive ( 1000 ) ; if ( message == null ) break ; } } } else { totalCount = count ; } LOG . info ( ""browser '"" + broker + ""' browsed "" + totalCount ) ; Thread . sleep ( 1000 ) ; } catch ( Exception e ) { LOG . info ( ""Exception browsing "" + e , e ) ; } finally { try { if ( browser != null ) { browser . close ( ) ; } if ( consumer != null ) { consumer . close ( ) ; } } catch ( Exception e ) { LOG . info ( ""Exception closing browser "" + e , e ) ; } } } } ","public void run ( ) { int retries = 0 ; while ( retries ++ < 20 && totalCount != expect ) { try { QueueBrowser browser = createBrowser ( broker , dest ) ; int count = browseMessages ( browser , broker ) ; if ( consume ) { if ( count != 0 ) { MessageConsumer consumer = createSyncConsumer ( broker , dest ) ; totalCount += count ; for ( int i = 0 ; i < count ; i ++ ) { ActiveMQTextMessage message = ( ActiveMQTextMessage ) consumer . receive ( 1000 ) ; if ( message == null ) break ; LOG . info ( broker + "" consumer: "" + message . getText ( ) + "" "" + message . getDestination ( ) + "" "" + message . getMessageId ( ) + "" "" + Arrays . toString ( message . getBrokerPath ( ) ) ) ; } } } else { totalCount = count ; } LOG . info ( ""browser '"" + broker + ""' browsed "" + totalCount ) ; Thread . sleep ( 1000 ) ; } catch ( Exception e ) { LOG . info ( ""Exception browsing "" + e , e ) ; } finally { try { if ( browser != null ) { browser . close ( ) ; } if ( consumer != null ) { consumer . close ( ) ; } } catch ( Exception e ) { LOG . info ( ""Exception closing browser "" + e , e ) ; } } } } " 577,"public void run ( ) { int retries = 0 ; while ( retries ++ < 20 && totalCount != expect ) { try { QueueBrowser browser = createBrowser ( broker , dest ) ; int count = browseMessages ( browser , broker ) ; if ( consume ) { if ( count != 0 ) { MessageConsumer consumer = createSyncConsumer ( broker , dest ) ; totalCount += count ; for ( int i = 0 ; i < count ; i ++ ) { ActiveMQTextMessage message = ( ActiveMQTextMessage ) consumer . receive ( 1000 ) ; if ( message == null ) break ; LOG . info ( broker + "" consumer: "" + message . getText ( ) + "" "" + message . getDestination ( ) + "" "" + message . getMessageId ( ) + "" "" + Arrays . toString ( message . getBrokerPath ( ) ) ) ; } } } else { totalCount = count ; } Thread . sleep ( 1000 ) ; } catch ( Exception e ) { LOG . info ( ""Exception browsing "" + e , e ) ; } finally { try { if ( browser != null ) { browser . close ( ) ; } if ( consumer != null ) { consumer . close ( ) ; } } catch ( Exception e ) { LOG . info ( ""Exception closing browser "" + e , e ) ; } } } } ","public void run ( ) { int retries = 0 ; while ( retries ++ < 20 && totalCount != expect ) { try { QueueBrowser browser = createBrowser ( broker , dest ) ; int count = browseMessages ( browser , broker ) ; if ( consume ) { if ( count != 0 ) { MessageConsumer consumer = createSyncConsumer ( broker , dest ) ; totalCount += count ; for ( int i = 0 ; i < count ; i ++ ) { ActiveMQTextMessage message = ( ActiveMQTextMessage ) consumer . receive ( 1000 ) ; if ( message == null ) break ; LOG . info ( broker + "" consumer: "" + message . getText ( ) + "" "" + message . getDestination ( ) + "" "" + message . getMessageId ( ) + "" "" + Arrays . toString ( message . getBrokerPath ( ) ) ) ; } } } else { totalCount = count ; } LOG . info ( ""browser '"" + broker + ""' browsed "" + totalCount ) ; Thread . sleep ( 1000 ) ; } catch ( Exception e ) { LOG . info ( ""Exception browsing "" + e , e ) ; } finally { try { if ( browser != null ) { browser . close ( ) ; } if ( consumer != null ) { consumer . close ( ) ; } } catch ( Exception e ) { LOG . info ( ""Exception closing browser "" + e , e ) ; } } } } " 578,"public void run ( ) { int retries = 0 ; while ( retries ++ < 20 && totalCount != expect ) { try { QueueBrowser browser = createBrowser ( broker , dest ) ; int count = browseMessages ( browser , broker ) ; if ( consume ) { if ( count != 0 ) { MessageConsumer consumer = createSyncConsumer ( broker , dest ) ; totalCount += count ; for ( int i = 0 ; i < count ; i ++ ) { ActiveMQTextMessage message = ( ActiveMQTextMessage ) consumer . receive ( 1000 ) ; if ( message == null ) break ; LOG . info ( broker + "" consumer: "" + message . getText ( ) + "" "" + message . getDestination ( ) + "" "" + message . getMessageId ( ) + "" "" + Arrays . toString ( message . getBrokerPath ( ) ) ) ; } } } else { totalCount = count ; } LOG . info ( ""browser '"" + broker + ""' browsed "" + totalCount ) ; Thread . sleep ( 1000 ) ; } catch ( Exception e ) { } finally { try { if ( browser != null ) { browser . close ( ) ; } if ( consumer != null ) { consumer . close ( ) ; } } catch ( Exception e ) { LOG . info ( ""Exception closing browser "" + e , e ) ; } } } } ","public void run ( ) { int retries = 0 ; while ( retries ++ < 20 && totalCount != expect ) { try { QueueBrowser browser = createBrowser ( broker , dest ) ; int count = browseMessages ( browser , broker ) ; if ( consume ) { if ( count != 0 ) { MessageConsumer consumer = createSyncConsumer ( broker , dest ) ; totalCount += count ; for ( int i = 0 ; i < count ; i ++ ) { ActiveMQTextMessage message = ( ActiveMQTextMessage ) consumer . receive ( 1000 ) ; if ( message == null ) break ; LOG . info ( broker + "" consumer: "" + message . getText ( ) + "" "" + message . getDestination ( ) + "" "" + message . getMessageId ( ) + "" "" + Arrays . toString ( message . getBrokerPath ( ) ) ) ; } } } else { totalCount = count ; } LOG . info ( ""browser '"" + broker + ""' browsed "" + totalCount ) ; Thread . sleep ( 1000 ) ; } catch ( Exception e ) { LOG . info ( ""Exception browsing "" + e , e ) ; } finally { try { if ( browser != null ) { browser . close ( ) ; } if ( consumer != null ) { consumer . close ( ) ; } } catch ( Exception e ) { LOG . info ( ""Exception closing browser "" + e , e ) ; } } } } " 579,"public void run ( ) { int retries = 0 ; while ( retries ++ < 20 && totalCount != expect ) { try { QueueBrowser browser = createBrowser ( broker , dest ) ; int count = browseMessages ( browser , broker ) ; if ( consume ) { if ( count != 0 ) { MessageConsumer consumer = createSyncConsumer ( broker , dest ) ; totalCount += count ; for ( int i = 0 ; i < count ; i ++ ) { ActiveMQTextMessage message = ( ActiveMQTextMessage ) consumer . receive ( 1000 ) ; if ( message == null ) break ; LOG . info ( broker + "" consumer: "" + message . getText ( ) + "" "" + message . getDestination ( ) + "" "" + message . getMessageId ( ) + "" "" + Arrays . toString ( message . getBrokerPath ( ) ) ) ; } } } else { totalCount = count ; } LOG . info ( ""browser '"" + broker + ""' browsed "" + totalCount ) ; Thread . sleep ( 1000 ) ; } catch ( Exception e ) { LOG . info ( ""Exception browsing "" + e , e ) ; } finally { try { if ( browser != null ) { browser . close ( ) ; } if ( consumer != null ) { consumer . close ( ) ; } } catch ( Exception e ) { } } } } ","public void run ( ) { int retries = 0 ; while ( retries ++ < 20 && totalCount != expect ) { try { QueueBrowser browser = createBrowser ( broker , dest ) ; int count = browseMessages ( browser , broker ) ; if ( consume ) { if ( count != 0 ) { MessageConsumer consumer = createSyncConsumer ( broker , dest ) ; totalCount += count ; for ( int i = 0 ; i < count ; i ++ ) { ActiveMQTextMessage message = ( ActiveMQTextMessage ) consumer . receive ( 1000 ) ; if ( message == null ) break ; LOG . info ( broker + "" consumer: "" + message . getText ( ) + "" "" + message . getDestination ( ) + "" "" + message . getMessageId ( ) + "" "" + Arrays . toString ( message . getBrokerPath ( ) ) ) ; } } } else { totalCount = count ; } LOG . info ( ""browser '"" + broker + ""' browsed "" + totalCount ) ; Thread . sleep ( 1000 ) ; } catch ( Exception e ) { LOG . info ( ""Exception browsing "" + e , e ) ; } finally { try { if ( browser != null ) { browser . close ( ) ; } if ( consumer != null ) { consumer . close ( ) ; } } catch ( Exception e ) { LOG . info ( ""Exception closing browser "" + e , e ) ; } } } } " 580,"public void validateDialog ( Object model , ValidationErrors errors ) throws SignalMLException { super . validateDialog ( model , errors ) ; getChooseTagPanel ( ) . validatePanel ( errors ) ; if ( ! errors . hasErrors ( ) ) { TagBasedAtomFilter filter = new TagBasedAtomFilter ( ) ; fillFilterFromDialog ( filter ) ; try { filter . initialize ( ) ; } catch ( Throwable t ) { errors . addError ( _ ( ""Failed to initialize filter. See log file for details."" ) ) ; } } } ","public void validateDialog ( Object model , ValidationErrors errors ) throws SignalMLException { super . validateDialog ( model , errors ) ; getChooseTagPanel ( ) . validatePanel ( errors ) ; if ( ! errors . hasErrors ( ) ) { TagBasedAtomFilter filter = new TagBasedAtomFilter ( ) ; fillFilterFromDialog ( filter ) ; try { filter . initialize ( ) ; } catch ( Throwable t ) { logger . error ( ""Filter failed to initialize"" , t ) ; errors . addError ( _ ( ""Failed to initialize filter. See log file for details."" ) ) ; } } } " 581,"protected void postCommit ( Xid arg0 ) { } ","protected void postCommit ( Xid arg0 ) { logger . info ( ""In postCommit with: ["" + arg0 + ""]"" ) ; } " 582,"protected void doProcessAction ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception { long newFolderId = ParamUtil . getLong ( actionRequest , ""newFolderId"" ) ; long [ ] folderIds = ParamUtil . getLongValues ( actionRequest , ""rowIdsJournalFolder"" ) ; ServiceContext serviceContext = ServiceContextFactory . getInstance ( JournalArticle . class . getName ( ) , actionRequest ) ; for ( long folderId : folderIds ) { _journalFolderService . moveFolder ( folderId , newFolderId , serviceContext ) ; } List < String > invalidArticleIds = new ArrayList < > ( ) ; ThemeDisplay themeDisplay = ( ThemeDisplay ) actionRequest . getAttribute ( WebKeys . THEME_DISPLAY ) ; String [ ] articleIds = ParamUtil . getStringValues ( actionRequest , ""rowIdsJournalArticle"" ) ; for ( String articleId : articleIds ) { try { _journalArticleService . moveArticle ( themeDisplay . getScopeGroupId ( ) , HtmlUtil . unescape ( articleId ) , newFolderId , serviceContext ) ; } catch ( InvalidDDMStructureException invalidDDMStructureException ) { if ( _log . isWarnEnabled ( ) ) { } invalidArticleIds . add ( articleId ) ; } } if ( ! invalidArticleIds . isEmpty ( ) ) { StringBundler sb = new StringBundler ( 4 ) ; sb . append ( ""Folder "" ) ; sb . append ( newFolderId ) ; sb . append ( "" does not allow the structures for articles: "" ) ; sb . append ( StringUtil . merge ( invalidArticleIds ) ) ; throw new InvalidDDMStructureException ( sb . toString ( ) ) ; } } ","protected void doProcessAction ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception { long newFolderId = ParamUtil . getLong ( actionRequest , ""newFolderId"" ) ; long [ ] folderIds = ParamUtil . getLongValues ( actionRequest , ""rowIdsJournalFolder"" ) ; ServiceContext serviceContext = ServiceContextFactory . getInstance ( JournalArticle . class . getName ( ) , actionRequest ) ; for ( long folderId : folderIds ) { _journalFolderService . moveFolder ( folderId , newFolderId , serviceContext ) ; } List < String > invalidArticleIds = new ArrayList < > ( ) ; ThemeDisplay themeDisplay = ( ThemeDisplay ) actionRequest . getAttribute ( WebKeys . THEME_DISPLAY ) ; String [ ] articleIds = ParamUtil . getStringValues ( actionRequest , ""rowIdsJournalArticle"" ) ; for ( String articleId : articleIds ) { try { _journalArticleService . moveArticle ( themeDisplay . getScopeGroupId ( ) , HtmlUtil . unescape ( articleId ) , newFolderId , serviceContext ) ; } catch ( InvalidDDMStructureException invalidDDMStructureException ) { if ( _log . isWarnEnabled ( ) ) { _log . warn ( invalidDDMStructureException . getMessage ( ) ) ; } invalidArticleIds . add ( articleId ) ; } } if ( ! invalidArticleIds . isEmpty ( ) ) { StringBundler sb = new StringBundler ( 4 ) ; sb . append ( ""Folder "" ) ; sb . append ( newFolderId ) ; sb . append ( "" does not allow the structures for articles: "" ) ; sb . append ( StringUtil . merge ( invalidArticleIds ) ) ; throw new InvalidDDMStructureException ( sb . toString ( ) ) ; } } " 583,"public IRODSRuleExecResult executeRuleFromParts ( final String ruleBody , final List < String > inputParameters , final List < String > outputParameters ) throws JargonException { if ( ruleBody == null || ruleBody . isEmpty ( ) ) { throw new IllegalArgumentException ( ""null or empty ruleBody"" ) ; } if ( inputParameters == null ) { throw new IllegalArgumentException ( ""null inputParameters"" ) ; } if ( outputParameters == null ) { throw new IllegalArgumentException ( ""null outputParameters"" ) ; } log . info ( ""inputParameters:{}"" , inputParameters ) ; log . info ( ""outputParameters:{}"" , outputParameters ) ; String ruleAsString = buildRuleStringFromParts ( ruleBody , inputParameters , outputParameters ) ; RuleProcessingAO ruleProcessingAO = irodsAccessObjectFactory . getRuleProcessingAO ( getIrodsAccount ( ) ) ; RuleInvocationConfiguration ruleInvocationConfiguration = RuleInvocationConfiguration . instanceWithDefaultAutoSettings ( irodsAccessObjectFactory . getJargonProperties ( ) ) ; log . info ( ""getting ready to submit rule:{}"" , ruleAsString ) ; return ruleProcessingAO . executeRule ( ruleAsString , null , ruleInvocationConfiguration ) ; } ","public IRODSRuleExecResult executeRuleFromParts ( final String ruleBody , final List < String > inputParameters , final List < String > outputParameters ) throws JargonException { if ( ruleBody == null || ruleBody . isEmpty ( ) ) { throw new IllegalArgumentException ( ""null or empty ruleBody"" ) ; } if ( inputParameters == null ) { throw new IllegalArgumentException ( ""null inputParameters"" ) ; } if ( outputParameters == null ) { throw new IllegalArgumentException ( ""null outputParameters"" ) ; } log . info ( ""ruleBody:{}"" , ruleBody ) ; log . info ( ""inputParameters:{}"" , inputParameters ) ; log . info ( ""outputParameters:{}"" , outputParameters ) ; String ruleAsString = buildRuleStringFromParts ( ruleBody , inputParameters , outputParameters ) ; RuleProcessingAO ruleProcessingAO = irodsAccessObjectFactory . getRuleProcessingAO ( getIrodsAccount ( ) ) ; RuleInvocationConfiguration ruleInvocationConfiguration = RuleInvocationConfiguration . instanceWithDefaultAutoSettings ( irodsAccessObjectFactory . getJargonProperties ( ) ) ; log . info ( ""getting ready to submit rule:{}"" , ruleAsString ) ; return ruleProcessingAO . executeRule ( ruleAsString , null , ruleInvocationConfiguration ) ; } " 584,"public IRODSRuleExecResult executeRuleFromParts ( final String ruleBody , final List < String > inputParameters , final List < String > outputParameters ) throws JargonException { if ( ruleBody == null || ruleBody . isEmpty ( ) ) { throw new IllegalArgumentException ( ""null or empty ruleBody"" ) ; } if ( inputParameters == null ) { throw new IllegalArgumentException ( ""null inputParameters"" ) ; } if ( outputParameters == null ) { throw new IllegalArgumentException ( ""null outputParameters"" ) ; } log . info ( ""ruleBody:{}"" , ruleBody ) ; log . info ( ""outputParameters:{}"" , outputParameters ) ; String ruleAsString = buildRuleStringFromParts ( ruleBody , inputParameters , outputParameters ) ; RuleProcessingAO ruleProcessingAO = irodsAccessObjectFactory . getRuleProcessingAO ( getIrodsAccount ( ) ) ; RuleInvocationConfiguration ruleInvocationConfiguration = RuleInvocationConfiguration . instanceWithDefaultAutoSettings ( irodsAccessObjectFactory . getJargonProperties ( ) ) ; log . info ( ""getting ready to submit rule:{}"" , ruleAsString ) ; return ruleProcessingAO . executeRule ( ruleAsString , null , ruleInvocationConfiguration ) ; } ","public IRODSRuleExecResult executeRuleFromParts ( final String ruleBody , final List < String > inputParameters , final List < String > outputParameters ) throws JargonException { if ( ruleBody == null || ruleBody . isEmpty ( ) ) { throw new IllegalArgumentException ( ""null or empty ruleBody"" ) ; } if ( inputParameters == null ) { throw new IllegalArgumentException ( ""null inputParameters"" ) ; } if ( outputParameters == null ) { throw new IllegalArgumentException ( ""null outputParameters"" ) ; } log . info ( ""ruleBody:{}"" , ruleBody ) ; log . info ( ""inputParameters:{}"" , inputParameters ) ; log . info ( ""outputParameters:{}"" , outputParameters ) ; String ruleAsString = buildRuleStringFromParts ( ruleBody , inputParameters , outputParameters ) ; RuleProcessingAO ruleProcessingAO = irodsAccessObjectFactory . getRuleProcessingAO ( getIrodsAccount ( ) ) ; RuleInvocationConfiguration ruleInvocationConfiguration = RuleInvocationConfiguration . instanceWithDefaultAutoSettings ( irodsAccessObjectFactory . getJargonProperties ( ) ) ; log . info ( ""getting ready to submit rule:{}"" , ruleAsString ) ; return ruleProcessingAO . executeRule ( ruleAsString , null , ruleInvocationConfiguration ) ; } " 585,"public IRODSRuleExecResult executeRuleFromParts ( final String ruleBody , final List < String > inputParameters , final List < String > outputParameters ) throws JargonException { if ( ruleBody == null || ruleBody . isEmpty ( ) ) { throw new IllegalArgumentException ( ""null or empty ruleBody"" ) ; } if ( inputParameters == null ) { throw new IllegalArgumentException ( ""null inputParameters"" ) ; } if ( outputParameters == null ) { throw new IllegalArgumentException ( ""null outputParameters"" ) ; } log . info ( ""ruleBody:{}"" , ruleBody ) ; log . info ( ""inputParameters:{}"" , inputParameters ) ; String ruleAsString = buildRuleStringFromParts ( ruleBody , inputParameters , outputParameters ) ; RuleProcessingAO ruleProcessingAO = irodsAccessObjectFactory . getRuleProcessingAO ( getIrodsAccount ( ) ) ; RuleInvocationConfiguration ruleInvocationConfiguration = RuleInvocationConfiguration . instanceWithDefaultAutoSettings ( irodsAccessObjectFactory . getJargonProperties ( ) ) ; log . info ( ""getting ready to submit rule:{}"" , ruleAsString ) ; return ruleProcessingAO . executeRule ( ruleAsString , null , ruleInvocationConfiguration ) ; } ","public IRODSRuleExecResult executeRuleFromParts ( final String ruleBody , final List < String > inputParameters , final List < String > outputParameters ) throws JargonException { if ( ruleBody == null || ruleBody . isEmpty ( ) ) { throw new IllegalArgumentException ( ""null or empty ruleBody"" ) ; } if ( inputParameters == null ) { throw new IllegalArgumentException ( ""null inputParameters"" ) ; } if ( outputParameters == null ) { throw new IllegalArgumentException ( ""null outputParameters"" ) ; } log . info ( ""ruleBody:{}"" , ruleBody ) ; log . info ( ""inputParameters:{}"" , inputParameters ) ; log . info ( ""outputParameters:{}"" , outputParameters ) ; String ruleAsString = buildRuleStringFromParts ( ruleBody , inputParameters , outputParameters ) ; RuleProcessingAO ruleProcessingAO = irodsAccessObjectFactory . getRuleProcessingAO ( getIrodsAccount ( ) ) ; RuleInvocationConfiguration ruleInvocationConfiguration = RuleInvocationConfiguration . instanceWithDefaultAutoSettings ( irodsAccessObjectFactory . getJargonProperties ( ) ) ; log . info ( ""getting ready to submit rule:{}"" , ruleAsString ) ; return ruleProcessingAO . executeRule ( ruleAsString , null , ruleInvocationConfiguration ) ; } " 586,"public IRODSRuleExecResult executeRuleFromParts ( final String ruleBody , final List < String > inputParameters , final List < String > outputParameters ) throws JargonException { if ( ruleBody == null || ruleBody . isEmpty ( ) ) { throw new IllegalArgumentException ( ""null or empty ruleBody"" ) ; } if ( inputParameters == null ) { throw new IllegalArgumentException ( ""null inputParameters"" ) ; } if ( outputParameters == null ) { throw new IllegalArgumentException ( ""null outputParameters"" ) ; } log . info ( ""ruleBody:{}"" , ruleBody ) ; log . info ( ""inputParameters:{}"" , inputParameters ) ; log . info ( ""outputParameters:{}"" , outputParameters ) ; String ruleAsString = buildRuleStringFromParts ( ruleBody , inputParameters , outputParameters ) ; RuleProcessingAO ruleProcessingAO = irodsAccessObjectFactory . getRuleProcessingAO ( getIrodsAccount ( ) ) ; RuleInvocationConfiguration ruleInvocationConfiguration = RuleInvocationConfiguration . instanceWithDefaultAutoSettings ( irodsAccessObjectFactory . getJargonProperties ( ) ) ; return ruleProcessingAO . executeRule ( ruleAsString , null , ruleInvocationConfiguration ) ; } ","public IRODSRuleExecResult executeRuleFromParts ( final String ruleBody , final List < String > inputParameters , final List < String > outputParameters ) throws JargonException { if ( ruleBody == null || ruleBody . isEmpty ( ) ) { throw new IllegalArgumentException ( ""null or empty ruleBody"" ) ; } if ( inputParameters == null ) { throw new IllegalArgumentException ( ""null inputParameters"" ) ; } if ( outputParameters == null ) { throw new IllegalArgumentException ( ""null outputParameters"" ) ; } log . info ( ""ruleBody:{}"" , ruleBody ) ; log . info ( ""inputParameters:{}"" , inputParameters ) ; log . info ( ""outputParameters:{}"" , outputParameters ) ; String ruleAsString = buildRuleStringFromParts ( ruleBody , inputParameters , outputParameters ) ; RuleProcessingAO ruleProcessingAO = irodsAccessObjectFactory . getRuleProcessingAO ( getIrodsAccount ( ) ) ; RuleInvocationConfiguration ruleInvocationConfiguration = RuleInvocationConfiguration . instanceWithDefaultAutoSettings ( irodsAccessObjectFactory . getJargonProperties ( ) ) ; log . info ( ""getting ready to submit rule:{}"" , ruleAsString ) ; return ruleProcessingAO . executeRule ( ruleAsString , null , ruleInvocationConfiguration ) ; } " 587,"public void process ( final Exchange exchange ) throws Exception { Snmp snmp = null ; TransportMapping < ? extends Address > transport = null ; try { if ( ""tcp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultTcpTransportMapping ( ) ; } else if ( ""udp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultUdpTransportMapping ( ) ; } else { throw new IllegalArgumentException ( ""Unknown protocol: "" + this . endpoint . getProtocol ( ) ) ; } snmp = new Snmp ( transport ) ; LOG . debug ( ""Snmp: i am sending"" ) ; snmp . listen ( ) ; if ( this . actionType == SnmpActionType . GET_NEXT ) { List < SnmpMessage > smLst = new ArrayList < > ( ) ; for ( OID oid : this . endpoint . getOids ( ) ) { this . pdu . clear ( ) ; this . pdu . add ( new VariableBinding ( oid ) ) ; boolean matched = true ; while ( matched ) { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; if ( responseEvent == null || responseEvent . getResponse ( ) == null ) { break ; } PDU response = responseEvent . getResponse ( ) ; String nextOid = null ; Vector < ? extends VariableBinding > variableBindings = response . getVariableBindings ( ) ; for ( int i = 0 ; i < variableBindings . size ( ) ; i ++ ) { VariableBinding variableBinding = variableBindings . elementAt ( i ) ; nextOid = variableBinding . getOid ( ) . toDottedString ( ) ; if ( ! nextOid . startsWith ( oid . toDottedString ( ) ) ) { matched = false ; break ; } } if ( ! matched ) { break ; } this . pdu . clear ( ) ; pdu . add ( new VariableBinding ( new OID ( nextOid ) ) ) ; smLst . add ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , response ) ) ; } } exchange . getIn ( ) . setBody ( smLst ) ; } else { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; LOG . debug ( ""Snmp: sended"" ) ; if ( responseEvent . getResponse ( ) != null ) { exchange . getIn ( ) . setBody ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , responseEvent . getResponse ( ) ) ) ; } else { throw new TimeoutException ( ""SNMP Producer Timeout"" ) ; } } } finally { try { transport . close ( ) ; } catch ( Exception e ) { } try { snmp . close ( ) ; } catch ( Exception e ) { } } } ","public void process ( final Exchange exchange ) throws Exception { Snmp snmp = null ; TransportMapping < ? extends Address > transport = null ; try { LOG . debug ( ""Starting SNMP producer on {}"" , this . endpoint . getAddress ( ) ) ; if ( ""tcp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultTcpTransportMapping ( ) ; } else if ( ""udp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultUdpTransportMapping ( ) ; } else { throw new IllegalArgumentException ( ""Unknown protocol: "" + this . endpoint . getProtocol ( ) ) ; } snmp = new Snmp ( transport ) ; LOG . debug ( ""Snmp: i am sending"" ) ; snmp . listen ( ) ; if ( this . actionType == SnmpActionType . GET_NEXT ) { List < SnmpMessage > smLst = new ArrayList < > ( ) ; for ( OID oid : this . endpoint . getOids ( ) ) { this . pdu . clear ( ) ; this . pdu . add ( new VariableBinding ( oid ) ) ; boolean matched = true ; while ( matched ) { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; if ( responseEvent == null || responseEvent . getResponse ( ) == null ) { break ; } PDU response = responseEvent . getResponse ( ) ; String nextOid = null ; Vector < ? extends VariableBinding > variableBindings = response . getVariableBindings ( ) ; for ( int i = 0 ; i < variableBindings . size ( ) ; i ++ ) { VariableBinding variableBinding = variableBindings . elementAt ( i ) ; nextOid = variableBinding . getOid ( ) . toDottedString ( ) ; if ( ! nextOid . startsWith ( oid . toDottedString ( ) ) ) { matched = false ; break ; } } if ( ! matched ) { break ; } this . pdu . clear ( ) ; pdu . add ( new VariableBinding ( new OID ( nextOid ) ) ) ; smLst . add ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , response ) ) ; } } exchange . getIn ( ) . setBody ( smLst ) ; } else { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; LOG . debug ( ""Snmp: sended"" ) ; if ( responseEvent . getResponse ( ) != null ) { exchange . getIn ( ) . setBody ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , responseEvent . getResponse ( ) ) ) ; } else { throw new TimeoutException ( ""SNMP Producer Timeout"" ) ; } } } finally { try { transport . close ( ) ; } catch ( Exception e ) { } try { snmp . close ( ) ; } catch ( Exception e ) { } } } " 588,"public void process ( final Exchange exchange ) throws Exception { Snmp snmp = null ; TransportMapping < ? extends Address > transport = null ; try { LOG . debug ( ""Starting SNMP producer on {}"" , this . endpoint . getAddress ( ) ) ; if ( ""tcp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultTcpTransportMapping ( ) ; } else if ( ""udp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultUdpTransportMapping ( ) ; } else { throw new IllegalArgumentException ( ""Unknown protocol: "" + this . endpoint . getProtocol ( ) ) ; } snmp = new Snmp ( transport ) ; snmp . listen ( ) ; if ( this . actionType == SnmpActionType . GET_NEXT ) { List < SnmpMessage > smLst = new ArrayList < > ( ) ; for ( OID oid : this . endpoint . getOids ( ) ) { this . pdu . clear ( ) ; this . pdu . add ( new VariableBinding ( oid ) ) ; boolean matched = true ; while ( matched ) { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; if ( responseEvent == null || responseEvent . getResponse ( ) == null ) { break ; } PDU response = responseEvent . getResponse ( ) ; String nextOid = null ; Vector < ? extends VariableBinding > variableBindings = response . getVariableBindings ( ) ; for ( int i = 0 ; i < variableBindings . size ( ) ; i ++ ) { VariableBinding variableBinding = variableBindings . elementAt ( i ) ; nextOid = variableBinding . getOid ( ) . toDottedString ( ) ; if ( ! nextOid . startsWith ( oid . toDottedString ( ) ) ) { matched = false ; break ; } } if ( ! matched ) { break ; } this . pdu . clear ( ) ; pdu . add ( new VariableBinding ( new OID ( nextOid ) ) ) ; smLst . add ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , response ) ) ; } } exchange . getIn ( ) . setBody ( smLst ) ; } else { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; LOG . debug ( ""Snmp: sended"" ) ; if ( responseEvent . getResponse ( ) != null ) { exchange . getIn ( ) . setBody ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , responseEvent . getResponse ( ) ) ) ; } else { throw new TimeoutException ( ""SNMP Producer Timeout"" ) ; } } } finally { try { transport . close ( ) ; } catch ( Exception e ) { } try { snmp . close ( ) ; } catch ( Exception e ) { } } } ","public void process ( final Exchange exchange ) throws Exception { Snmp snmp = null ; TransportMapping < ? extends Address > transport = null ; try { LOG . debug ( ""Starting SNMP producer on {}"" , this . endpoint . getAddress ( ) ) ; if ( ""tcp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultTcpTransportMapping ( ) ; } else if ( ""udp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultUdpTransportMapping ( ) ; } else { throw new IllegalArgumentException ( ""Unknown protocol: "" + this . endpoint . getProtocol ( ) ) ; } snmp = new Snmp ( transport ) ; LOG . debug ( ""Snmp: i am sending"" ) ; snmp . listen ( ) ; if ( this . actionType == SnmpActionType . GET_NEXT ) { List < SnmpMessage > smLst = new ArrayList < > ( ) ; for ( OID oid : this . endpoint . getOids ( ) ) { this . pdu . clear ( ) ; this . pdu . add ( new VariableBinding ( oid ) ) ; boolean matched = true ; while ( matched ) { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; if ( responseEvent == null || responseEvent . getResponse ( ) == null ) { break ; } PDU response = responseEvent . getResponse ( ) ; String nextOid = null ; Vector < ? extends VariableBinding > variableBindings = response . getVariableBindings ( ) ; for ( int i = 0 ; i < variableBindings . size ( ) ; i ++ ) { VariableBinding variableBinding = variableBindings . elementAt ( i ) ; nextOid = variableBinding . getOid ( ) . toDottedString ( ) ; if ( ! nextOid . startsWith ( oid . toDottedString ( ) ) ) { matched = false ; break ; } } if ( ! matched ) { break ; } this . pdu . clear ( ) ; pdu . add ( new VariableBinding ( new OID ( nextOid ) ) ) ; smLst . add ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , response ) ) ; } } exchange . getIn ( ) . setBody ( smLst ) ; } else { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; LOG . debug ( ""Snmp: sended"" ) ; if ( responseEvent . getResponse ( ) != null ) { exchange . getIn ( ) . setBody ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , responseEvent . getResponse ( ) ) ) ; } else { throw new TimeoutException ( ""SNMP Producer Timeout"" ) ; } } } finally { try { transport . close ( ) ; } catch ( Exception e ) { } try { snmp . close ( ) ; } catch ( Exception e ) { } } } " 589,"public void process ( final Exchange exchange ) throws Exception { Snmp snmp = null ; TransportMapping < ? extends Address > transport = null ; try { LOG . debug ( ""Starting SNMP producer on {}"" , this . endpoint . getAddress ( ) ) ; if ( ""tcp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultTcpTransportMapping ( ) ; } else if ( ""udp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultUdpTransportMapping ( ) ; } else { throw new IllegalArgumentException ( ""Unknown protocol: "" + this . endpoint . getProtocol ( ) ) ; } snmp = new Snmp ( transport ) ; LOG . debug ( ""Snmp: i am sending"" ) ; snmp . listen ( ) ; if ( this . actionType == SnmpActionType . GET_NEXT ) { List < SnmpMessage > smLst = new ArrayList < > ( ) ; for ( OID oid : this . endpoint . getOids ( ) ) { this . pdu . clear ( ) ; this . pdu . add ( new VariableBinding ( oid ) ) ; boolean matched = true ; while ( matched ) { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; if ( responseEvent == null || responseEvent . getResponse ( ) == null ) { break ; } PDU response = responseEvent . getResponse ( ) ; String nextOid = null ; Vector < ? extends VariableBinding > variableBindings = response . getVariableBindings ( ) ; for ( int i = 0 ; i < variableBindings . size ( ) ; i ++ ) { VariableBinding variableBinding = variableBindings . elementAt ( i ) ; nextOid = variableBinding . getOid ( ) . toDottedString ( ) ; if ( ! nextOid . startsWith ( oid . toDottedString ( ) ) ) { matched = false ; break ; } } if ( ! matched ) { break ; } this . pdu . clear ( ) ; pdu . add ( new VariableBinding ( new OID ( nextOid ) ) ) ; smLst . add ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , response ) ) ; } } exchange . getIn ( ) . setBody ( smLst ) ; } else { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; if ( responseEvent . getResponse ( ) != null ) { exchange . getIn ( ) . setBody ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , responseEvent . getResponse ( ) ) ) ; } else { throw new TimeoutException ( ""SNMP Producer Timeout"" ) ; } } } finally { try { transport . close ( ) ; } catch ( Exception e ) { } try { snmp . close ( ) ; } catch ( Exception e ) { } } } ","public void process ( final Exchange exchange ) throws Exception { Snmp snmp = null ; TransportMapping < ? extends Address > transport = null ; try { LOG . debug ( ""Starting SNMP producer on {}"" , this . endpoint . getAddress ( ) ) ; if ( ""tcp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultTcpTransportMapping ( ) ; } else if ( ""udp"" . equals ( this . endpoint . getProtocol ( ) ) ) { transport = new DefaultUdpTransportMapping ( ) ; } else { throw new IllegalArgumentException ( ""Unknown protocol: "" + this . endpoint . getProtocol ( ) ) ; } snmp = new Snmp ( transport ) ; LOG . debug ( ""Snmp: i am sending"" ) ; snmp . listen ( ) ; if ( this . actionType == SnmpActionType . GET_NEXT ) { List < SnmpMessage > smLst = new ArrayList < > ( ) ; for ( OID oid : this . endpoint . getOids ( ) ) { this . pdu . clear ( ) ; this . pdu . add ( new VariableBinding ( oid ) ) ; boolean matched = true ; while ( matched ) { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; if ( responseEvent == null || responseEvent . getResponse ( ) == null ) { break ; } PDU response = responseEvent . getResponse ( ) ; String nextOid = null ; Vector < ? extends VariableBinding > variableBindings = response . getVariableBindings ( ) ; for ( int i = 0 ; i < variableBindings . size ( ) ; i ++ ) { VariableBinding variableBinding = variableBindings . elementAt ( i ) ; nextOid = variableBinding . getOid ( ) . toDottedString ( ) ; if ( ! nextOid . startsWith ( oid . toDottedString ( ) ) ) { matched = false ; break ; } } if ( ! matched ) { break ; } this . pdu . clear ( ) ; pdu . add ( new VariableBinding ( new OID ( nextOid ) ) ) ; smLst . add ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , response ) ) ; } } exchange . getIn ( ) . setBody ( smLst ) ; } else { ResponseEvent responseEvent = snmp . send ( this . pdu , this . target ) ; LOG . debug ( ""Snmp: sended"" ) ; if ( responseEvent . getResponse ( ) != null ) { exchange . getIn ( ) . setBody ( new SnmpMessage ( getEndpoint ( ) . getCamelContext ( ) , responseEvent . getResponse ( ) ) ) ; } else { throw new TimeoutException ( ""SNMP Producer Timeout"" ) ; } } } finally { try { transport . close ( ) ; } catch ( Exception e ) { } try { snmp . close ( ) ; } catch ( Exception e ) { } } } " 590,"protected String extractCategoryFormValues ( ) { String selectedNode = this . getSelectedNode ( ) ; try { Category category = this . getCategory ( selectedNode ) ; if ( null == category ) { this . addActionError ( this . getText ( ""error.category.selectCategory"" ) ) ; return ""categoryTree"" ; } this . setParentCategoryCode ( category . getParentCode ( ) ) ; this . setCategoryCode ( category . getCode ( ) ) ; this . setTitles ( category . getTitles ( ) ) ; } catch ( Throwable t ) { return FAILURE ; } return SUCCESS ; } ","protected String extractCategoryFormValues ( ) { String selectedNode = this . getSelectedNode ( ) ; try { Category category = this . getCategory ( selectedNode ) ; if ( null == category ) { this . addActionError ( this . getText ( ""error.category.selectCategory"" ) ) ; return ""categoryTree"" ; } this . setParentCategoryCode ( category . getParentCode ( ) ) ; this . setCategoryCode ( category . getCode ( ) ) ; this . setTitles ( category . getTitles ( ) ) ; } catch ( Throwable t ) { _logger . error ( ""error in extractCategoryFormValues"" , t ) ; return FAILURE ; } return SUCCESS ; } " 591,"public static < T > T get ( Class < T > interfaceClass , final IPentahoSession session , final Map < String , String > properties ) { try { if ( ! aggObjectFactory . objectDefined ( interfaceClass ) ) { return null ; } IPentahoSession curSession = ( session == null ) ? PentahoSessionHolder . getSession ( ) : session ; return aggObjectFactory . get ( interfaceClass , curSession , properties ) ; } catch ( ObjectFactoryException e ) { Logger . debug ( PentahoSystem . class . getName ( ) , Messages . getInstance ( ) . getErrorString ( ""PentahoSystem.ERROR_0026_COULD_NOT_RETRIEVE_CONFIGURED_OBJECT"" , interfaceClass . getSimpleName ( ) ) , e ) ; return null ; } } ","public static < T > T get ( Class < T > interfaceClass , final IPentahoSession session , final Map < String , String > properties ) { try { if ( ! aggObjectFactory . objectDefined ( interfaceClass ) ) { Logger . warn ( PentahoSystem . class . getName ( ) , Messages . getInstance ( ) . getErrorString ( ""PentahoSystem.WARN_OBJECT_NOT_CONFIGURED"" , interfaceClass . getSimpleName ( ) ) ) ; return null ; } IPentahoSession curSession = ( session == null ) ? PentahoSessionHolder . getSession ( ) : session ; return aggObjectFactory . get ( interfaceClass , curSession , properties ) ; } catch ( ObjectFactoryException e ) { Logger . debug ( PentahoSystem . class . getName ( ) , Messages . getInstance ( ) . getErrorString ( ""PentahoSystem.ERROR_0026_COULD_NOT_RETRIEVE_CONFIGURED_OBJECT"" , interfaceClass . getSimpleName ( ) ) , e ) ; return null ; } } " 592,"public static < T > T get ( Class < T > interfaceClass , final IPentahoSession session , final Map < String , String > properties ) { try { if ( ! aggObjectFactory . objectDefined ( interfaceClass ) ) { Logger . warn ( PentahoSystem . class . getName ( ) , Messages . getInstance ( ) . getErrorString ( ""PentahoSystem.WARN_OBJECT_NOT_CONFIGURED"" , interfaceClass . getSimpleName ( ) ) ) ; return null ; } IPentahoSession curSession = ( session == null ) ? PentahoSessionHolder . getSession ( ) : session ; return aggObjectFactory . get ( interfaceClass , curSession , properties ) ; } catch ( ObjectFactoryException e ) { return null ; } } ","public static < T > T get ( Class < T > interfaceClass , final IPentahoSession session , final Map < String , String > properties ) { try { if ( ! aggObjectFactory . objectDefined ( interfaceClass ) ) { Logger . warn ( PentahoSystem . class . getName ( ) , Messages . getInstance ( ) . getErrorString ( ""PentahoSystem.WARN_OBJECT_NOT_CONFIGURED"" , interfaceClass . getSimpleName ( ) ) ) ; return null ; } IPentahoSession curSession = ( session == null ) ? PentahoSessionHolder . getSession ( ) : session ; return aggObjectFactory . get ( interfaceClass , curSession , properties ) ; } catch ( ObjectFactoryException e ) { Logger . debug ( PentahoSystem . class . getName ( ) , Messages . getInstance ( ) . getErrorString ( ""PentahoSystem.ERROR_0026_COULD_NOT_RETRIEVE_CONFIGURED_OBJECT"" , interfaceClass . getSimpleName ( ) ) , e ) ; return null ; } } " 593,"private boolean initializePruningDebug ( HttpResponder responder ) { if ( ! pruneEnable ) { responder . sendString ( HttpResponseStatus . BAD_REQUEST , ""Invalid List Pruning is not enabled."" ) ; return false ; } synchronized ( this ) { if ( pruningDebug != null ) { return true ; } Configuration configuration = new Configuration ( ) ; configuration . clear ( ) ; copyConf ( configuration , hConf ) ; copyConf ( configuration , cConf ) ; try { @ SuppressWarnings ( ""unchecked"" ) Class < ? extends InvalidListPruningDebug > clazz = ( Class < ? extends InvalidListPruningDebug > ) getClass ( ) . getClassLoader ( ) . loadClass ( PRUNING_TOOL_CLASS_NAME ) ; this . pruningDebug = clazz . newInstance ( ) ; pruningDebug . initialize ( configuration ) ; } catch ( Exception e ) { responder . sendString ( HttpResponseStatus . INTERNAL_SERVER_ERROR , ""Cannot instantiate the pruning debug tool: "" + e . getMessage ( ) ) ; pruningDebug = null ; return false ; } return true ; } } ","private boolean initializePruningDebug ( HttpResponder responder ) { if ( ! pruneEnable ) { responder . sendString ( HttpResponseStatus . BAD_REQUEST , ""Invalid List Pruning is not enabled."" ) ; return false ; } synchronized ( this ) { if ( pruningDebug != null ) { return true ; } Configuration configuration = new Configuration ( ) ; configuration . clear ( ) ; copyConf ( configuration , hConf ) ; copyConf ( configuration , cConf ) ; try { @ SuppressWarnings ( ""unchecked"" ) Class < ? extends InvalidListPruningDebug > clazz = ( Class < ? extends InvalidListPruningDebug > ) getClass ( ) . getClassLoader ( ) . loadClass ( PRUNING_TOOL_CLASS_NAME ) ; this . pruningDebug = clazz . newInstance ( ) ; pruningDebug . initialize ( configuration ) ; } catch ( Exception e ) { LOG . error ( ""Not able to instantiate pruning debug class"" , e ) ; responder . sendString ( HttpResponseStatus . INTERNAL_SERVER_ERROR , ""Cannot instantiate the pruning debug tool: "" + e . getMessage ( ) ) ; pruningDebug = null ; return false ; } return true ; } } " 594,"public boolean advance ( ) throws IOException { if ( isDone ) { return false ; } ImmutableBytesWritable startKey = this . currentRangeStartKey ; ImmutableBytesWritable hash = this . currentHash ; isDone = ! readNextKey ( ) ; currentRangeHash = RangeHash . of ( startKey , currentRangeStartKey , hash ) ; return true ; } ","public boolean advance ( ) throws IOException { if ( isDone ) { LOG . debug ( ""Ending workitem at key "" + immutableBytesToString ( currentRangeStartKey ) + "" ."" ) ; return false ; } ImmutableBytesWritable startKey = this . currentRangeStartKey ; ImmutableBytesWritable hash = this . currentHash ; isDone = ! readNextKey ( ) ; currentRangeHash = RangeHash . of ( startKey , currentRangeStartKey , hash ) ; return true ; } " 595,"synchronized boolean removeKey ( Integer keyId ) { requireNonNull ( keyId ) ; return allKeys . remove ( keyId ) != null ; } ","synchronized boolean removeKey ( Integer keyId ) { requireNonNull ( keyId ) ; log . debug ( ""Removing AuthenticatioKey with keyId {}"" , keyId ) ; return allKeys . remove ( keyId ) != null ; } " 596,"public void update ( ActionDesignTrace actionDesignTrace ) { String updateStatement = updateStatement ( actionDesignTrace ) ; getMetadataRepository ( ) . executeUpdate ( updateStatement ) ; } ","public void update ( ActionDesignTrace actionDesignTrace ) { LOGGER . trace ( MessageFormat . format ( ""Updating ActionDesignTrace {0}."" , actionDesignTrace . getMetadataKey ( ) . toString ( ) ) ) ; String updateStatement = updateStatement ( actionDesignTrace ) ; getMetadataRepository ( ) . executeUpdate ( updateStatement ) ; } " 597,"@ Test public void testDeserializeVectorUsingPolicy ( ) throws Exception { Vector < Object > vector = new Vector < Object > ( ) ; vector . add ( ""pi"" ) ; vector . add ( Integer . valueOf ( 314159 ) ) ; vector . add ( new Vector < String > ( ) ) ; vector . add ( Boolean . FALSE ) ; final JmsDefaultDeserializationPolicy policy = new JmsDefaultDeserializationPolicy ( ) ; ByteArrayInputStream input = new ByteArrayInputStream ( serializeObject ( vector ) ) ; TrustedClassFilter filter = new TrustedClassFilter ( ) { @ Override public boolean isTrusted ( Class < ? > clazz ) { return policy . isTrustedType ( new JmsQueue ( ) , clazz ) ; } } ; ClassLoadingAwareObjectInputStream reader = new ClassLoadingAwareObjectInputStream ( input , filter ) ; Object result = null ; try { result = reader . readObject ( ) ; } catch ( Exception ex ) { fail ( ""Should no throw any errors"" ) ; } finally { reader . close ( ) ; } assertNotNull ( result ) ; assertTrue ( result instanceof Vector ) ; assertEquals ( 4 , ( ( Vector < ? > ) result ) . size ( ) ) ; } ","@ Test public void testDeserializeVectorUsingPolicy ( ) throws Exception { Vector < Object > vector = new Vector < Object > ( ) ; vector . add ( ""pi"" ) ; vector . add ( Integer . valueOf ( 314159 ) ) ; vector . add ( new Vector < String > ( ) ) ; vector . add ( Boolean . FALSE ) ; final JmsDefaultDeserializationPolicy policy = new JmsDefaultDeserializationPolicy ( ) ; ByteArrayInputStream input = new ByteArrayInputStream ( serializeObject ( vector ) ) ; TrustedClassFilter filter = new TrustedClassFilter ( ) { @ Override public boolean isTrusted ( Class < ? > clazz ) { LOG . trace ( ""Check for trust status of class: {}"" , clazz . getName ( ) ) ; return policy . isTrustedType ( new JmsQueue ( ) , clazz ) ; } } ; ClassLoadingAwareObjectInputStream reader = new ClassLoadingAwareObjectInputStream ( input , filter ) ; Object result = null ; try { result = reader . readObject ( ) ; } catch ( Exception ex ) { fail ( ""Should no throw any errors"" ) ; } finally { reader . close ( ) ; } assertNotNull ( result ) ; assertTrue ( result instanceof Vector ) ; assertEquals ( 4 , ( ( Vector < ? > ) result ) . size ( ) ) ; } " 598,"public void userEventTriggered ( ChannelHandlerContext ctx , Object evt ) { if ( evt instanceof IdleStateEvent ) { IdleStateEvent idleStateEvent = ( IdleStateEvent ) evt ; if ( idleStateEvent . state ( ) == IdleState . READER_IDLE ) { if ( LOGGER . isInfoEnabled ( ) ) { } try { String serverAddress = NetUtil . toStringAddress ( ctx . channel ( ) . remoteAddress ( ) ) ; clientChannelManager . invalidateObject ( serverAddress , ctx . channel ( ) ) ; } catch ( Exception exx ) { LOGGER . error ( exx . getMessage ( ) ) ; } finally { clientChannelManager . releaseChannel ( ctx . channel ( ) , getAddressFromContext ( ctx ) ) ; } } if ( idleStateEvent == IdleStateEvent . WRITER_IDLE_STATE_EVENT ) { try { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""will send ping msg,channel {}"" , ctx . channel ( ) ) ; } AbstractNettyRemotingClient . this . sendAsyncRequest ( ctx . channel ( ) , HeartbeatMessage . PING ) ; } catch ( Throwable throwable ) { LOGGER . error ( ""send request error: {}"" , throwable . getMessage ( ) , throwable ) ; } } } } ","public void userEventTriggered ( ChannelHandlerContext ctx , Object evt ) { if ( evt instanceof IdleStateEvent ) { IdleStateEvent idleStateEvent = ( IdleStateEvent ) evt ; if ( idleStateEvent . state ( ) == IdleState . READER_IDLE ) { if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( ""channel {} read idle."" , ctx . channel ( ) ) ; } try { String serverAddress = NetUtil . toStringAddress ( ctx . channel ( ) . remoteAddress ( ) ) ; clientChannelManager . invalidateObject ( serverAddress , ctx . channel ( ) ) ; } catch ( Exception exx ) { LOGGER . error ( exx . getMessage ( ) ) ; } finally { clientChannelManager . releaseChannel ( ctx . channel ( ) , getAddressFromContext ( ctx ) ) ; } } if ( idleStateEvent == IdleStateEvent . WRITER_IDLE_STATE_EVENT ) { try { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""will send ping msg,channel {}"" , ctx . channel ( ) ) ; } AbstractNettyRemotingClient . this . sendAsyncRequest ( ctx . channel ( ) , HeartbeatMessage . PING ) ; } catch ( Throwable throwable ) { LOGGER . error ( ""send request error: {}"" , throwable . getMessage ( ) , throwable ) ; } } } } " 599,"public void userEventTriggered ( ChannelHandlerContext ctx , Object evt ) { if ( evt instanceof IdleStateEvent ) { IdleStateEvent idleStateEvent = ( IdleStateEvent ) evt ; if ( idleStateEvent . state ( ) == IdleState . READER_IDLE ) { if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( ""channel {} read idle."" , ctx . channel ( ) ) ; } try { String serverAddress = NetUtil . toStringAddress ( ctx . channel ( ) . remoteAddress ( ) ) ; clientChannelManager . invalidateObject ( serverAddress , ctx . channel ( ) ) ; } catch ( Exception exx ) { } finally { clientChannelManager . releaseChannel ( ctx . channel ( ) , getAddressFromContext ( ctx ) ) ; } } if ( idleStateEvent == IdleStateEvent . WRITER_IDLE_STATE_EVENT ) { try { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""will send ping msg,channel {}"" , ctx . channel ( ) ) ; } AbstractNettyRemotingClient . this . sendAsyncRequest ( ctx . channel ( ) , HeartbeatMessage . PING ) ; } catch ( Throwable throwable ) { LOGGER . error ( ""send request error: {}"" , throwable . getMessage ( ) , throwable ) ; } } } } ","public void userEventTriggered ( ChannelHandlerContext ctx , Object evt ) { if ( evt instanceof IdleStateEvent ) { IdleStateEvent idleStateEvent = ( IdleStateEvent ) evt ; if ( idleStateEvent . state ( ) == IdleState . READER_IDLE ) { if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( ""channel {} read idle."" , ctx . channel ( ) ) ; } try { String serverAddress = NetUtil . toStringAddress ( ctx . channel ( ) . remoteAddress ( ) ) ; clientChannelManager . invalidateObject ( serverAddress , ctx . channel ( ) ) ; } catch ( Exception exx ) { LOGGER . error ( exx . getMessage ( ) ) ; } finally { clientChannelManager . releaseChannel ( ctx . channel ( ) , getAddressFromContext ( ctx ) ) ; } } if ( idleStateEvent == IdleStateEvent . WRITER_IDLE_STATE_EVENT ) { try { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""will send ping msg,channel {}"" , ctx . channel ( ) ) ; } AbstractNettyRemotingClient . this . sendAsyncRequest ( ctx . channel ( ) , HeartbeatMessage . PING ) ; } catch ( Throwable throwable ) { LOGGER . error ( ""send request error: {}"" , throwable . getMessage ( ) , throwable ) ; } } } } " 600,"public void userEventTriggered ( ChannelHandlerContext ctx , Object evt ) { if ( evt instanceof IdleStateEvent ) { IdleStateEvent idleStateEvent = ( IdleStateEvent ) evt ; if ( idleStateEvent . state ( ) == IdleState . READER_IDLE ) { if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( ""channel {} read idle."" , ctx . channel ( ) ) ; } try { String serverAddress = NetUtil . toStringAddress ( ctx . channel ( ) . remoteAddress ( ) ) ; clientChannelManager . invalidateObject ( serverAddress , ctx . channel ( ) ) ; } catch ( Exception exx ) { LOGGER . error ( exx . getMessage ( ) ) ; } finally { clientChannelManager . releaseChannel ( ctx . channel ( ) , getAddressFromContext ( ctx ) ) ; } } if ( idleStateEvent == IdleStateEvent . WRITER_IDLE_STATE_EVENT ) { try { if ( LOGGER . isDebugEnabled ( ) ) { } AbstractNettyRemotingClient . this . sendAsyncRequest ( ctx . channel ( ) , HeartbeatMessage . PING ) ; } catch ( Throwable throwable ) { LOGGER . error ( ""send request error: {}"" , throwable . getMessage ( ) , throwable ) ; } } } } ","public void userEventTriggered ( ChannelHandlerContext ctx , Object evt ) { if ( evt instanceof IdleStateEvent ) { IdleStateEvent idleStateEvent = ( IdleStateEvent ) evt ; if ( idleStateEvent . state ( ) == IdleState . READER_IDLE ) { if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( ""channel {} read idle."" , ctx . channel ( ) ) ; } try { String serverAddress = NetUtil . toStringAddress ( ctx . channel ( ) . remoteAddress ( ) ) ; clientChannelManager . invalidateObject ( serverAddress , ctx . channel ( ) ) ; } catch ( Exception exx ) { LOGGER . error ( exx . getMessage ( ) ) ; } finally { clientChannelManager . releaseChannel ( ctx . channel ( ) , getAddressFromContext ( ctx ) ) ; } } if ( idleStateEvent == IdleStateEvent . WRITER_IDLE_STATE_EVENT ) { try { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""will send ping msg,channel {}"" , ctx . channel ( ) ) ; } AbstractNettyRemotingClient . this . sendAsyncRequest ( ctx . channel ( ) , HeartbeatMessage . PING ) ; } catch ( Throwable throwable ) { LOGGER . error ( ""send request error: {}"" , throwable . getMessage ( ) , throwable ) ; } } } } " 601,"public void userEventTriggered ( ChannelHandlerContext ctx , Object evt ) { if ( evt instanceof IdleStateEvent ) { IdleStateEvent idleStateEvent = ( IdleStateEvent ) evt ; if ( idleStateEvent . state ( ) == IdleState . READER_IDLE ) { if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( ""channel {} read idle."" , ctx . channel ( ) ) ; } try { String serverAddress = NetUtil . toStringAddress ( ctx . channel ( ) . remoteAddress ( ) ) ; clientChannelManager . invalidateObject ( serverAddress , ctx . channel ( ) ) ; } catch ( Exception exx ) { LOGGER . error ( exx . getMessage ( ) ) ; } finally { clientChannelManager . releaseChannel ( ctx . channel ( ) , getAddressFromContext ( ctx ) ) ; } } if ( idleStateEvent == IdleStateEvent . WRITER_IDLE_STATE_EVENT ) { try { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""will send ping msg,channel {}"" , ctx . channel ( ) ) ; } AbstractNettyRemotingClient . this . sendAsyncRequest ( ctx . channel ( ) , HeartbeatMessage . PING ) ; } catch ( Throwable throwable ) { } } } } ","public void userEventTriggered ( ChannelHandlerContext ctx , Object evt ) { if ( evt instanceof IdleStateEvent ) { IdleStateEvent idleStateEvent = ( IdleStateEvent ) evt ; if ( idleStateEvent . state ( ) == IdleState . READER_IDLE ) { if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( ""channel {} read idle."" , ctx . channel ( ) ) ; } try { String serverAddress = NetUtil . toStringAddress ( ctx . channel ( ) . remoteAddress ( ) ) ; clientChannelManager . invalidateObject ( serverAddress , ctx . channel ( ) ) ; } catch ( Exception exx ) { LOGGER . error ( exx . getMessage ( ) ) ; } finally { clientChannelManager . releaseChannel ( ctx . channel ( ) , getAddressFromContext ( ctx ) ) ; } } if ( idleStateEvent == IdleStateEvent . WRITER_IDLE_STATE_EVENT ) { try { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ""will send ping msg,channel {}"" , ctx . channel ( ) ) ; } AbstractNettyRemotingClient . this . sendAsyncRequest ( ctx . channel ( ) , HeartbeatMessage . PING ) ; } catch ( Throwable throwable ) { LOGGER . error ( ""send request error: {}"" , throwable . getMessage ( ) , throwable ) ; } } } } " 602,"protected void configureSSLContext ( SSLContext context ) throws GeneralSecurityException { if ( this . getSessionTimeout ( ) != null ) { LOG . info ( ""Configuring client-side SSLContext session timeout on SSLContext [{}] to [{}]."" , context , this . getSessionTimeout ( ) ) ; this . configureSessionContext ( context . getClientSessionContext ( ) , this . getSessionTimeout ( ) ) ; } LOG . trace ( ""Configured client-side SSLContext parameters on SSLContext [{}]."" , context ) ; } ","protected void configureSSLContext ( SSLContext context ) throws GeneralSecurityException { LOG . trace ( ""Configuring client-side SSLContext parameters on SSLContext [{}]..."" , context ) ; if ( this . getSessionTimeout ( ) != null ) { LOG . info ( ""Configuring client-side SSLContext session timeout on SSLContext [{}] to [{}]."" , context , this . getSessionTimeout ( ) ) ; this . configureSessionContext ( context . getClientSessionContext ( ) , this . getSessionTimeout ( ) ) ; } LOG . trace ( ""Configured client-side SSLContext parameters on SSLContext [{}]."" , context ) ; } " 603,"protected void configureSSLContext ( SSLContext context ) throws GeneralSecurityException { LOG . trace ( ""Configuring client-side SSLContext parameters on SSLContext [{}]..."" , context ) ; if ( this . getSessionTimeout ( ) != null ) { this . configureSessionContext ( context . getClientSessionContext ( ) , this . getSessionTimeout ( ) ) ; } LOG . trace ( ""Configured client-side SSLContext parameters on SSLContext [{}]."" , context ) ; } ","protected void configureSSLContext ( SSLContext context ) throws GeneralSecurityException { LOG . trace ( ""Configuring client-side SSLContext parameters on SSLContext [{}]..."" , context ) ; if ( this . getSessionTimeout ( ) != null ) { LOG . info ( ""Configuring client-side SSLContext session timeout on SSLContext [{}] to [{}]."" , context , this . getSessionTimeout ( ) ) ; this . configureSessionContext ( context . getClientSessionContext ( ) , this . getSessionTimeout ( ) ) ; } LOG . trace ( ""Configured client-side SSLContext parameters on SSLContext [{}]."" , context ) ; } " 604,"protected void configureSSLContext ( SSLContext context ) throws GeneralSecurityException { LOG . trace ( ""Configuring client-side SSLContext parameters on SSLContext [{}]..."" , context ) ; if ( this . getSessionTimeout ( ) != null ) { LOG . info ( ""Configuring client-side SSLContext session timeout on SSLContext [{}] to [{}]."" , context , this . getSessionTimeout ( ) ) ; this . configureSessionContext ( context . getClientSessionContext ( ) , this . getSessionTimeout ( ) ) ; } } ","protected void configureSSLContext ( SSLContext context ) throws GeneralSecurityException { LOG . trace ( ""Configuring client-side SSLContext parameters on SSLContext [{}]..."" , context ) ; if ( this . getSessionTimeout ( ) != null ) { LOG . info ( ""Configuring client-side SSLContext session timeout on SSLContext [{}] to [{}]."" , context , this . getSessionTimeout ( ) ) ; this . configureSessionContext ( context . getClientSessionContext ( ) , this . getSessionTimeout ( ) ) ; } LOG . trace ( ""Configured client-side SSLContext parameters on SSLContext [{}]."" , context ) ; } " 605,"private void loadTrustedMaps ( QueryResultListener . Feed dataFeed ) { String filePath = System . getProperty ( ""kim.home.dir"" , ""."" ) + EntityPriority . PRIORITY_CONF_FILE . substring ( 1 ) ; existsClassPriority = ( new File ( filePath ) ) . exists ( ) ; if ( existsClassPriority ) { try { entPrior = new EntityPriority ( ) ; entPrior . init ( ) ; existsClassPriority = existsClassPriority && entPrior . getFilterLookups ( ) ; } catch ( Exception e ) { log . error ( ""Cannot create instance of Priorities class"" , e ) ; entPrior = null ; } } EntitiesQueryListener entityListener = new TrustedEntitiesListener ( entPrior ) ; if ( log . isDebugEnabled ( ) ) { entityListener = StatisticListener . wrap ( entityListener , ""Thrusted Entities"" ) ; } try { dataFeed . feedTo ( entityListener ) ; } catch ( KIMQueryException e ) { log . error ( ""Loading failed."" , e ) ; throw new KIMRuntimeException ( ""The loading failed."" , e ) ; } finally { log . info ( ""The loading from Sesame finished"" ) ; } } ","private void loadTrustedMaps ( QueryResultListener . Feed dataFeed ) { log . info ( ""Loading of trusted entities from Sesame"" ) ; String filePath = System . getProperty ( ""kim.home.dir"" , ""."" ) + EntityPriority . PRIORITY_CONF_FILE . substring ( 1 ) ; existsClassPriority = ( new File ( filePath ) ) . exists ( ) ; if ( existsClassPriority ) { try { entPrior = new EntityPriority ( ) ; entPrior . init ( ) ; existsClassPriority = existsClassPriority && entPrior . getFilterLookups ( ) ; } catch ( Exception e ) { log . error ( ""Cannot create instance of Priorities class"" , e ) ; entPrior = null ; } } EntitiesQueryListener entityListener = new TrustedEntitiesListener ( entPrior ) ; if ( log . isDebugEnabled ( ) ) { entityListener = StatisticListener . wrap ( entityListener , ""Thrusted Entities"" ) ; } try { dataFeed . feedTo ( entityListener ) ; } catch ( KIMQueryException e ) { log . error ( ""Loading failed."" , e ) ; throw new KIMRuntimeException ( ""The loading failed."" , e ) ; } finally { log . info ( ""The loading from Sesame finished"" ) ; } } " 606,"private void loadTrustedMaps ( QueryResultListener . Feed dataFeed ) { log . info ( ""Loading of trusted entities from Sesame"" ) ; String filePath = System . getProperty ( ""kim.home.dir"" , ""."" ) + EntityPriority . PRIORITY_CONF_FILE . substring ( 1 ) ; existsClassPriority = ( new File ( filePath ) ) . exists ( ) ; if ( existsClassPriority ) { try { entPrior = new EntityPriority ( ) ; entPrior . init ( ) ; existsClassPriority = existsClassPriority && entPrior . getFilterLookups ( ) ; } catch ( Exception e ) { entPrior = null ; } } EntitiesQueryListener entityListener = new TrustedEntitiesListener ( entPrior ) ; if ( log . isDebugEnabled ( ) ) { entityListener = StatisticListener . wrap ( entityListener , ""Thrusted Entities"" ) ; } try { dataFeed . feedTo ( entityListener ) ; } catch ( KIMQueryException e ) { log . error ( ""Loading failed."" , e ) ; throw new KIMRuntimeException ( ""The loading failed."" , e ) ; } finally { log . info ( ""The loading from Sesame finished"" ) ; } } ","private void loadTrustedMaps ( QueryResultListener . Feed dataFeed ) { log . info ( ""Loading of trusted entities from Sesame"" ) ; String filePath = System . getProperty ( ""kim.home.dir"" , ""."" ) + EntityPriority . PRIORITY_CONF_FILE . substring ( 1 ) ; existsClassPriority = ( new File ( filePath ) ) . exists ( ) ; if ( existsClassPriority ) { try { entPrior = new EntityPriority ( ) ; entPrior . init ( ) ; existsClassPriority = existsClassPriority && entPrior . getFilterLookups ( ) ; } catch ( Exception e ) { log . error ( ""Cannot create instance of Priorities class"" , e ) ; entPrior = null ; } } EntitiesQueryListener entityListener = new TrustedEntitiesListener ( entPrior ) ; if ( log . isDebugEnabled ( ) ) { entityListener = StatisticListener . wrap ( entityListener , ""Thrusted Entities"" ) ; } try { dataFeed . feedTo ( entityListener ) ; } catch ( KIMQueryException e ) { log . error ( ""Loading failed."" , e ) ; throw new KIMRuntimeException ( ""The loading failed."" , e ) ; } finally { log . info ( ""The loading from Sesame finished"" ) ; } } " 607,"private void loadTrustedMaps ( QueryResultListener . Feed dataFeed ) { log . info ( ""Loading of trusted entities from Sesame"" ) ; String filePath = System . getProperty ( ""kim.home.dir"" , ""."" ) + EntityPriority . PRIORITY_CONF_FILE . substring ( 1 ) ; existsClassPriority = ( new File ( filePath ) ) . exists ( ) ; if ( existsClassPriority ) { try { entPrior = new EntityPriority ( ) ; entPrior . init ( ) ; existsClassPriority = existsClassPriority && entPrior . getFilterLookups ( ) ; } catch ( Exception e ) { log . error ( ""Cannot create instance of Priorities class"" , e ) ; entPrior = null ; } } EntitiesQueryListener entityListener = new TrustedEntitiesListener ( entPrior ) ; if ( log . isDebugEnabled ( ) ) { entityListener = StatisticListener . wrap ( entityListener , ""Thrusted Entities"" ) ; } try { dataFeed . feedTo ( entityListener ) ; } catch ( KIMQueryException e ) { throw new KIMRuntimeException ( ""The loading failed."" , e ) ; } finally { log . info ( ""The loading from Sesame finished"" ) ; } } ","private void loadTrustedMaps ( QueryResultListener . Feed dataFeed ) { log . info ( ""Loading of trusted entities from Sesame"" ) ; String filePath = System . getProperty ( ""kim.home.dir"" , ""."" ) + EntityPriority . PRIORITY_CONF_FILE . substring ( 1 ) ; existsClassPriority = ( new File ( filePath ) ) . exists ( ) ; if ( existsClassPriority ) { try { entPrior = new EntityPriority ( ) ; entPrior . init ( ) ; existsClassPriority = existsClassPriority && entPrior . getFilterLookups ( ) ; } catch ( Exception e ) { log . error ( ""Cannot create instance of Priorities class"" , e ) ; entPrior = null ; } } EntitiesQueryListener entityListener = new TrustedEntitiesListener ( entPrior ) ; if ( log . isDebugEnabled ( ) ) { entityListener = StatisticListener . wrap ( entityListener , ""Thrusted Entities"" ) ; } try { dataFeed . feedTo ( entityListener ) ; } catch ( KIMQueryException e ) { log . error ( ""Loading failed."" , e ) ; throw new KIMRuntimeException ( ""The loading failed."" , e ) ; } finally { log . info ( ""The loading from Sesame finished"" ) ; } } " 608,"private void loadTrustedMaps ( QueryResultListener . Feed dataFeed ) { log . info ( ""Loading of trusted entities from Sesame"" ) ; String filePath = System . getProperty ( ""kim.home.dir"" , ""."" ) + EntityPriority . PRIORITY_CONF_FILE . substring ( 1 ) ; existsClassPriority = ( new File ( filePath ) ) . exists ( ) ; if ( existsClassPriority ) { try { entPrior = new EntityPriority ( ) ; entPrior . init ( ) ; existsClassPriority = existsClassPriority && entPrior . getFilterLookups ( ) ; } catch ( Exception e ) { log . error ( ""Cannot create instance of Priorities class"" , e ) ; entPrior = null ; } } EntitiesQueryListener entityListener = new TrustedEntitiesListener ( entPrior ) ; if ( log . isDebugEnabled ( ) ) { entityListener = StatisticListener . wrap ( entityListener , ""Thrusted Entities"" ) ; } try { dataFeed . feedTo ( entityListener ) ; } catch ( KIMQueryException e ) { log . error ( ""Loading failed."" , e ) ; throw new KIMRuntimeException ( ""The loading failed."" , e ) ; } finally { } } ","private void loadTrustedMaps ( QueryResultListener . Feed dataFeed ) { log . info ( ""Loading of trusted entities from Sesame"" ) ; String filePath = System . getProperty ( ""kim.home.dir"" , ""."" ) + EntityPriority . PRIORITY_CONF_FILE . substring ( 1 ) ; existsClassPriority = ( new File ( filePath ) ) . exists ( ) ; if ( existsClassPriority ) { try { entPrior = new EntityPriority ( ) ; entPrior . init ( ) ; existsClassPriority = existsClassPriority && entPrior . getFilterLookups ( ) ; } catch ( Exception e ) { log . error ( ""Cannot create instance of Priorities class"" , e ) ; entPrior = null ; } } EntitiesQueryListener entityListener = new TrustedEntitiesListener ( entPrior ) ; if ( log . isDebugEnabled ( ) ) { entityListener = StatisticListener . wrap ( entityListener , ""Thrusted Entities"" ) ; } try { dataFeed . feedTo ( entityListener ) ; } catch ( KIMQueryException e ) { log . error ( ""Loading failed."" , e ) ; throw new KIMRuntimeException ( ""The loading failed."" , e ) ; } finally { log . info ( ""The loading from Sesame finished"" ) ; } } " 609,"private static void setTrustManager ( TLSClientParameters tlsClientParameters ) { try { TrustManagerFactory trustFactory = getInstance ( ) . trustFactory ; if ( trustFactory != null ) { TrustManager [ ] trustManager = trustFactory . getTrustManagers ( ) ; if ( trustManager != null ) { tlsClientParameters . setTrustManagers ( trustManager ) ; } } else { } } catch ( IllegalStateException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } ","private static void setTrustManager ( TLSClientParameters tlsClientParameters ) { try { TrustManagerFactory trustFactory = getInstance ( ) . trustFactory ; if ( trustFactory != null ) { TrustManager [ ] trustManager = trustFactory . getTrustManagers ( ) ; if ( trustManager != null ) { tlsClientParameters . setTrustManagers ( trustManager ) ; } } else { LOG . debug ( ""Trust Factory is empty"" ) ; } } catch ( IllegalStateException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } " 610,"private static void setTrustManager ( TLSClientParameters tlsClientParameters ) { try { TrustManagerFactory trustFactory = getInstance ( ) . trustFactory ; if ( trustFactory != null ) { TrustManager [ ] trustManager = trustFactory . getTrustManagers ( ) ; if ( trustManager != null ) { tlsClientParameters . setTrustManagers ( trustManager ) ; } } else { LOG . debug ( ""Trust Factory is empty"" ) ; } } catch ( IllegalStateException e ) { } } ","private static void setTrustManager ( TLSClientParameters tlsClientParameters ) { try { TrustManagerFactory trustFactory = getInstance ( ) . trustFactory ; if ( trustFactory != null ) { TrustManager [ ] trustManager = trustFactory . getTrustManagers ( ) ; if ( trustManager != null ) { tlsClientParameters . setTrustManagers ( trustManager ) ; } } else { LOG . debug ( ""Trust Factory is empty"" ) ; } } catch ( IllegalStateException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } " 611,"public void writeFinished ( Connection c , Transfer t ) { this . agent . releaseSendSlot ( c ) ; } ","public void writeFinished ( Connection c , Transfer t ) { LOGGER . debug ( ""Finished sending "" + ( t . isFile ( ) ? t . getFileName ( ) : t . getObject ( ) ) + "" through connection "" + c . hashCode ( ) ) ; this . agent . releaseSendSlot ( c ) ; } " 612,"protected GuiFragment buildGuiFragmentFromRes ( ResultSet res ) { GuiFragment guiFragment = null ; try { guiFragment = new GuiFragment ( ) ; guiFragment . setCode ( res . getString ( ""code"" ) ) ; guiFragment . setWidgetTypeCode ( res . getString ( ""widgettypecode"" ) ) ; guiFragment . setPluginCode ( res . getString ( ""plugincode"" ) ) ; guiFragment . setGui ( res . getString ( ""gui"" ) ) ; guiFragment . setDefaultGui ( res . getString ( ""defaultgui"" ) ) ; Integer locked = res . getInt ( ""locked"" ) ; guiFragment . setLocked ( null != locked && locked . intValue ( ) == 1 ) ; } catch ( Throwable t ) { } return guiFragment ; } ","protected GuiFragment buildGuiFragmentFromRes ( ResultSet res ) { GuiFragment guiFragment = null ; try { guiFragment = new GuiFragment ( ) ; guiFragment . setCode ( res . getString ( ""code"" ) ) ; guiFragment . setWidgetTypeCode ( res . getString ( ""widgettypecode"" ) ) ; guiFragment . setPluginCode ( res . getString ( ""plugincode"" ) ) ; guiFragment . setGui ( res . getString ( ""gui"" ) ) ; guiFragment . setDefaultGui ( res . getString ( ""defaultgui"" ) ) ; Integer locked = res . getInt ( ""locked"" ) ; guiFragment . setLocked ( null != locked && locked . intValue ( ) == 1 ) ; } catch ( Throwable t ) { logger . error ( ""Error in buildGuiFragmentFromRes"" , t ) ; } return guiFragment ; } " 613,"public static VocabularyCandidates findVocabulariesForUrl ( String resourceId , Function < String , List < Vocabulary > > searchInPersistence ) throws URISyntaxException { final String searchString = new URI ( resourceId . replace ( "" "" , ""%20"" ) ) . getHost ( ) ; final List < Vocabulary > searchedVocabularies = searchInPersistence . apply ( searchString ) ; final List < Vocabulary > candidates ; if ( searchedVocabularies == null ) { candidates = Collections . emptyList ( ) ; } else { candidates = searchedVocabularies . stream ( ) . filter ( vocabulary -> vocabularyMatchesUri ( resourceId , vocabulary ) ) . collect ( Collectors . toList ( ) ) ; } if ( candidates . isEmpty ( ) ) { } if ( candidates . size ( ) > 1 && LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( ""Multiple vocabularies found for uri {}: {}"" , resourceId , candidates . stream ( ) . map ( Vocabulary :: getName ) . collect ( Collectors . joining ( "", "" ) ) ) ; } return new VocabularyCandidates ( candidates ) ; } ","public static VocabularyCandidates findVocabulariesForUrl ( String resourceId , Function < String , List < Vocabulary > > searchInPersistence ) throws URISyntaxException { final String searchString = new URI ( resourceId . replace ( "" "" , ""%20"" ) ) . getHost ( ) ; final List < Vocabulary > searchedVocabularies = searchInPersistence . apply ( searchString ) ; final List < Vocabulary > candidates ; if ( searchedVocabularies == null ) { candidates = Collections . emptyList ( ) ; } else { candidates = searchedVocabularies . stream ( ) . filter ( vocabulary -> vocabularyMatchesUri ( resourceId , vocabulary ) ) . collect ( Collectors . toList ( ) ) ; } if ( candidates . isEmpty ( ) ) { LOGGER . info ( ""No vocabularies found for uri {}"" , resourceId ) ; } if ( candidates . size ( ) > 1 && LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( ""Multiple vocabularies found for uri {}: {}"" , resourceId , candidates . stream ( ) . map ( Vocabulary :: getName ) . collect ( Collectors . joining ( "", "" ) ) ) ; } return new VocabularyCandidates ( candidates ) ; } " 614,"public static VocabularyCandidates findVocabulariesForUrl ( String resourceId , Function < String , List < Vocabulary > > searchInPersistence ) throws URISyntaxException { final String searchString = new URI ( resourceId . replace ( "" "" , ""%20"" ) ) . getHost ( ) ; final List < Vocabulary > searchedVocabularies = searchInPersistence . apply ( searchString ) ; final List < Vocabulary > candidates ; if ( searchedVocabularies == null ) { candidates = Collections . emptyList ( ) ; } else { candidates = searchedVocabularies . stream ( ) . filter ( vocabulary -> vocabularyMatchesUri ( resourceId , vocabulary ) ) . collect ( Collectors . toList ( ) ) ; } if ( candidates . isEmpty ( ) ) { LOGGER . info ( ""No vocabularies found for uri {}"" , resourceId ) ; } if ( candidates . size ( ) > 1 && LOGGER . isWarnEnabled ( ) ) { } return new VocabularyCandidates ( candidates ) ; } ","public static VocabularyCandidates findVocabulariesForUrl ( String resourceId , Function < String , List < Vocabulary > > searchInPersistence ) throws URISyntaxException { final String searchString = new URI ( resourceId . replace ( "" "" , ""%20"" ) ) . getHost ( ) ; final List < Vocabulary > searchedVocabularies = searchInPersistence . apply ( searchString ) ; final List < Vocabulary > candidates ; if ( searchedVocabularies == null ) { candidates = Collections . emptyList ( ) ; } else { candidates = searchedVocabularies . stream ( ) . filter ( vocabulary -> vocabularyMatchesUri ( resourceId , vocabulary ) ) . collect ( Collectors . toList ( ) ) ; } if ( candidates . isEmpty ( ) ) { LOGGER . info ( ""No vocabularies found for uri {}"" , resourceId ) ; } if ( candidates . size ( ) > 1 && LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( ""Multiple vocabularies found for uri {}: {}"" , resourceId , candidates . stream ( ) . map ( Vocabulary :: getName ) . collect ( Collectors . joining ( "", "" ) ) ) ; } return new VocabularyCandidates ( candidates ) ; } " 615,"protected void setup ( Context context ) throws IOException , InterruptedException { String multipleOutputStr = context . getConfiguration ( ) . get ( PROPERTY_MULTIPLEOUTPUTS ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( multipleOutputStr ) , ""required parameter '%s' is missing!"" , PROPERTY_MULTIPLEOUTPUTS ) ; this . mos = instantiateMultipleOutputs ( context ) ; this . mimeTypeToPortNameMap = new HashMap < CharSequence , String > ( ) ; String [ ] portNames = StringUtils . split ( context . getConfiguration ( ) . get ( PROPERTY_MULTIPLEOUTPUTS ) ) ; for ( String portName : portNames ) { String currentMimeTypePropName = PROPERTY_PREFIX_MIMETYPES_CSV + portName ; if ( context . getConfiguration ( ) . get ( currentMimeTypePropName ) != null ) { String [ ] currentPortMimeTypes = StringUtils . split ( context . getConfiguration ( ) . get ( currentMimeTypePropName ) , WorkflowRuntimeParameters . DEFAULT_CSV_DELIMITER ) ; for ( String currentPortMimeType : currentPortMimeTypes ) { if ( ! currentPortMimeType . isEmpty ( ) && ! WorkflowRuntimeParameters . UNDEFINED_NONEMPTY_VALUE . equals ( currentPortMimeType ) ) { this . mimeTypeToPortNameMap . put ( currentPortMimeType . toLowerCase ( ) , portName ) ; } } } else { } } } ","protected void setup ( Context context ) throws IOException , InterruptedException { String multipleOutputStr = context . getConfiguration ( ) . get ( PROPERTY_MULTIPLEOUTPUTS ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( multipleOutputStr ) , ""required parameter '%s' is missing!"" , PROPERTY_MULTIPLEOUTPUTS ) ; this . mos = instantiateMultipleOutputs ( context ) ; this . mimeTypeToPortNameMap = new HashMap < CharSequence , String > ( ) ; String [ ] portNames = StringUtils . split ( context . getConfiguration ( ) . get ( PROPERTY_MULTIPLEOUTPUTS ) ) ; for ( String portName : portNames ) { String currentMimeTypePropName = PROPERTY_PREFIX_MIMETYPES_CSV + portName ; if ( context . getConfiguration ( ) . get ( currentMimeTypePropName ) != null ) { String [ ] currentPortMimeTypes = StringUtils . split ( context . getConfiguration ( ) . get ( currentMimeTypePropName ) , WorkflowRuntimeParameters . DEFAULT_CSV_DELIMITER ) ; for ( String currentPortMimeType : currentPortMimeTypes ) { if ( ! currentPortMimeType . isEmpty ( ) && ! WorkflowRuntimeParameters . UNDEFINED_NONEMPTY_VALUE . equals ( currentPortMimeType ) ) { this . mimeTypeToPortNameMap . put ( currentPortMimeType . toLowerCase ( ) , portName ) ; } } } else { log . warn ( ""undefined property '"" + currentMimeTypePropName + ""', no data will be dispatched to port '"" + portName + ""'"" ) ; } } } " 616,"public Study updateStudyDiseaseTraitByAccessionId ( String trait , String accessionId ) { Study study = this . getStudyByAccessionId ( accessionId ) . orElseThrow ( ( ) -> new ResourceNotFoundException ( ""Study"" , accessionId ) ) ; DiseaseTrait diseaseTrait = Optional . ofNullable ( diseaseTraitRepository . findByTraitIgnoreCase ( trait ) ) . orElseThrow ( ( ) -> new ResourceNotFoundException ( ""Disease Trait"" , trait ) ) ; study . setDiseaseTrait ( diseaseTrait ) ; studyRepository . save ( study ) ; return study ; } ","public Study updateStudyDiseaseTraitByAccessionId ( String trait , String accessionId ) { Study study = this . getStudyByAccessionId ( accessionId ) . orElseThrow ( ( ) -> new ResourceNotFoundException ( ""Study"" , accessionId ) ) ; DiseaseTrait diseaseTrait = Optional . ofNullable ( diseaseTraitRepository . findByTraitIgnoreCase ( trait ) ) . orElseThrow ( ( ) -> new ResourceNotFoundException ( ""Disease Trait"" , trait ) ) ; study . setDiseaseTrait ( diseaseTrait ) ; studyRepository . save ( study ) ; log . info ( ""Study with accession Id: {} found and updated"" , accessionId ) ; return study ; } " 617,"@ Test @ Ignore public final void testSendProcessConfigurationRequest ( ) { ActiveRequestSenderTest . testType = TestType . CONFIG ; ProcessConfiguration processConfiguration = new ProcessConfiguration ( ) ; processConfiguration . setProcessName ( PROCESS_NAME ) ; processConfiguration . setprocessPIK ( PROCESS_PIK ) ; ProcessConfigurationHolder . setInstance ( processConfiguration ) ; ProcessConfigurationResponse processConfigurationResponse = this . activeRequestSender . sendProcessConfigurationRequest ( PROCESS_NAME ) ; compareConfiguration ( processConfigurationResponse ) ; } ","@ Test @ Ignore public final void testSendProcessConfigurationRequest ( ) { ActiveRequestSenderTest . testType = TestType . CONFIG ; LOGGER . debug ( ""Starting "" + ActiveRequestSenderTest . testType . getName ( ) ) ; ProcessConfiguration processConfiguration = new ProcessConfiguration ( ) ; processConfiguration . setProcessName ( PROCESS_NAME ) ; processConfiguration . setprocessPIK ( PROCESS_PIK ) ; ProcessConfigurationHolder . setInstance ( processConfiguration ) ; ProcessConfigurationResponse processConfigurationResponse = this . activeRequestSender . sendProcessConfigurationRequest ( PROCESS_NAME ) ; compareConfiguration ( processConfigurationResponse ) ; } " 618,"private CompletableFuture < AsyncBiFunctionService . WithSerdes < String , String , Integer > > createKafkaStreams ( Config config , Properties kafkaProperties , String storeTopic , String storeName ) { long timeoutMillis = config . get ( Config . STALE_RESULT_TIMEOUT_MS ) ; ForeachActionDispatcher < String , Integer > dispatcher = new ForeachActionDispatcher < > ( ) ; WaitForResultService serviceImpl = new WaitForResultService ( timeoutMillis , dispatcher ) ; closeables . add ( serviceImpl ) ; AtomicBoolean done = new AtomicBoolean ( false ) ; CompletableFuture < AsyncBiFunctionService . WithSerdes < String , String , Integer > > cf = new CompletableFuture < > ( ) ; KafkaStreams . StateListener listener = ( newState , oldState ) -> { if ( newState == KafkaStreams . State . RUNNING && ! done . getAndSet ( true ) ) { cf . completeAsync ( ( ) -> serviceImpl ) ; } if ( newState == KafkaStreams . State . ERROR ) { cf . completeExceptionally ( new IllegalStateException ( ""KafkaStreams error"" ) ) ; } } ; Properties streamsProperties = new Properties ( ) ; streamsProperties . putAll ( kafkaProperties ) ; Object rf = kafkaProperties . get ( StreamsConfig . REPLICATION_FACTOR_CONFIG ) ; if ( rf == null ) { streamsProperties . put ( StreamsConfig . REPLICATION_FACTOR_CONFIG , ""-1"" ) ; } Topology topology = new TopicStoreTopologyProvider ( storeTopic , storeName , streamsProperties , dispatcher ) . get ( ) ; streams = new KafkaStreams ( topology , streamsProperties ) ; streams . setStateListener ( listener ) ; streams . setGlobalStateRestoreListener ( new LoggingStateRestoreListener ( ) ) ; closeables . add ( streams ) ; streams . start ( ) ; return cf ; } ","private CompletableFuture < AsyncBiFunctionService . WithSerdes < String , String , Integer > > createKafkaStreams ( Config config , Properties kafkaProperties , String storeTopic , String storeName ) { log . info ( ""Creating Kafka Streams, store name: {}"" , storeName ) ; long timeoutMillis = config . get ( Config . STALE_RESULT_TIMEOUT_MS ) ; ForeachActionDispatcher < String , Integer > dispatcher = new ForeachActionDispatcher < > ( ) ; WaitForResultService serviceImpl = new WaitForResultService ( timeoutMillis , dispatcher ) ; closeables . add ( serviceImpl ) ; AtomicBoolean done = new AtomicBoolean ( false ) ; CompletableFuture < AsyncBiFunctionService . WithSerdes < String , String , Integer > > cf = new CompletableFuture < > ( ) ; KafkaStreams . StateListener listener = ( newState , oldState ) -> { if ( newState == KafkaStreams . State . RUNNING && ! done . getAndSet ( true ) ) { cf . completeAsync ( ( ) -> serviceImpl ) ; } if ( newState == KafkaStreams . State . ERROR ) { cf . completeExceptionally ( new IllegalStateException ( ""KafkaStreams error"" ) ) ; } } ; Properties streamsProperties = new Properties ( ) ; streamsProperties . putAll ( kafkaProperties ) ; Object rf = kafkaProperties . get ( StreamsConfig . REPLICATION_FACTOR_CONFIG ) ; if ( rf == null ) { streamsProperties . put ( StreamsConfig . REPLICATION_FACTOR_CONFIG , ""-1"" ) ; } Topology topology = new TopicStoreTopologyProvider ( storeTopic , storeName , streamsProperties , dispatcher ) . get ( ) ; streams = new KafkaStreams ( topology , streamsProperties ) ; streams . setStateListener ( listener ) ; streams . setGlobalStateRestoreListener ( new LoggingStateRestoreListener ( ) ) ; closeables . add ( streams ) ; streams . start ( ) ; return cf ; } " 619,"public void mouseClicked ( MouseEvent mouseEvent ) { JList theList = ( JList ) mouseEvent . getSource ( ) ; if ( mouseEvent . getClickCount ( ) == 2 ) { int index = theList . locationToIndex ( mouseEvent . getPoint ( ) ) ; if ( index >= 0 ) { Object o = theList . getModel ( ) . getElementAt ( index ) ; send ( ""toggleFilter"" , o . toString ( ) ) ; } } } ","public void mouseClicked ( MouseEvent mouseEvent ) { JList theList = ( JList ) mouseEvent . getSource ( ) ; if ( mouseEvent . getClickCount ( ) == 2 ) { int index = theList . locationToIndex ( mouseEvent . getPoint ( ) ) ; if ( index >= 0 ) { Object o = theList . getModel ( ) . getElementAt ( index ) ; log . info ( ""Double-clicked on: {} Toggling filter enabled."" , o ) ; send ( ""toggleFilter"" , o . toString ( ) ) ; } } } " 620,"public boolean updateServiceProperties ( Map < String , String > properties ) { EntityManager em = getEntityManager ( getManagementAppId ( ) ) ; Query q = Query . fromQL ( ""select *"" ) ; Results results = null ; try { results = em . searchCollection ( em . getApplicationRef ( ) , ""propertymaps"" , q ) ; } catch ( Exception ex ) { return false ; } org . apache . usergrid . persistence . Entity propsEntity = null ; if ( ! results . isEmpty ( ) ) { propsEntity = results . getEntity ( ) ; } else { propsEntity = EntityFactory . newEntity ( UUIDUtils . newTimeUUID ( ) , ""propertymap"" ) ; } for ( String key : properties . keySet ( ) ) { propsEntity . setProperty ( key , properties . get ( key ) . toString ( ) ) ; } try { em . update ( propsEntity ) ; } catch ( Exception ex ) { logger . error ( ""Error updating service properties"" , ex ) ; return false ; } return true ; } ","public boolean updateServiceProperties ( Map < String , String > properties ) { EntityManager em = getEntityManager ( getManagementAppId ( ) ) ; Query q = Query . fromQL ( ""select *"" ) ; Results results = null ; try { results = em . searchCollection ( em . getApplicationRef ( ) , ""propertymaps"" , q ) ; } catch ( Exception ex ) { logger . error ( ""Error getting system properties"" , ex ) ; return false ; } org . apache . usergrid . persistence . Entity propsEntity = null ; if ( ! results . isEmpty ( ) ) { propsEntity = results . getEntity ( ) ; } else { propsEntity = EntityFactory . newEntity ( UUIDUtils . newTimeUUID ( ) , ""propertymap"" ) ; } for ( String key : properties . keySet ( ) ) { propsEntity . setProperty ( key , properties . get ( key ) . toString ( ) ) ; } try { em . update ( propsEntity ) ; } catch ( Exception ex ) { logger . error ( ""Error updating service properties"" , ex ) ; return false ; } return true ; } " 621,"public boolean updateServiceProperties ( Map < String , String > properties ) { EntityManager em = getEntityManager ( getManagementAppId ( ) ) ; Query q = Query . fromQL ( ""select *"" ) ; Results results = null ; try { results = em . searchCollection ( em . getApplicationRef ( ) , ""propertymaps"" , q ) ; } catch ( Exception ex ) { logger . error ( ""Error getting system properties"" , ex ) ; return false ; } org . apache . usergrid . persistence . Entity propsEntity = null ; if ( ! results . isEmpty ( ) ) { propsEntity = results . getEntity ( ) ; } else { propsEntity = EntityFactory . newEntity ( UUIDUtils . newTimeUUID ( ) , ""propertymap"" ) ; } for ( String key : properties . keySet ( ) ) { propsEntity . setProperty ( key , properties . get ( key ) . toString ( ) ) ; } try { em . update ( propsEntity ) ; } catch ( Exception ex ) { return false ; } return true ; } ","public boolean updateServiceProperties ( Map < String , String > properties ) { EntityManager em = getEntityManager ( getManagementAppId ( ) ) ; Query q = Query . fromQL ( ""select *"" ) ; Results results = null ; try { results = em . searchCollection ( em . getApplicationRef ( ) , ""propertymaps"" , q ) ; } catch ( Exception ex ) { logger . error ( ""Error getting system properties"" , ex ) ; return false ; } org . apache . usergrid . persistence . Entity propsEntity = null ; if ( ! results . isEmpty ( ) ) { propsEntity = results . getEntity ( ) ; } else { propsEntity = EntityFactory . newEntity ( UUIDUtils . newTimeUUID ( ) , ""propertymap"" ) ; } for ( String key : properties . keySet ( ) ) { propsEntity . setProperty ( key , properties . get ( key ) . toString ( ) ) ; } try { em . update ( propsEntity ) ; } catch ( Exception ex ) { logger . error ( ""Error updating service properties"" , ex ) ; return false ; } return true ; } " 622,"public CubeInstance createCubeAndDesc ( String cubeName , String projectName , CubeDesc desc ) throws IOException { if ( getCubeManager ( ) . getCube ( cubeName ) != null ) { throw new InternalErrorException ( ""The cube named "" + cubeName + "" already exists"" ) ; } String owner = SecurityContextHolder . getContext ( ) . getAuthentication ( ) . getName ( ) ; CubeDesc createdDesc = null ; CubeInstance createdCube = null ; boolean isNew = false ; if ( getCubeDescManager ( ) . getCubeDesc ( desc . getName ( ) ) == null ) { createdDesc = getCubeDescManager ( ) . createCubeDesc ( desc ) ; isNew = true ; } else { createdDesc = getCubeDescManager ( ) . updateCubeDesc ( desc ) ; } if ( ! createdDesc . getError ( ) . isEmpty ( ) ) { if ( isNew ) { getCubeDescManager ( ) . removeCubeDesc ( createdDesc ) ; } throw new InternalErrorException ( createdDesc . getError ( ) . get ( 0 ) ) ; } try { int cuboidCount = CuboidCLI . simulateCuboidGeneration ( createdDesc ) ; } catch ( Exception e ) { getCubeDescManager ( ) . removeCubeDesc ( createdDesc ) ; throw new InternalErrorException ( ""Failed to deal with the request."" , e ) ; } createdCube = getCubeManager ( ) . createCube ( cubeName , projectName , createdDesc , owner ) ; accessService . init ( createdCube , AclPermission . ADMINISTRATION ) ; ProjectInstance project = getProjectManager ( ) . getProject ( projectName ) ; accessService . inherit ( createdCube , project ) ; return createdCube ; } ","public CubeInstance createCubeAndDesc ( String cubeName , String projectName , CubeDesc desc ) throws IOException { if ( getCubeManager ( ) . getCube ( cubeName ) != null ) { throw new InternalErrorException ( ""The cube named "" + cubeName + "" already exists"" ) ; } String owner = SecurityContextHolder . getContext ( ) . getAuthentication ( ) . getName ( ) ; CubeDesc createdDesc = null ; CubeInstance createdCube = null ; boolean isNew = false ; if ( getCubeDescManager ( ) . getCubeDesc ( desc . getName ( ) ) == null ) { createdDesc = getCubeDescManager ( ) . createCubeDesc ( desc ) ; isNew = true ; } else { createdDesc = getCubeDescManager ( ) . updateCubeDesc ( desc ) ; } if ( ! createdDesc . getError ( ) . isEmpty ( ) ) { if ( isNew ) { getCubeDescManager ( ) . removeCubeDesc ( createdDesc ) ; } throw new InternalErrorException ( createdDesc . getError ( ) . get ( 0 ) ) ; } try { int cuboidCount = CuboidCLI . simulateCuboidGeneration ( createdDesc ) ; logger . info ( ""New cube "" + cubeName + "" has "" + cuboidCount + "" cuboids"" ) ; } catch ( Exception e ) { getCubeDescManager ( ) . removeCubeDesc ( createdDesc ) ; throw new InternalErrorException ( ""Failed to deal with the request."" , e ) ; } createdCube = getCubeManager ( ) . createCube ( cubeName , projectName , createdDesc , owner ) ; accessService . init ( createdCube , AclPermission . ADMINISTRATION ) ; ProjectInstance project = getProjectManager ( ) . getProject ( projectName ) ; accessService . inherit ( createdCube , project ) ; return createdCube ; } " 623,"private void initThemeResolver ( ApplicationContext context ) { try { this . themeResolver = context . getBean ( THEME_RESOLVER_BEAN_NAME , ThemeResolver . class ) ; if ( logger . isDebugEnabled ( ) ) { } } catch ( NoSuchBeanDefinitionException ex ) { this . themeResolver = getDefaultStrategy ( context , ThemeResolver . class ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Unable to locate ThemeResolver with name '"" + THEME_RESOLVER_BEAN_NAME + ""': using default ["" + this . themeResolver + ""]"" ) ; } } } ","private void initThemeResolver ( ApplicationContext context ) { try { this . themeResolver = context . getBean ( THEME_RESOLVER_BEAN_NAME , ThemeResolver . class ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Using ThemeResolver ["" + this . themeResolver + ""]"" ) ; } } catch ( NoSuchBeanDefinitionException ex ) { this . themeResolver = getDefaultStrategy ( context , ThemeResolver . class ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Unable to locate ThemeResolver with name '"" + THEME_RESOLVER_BEAN_NAME + ""': using default ["" + this . themeResolver + ""]"" ) ; } } } " 624,"private void initThemeResolver ( ApplicationContext context ) { try { this . themeResolver = context . getBean ( THEME_RESOLVER_BEAN_NAME , ThemeResolver . class ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Using ThemeResolver ["" + this . themeResolver + ""]"" ) ; } } catch ( NoSuchBeanDefinitionException ex ) { this . themeResolver = getDefaultStrategy ( context , ThemeResolver . class ) ; if ( logger . isDebugEnabled ( ) ) { } } } ","private void initThemeResolver ( ApplicationContext context ) { try { this . themeResolver = context . getBean ( THEME_RESOLVER_BEAN_NAME , ThemeResolver . class ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Using ThemeResolver ["" + this . themeResolver + ""]"" ) ; } } catch ( NoSuchBeanDefinitionException ex ) { this . themeResolver = getDefaultStrategy ( context , ThemeResolver . class ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Unable to locate ThemeResolver with name '"" + THEME_RESOLVER_BEAN_NAME + ""': using default ["" + this . themeResolver + ""]"" ) ; } } } " 625,"private double addNetworkDelays ( Solution bestSol , Topology topology , double [ ] numVisitsModule , SuitableOptions cloudCharacteristics ) { double networkDelay = 0.0 ; for ( int i = 0 ; i < topology . size ( ) ; i ++ ) { TopologyElement element = topology . getElementIndex ( i ) ; double sumOfDelaysSingleModule = 0.0 ; for ( TopologyElementCalled elementCalled : element ) { sumOfDelaysSingleModule += elementCalled . getProbCall ( ) * latencyBetweenElements ( bestSol , element . getName ( ) , elementCalled . getElement ( ) . getName ( ) , cloudCharacteristics ) ; } networkDelay += numVisitsModule [ i ] * sumOfDelaysSingleModule ; } return networkDelay ; } ","private double addNetworkDelays ( Solution bestSol , Topology topology , double [ ] numVisitsModule , SuitableOptions cloudCharacteristics ) { double networkDelay = 0.0 ; for ( int i = 0 ; i < topology . size ( ) ; i ++ ) { TopologyElement element = topology . getElementIndex ( i ) ; double sumOfDelaysSingleModule = 0.0 ; for ( TopologyElementCalled elementCalled : element ) { sumOfDelaysSingleModule += elementCalled . getProbCall ( ) * latencyBetweenElements ( bestSol , element . getName ( ) , elementCalled . getElement ( ) . getName ( ) , cloudCharacteristics ) ; } log . trace ( ""calculated network delay for module {} in solution {} is (numVisitsModule[i] * sumOfDelaysSingleModule): {}"" , i , bestSol . toString ( ) , numVisitsModule [ i ] * sumOfDelaysSingleModule ) ; networkDelay += numVisitsModule [ i ] * sumOfDelaysSingleModule ; } return networkDelay ; } " 626,"public static < T extends Entity < T > > void deleteAll ( BaseDao < T > doa ) throws ServiceFailureException { boolean more = true ; int count = 0 ; while ( more ) { EntityList < T > entities = doa . query ( ) . list ( ) ; if ( entities . getCount ( ) > 0 ) { } else { more = false ; } for ( T entity : entities ) { doa . delete ( entity ) ; count ++ ; } } LOGGER . debug ( ""Deleted {} using {}."" , count , doa . getClass ( ) . getName ( ) ) ; } ","public static < T extends Entity < T > > void deleteAll ( BaseDao < T > doa ) throws ServiceFailureException { boolean more = true ; int count = 0 ; while ( more ) { EntityList < T > entities = doa . query ( ) . list ( ) ; if ( entities . getCount ( ) > 0 ) { LOGGER . debug ( ""{} to go."" , entities . getCount ( ) ) ; } else { more = false ; } for ( T entity : entities ) { doa . delete ( entity ) ; count ++ ; } } LOGGER . debug ( ""Deleted {} using {}."" , count , doa . getClass ( ) . getName ( ) ) ; } " 627,"public static < T extends Entity < T > > void deleteAll ( BaseDao < T > doa ) throws ServiceFailureException { boolean more = true ; int count = 0 ; while ( more ) { EntityList < T > entities = doa . query ( ) . list ( ) ; if ( entities . getCount ( ) > 0 ) { LOGGER . debug ( ""{} to go."" , entities . getCount ( ) ) ; } else { more = false ; } for ( T entity : entities ) { doa . delete ( entity ) ; count ++ ; } } } ","public static < T extends Entity < T > > void deleteAll ( BaseDao < T > doa ) throws ServiceFailureException { boolean more = true ; int count = 0 ; while ( more ) { EntityList < T > entities = doa . query ( ) . list ( ) ; if ( entities . getCount ( ) > 0 ) { LOGGER . debug ( ""{} to go."" , entities . getCount ( ) ) ; } else { more = false ; } for ( T entity : entities ) { doa . delete ( entity ) ; count ++ ; } } LOGGER . debug ( ""Deleted {} using {}."" , count , doa . getClass ( ) . getName ( ) ) ; } " 628,"public int assertStatusCode ( Response res , String testName ) { int statusCode = res . getStatus ( ) ; Assert . assertTrue ( testRequestType . isValidStatusCode ( statusCode ) , invalidStatusCodeMessage ( testRequestType , statusCode ) ) ; Assert . assertEquals ( statusCode , testExpectedStatusCode ) ; return statusCode ; } ","public int assertStatusCode ( Response res , String testName ) { int statusCode = res . getStatus ( ) ; logger . debug ( testName + "": status = "" + statusCode ) ; Assert . assertTrue ( testRequestType . isValidStatusCode ( statusCode ) , invalidStatusCodeMessage ( testRequestType , statusCode ) ) ; Assert . assertEquals ( statusCode , testExpectedStatusCode ) ; return statusCode ; } " 629,"public void createSessionIdCookie ( SessionId sessionId , boolean isUma ) { try { final Object response = externalContext . getResponse ( ) ; final Object request = externalContext . getRequest ( ) ; if ( response instanceof HttpServletResponse && request instanceof HttpServletRequest ) { final HttpServletResponse httpResponse = ( HttpServletResponse ) response ; final HttpServletRequest httpRequest = ( HttpServletRequest ) request ; createSessionIdCookie ( sessionId , httpRequest , httpResponse , isUma ) ; } } catch ( Exception e ) { } } ","public void createSessionIdCookie ( SessionId sessionId , boolean isUma ) { try { final Object response = externalContext . getResponse ( ) ; final Object request = externalContext . getRequest ( ) ; if ( response instanceof HttpServletResponse && request instanceof HttpServletRequest ) { final HttpServletResponse httpResponse = ( HttpServletResponse ) response ; final HttpServletRequest httpRequest = ( HttpServletRequest ) request ; createSessionIdCookie ( sessionId , httpRequest , httpResponse , isUma ) ; } } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } } " 630,"public void callCrawlerService ( ) { getCrawlerService ( ) . crawlSite ( getAudit ( ) , getUrl ( ) ) ; } ","public void callCrawlerService ( ) { LOGGER . info ( ""Launching crawler for page "" + getUrl ( ) ) ; getCrawlerService ( ) . crawlSite ( getAudit ( ) , getUrl ( ) ) ; } " 631,"private void decodeSelfContained ( Segment < ByteBuf > segment , List < Object > out ) { ByteBuf payload = segment . payload ; int frameCount = 0 ; do { Frame frame = frameCodec . decode ( payload ) ; out . add ( frame ) ; frameCount += 1 ; } while ( payload . isReadable ( ) ) ; payload . release ( ) ; LOG . trace ( ""[{}] Done processing self-contained segment ({} frames)"" , logPrefix , frameCount ) ; } ","private void decodeSelfContained ( Segment < ByteBuf > segment , List < Object > out ) { ByteBuf payload = segment . payload ; int frameCount = 0 ; do { Frame frame = frameCodec . decode ( payload ) ; LOG . trace ( ""[{}] Decoded response frame {} from self-contained segment"" , logPrefix , frame . streamId ) ; out . add ( frame ) ; frameCount += 1 ; } while ( payload . isReadable ( ) ) ; payload . release ( ) ; LOG . trace ( ""[{}] Done processing self-contained segment ({} frames)"" , logPrefix , frameCount ) ; } " 632,"private void decodeSelfContained ( Segment < ByteBuf > segment , List < Object > out ) { ByteBuf payload = segment . payload ; int frameCount = 0 ; do { Frame frame = frameCodec . decode ( payload ) ; LOG . trace ( ""[{}] Decoded response frame {} from self-contained segment"" , logPrefix , frame . streamId ) ; out . add ( frame ) ; frameCount += 1 ; } while ( payload . isReadable ( ) ) ; payload . release ( ) ; } ","private void decodeSelfContained ( Segment < ByteBuf > segment , List < Object > out ) { ByteBuf payload = segment . payload ; int frameCount = 0 ; do { Frame frame = frameCodec . decode ( payload ) ; LOG . trace ( ""[{}] Decoded response frame {} from self-contained segment"" , logPrefix , frame . streamId ) ; out . add ( frame ) ; frameCount += 1 ; } while ( payload . isReadable ( ) ) ; payload . release ( ) ; LOG . trace ( ""[{}] Done processing self-contained segment ({} frames)"" , logPrefix , frameCount ) ; } " 633,"public static com . liferay . calendar . model . CalendarResourceSoap [ ] search ( long companyId , long [ ] groupIds , long [ ] classNameIds , String code , String name , String description , boolean active , boolean andOperator , int start , int end , com . liferay . portal . kernel . util . OrderByComparator < com . liferay . calendar . model . CalendarResource > orderByComparator ) throws RemoteException { try { java . util . List < com . liferay . calendar . model . CalendarResource > returnValue = CalendarResourceServiceUtil . search ( companyId , groupIds , classNameIds , code , name , description , active , andOperator , start , end , orderByComparator ) ; return com . liferay . calendar . model . CalendarResourceSoap . toSoapModels ( returnValue ) ; } catch ( Exception exception ) { throw new RemoteException ( exception . getMessage ( ) ) ; } } ","public static com . liferay . calendar . model . CalendarResourceSoap [ ] search ( long companyId , long [ ] groupIds , long [ ] classNameIds , String code , String name , String description , boolean active , boolean andOperator , int start , int end , com . liferay . portal . kernel . util . OrderByComparator < com . liferay . calendar . model . CalendarResource > orderByComparator ) throws RemoteException { try { java . util . List < com . liferay . calendar . model . CalendarResource > returnValue = CalendarResourceServiceUtil . search ( companyId , groupIds , classNameIds , code , name , description , active , andOperator , start , end , orderByComparator ) ; return com . liferay . calendar . model . CalendarResourceSoap . toSoapModels ( returnValue ) ; } catch ( Exception exception ) { _log . error ( exception , exception ) ; throw new RemoteException ( exception . getMessage ( ) ) ; } } " 634,"private PropertyConverter createConverter ( SecurityContext securityContext , GraphObject entity ) { try { return ( PropertyConverter < ? , T > ) constructor . newInstance ( securityContext , entity ) ; } catch ( Throwable t ) { } return null ; } ","private PropertyConverter createConverter ( SecurityContext securityContext , GraphObject entity ) { try { return ( PropertyConverter < ? , T > ) constructor . newInstance ( securityContext , entity ) ; } catch ( Throwable t ) { logger . error ( ""Unable to instantiate converter of type {} for key {}"" , new Object [ ] { constructor . getClass ( ) . getName ( ) , dbName } ) ; } return null ; } " 635,"public void encode ( Object value , OutputStream outputStream ) throws IOException { if ( converter == null ) { converter = ConvertToIndexedRecord . getConverter ( ( T ) value ) ; } IndexedRecord ir = converter . convertToAvro ( ( T ) value ) ; if ( internalAvroCoder == null ) { Schema s = converter . getSchema ( ) ; avroSchemaHolder . put ( s ) ; @ SuppressWarnings ( ""unchecked"" ) AvroCoder < IndexedRecord > tCoder = ( AvroCoder < IndexedRecord > ) ( AvroCoder < ? extends IndexedRecord > ) AvroCoder . of ( ir . getSchema ( ) ) ; internalAvroCoder = tCoder ; } LOG . debug ( ""Encode value is {}"" , value ) ; internalAvroCoder . encode ( convertToAvro ( value ) , outputStream ) ; } ","public void encode ( Object value , OutputStream outputStream ) throws IOException { if ( converter == null ) { converter = ConvertToIndexedRecord . getConverter ( ( T ) value ) ; } IndexedRecord ir = converter . convertToAvro ( ( T ) value ) ; if ( internalAvroCoder == null ) { Schema s = converter . getSchema ( ) ; avroSchemaHolder . put ( s ) ; @ SuppressWarnings ( ""unchecked"" ) AvroCoder < IndexedRecord > tCoder = ( AvroCoder < IndexedRecord > ) ( AvroCoder < ? extends IndexedRecord > ) AvroCoder . of ( ir . getSchema ( ) ) ; internalAvroCoder = tCoder ; } LOG . debug ( ""Internal AvroCoder's schema is {}"" , internalAvroCoder . getSchema ( ) ) ; LOG . debug ( ""Encode value is {}"" , value ) ; internalAvroCoder . encode ( convertToAvro ( value ) , outputStream ) ; } " 636,"public void encode ( Object value , OutputStream outputStream ) throws IOException { if ( converter == null ) { converter = ConvertToIndexedRecord . getConverter ( ( T ) value ) ; } IndexedRecord ir = converter . convertToAvro ( ( T ) value ) ; if ( internalAvroCoder == null ) { Schema s = converter . getSchema ( ) ; avroSchemaHolder . put ( s ) ; @ SuppressWarnings ( ""unchecked"" ) AvroCoder < IndexedRecord > tCoder = ( AvroCoder < IndexedRecord > ) ( AvroCoder < ? extends IndexedRecord > ) AvroCoder . of ( ir . getSchema ( ) ) ; internalAvroCoder = tCoder ; } LOG . debug ( ""Internal AvroCoder's schema is {}"" , internalAvroCoder . getSchema ( ) ) ; internalAvroCoder . encode ( convertToAvro ( value ) , outputStream ) ; } ","public void encode ( Object value , OutputStream outputStream ) throws IOException { if ( converter == null ) { converter = ConvertToIndexedRecord . getConverter ( ( T ) value ) ; } IndexedRecord ir = converter . convertToAvro ( ( T ) value ) ; if ( internalAvroCoder == null ) { Schema s = converter . getSchema ( ) ; avroSchemaHolder . put ( s ) ; @ SuppressWarnings ( ""unchecked"" ) AvroCoder < IndexedRecord > tCoder = ( AvroCoder < IndexedRecord > ) ( AvroCoder < ? extends IndexedRecord > ) AvroCoder . of ( ir . getSchema ( ) ) ; internalAvroCoder = tCoder ; } LOG . debug ( ""Internal AvroCoder's schema is {}"" , internalAvroCoder . getSchema ( ) ) ; LOG . debug ( ""Encode value is {}"" , value ) ; internalAvroCoder . encode ( convertToAvro ( value ) , outputStream ) ; } " 637,"public ConnectorPageSource createPageSource ( ConnectorTransactionHandle transaction , ConnectorSession session , ConnectorSplit split , ConnectorTableHandle table , List < ColumnHandle > columns , DynamicFilter dynamicFilter ) { BigQuerySplit bigQuerySplit = ( BigQuerySplit ) split ; checkArgument ( bigQuerySplit . getColumns ( ) . isEmpty ( ) || bigQuerySplit . getColumns ( ) . equals ( columns ) , ""Requested columns %s do not match list in split %s"" , columns , bigQuerySplit . getColumns ( ) ) ; if ( bigQuerySplit . representsEmptyProjection ( ) ) { return new BigQueryEmptyProjectionPageSource ( bigQuerySplit . getEmptyRowsToGenerate ( ) ) ; } List < BigQueryColumnHandle > bigQueryColumnHandles = columns . stream ( ) . map ( BigQueryColumnHandle . class :: cast ) . collect ( toImmutableList ( ) ) ; return new BigQueryResultPageSource ( bigQueryStorageClientFactory , maxReadRowsRetries , bigQuerySplit , bigQueryColumnHandles ) ; } ","public ConnectorPageSource createPageSource ( ConnectorTransactionHandle transaction , ConnectorSession session , ConnectorSplit split , ConnectorTableHandle table , List < ColumnHandle > columns , DynamicFilter dynamicFilter ) { log . debug ( ""createPageSource(transaction=%s, session=%s, split=%s, table=%s, columns=%s)"" , transaction , session , split , table , columns ) ; BigQuerySplit bigQuerySplit = ( BigQuerySplit ) split ; checkArgument ( bigQuerySplit . getColumns ( ) . isEmpty ( ) || bigQuerySplit . getColumns ( ) . equals ( columns ) , ""Requested columns %s do not match list in split %s"" , columns , bigQuerySplit . getColumns ( ) ) ; if ( bigQuerySplit . representsEmptyProjection ( ) ) { return new BigQueryEmptyProjectionPageSource ( bigQuerySplit . getEmptyRowsToGenerate ( ) ) ; } List < BigQueryColumnHandle > bigQueryColumnHandles = columns . stream ( ) . map ( BigQueryColumnHandle . class :: cast ) . collect ( toImmutableList ( ) ) ; return new BigQueryResultPageSource ( bigQueryStorageClientFactory , maxReadRowsRetries , bigQuerySplit , bigQueryColumnHandles ) ; } " 638,"public ReturnValue update_processing_status ( int processingID , ProcessingStatus status ) { if ( status == null ) { return new ReturnValue ( null , ""Processing.Status argument cannot be null"" , ReturnValue . INVALIDARGUMENT ) ; } StringBuilder sql = new StringBuilder ( ) ; try { sql . append ( ""UPDATE processing SET status = "" ) ; sql . append ( ""'"" ) . append ( status . name ( ) ) . append ( ""'"" ) ; sql . append ( "", update_tstmp='"" ) . append ( new Timestamp ( System . currentTimeMillis ( ) ) ) . append ( ""' "" ) ; sql . append ( "" WHERE processing_id = "" ) . append ( processingID ) ; executeUpdate ( sql . toString ( ) ) ; } catch ( SQLException e ) { return new ReturnValue ( null , ""Could not execute one of the SQL commands: "" + sql . toString ( ) + ""\nException: "" + e . getMessage ( ) , ReturnValue . SQLQUERYFAILED ) ; } return new ReturnValue ( ) ; } ","public ReturnValue update_processing_status ( int processingID , ProcessingStatus status ) { if ( status == null ) { return new ReturnValue ( null , ""Processing.Status argument cannot be null"" , ReturnValue . INVALIDARGUMENT ) ; } StringBuilder sql = new StringBuilder ( ) ; try { sql . append ( ""UPDATE processing SET status = "" ) ; sql . append ( ""'"" ) . append ( status . name ( ) ) . append ( ""'"" ) ; sql . append ( "", update_tstmp='"" ) . append ( new Timestamp ( System . currentTimeMillis ( ) ) ) . append ( ""' "" ) ; sql . append ( "" WHERE processing_id = "" ) . append ( processingID ) ; executeUpdate ( sql . toString ( ) ) ; } catch ( SQLException e ) { logger . error ( ""SQL Command failed: "" + sql . toString ( ) + "":"" + e . getMessage ( ) ) ; return new ReturnValue ( null , ""Could not execute one of the SQL commands: "" + sql . toString ( ) + ""\nException: "" + e . getMessage ( ) , ReturnValue . SQLQUERYFAILED ) ; } return new ReturnValue ( ) ; } " 639,"@ JmsListener ( destination = MetadataTopics . FEED_INIT_STATUS_CHANGE , containerFactory = JmsConstants . TOPIC_LISTENER_CONTAINER_FACTORY ) public void receiveEvent ( FeedInitializationChangeEvent event ) { LOG . info ( ""{} Received feed initialization status change event: {}"" , this , event ) ; if ( this . metadataRecorders . isEmpty ( ) ) { LOG . debug ( ""No metadata recorder registerd yet - ingoring event: {}"" , event ) ; } else { this . metadataRecorders . forEach ( r -> r . initializationStatusChanged ( event . getFeedId ( ) , event . getStatus ( ) ) ) ; } } ","@ JmsListener ( destination = MetadataTopics . FEED_INIT_STATUS_CHANGE , containerFactory = JmsConstants . TOPIC_LISTENER_CONTAINER_FACTORY ) public void receiveEvent ( FeedInitializationChangeEvent event ) { LOG . debug ( ""{} Received JMS message - topic: {}, message: {}"" , this , MetadataTopics . FEED_INIT_STATUS_CHANGE , event ) ; LOG . info ( ""{} Received feed initialization status change event: {}"" , this , event ) ; if ( this . metadataRecorders . isEmpty ( ) ) { LOG . debug ( ""No metadata recorder registerd yet - ingoring event: {}"" , event ) ; } else { this . metadataRecorders . forEach ( r -> r . initializationStatusChanged ( event . getFeedId ( ) , event . getStatus ( ) ) ) ; } } " 640,"@ JmsListener ( destination = MetadataTopics . FEED_INIT_STATUS_CHANGE , containerFactory = JmsConstants . TOPIC_LISTENER_CONTAINER_FACTORY ) public void receiveEvent ( FeedInitializationChangeEvent event ) { LOG . debug ( ""{} Received JMS message - topic: {}, message: {}"" , this , MetadataTopics . FEED_INIT_STATUS_CHANGE , event ) ; if ( this . metadataRecorders . isEmpty ( ) ) { LOG . debug ( ""No metadata recorder registerd yet - ingoring event: {}"" , event ) ; } else { this . metadataRecorders . forEach ( r -> r . initializationStatusChanged ( event . getFeedId ( ) , event . getStatus ( ) ) ) ; } } ","@ JmsListener ( destination = MetadataTopics . FEED_INIT_STATUS_CHANGE , containerFactory = JmsConstants . TOPIC_LISTENER_CONTAINER_FACTORY ) public void receiveEvent ( FeedInitializationChangeEvent event ) { LOG . debug ( ""{} Received JMS message - topic: {}, message: {}"" , this , MetadataTopics . FEED_INIT_STATUS_CHANGE , event ) ; LOG . info ( ""{} Received feed initialization status change event: {}"" , this , event ) ; if ( this . metadataRecorders . isEmpty ( ) ) { LOG . debug ( ""No metadata recorder registerd yet - ingoring event: {}"" , event ) ; } else { this . metadataRecorders . forEach ( r -> r . initializationStatusChanged ( event . getFeedId ( ) , event . getStatus ( ) ) ) ; } } " 641,"@ JmsListener ( destination = MetadataTopics . FEED_INIT_STATUS_CHANGE , containerFactory = JmsConstants . TOPIC_LISTENER_CONTAINER_FACTORY ) public void receiveEvent ( FeedInitializationChangeEvent event ) { LOG . debug ( ""{} Received JMS message - topic: {}, message: {}"" , this , MetadataTopics . FEED_INIT_STATUS_CHANGE , event ) ; LOG . info ( ""{} Received feed initialization status change event: {}"" , this , event ) ; if ( this . metadataRecorders . isEmpty ( ) ) { } else { this . metadataRecorders . forEach ( r -> r . initializationStatusChanged ( event . getFeedId ( ) , event . getStatus ( ) ) ) ; } } ","@ JmsListener ( destination = MetadataTopics . FEED_INIT_STATUS_CHANGE , containerFactory = JmsConstants . TOPIC_LISTENER_CONTAINER_FACTORY ) public void receiveEvent ( FeedInitializationChangeEvent event ) { LOG . debug ( ""{} Received JMS message - topic: {}, message: {}"" , this , MetadataTopics . FEED_INIT_STATUS_CHANGE , event ) ; LOG . info ( ""{} Received feed initialization status change event: {}"" , this , event ) ; if ( this . metadataRecorders . isEmpty ( ) ) { LOG . debug ( ""No metadata recorder registerd yet - ingoring event: {}"" , event ) ; } else { this . metadataRecorders . forEach ( r -> r . initializationStatusChanged ( event . getFeedId ( ) , event . getStatus ( ) ) ) ; } } " 642,"private void logError ( Path path , IOException e ) { if ( logToStdErr ) { System . err . println ( ""Unexpected file visiting failure: "" + path ) ; e . printStackTrace ( ) ; } else { } } ","private void logError ( Path path , IOException e ) { if ( logToStdErr ) { System . err . println ( ""Unexpected file visiting failure: "" + path ) ; e . printStackTrace ( ) ; } else { LOGGER . error ( ""Unexpected file visiting failure: "" + path , e ) ; } } " 643,"public void doConfigure ( ServiceProfile < ? > profile ) throws InterruptedException , IOException { directory = prepareDirectory ( profile ) ; LOG . debug ( ""Configured file sessions: {}"" , directory ) ; } ","public void doConfigure ( ServiceProfile < ? > profile ) throws InterruptedException , IOException { LOG . debug ( ""Configuring file sessions: {}"" , profile . getPrefix ( ) ) ; directory = prepareDirectory ( profile ) ; LOG . debug ( ""Configured file sessions: {}"" , directory ) ; } " 644,"public void doConfigure ( ServiceProfile < ? > profile ) throws InterruptedException , IOException { LOG . debug ( ""Configuring file sessions: {}"" , profile . getPrefix ( ) ) ; directory = prepareDirectory ( profile ) ; } ","public void doConfigure ( ServiceProfile < ? > profile ) throws InterruptedException , IOException { LOG . debug ( ""Configuring file sessions: {}"" , profile . getPrefix ( ) ) ; directory = prepareDirectory ( profile ) ; LOG . debug ( ""Configured file sessions: {}"" , directory ) ; } " 645,"public MLModel call ( ) throws Exception { FileSystem fs = modelPath . getFileSystem ( new HiveConf ( ) ) ; if ( ! fs . exists ( modelPath ) ) { throw new IOException ( ""Model path not found "" + modelPath . toString ( ) ) ; } ObjectInputStream ois = null ; try { ois = new ObjectInputStream ( fs . open ( modelPath ) ) ; MLModel model = ( MLModel ) ois . readObject ( ) ; return model ; } catch ( ClassNotFoundException e ) { throw new IOException ( e ) ; } finally { IOUtils . closeQuietly ( ois ) ; } } ","public MLModel call ( ) throws Exception { FileSystem fs = modelPath . getFileSystem ( new HiveConf ( ) ) ; if ( ! fs . exists ( modelPath ) ) { throw new IOException ( ""Model path not found "" + modelPath . toString ( ) ) ; } ObjectInputStream ois = null ; try { ois = new ObjectInputStream ( fs . open ( modelPath ) ) ; MLModel model = ( MLModel ) ois . readObject ( ) ; log . info ( ""Loaded model {} from location {}"" , model . getId ( ) , modelPath ) ; return model ; } catch ( ClassNotFoundException e ) { throw new IOException ( e ) ; } finally { IOUtils . closeQuietly ( ois ) ; } } " 646,"public List < ViewResult . Row > getDBViewQueryResult ( String id , String docEntityType ) { List < ViewResult . Row > rows = db . queryView ( new ViewQuery ( ) . viewName ( CASE_ID_VIEW_NAME ) . designDocId ( ""_design/"" + docEntityType ) . key ( id ) . queryParam ( ID_FIELD_ON_ENTITY , id ) . includeDocs ( true ) ) . getRows ( ) ; logger . debug ( MessageFormat . format ( ""Found these rows for entityType: {0}, with id: {1}, rows: {2}"" , docEntityType , id , rows ) ) ; return rows ; } ","public List < ViewResult . Row > getDBViewQueryResult ( String id , String docEntityType ) { logger . info ( MessageFormat . format ( ""Trying to load entityType: {0}, with id: {1}"" , docEntityType , id ) ) ; List < ViewResult . Row > rows = db . queryView ( new ViewQuery ( ) . viewName ( CASE_ID_VIEW_NAME ) . designDocId ( ""_design/"" + docEntityType ) . key ( id ) . queryParam ( ID_FIELD_ON_ENTITY , id ) . includeDocs ( true ) ) . getRows ( ) ; logger . debug ( MessageFormat . format ( ""Found these rows for entityType: {0}, with id: {1}, rows: {2}"" , docEntityType , id , rows ) ) ; return rows ; } " 647,"public List < ViewResult . Row > getDBViewQueryResult ( String id , String docEntityType ) { logger . info ( MessageFormat . format ( ""Trying to load entityType: {0}, with id: {1}"" , docEntityType , id ) ) ; List < ViewResult . Row > rows = db . queryView ( new ViewQuery ( ) . viewName ( CASE_ID_VIEW_NAME ) . designDocId ( ""_design/"" + docEntityType ) . key ( id ) . queryParam ( ID_FIELD_ON_ENTITY , id ) . includeDocs ( true ) ) . getRows ( ) ; return rows ; } ","public List < ViewResult . Row > getDBViewQueryResult ( String id , String docEntityType ) { logger . info ( MessageFormat . format ( ""Trying to load entityType: {0}, with id: {1}"" , docEntityType , id ) ) ; List < ViewResult . Row > rows = db . queryView ( new ViewQuery ( ) . viewName ( CASE_ID_VIEW_NAME ) . designDocId ( ""_design/"" + docEntityType ) . key ( id ) . queryParam ( ID_FIELD_ON_ENTITY , id ) . includeDocs ( true ) ) . getRows ( ) ; logger . debug ( MessageFormat . format ( ""Found these rows for entityType: {0}, with id: {1}, rows: {2}"" , docEntityType , id , rows ) ) ; return rows ; } " 648,"public void beforeDocumentChange ( DocumentEvent e ) { if ( myDuringOnesideDocumentModification ) return ; if ( myChangedBlockData == null ) { return ; } try { myDuringTwosideDocumentModification = true ; Document twosideDocument = getDocument ( myMasterSide ) ; LineCol onesideStartPosition = LineCol . fromOffset ( myDocument , e . getOffset ( ) ) ; LineCol onesideEndPosition = LineCol . fromOffset ( myDocument , e . getOffset ( ) + e . getOldLength ( ) ) ; int line1 = onesideStartPosition . line ; int line2 = onesideEndPosition . line + 1 ; int shift = DiffUtil . countLinesShift ( e ) ; int twosideStartLine = transferLineFromOnesideStrict ( myMasterSide , onesideStartPosition . line ) ; int twosideEndLine = transferLineFromOnesideStrict ( myMasterSide , onesideEndPosition . line ) ; if ( twosideStartLine == - 1 || twosideEndLine == - 1 ) { logDebugInfo ( e , onesideStartPosition , onesideEndPosition , twosideStartLine , twosideEndLine ) ; markSuppressEditorTyping ( ) ; return ; } int twosideStartOffset = twosideDocument . getLineStartOffset ( twosideStartLine ) + onesideStartPosition . column ; int twosideEndOffset = twosideDocument . getLineStartOffset ( twosideEndLine ) + onesideEndPosition . column ; twosideDocument . replaceString ( twosideStartOffset , twosideEndOffset , e . getNewFragment ( ) ) ; for ( UnifiedDiffChange change : myChangedBlockData . getDiffChanges ( ) ) { change . processChange ( line1 , line2 , shift ) ; } LineNumberConvertor lineNumberConvertor = myChangedBlockData . getLineNumberConvertor ( ) ; lineNumberConvertor . handleOnesideChange ( line1 , line2 , shift , myMasterSide ) ; } finally { markStateIsOutOfDate ( ) ; scheduleRediff ( ) ; myDuringTwosideDocumentModification = false ; } } ","public void beforeDocumentChange ( DocumentEvent e ) { if ( myDuringOnesideDocumentModification ) return ; if ( myChangedBlockData == null ) { LOG . warn ( ""oneside beforeDocumentChange - myChangedBlockData == null"" ) ; return ; } try { myDuringTwosideDocumentModification = true ; Document twosideDocument = getDocument ( myMasterSide ) ; LineCol onesideStartPosition = LineCol . fromOffset ( myDocument , e . getOffset ( ) ) ; LineCol onesideEndPosition = LineCol . fromOffset ( myDocument , e . getOffset ( ) + e . getOldLength ( ) ) ; int line1 = onesideStartPosition . line ; int line2 = onesideEndPosition . line + 1 ; int shift = DiffUtil . countLinesShift ( e ) ; int twosideStartLine = transferLineFromOnesideStrict ( myMasterSide , onesideStartPosition . line ) ; int twosideEndLine = transferLineFromOnesideStrict ( myMasterSide , onesideEndPosition . line ) ; if ( twosideStartLine == - 1 || twosideEndLine == - 1 ) { logDebugInfo ( e , onesideStartPosition , onesideEndPosition , twosideStartLine , twosideEndLine ) ; markSuppressEditorTyping ( ) ; return ; } int twosideStartOffset = twosideDocument . getLineStartOffset ( twosideStartLine ) + onesideStartPosition . column ; int twosideEndOffset = twosideDocument . getLineStartOffset ( twosideEndLine ) + onesideEndPosition . column ; twosideDocument . replaceString ( twosideStartOffset , twosideEndOffset , e . getNewFragment ( ) ) ; for ( UnifiedDiffChange change : myChangedBlockData . getDiffChanges ( ) ) { change . processChange ( line1 , line2 , shift ) ; } LineNumberConvertor lineNumberConvertor = myChangedBlockData . getLineNumberConvertor ( ) ; lineNumberConvertor . handleOnesideChange ( line1 , line2 , shift , myMasterSide ) ; } finally { markStateIsOutOfDate ( ) ; scheduleRediff ( ) ; myDuringTwosideDocumentModification = false ; } } " 649,"private Optional < TaskCleanupType > getCleanupType ( SingularityTaskId taskId , String statusMessage ) { try { String [ ] cleanupTypeString = statusMessage . split ( ""\\s+"" ) ; if ( cleanupTypeString . length > 0 ) { return Optional . of ( TaskCleanupType . valueOf ( cleanupTypeString [ 0 ] ) ) ; } } catch ( Throwable t ) { } return Optional . empty ( ) ; } ","private Optional < TaskCleanupType > getCleanupType ( SingularityTaskId taskId , String statusMessage ) { try { String [ ] cleanupTypeString = statusMessage . split ( ""\\s+"" ) ; if ( cleanupTypeString . length > 0 ) { return Optional . of ( TaskCleanupType . valueOf ( cleanupTypeString [ 0 ] ) ) ; } } catch ( Throwable t ) { LOG . info ( ""Could not parse cleanup type from {} for {}"" , statusMessage , taskId ) ; } return Optional . empty ( ) ; } " 650,"public void init ( FilterConfig filterConfig ) throws ServletException { ServletContext context = filterConfig . getServletContext ( ) ; Object attribute = context . getAttribute ( TAG_CORE_SETTINGS ) ; if ( ! ( attribute instanceof CoreSettings ) ) { throw new IllegalArgumentException ( ""Could not load core settings."" ) ; } CoreSettings coreSettings = ( CoreSettings ) attribute ; Settings authSettings = coreSettings . getAuthSettings ( ) ; roleMappings = AuthUtils . loadRoleMapping ( authSettings ) ; final boolean anonRead = authSettings . getBoolean ( TAG_AUTH_ALLOW_ANON_READ , CoreSettings . class ) ; roleMappersByPath . put ( ""/Data"" , method -> Role . ADMIN ) ; roleMappersByPath . put ( ""/keyc"" , method -> Role . ADMIN ) ; final Utils . MethodRoleMapper roleMapperSta = ( HttpMethod method ) -> { switch ( method ) { case DELETE : return Role . DELETE ; case GET : if ( anonRead ) { return Role . NONE ; } return Role . READ ; case HEAD : return Role . NONE ; case PATCH : return Role . UPDATE ; case POST : return Role . CREATE ; case PUT : return Role . UPDATE ; case OPTIONS : return Role . NONE ; default : return Role . ERROR ; } } ; roleMappersByPath . put ( ""/v1.0"" , roleMapperSta ) ; roleMappersByPath . put ( ""/v1.1"" , roleMapperSta ) ; try { deploymentContext = new AdapterDeploymentContext ( Utils . resolveDeployment ( coreSettings ) ) ; } catch ( RuntimeException exc ) { LOGGER . error ( ""Failed to initialise Keycloak. There is a problem with the configuration."" ) ; throw new IllegalArgumentException ( ""Exception initialising keycloak."" , exc ) ; } nodesRegistrationManagement = new NodesRegistrationManagement ( ) ; sessionCleaner = new UserSessionManagement ( ) { @ Override public void logoutAll ( ) { idMapper . clear ( ) ; } @ Override public void logoutHttpSessions ( List < String > ids ) { LOGGER . debug ( ""Logging out Http Sessions"" ) ; for ( String id : ids ) { LOGGER . debug ( ""Removed session: {}"" , id ) ; idMapper . removeSession ( id ) ; } } } ; } ","public void init ( FilterConfig filterConfig ) throws ServletException { ServletContext context = filterConfig . getServletContext ( ) ; Object attribute = context . getAttribute ( TAG_CORE_SETTINGS ) ; if ( ! ( attribute instanceof CoreSettings ) ) { throw new IllegalArgumentException ( ""Could not load core settings."" ) ; } CoreSettings coreSettings = ( CoreSettings ) attribute ; Settings authSettings = coreSettings . getAuthSettings ( ) ; roleMappings = AuthUtils . loadRoleMapping ( authSettings ) ; final boolean anonRead = authSettings . getBoolean ( TAG_AUTH_ALLOW_ANON_READ , CoreSettings . class ) ; roleMappersByPath . put ( ""/Data"" , method -> Role . ADMIN ) ; roleMappersByPath . put ( ""/keyc"" , method -> Role . ADMIN ) ; final Utils . MethodRoleMapper roleMapperSta = ( HttpMethod method ) -> { switch ( method ) { case DELETE : return Role . DELETE ; case GET : if ( anonRead ) { return Role . NONE ; } return Role . READ ; case HEAD : return Role . NONE ; case PATCH : return Role . UPDATE ; case POST : return Role . CREATE ; case PUT : return Role . UPDATE ; case OPTIONS : return Role . NONE ; default : LOGGER . error ( ""Unknown method: {}"" , method ) ; return Role . ERROR ; } } ; roleMappersByPath . put ( ""/v1.0"" , roleMapperSta ) ; roleMappersByPath . put ( ""/v1.1"" , roleMapperSta ) ; try { deploymentContext = new AdapterDeploymentContext ( Utils . resolveDeployment ( coreSettings ) ) ; } catch ( RuntimeException exc ) { LOGGER . error ( ""Failed to initialise Keycloak. There is a problem with the configuration."" ) ; throw new IllegalArgumentException ( ""Exception initialising keycloak."" , exc ) ; } nodesRegistrationManagement = new NodesRegistrationManagement ( ) ; sessionCleaner = new UserSessionManagement ( ) { @ Override public void logoutAll ( ) { idMapper . clear ( ) ; } @ Override public void logoutHttpSessions ( List < String > ids ) { LOGGER . debug ( ""Logging out Http Sessions"" ) ; for ( String id : ids ) { LOGGER . debug ( ""Removed session: {}"" , id ) ; idMapper . removeSession ( id ) ; } } } ; } " 651,"public void init ( FilterConfig filterConfig ) throws ServletException { ServletContext context = filterConfig . getServletContext ( ) ; Object attribute = context . getAttribute ( TAG_CORE_SETTINGS ) ; if ( ! ( attribute instanceof CoreSettings ) ) { throw new IllegalArgumentException ( ""Could not load core settings."" ) ; } CoreSettings coreSettings = ( CoreSettings ) attribute ; Settings authSettings = coreSettings . getAuthSettings ( ) ; roleMappings = AuthUtils . loadRoleMapping ( authSettings ) ; final boolean anonRead = authSettings . getBoolean ( TAG_AUTH_ALLOW_ANON_READ , CoreSettings . class ) ; roleMappersByPath . put ( ""/Data"" , method -> Role . ADMIN ) ; roleMappersByPath . put ( ""/keyc"" , method -> Role . ADMIN ) ; final Utils . MethodRoleMapper roleMapperSta = ( HttpMethod method ) -> { switch ( method ) { case DELETE : return Role . DELETE ; case GET : if ( anonRead ) { return Role . NONE ; } return Role . READ ; case HEAD : return Role . NONE ; case PATCH : return Role . UPDATE ; case POST : return Role . CREATE ; case PUT : return Role . UPDATE ; case OPTIONS : return Role . NONE ; default : LOGGER . error ( ""Unknown method: {}"" , method ) ; return Role . ERROR ; } } ; roleMappersByPath . put ( ""/v1.0"" , roleMapperSta ) ; roleMappersByPath . put ( ""/v1.1"" , roleMapperSta ) ; try { deploymentContext = new AdapterDeploymentContext ( Utils . resolveDeployment ( coreSettings ) ) ; } catch ( RuntimeException exc ) { throw new IllegalArgumentException ( ""Exception initialising keycloak."" , exc ) ; } nodesRegistrationManagement = new NodesRegistrationManagement ( ) ; sessionCleaner = new UserSessionManagement ( ) { @ Override public void logoutAll ( ) { idMapper . clear ( ) ; } @ Override public void logoutHttpSessions ( List < String > ids ) { LOGGER . debug ( ""Logging out Http Sessions"" ) ; for ( String id : ids ) { LOGGER . debug ( ""Removed session: {}"" , id ) ; idMapper . removeSession ( id ) ; } } } ; } ","public void init ( FilterConfig filterConfig ) throws ServletException { ServletContext context = filterConfig . getServletContext ( ) ; Object attribute = context . getAttribute ( TAG_CORE_SETTINGS ) ; if ( ! ( attribute instanceof CoreSettings ) ) { throw new IllegalArgumentException ( ""Could not load core settings."" ) ; } CoreSettings coreSettings = ( CoreSettings ) attribute ; Settings authSettings = coreSettings . getAuthSettings ( ) ; roleMappings = AuthUtils . loadRoleMapping ( authSettings ) ; final boolean anonRead = authSettings . getBoolean ( TAG_AUTH_ALLOW_ANON_READ , CoreSettings . class ) ; roleMappersByPath . put ( ""/Data"" , method -> Role . ADMIN ) ; roleMappersByPath . put ( ""/keyc"" , method -> Role . ADMIN ) ; final Utils . MethodRoleMapper roleMapperSta = ( HttpMethod method ) -> { switch ( method ) { case DELETE : return Role . DELETE ; case GET : if ( anonRead ) { return Role . NONE ; } return Role . READ ; case HEAD : return Role . NONE ; case PATCH : return Role . UPDATE ; case POST : return Role . CREATE ; case PUT : return Role . UPDATE ; case OPTIONS : return Role . NONE ; default : LOGGER . error ( ""Unknown method: {}"" , method ) ; return Role . ERROR ; } } ; roleMappersByPath . put ( ""/v1.0"" , roleMapperSta ) ; roleMappersByPath . put ( ""/v1.1"" , roleMapperSta ) ; try { deploymentContext = new AdapterDeploymentContext ( Utils . resolveDeployment ( coreSettings ) ) ; } catch ( RuntimeException exc ) { LOGGER . error ( ""Failed to initialise Keycloak. There is a problem with the configuration."" ) ; throw new IllegalArgumentException ( ""Exception initialising keycloak."" , exc ) ; } nodesRegistrationManagement = new NodesRegistrationManagement ( ) ; sessionCleaner = new UserSessionManagement ( ) { @ Override public void logoutAll ( ) { idMapper . clear ( ) ; } @ Override public void logoutHttpSessions ( List < String > ids ) { LOGGER . debug ( ""Logging out Http Sessions"" ) ; for ( String id : ids ) { LOGGER . debug ( ""Removed session: {}"" , id ) ; idMapper . removeSession ( id ) ; } } } ; } " 652,"public void init ( FilterConfig filterConfig ) throws ServletException { ServletContext context = filterConfig . getServletContext ( ) ; Object attribute = context . getAttribute ( TAG_CORE_SETTINGS ) ; if ( ! ( attribute instanceof CoreSettings ) ) { throw new IllegalArgumentException ( ""Could not load core settings."" ) ; } CoreSettings coreSettings = ( CoreSettings ) attribute ; Settings authSettings = coreSettings . getAuthSettings ( ) ; roleMappings = AuthUtils . loadRoleMapping ( authSettings ) ; final boolean anonRead = authSettings . getBoolean ( TAG_AUTH_ALLOW_ANON_READ , CoreSettings . class ) ; roleMappersByPath . put ( ""/Data"" , method -> Role . ADMIN ) ; roleMappersByPath . put ( ""/keyc"" , method -> Role . ADMIN ) ; final Utils . MethodRoleMapper roleMapperSta = ( HttpMethod method ) -> { switch ( method ) { case DELETE : return Role . DELETE ; case GET : if ( anonRead ) { return Role . NONE ; } return Role . READ ; case HEAD : return Role . NONE ; case PATCH : return Role . UPDATE ; case POST : return Role . CREATE ; case PUT : return Role . UPDATE ; case OPTIONS : return Role . NONE ; default : LOGGER . error ( ""Unknown method: {}"" , method ) ; return Role . ERROR ; } } ; roleMappersByPath . put ( ""/v1.0"" , roleMapperSta ) ; roleMappersByPath . put ( ""/v1.1"" , roleMapperSta ) ; try { deploymentContext = new AdapterDeploymentContext ( Utils . resolveDeployment ( coreSettings ) ) ; } catch ( RuntimeException exc ) { LOGGER . error ( ""Failed to initialise Keycloak. There is a problem with the configuration."" ) ; throw new IllegalArgumentException ( ""Exception initialising keycloak."" , exc ) ; } nodesRegistrationManagement = new NodesRegistrationManagement ( ) ; sessionCleaner = new UserSessionManagement ( ) { @ Override public void logoutAll ( ) { idMapper . clear ( ) ; } @ Override public void logoutHttpSessions ( List < String > ids ) { for ( String id : ids ) { LOGGER . debug ( ""Removed session: {}"" , id ) ; idMapper . removeSession ( id ) ; } } } ; } ","public void init ( FilterConfig filterConfig ) throws ServletException { ServletContext context = filterConfig . getServletContext ( ) ; Object attribute = context . getAttribute ( TAG_CORE_SETTINGS ) ; if ( ! ( attribute instanceof CoreSettings ) ) { throw new IllegalArgumentException ( ""Could not load core settings."" ) ; } CoreSettings coreSettings = ( CoreSettings ) attribute ; Settings authSettings = coreSettings . getAuthSettings ( ) ; roleMappings = AuthUtils . loadRoleMapping ( authSettings ) ; final boolean anonRead = authSettings . getBoolean ( TAG_AUTH_ALLOW_ANON_READ , CoreSettings . class ) ; roleMappersByPath . put ( ""/Data"" , method -> Role . ADMIN ) ; roleMappersByPath . put ( ""/keyc"" , method -> Role . ADMIN ) ; final Utils . MethodRoleMapper roleMapperSta = ( HttpMethod method ) -> { switch ( method ) { case DELETE : return Role . DELETE ; case GET : if ( anonRead ) { return Role . NONE ; } return Role . READ ; case HEAD : return Role . NONE ; case PATCH : return Role . UPDATE ; case POST : return Role . CREATE ; case PUT : return Role . UPDATE ; case OPTIONS : return Role . NONE ; default : LOGGER . error ( ""Unknown method: {}"" , method ) ; return Role . ERROR ; } } ; roleMappersByPath . put ( ""/v1.0"" , roleMapperSta ) ; roleMappersByPath . put ( ""/v1.1"" , roleMapperSta ) ; try { deploymentContext = new AdapterDeploymentContext ( Utils . resolveDeployment ( coreSettings ) ) ; } catch ( RuntimeException exc ) { LOGGER . error ( ""Failed to initialise Keycloak. There is a problem with the configuration."" ) ; throw new IllegalArgumentException ( ""Exception initialising keycloak."" , exc ) ; } nodesRegistrationManagement = new NodesRegistrationManagement ( ) ; sessionCleaner = new UserSessionManagement ( ) { @ Override public void logoutAll ( ) { idMapper . clear ( ) ; } @ Override public void logoutHttpSessions ( List < String > ids ) { LOGGER . debug ( ""Logging out Http Sessions"" ) ; for ( String id : ids ) { LOGGER . debug ( ""Removed session: {}"" , id ) ; idMapper . removeSession ( id ) ; } } } ; } " 653,"public void init ( FilterConfig filterConfig ) throws ServletException { ServletContext context = filterConfig . getServletContext ( ) ; Object attribute = context . getAttribute ( TAG_CORE_SETTINGS ) ; if ( ! ( attribute instanceof CoreSettings ) ) { throw new IllegalArgumentException ( ""Could not load core settings."" ) ; } CoreSettings coreSettings = ( CoreSettings ) attribute ; Settings authSettings = coreSettings . getAuthSettings ( ) ; roleMappings = AuthUtils . loadRoleMapping ( authSettings ) ; final boolean anonRead = authSettings . getBoolean ( TAG_AUTH_ALLOW_ANON_READ , CoreSettings . class ) ; roleMappersByPath . put ( ""/Data"" , method -> Role . ADMIN ) ; roleMappersByPath . put ( ""/keyc"" , method -> Role . ADMIN ) ; final Utils . MethodRoleMapper roleMapperSta = ( HttpMethod method ) -> { switch ( method ) { case DELETE : return Role . DELETE ; case GET : if ( anonRead ) { return Role . NONE ; } return Role . READ ; case HEAD : return Role . NONE ; case PATCH : return Role . UPDATE ; case POST : return Role . CREATE ; case PUT : return Role . UPDATE ; case OPTIONS : return Role . NONE ; default : LOGGER . error ( ""Unknown method: {}"" , method ) ; return Role . ERROR ; } } ; roleMappersByPath . put ( ""/v1.0"" , roleMapperSta ) ; roleMappersByPath . put ( ""/v1.1"" , roleMapperSta ) ; try { deploymentContext = new AdapterDeploymentContext ( Utils . resolveDeployment ( coreSettings ) ) ; } catch ( RuntimeException exc ) { LOGGER . error ( ""Failed to initialise Keycloak. There is a problem with the configuration."" ) ; throw new IllegalArgumentException ( ""Exception initialising keycloak."" , exc ) ; } nodesRegistrationManagement = new NodesRegistrationManagement ( ) ; sessionCleaner = new UserSessionManagement ( ) { @ Override public void logoutAll ( ) { idMapper . clear ( ) ; } @ Override public void logoutHttpSessions ( List < String > ids ) { LOGGER . debug ( ""Logging out Http Sessions"" ) ; for ( String id : ids ) { idMapper . removeSession ( id ) ; } } } ; } ","public void init ( FilterConfig filterConfig ) throws ServletException { ServletContext context = filterConfig . getServletContext ( ) ; Object attribute = context . getAttribute ( TAG_CORE_SETTINGS ) ; if ( ! ( attribute instanceof CoreSettings ) ) { throw new IllegalArgumentException ( ""Could not load core settings."" ) ; } CoreSettings coreSettings = ( CoreSettings ) attribute ; Settings authSettings = coreSettings . getAuthSettings ( ) ; roleMappings = AuthUtils . loadRoleMapping ( authSettings ) ; final boolean anonRead = authSettings . getBoolean ( TAG_AUTH_ALLOW_ANON_READ , CoreSettings . class ) ; roleMappersByPath . put ( ""/Data"" , method -> Role . ADMIN ) ; roleMappersByPath . put ( ""/keyc"" , method -> Role . ADMIN ) ; final Utils . MethodRoleMapper roleMapperSta = ( HttpMethod method ) -> { switch ( method ) { case DELETE : return Role . DELETE ; case GET : if ( anonRead ) { return Role . NONE ; } return Role . READ ; case HEAD : return Role . NONE ; case PATCH : return Role . UPDATE ; case POST : return Role . CREATE ; case PUT : return Role . UPDATE ; case OPTIONS : return Role . NONE ; default : LOGGER . error ( ""Unknown method: {}"" , method ) ; return Role . ERROR ; } } ; roleMappersByPath . put ( ""/v1.0"" , roleMapperSta ) ; roleMappersByPath . put ( ""/v1.1"" , roleMapperSta ) ; try { deploymentContext = new AdapterDeploymentContext ( Utils . resolveDeployment ( coreSettings ) ) ; } catch ( RuntimeException exc ) { LOGGER . error ( ""Failed to initialise Keycloak. There is a problem with the configuration."" ) ; throw new IllegalArgumentException ( ""Exception initialising keycloak."" , exc ) ; } nodesRegistrationManagement = new NodesRegistrationManagement ( ) ; sessionCleaner = new UserSessionManagement ( ) { @ Override public void logoutAll ( ) { idMapper . clear ( ) ; } @ Override public void logoutHttpSessions ( List < String > ids ) { LOGGER . debug ( ""Logging out Http Sessions"" ) ; for ( String id : ids ) { LOGGER . debug ( ""Removed session: {}"" , id ) ; idMapper . removeSession ( id ) ; } } } ; } " 654,"public static void annotationMockSupportSetup ( Class < ? > testClass , String methodName , ActivitiMockSupport mockSupport ) { Method method = null ; try { method = testClass . getMethod ( methodName , ( Class < ? > [ ] ) null ) ; } catch ( Exception e ) { return ; } handleMockServiceTaskAnnotation ( mockSupport , method ) ; handleMockServiceTasksAnnotation ( mockSupport , method ) ; handleNoOpServiceTasksAnnotation ( mockSupport , method ) ; } ","public static void annotationMockSupportSetup ( Class < ? > testClass , String methodName , ActivitiMockSupport mockSupport ) { Method method = null ; try { method = testClass . getMethod ( methodName , ( Class < ? > [ ] ) null ) ; } catch ( Exception e ) { log . warn ( ""Could not get method by reflection. This could happen if you are using @Parameters in combination with annotations."" , e ) ; return ; } handleMockServiceTaskAnnotation ( mockSupport , method ) ; handleMockServiceTasksAnnotation ( mockSupport , method ) ; handleNoOpServiceTasksAnnotation ( mockSupport , method ) ; } " 655,"public void onWarning ( String message ) { if ( loggingInitialized . get ( ) ) { } else { warnings . add ( message ) ; } } ","public void onWarning ( String message ) { if ( loggingInitialized . get ( ) ) { log . warn ( message ) ; } else { warnings . add ( message ) ; } } " 656,"public static SortedKeyValueIterator < Key , Value > loadIterators ( SortedKeyValueIterator < Key , Value > source , IterLoad iterLoad ) throws IOException { SortedKeyValueIterator < Key , Value > prev = source ; try { for ( IterInfo iterInfo : iterLoad . iters ) { Class < SortedKeyValueIterator < Key , Value > > clazz = null ; if ( iterLoad . classCache != null ) { clazz = iterLoad . classCache . get ( iterInfo . className ) ; if ( clazz == null ) { clazz = loadClass ( iterLoad . useAccumuloClassLoader , iterLoad . context , iterInfo ) ; iterLoad . classCache . put ( iterInfo . className , clazz ) ; } } else { clazz = loadClass ( iterLoad . useAccumuloClassLoader , iterLoad . context , iterInfo ) ; } SortedKeyValueIterator < Key , Value > skvi = clazz . getDeclaredConstructor ( ) . newInstance ( ) ; Map < String , String > options = iterLoad . iterOpts . get ( iterInfo . iterName ) ; if ( options == null ) options = Collections . emptyMap ( ) ; skvi . init ( prev , options , iterLoad . iteratorEnvironment ) ; prev = skvi ; } } catch ( ReflectiveOperationException e ) { log . error ( e . toString ( ) ) ; throw new RuntimeException ( e ) ; } return prev ; } ","public static SortedKeyValueIterator < Key , Value > loadIterators ( SortedKeyValueIterator < Key , Value > source , IterLoad iterLoad ) throws IOException { SortedKeyValueIterator < Key , Value > prev = source ; try { for ( IterInfo iterInfo : iterLoad . iters ) { Class < SortedKeyValueIterator < Key , Value > > clazz = null ; log . trace ( ""Attempting to load iterator class {}"" , iterInfo . className ) ; if ( iterLoad . classCache != null ) { clazz = iterLoad . classCache . get ( iterInfo . className ) ; if ( clazz == null ) { clazz = loadClass ( iterLoad . useAccumuloClassLoader , iterLoad . context , iterInfo ) ; iterLoad . classCache . put ( iterInfo . className , clazz ) ; } } else { clazz = loadClass ( iterLoad . useAccumuloClassLoader , iterLoad . context , iterInfo ) ; } SortedKeyValueIterator < Key , Value > skvi = clazz . getDeclaredConstructor ( ) . newInstance ( ) ; Map < String , String > options = iterLoad . iterOpts . get ( iterInfo . iterName ) ; if ( options == null ) options = Collections . emptyMap ( ) ; skvi . init ( prev , options , iterLoad . iteratorEnvironment ) ; prev = skvi ; } } catch ( ReflectiveOperationException e ) { log . error ( e . toString ( ) ) ; throw new RuntimeException ( e ) ; } return prev ; } " 657,"public static SortedKeyValueIterator < Key , Value > loadIterators ( SortedKeyValueIterator < Key , Value > source , IterLoad iterLoad ) throws IOException { SortedKeyValueIterator < Key , Value > prev = source ; try { for ( IterInfo iterInfo : iterLoad . iters ) { Class < SortedKeyValueIterator < Key , Value > > clazz = null ; log . trace ( ""Attempting to load iterator class {}"" , iterInfo . className ) ; if ( iterLoad . classCache != null ) { clazz = iterLoad . classCache . get ( iterInfo . className ) ; if ( clazz == null ) { clazz = loadClass ( iterLoad . useAccumuloClassLoader , iterLoad . context , iterInfo ) ; iterLoad . classCache . put ( iterInfo . className , clazz ) ; } } else { clazz = loadClass ( iterLoad . useAccumuloClassLoader , iterLoad . context , iterInfo ) ; } SortedKeyValueIterator < Key , Value > skvi = clazz . getDeclaredConstructor ( ) . newInstance ( ) ; Map < String , String > options = iterLoad . iterOpts . get ( iterInfo . iterName ) ; if ( options == null ) options = Collections . emptyMap ( ) ; skvi . init ( prev , options , iterLoad . iteratorEnvironment ) ; prev = skvi ; } } catch ( ReflectiveOperationException e ) { throw new RuntimeException ( e ) ; } return prev ; } ","public static SortedKeyValueIterator < Key , Value > loadIterators ( SortedKeyValueIterator < Key , Value > source , IterLoad iterLoad ) throws IOException { SortedKeyValueIterator < Key , Value > prev = source ; try { for ( IterInfo iterInfo : iterLoad . iters ) { Class < SortedKeyValueIterator < Key , Value > > clazz = null ; log . trace ( ""Attempting to load iterator class {}"" , iterInfo . className ) ; if ( iterLoad . classCache != null ) { clazz = iterLoad . classCache . get ( iterInfo . className ) ; if ( clazz == null ) { clazz = loadClass ( iterLoad . useAccumuloClassLoader , iterLoad . context , iterInfo ) ; iterLoad . classCache . put ( iterInfo . className , clazz ) ; } } else { clazz = loadClass ( iterLoad . useAccumuloClassLoader , iterLoad . context , iterInfo ) ; } SortedKeyValueIterator < Key , Value > skvi = clazz . getDeclaredConstructor ( ) . newInstance ( ) ; Map < String , String > options = iterLoad . iterOpts . get ( iterInfo . iterName ) ; if ( options == null ) options = Collections . emptyMap ( ) ; skvi . init ( prev , options , iterLoad . iteratorEnvironment ) ; prev = skvi ; } } catch ( ReflectiveOperationException e ) { log . error ( e . toString ( ) ) ; throw new RuntimeException ( e ) ; } return prev ; } " 658,"public void execute ( ) throws IOException , InterruptedException { if ( checkTaskState ( ) ) { return ; } preLoadOnWorkerObservers ( ) ; GiraphTimerContext superstepTimerContext = superstepTimer . time ( ) ; finishedSuperstepStats = serviceWorker . setup ( ) ; superstepTimerContext . stop ( ) ; if ( collectInputSuperstepStats ( finishedSuperstepStats ) ) { return ; } prepareGraphStateAndWorkerContext ( ) ; List < PartitionStats > partitionStatsList = new ArrayList < PartitionStats > ( ) ; int numComputeThreads = conf . getNumComputeThreads ( ) ; while ( ! finishedSuperstepStats . allVerticesHalted ( ) ) { final long superstep = serviceWorker . getSuperstep ( ) ; superstepTimerContext = getTimerForThisSuperstep ( superstep ) ; GraphState graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; Collection < ? extends PartitionOwner > masterAssignedPartitionOwners = serviceWorker . startSuperstep ( ) ; if ( LOG . isDebugEnabled ( ) ) { } context . progress ( ) ; serviceWorker . exchangeVertexPartitions ( masterAssignedPartitionOwners ) ; context . progress ( ) ; boolean hasBeenRestarted = checkSuperstepRestarted ( superstep ) ; GlobalStats globalStats = serviceWorker . getGlobalStats ( ) ; if ( hasBeenRestarted ) { graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; } else if ( storeCheckpoint ( globalStats . getCheckpointStatus ( ) ) ) { break ; } serviceWorker . getServerData ( ) . prepareResolveMutations ( ) ; context . progress ( ) ; prepareForSuperstep ( graphState ) ; context . progress ( ) ; MessageStore < I , Writable > messageStore = serviceWorker . getServerData ( ) . getCurrentMessageStore ( ) ; int numPartitions = serviceWorker . getPartitionStore ( ) . getNumPartitions ( ) ; int numThreads = Math . min ( numComputeThreads , numPartitions ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( ""execute: "" + numPartitions + "" partitions to process with "" + numThreads + "" compute thread(s), originally "" + numComputeThreads + "" thread(s) on superstep "" + superstep ) ; } partitionStatsList . clear ( ) ; if ( numPartitions > 0 ) { processGraphPartitions ( context , partitionStatsList , graphState , messageStore , numThreads ) ; } finishedSuperstepStats = completeSuperstepAndCollectStats ( partitionStatsList , superstepTimerContext ) ; } if ( LOG . isInfoEnabled ( ) ) { LOG . info ( ""execute: BSP application done (global vertices marked done)"" ) ; } updateSuperstepGraphState ( ) ; postApplication ( ) ; } ","public void execute ( ) throws IOException , InterruptedException { if ( checkTaskState ( ) ) { return ; } preLoadOnWorkerObservers ( ) ; GiraphTimerContext superstepTimerContext = superstepTimer . time ( ) ; finishedSuperstepStats = serviceWorker . setup ( ) ; superstepTimerContext . stop ( ) ; if ( collectInputSuperstepStats ( finishedSuperstepStats ) ) { return ; } prepareGraphStateAndWorkerContext ( ) ; List < PartitionStats > partitionStatsList = new ArrayList < PartitionStats > ( ) ; int numComputeThreads = conf . getNumComputeThreads ( ) ; while ( ! finishedSuperstepStats . allVerticesHalted ( ) ) { final long superstep = serviceWorker . getSuperstep ( ) ; superstepTimerContext = getTimerForThisSuperstep ( superstep ) ; GraphState graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; Collection < ? extends PartitionOwner > masterAssignedPartitionOwners = serviceWorker . startSuperstep ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""execute: "" + MemoryUtils . getRuntimeMemoryStats ( ) ) ; } context . progress ( ) ; serviceWorker . exchangeVertexPartitions ( masterAssignedPartitionOwners ) ; context . progress ( ) ; boolean hasBeenRestarted = checkSuperstepRestarted ( superstep ) ; GlobalStats globalStats = serviceWorker . getGlobalStats ( ) ; if ( hasBeenRestarted ) { graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; } else if ( storeCheckpoint ( globalStats . getCheckpointStatus ( ) ) ) { break ; } serviceWorker . getServerData ( ) . prepareResolveMutations ( ) ; context . progress ( ) ; prepareForSuperstep ( graphState ) ; context . progress ( ) ; MessageStore < I , Writable > messageStore = serviceWorker . getServerData ( ) . getCurrentMessageStore ( ) ; int numPartitions = serviceWorker . getPartitionStore ( ) . getNumPartitions ( ) ; int numThreads = Math . min ( numComputeThreads , numPartitions ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( ""execute: "" + numPartitions + "" partitions to process with "" + numThreads + "" compute thread(s), originally "" + numComputeThreads + "" thread(s) on superstep "" + superstep ) ; } partitionStatsList . clear ( ) ; if ( numPartitions > 0 ) { processGraphPartitions ( context , partitionStatsList , graphState , messageStore , numThreads ) ; } finishedSuperstepStats = completeSuperstepAndCollectStats ( partitionStatsList , superstepTimerContext ) ; } if ( LOG . isInfoEnabled ( ) ) { LOG . info ( ""execute: BSP application done (global vertices marked done)"" ) ; } updateSuperstepGraphState ( ) ; postApplication ( ) ; } " 659,"public void execute ( ) throws IOException , InterruptedException { if ( checkTaskState ( ) ) { return ; } preLoadOnWorkerObservers ( ) ; GiraphTimerContext superstepTimerContext = superstepTimer . time ( ) ; finishedSuperstepStats = serviceWorker . setup ( ) ; superstepTimerContext . stop ( ) ; if ( collectInputSuperstepStats ( finishedSuperstepStats ) ) { return ; } prepareGraphStateAndWorkerContext ( ) ; List < PartitionStats > partitionStatsList = new ArrayList < PartitionStats > ( ) ; int numComputeThreads = conf . getNumComputeThreads ( ) ; while ( ! finishedSuperstepStats . allVerticesHalted ( ) ) { final long superstep = serviceWorker . getSuperstep ( ) ; superstepTimerContext = getTimerForThisSuperstep ( superstep ) ; GraphState graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; Collection < ? extends PartitionOwner > masterAssignedPartitionOwners = serviceWorker . startSuperstep ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""execute: "" + MemoryUtils . getRuntimeMemoryStats ( ) ) ; } context . progress ( ) ; serviceWorker . exchangeVertexPartitions ( masterAssignedPartitionOwners ) ; context . progress ( ) ; boolean hasBeenRestarted = checkSuperstepRestarted ( superstep ) ; GlobalStats globalStats = serviceWorker . getGlobalStats ( ) ; if ( hasBeenRestarted ) { graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; } else if ( storeCheckpoint ( globalStats . getCheckpointStatus ( ) ) ) { break ; } serviceWorker . getServerData ( ) . prepareResolveMutations ( ) ; context . progress ( ) ; prepareForSuperstep ( graphState ) ; context . progress ( ) ; MessageStore < I , Writable > messageStore = serviceWorker . getServerData ( ) . getCurrentMessageStore ( ) ; int numPartitions = serviceWorker . getPartitionStore ( ) . getNumPartitions ( ) ; int numThreads = Math . min ( numComputeThreads , numPartitions ) ; if ( LOG . isInfoEnabled ( ) ) { } partitionStatsList . clear ( ) ; if ( numPartitions > 0 ) { processGraphPartitions ( context , partitionStatsList , graphState , messageStore , numThreads ) ; } finishedSuperstepStats = completeSuperstepAndCollectStats ( partitionStatsList , superstepTimerContext ) ; } if ( LOG . isInfoEnabled ( ) ) { LOG . info ( ""execute: BSP application done (global vertices marked done)"" ) ; } updateSuperstepGraphState ( ) ; postApplication ( ) ; } ","public void execute ( ) throws IOException , InterruptedException { if ( checkTaskState ( ) ) { return ; } preLoadOnWorkerObservers ( ) ; GiraphTimerContext superstepTimerContext = superstepTimer . time ( ) ; finishedSuperstepStats = serviceWorker . setup ( ) ; superstepTimerContext . stop ( ) ; if ( collectInputSuperstepStats ( finishedSuperstepStats ) ) { return ; } prepareGraphStateAndWorkerContext ( ) ; List < PartitionStats > partitionStatsList = new ArrayList < PartitionStats > ( ) ; int numComputeThreads = conf . getNumComputeThreads ( ) ; while ( ! finishedSuperstepStats . allVerticesHalted ( ) ) { final long superstep = serviceWorker . getSuperstep ( ) ; superstepTimerContext = getTimerForThisSuperstep ( superstep ) ; GraphState graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; Collection < ? extends PartitionOwner > masterAssignedPartitionOwners = serviceWorker . startSuperstep ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""execute: "" + MemoryUtils . getRuntimeMemoryStats ( ) ) ; } context . progress ( ) ; serviceWorker . exchangeVertexPartitions ( masterAssignedPartitionOwners ) ; context . progress ( ) ; boolean hasBeenRestarted = checkSuperstepRestarted ( superstep ) ; GlobalStats globalStats = serviceWorker . getGlobalStats ( ) ; if ( hasBeenRestarted ) { graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; } else if ( storeCheckpoint ( globalStats . getCheckpointStatus ( ) ) ) { break ; } serviceWorker . getServerData ( ) . prepareResolveMutations ( ) ; context . progress ( ) ; prepareForSuperstep ( graphState ) ; context . progress ( ) ; MessageStore < I , Writable > messageStore = serviceWorker . getServerData ( ) . getCurrentMessageStore ( ) ; int numPartitions = serviceWorker . getPartitionStore ( ) . getNumPartitions ( ) ; int numThreads = Math . min ( numComputeThreads , numPartitions ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( ""execute: "" + numPartitions + "" partitions to process with "" + numThreads + "" compute thread(s), originally "" + numComputeThreads + "" thread(s) on superstep "" + superstep ) ; } partitionStatsList . clear ( ) ; if ( numPartitions > 0 ) { processGraphPartitions ( context , partitionStatsList , graphState , messageStore , numThreads ) ; } finishedSuperstepStats = completeSuperstepAndCollectStats ( partitionStatsList , superstepTimerContext ) ; } if ( LOG . isInfoEnabled ( ) ) { LOG . info ( ""execute: BSP application done (global vertices marked done)"" ) ; } updateSuperstepGraphState ( ) ; postApplication ( ) ; } " 660,"public void execute ( ) throws IOException , InterruptedException { if ( checkTaskState ( ) ) { return ; } preLoadOnWorkerObservers ( ) ; GiraphTimerContext superstepTimerContext = superstepTimer . time ( ) ; finishedSuperstepStats = serviceWorker . setup ( ) ; superstepTimerContext . stop ( ) ; if ( collectInputSuperstepStats ( finishedSuperstepStats ) ) { return ; } prepareGraphStateAndWorkerContext ( ) ; List < PartitionStats > partitionStatsList = new ArrayList < PartitionStats > ( ) ; int numComputeThreads = conf . getNumComputeThreads ( ) ; while ( ! finishedSuperstepStats . allVerticesHalted ( ) ) { final long superstep = serviceWorker . getSuperstep ( ) ; superstepTimerContext = getTimerForThisSuperstep ( superstep ) ; GraphState graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; Collection < ? extends PartitionOwner > masterAssignedPartitionOwners = serviceWorker . startSuperstep ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""execute: "" + MemoryUtils . getRuntimeMemoryStats ( ) ) ; } context . progress ( ) ; serviceWorker . exchangeVertexPartitions ( masterAssignedPartitionOwners ) ; context . progress ( ) ; boolean hasBeenRestarted = checkSuperstepRestarted ( superstep ) ; GlobalStats globalStats = serviceWorker . getGlobalStats ( ) ; if ( hasBeenRestarted ) { graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; } else if ( storeCheckpoint ( globalStats . getCheckpointStatus ( ) ) ) { break ; } serviceWorker . getServerData ( ) . prepareResolveMutations ( ) ; context . progress ( ) ; prepareForSuperstep ( graphState ) ; context . progress ( ) ; MessageStore < I , Writable > messageStore = serviceWorker . getServerData ( ) . getCurrentMessageStore ( ) ; int numPartitions = serviceWorker . getPartitionStore ( ) . getNumPartitions ( ) ; int numThreads = Math . min ( numComputeThreads , numPartitions ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( ""execute: "" + numPartitions + "" partitions to process with "" + numThreads + "" compute thread(s), originally "" + numComputeThreads + "" thread(s) on superstep "" + superstep ) ; } partitionStatsList . clear ( ) ; if ( numPartitions > 0 ) { processGraphPartitions ( context , partitionStatsList , graphState , messageStore , numThreads ) ; } finishedSuperstepStats = completeSuperstepAndCollectStats ( partitionStatsList , superstepTimerContext ) ; } if ( LOG . isInfoEnabled ( ) ) { } updateSuperstepGraphState ( ) ; postApplication ( ) ; } ","public void execute ( ) throws IOException , InterruptedException { if ( checkTaskState ( ) ) { return ; } preLoadOnWorkerObservers ( ) ; GiraphTimerContext superstepTimerContext = superstepTimer . time ( ) ; finishedSuperstepStats = serviceWorker . setup ( ) ; superstepTimerContext . stop ( ) ; if ( collectInputSuperstepStats ( finishedSuperstepStats ) ) { return ; } prepareGraphStateAndWorkerContext ( ) ; List < PartitionStats > partitionStatsList = new ArrayList < PartitionStats > ( ) ; int numComputeThreads = conf . getNumComputeThreads ( ) ; while ( ! finishedSuperstepStats . allVerticesHalted ( ) ) { final long superstep = serviceWorker . getSuperstep ( ) ; superstepTimerContext = getTimerForThisSuperstep ( superstep ) ; GraphState graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; Collection < ? extends PartitionOwner > masterAssignedPartitionOwners = serviceWorker . startSuperstep ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""execute: "" + MemoryUtils . getRuntimeMemoryStats ( ) ) ; } context . progress ( ) ; serviceWorker . exchangeVertexPartitions ( masterAssignedPartitionOwners ) ; context . progress ( ) ; boolean hasBeenRestarted = checkSuperstepRestarted ( superstep ) ; GlobalStats globalStats = serviceWorker . getGlobalStats ( ) ; if ( hasBeenRestarted ) { graphState = new GraphState ( superstep , finishedSuperstepStats . getVertexCount ( ) , finishedSuperstepStats . getEdgeCount ( ) , context ) ; } else if ( storeCheckpoint ( globalStats . getCheckpointStatus ( ) ) ) { break ; } serviceWorker . getServerData ( ) . prepareResolveMutations ( ) ; context . progress ( ) ; prepareForSuperstep ( graphState ) ; context . progress ( ) ; MessageStore < I , Writable > messageStore = serviceWorker . getServerData ( ) . getCurrentMessageStore ( ) ; int numPartitions = serviceWorker . getPartitionStore ( ) . getNumPartitions ( ) ; int numThreads = Math . min ( numComputeThreads , numPartitions ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( ""execute: "" + numPartitions + "" partitions to process with "" + numThreads + "" compute thread(s), originally "" + numComputeThreads + "" thread(s) on superstep "" + superstep ) ; } partitionStatsList . clear ( ) ; if ( numPartitions > 0 ) { processGraphPartitions ( context , partitionStatsList , graphState , messageStore , numThreads ) ; } finishedSuperstepStats = completeSuperstepAndCollectStats ( partitionStatsList , superstepTimerContext ) ; } if ( LOG . isInfoEnabled ( ) ) { LOG . info ( ""execute: BSP application done (global vertices marked done)"" ) ; } updateSuperstepGraphState ( ) ; postApplication ( ) ; } " 661,"@ Asynchronous public void processMetadataValidationTimerEvent ( @ Observes @ Scheduled EntityIdMonitoringEvent entityIdMonitoringEvent ) { if ( this . isActive . get ( ) ) { return ; } if ( ! this . isActive . compareAndSet ( false , true ) ) { return ; } try { process ( ) ; } catch ( Throwable ex ) { } finally { this . isActive . set ( false ) ; } } ","@ Asynchronous public void processMetadataValidationTimerEvent ( @ Observes @ Scheduled EntityIdMonitoringEvent entityIdMonitoringEvent ) { if ( this . isActive . get ( ) ) { return ; } if ( ! this . isActive . compareAndSet ( false , true ) ) { return ; } try { process ( ) ; } catch ( Throwable ex ) { log . error ( ""Exception happened while monitoring EntityId"" , ex ) ; } finally { this . isActive . set ( false ) ; } } " 662,"private void handleCommandPlaylistRestore ( ) { if ( ! playlistName . isEmpty ( ) ) { CompletableFuture < Boolean > browsing = isBrowsing ; try { if ( browsing != null ) { browsing . get ( config . responseTimeout , TimeUnit . MILLISECONDS ) ; } } catch ( InterruptedException | ExecutionException | TimeoutException e ) { } UpnpEntryQueue queue = new UpnpEntryQueue ( ) ; queue . restoreQueue ( playlistName , config . udn , bindingConfig . path ) ; updateTitleSelection ( queue . getEntryList ( ) ) ; String parentId ; UpnpEntry current = queue . get ( 0 ) ; if ( current != null ) { parentId = current . getParentId ( ) ; UpnpEntry entry = parentMap . get ( parentId ) ; if ( entry != null ) { currentEntry = entry ; } else { currentEntry = new UpnpEntry ( parentId , parentId , DIRECTORY_ROOT , ""object.container"" ) ; } } else { parentId = DIRECTORY_ROOT ; currentEntry = ROOT_ENTRY ; } logger . debug ( ""Restoring playlist to node {} on server {}"" , parentId , thing . getLabel ( ) ) ; } } ","private void handleCommandPlaylistRestore ( ) { if ( ! playlistName . isEmpty ( ) ) { CompletableFuture < Boolean > browsing = isBrowsing ; try { if ( browsing != null ) { browsing . get ( config . responseTimeout , TimeUnit . MILLISECONDS ) ; } } catch ( InterruptedException | ExecutionException | TimeoutException e ) { logger . debug ( ""Exception, previous server on {} query interrupted or timed out, restoring playlist anyway"" , thing . getLabel ( ) ) ; } UpnpEntryQueue queue = new UpnpEntryQueue ( ) ; queue . restoreQueue ( playlistName , config . udn , bindingConfig . path ) ; updateTitleSelection ( queue . getEntryList ( ) ) ; String parentId ; UpnpEntry current = queue . get ( 0 ) ; if ( current != null ) { parentId = current . getParentId ( ) ; UpnpEntry entry = parentMap . get ( parentId ) ; if ( entry != null ) { currentEntry = entry ; } else { currentEntry = new UpnpEntry ( parentId , parentId , DIRECTORY_ROOT , ""object.container"" ) ; } } else { parentId = DIRECTORY_ROOT ; currentEntry = ROOT_ENTRY ; } logger . debug ( ""Restoring playlist to node {} on server {}"" , parentId , thing . getLabel ( ) ) ; } } " 663,"private void handleCommandPlaylistRestore ( ) { if ( ! playlistName . isEmpty ( ) ) { CompletableFuture < Boolean > browsing = isBrowsing ; try { if ( browsing != null ) { browsing . get ( config . responseTimeout , TimeUnit . MILLISECONDS ) ; } } catch ( InterruptedException | ExecutionException | TimeoutException e ) { logger . debug ( ""Exception, previous server on {} query interrupted or timed out, restoring playlist anyway"" , thing . getLabel ( ) ) ; } UpnpEntryQueue queue = new UpnpEntryQueue ( ) ; queue . restoreQueue ( playlistName , config . udn , bindingConfig . path ) ; updateTitleSelection ( queue . getEntryList ( ) ) ; String parentId ; UpnpEntry current = queue . get ( 0 ) ; if ( current != null ) { parentId = current . getParentId ( ) ; UpnpEntry entry = parentMap . get ( parentId ) ; if ( entry != null ) { currentEntry = entry ; } else { currentEntry = new UpnpEntry ( parentId , parentId , DIRECTORY_ROOT , ""object.container"" ) ; } } else { parentId = DIRECTORY_ROOT ; currentEntry = ROOT_ENTRY ; } } } ","private void handleCommandPlaylistRestore ( ) { if ( ! playlistName . isEmpty ( ) ) { CompletableFuture < Boolean > browsing = isBrowsing ; try { if ( browsing != null ) { browsing . get ( config . responseTimeout , TimeUnit . MILLISECONDS ) ; } } catch ( InterruptedException | ExecutionException | TimeoutException e ) { logger . debug ( ""Exception, previous server on {} query interrupted or timed out, restoring playlist anyway"" , thing . getLabel ( ) ) ; } UpnpEntryQueue queue = new UpnpEntryQueue ( ) ; queue . restoreQueue ( playlistName , config . udn , bindingConfig . path ) ; updateTitleSelection ( queue . getEntryList ( ) ) ; String parentId ; UpnpEntry current = queue . get ( 0 ) ; if ( current != null ) { parentId = current . getParentId ( ) ; UpnpEntry entry = parentMap . get ( parentId ) ; if ( entry != null ) { currentEntry = entry ; } else { currentEntry = new UpnpEntry ( parentId , parentId , DIRECTORY_ROOT , ""object.container"" ) ; } } else { parentId = DIRECTORY_ROOT ; currentEntry = ROOT_ENTRY ; } logger . debug ( ""Restoring playlist to node {} on server {}"" , parentId , thing . getLabel ( ) ) ; } } " 664,"private void updatePeerReviewOrgReferences ( OrgEntity orgToReference , List < Long > orgIds ) { List < PeerReviewEntity > peerReviews = peerReviewDao . getPeerReviewsReferencingOrgs ( orgIds ) ; LOG . info ( ""Found {} peer reviews referencing org"" , peerReviews . size ( ) ) ; peerReviews . forEach ( p -> { p . setOrg ( orgToReference ) ; if ( ! dryRun ) { LOG . info ( ""Updated peer review {}"" , p . getId ( ) ) ; peerReviewDao . merge ( p ) ; } } ) ; } ","private void updatePeerReviewOrgReferences ( OrgEntity orgToReference , List < Long > orgIds ) { LOG . info ( ""Pointing peer reviews to org {}"" , orgToReference . getId ( ) ) ; List < PeerReviewEntity > peerReviews = peerReviewDao . getPeerReviewsReferencingOrgs ( orgIds ) ; LOG . info ( ""Found {} peer reviews referencing org"" , peerReviews . size ( ) ) ; peerReviews . forEach ( p -> { p . setOrg ( orgToReference ) ; if ( ! dryRun ) { LOG . info ( ""Updated peer review {}"" , p . getId ( ) ) ; peerReviewDao . merge ( p ) ; } } ) ; } " 665,"private void updatePeerReviewOrgReferences ( OrgEntity orgToReference , List < Long > orgIds ) { LOG . info ( ""Pointing peer reviews to org {}"" , orgToReference . getId ( ) ) ; List < PeerReviewEntity > peerReviews = peerReviewDao . getPeerReviewsReferencingOrgs ( orgIds ) ; peerReviews . forEach ( p -> { p . setOrg ( orgToReference ) ; if ( ! dryRun ) { LOG . info ( ""Updated peer review {}"" , p . getId ( ) ) ; peerReviewDao . merge ( p ) ; } } ) ; } ","private void updatePeerReviewOrgReferences ( OrgEntity orgToReference , List < Long > orgIds ) { LOG . info ( ""Pointing peer reviews to org {}"" , orgToReference . getId ( ) ) ; List < PeerReviewEntity > peerReviews = peerReviewDao . getPeerReviewsReferencingOrgs ( orgIds ) ; LOG . info ( ""Found {} peer reviews referencing org"" , peerReviews . size ( ) ) ; peerReviews . forEach ( p -> { p . setOrg ( orgToReference ) ; if ( ! dryRun ) { LOG . info ( ""Updated peer review {}"" , p . getId ( ) ) ; peerReviewDao . merge ( p ) ; } } ) ; } " 666,"private void updatePeerReviewOrgReferences ( OrgEntity orgToReference , List < Long > orgIds ) { LOG . info ( ""Pointing peer reviews to org {}"" , orgToReference . getId ( ) ) ; List < PeerReviewEntity > peerReviews = peerReviewDao . getPeerReviewsReferencingOrgs ( orgIds ) ; LOG . info ( ""Found {} peer reviews referencing org"" , peerReviews . size ( ) ) ; peerReviews . forEach ( p -> { p . setOrg ( orgToReference ) ; if ( ! dryRun ) { peerReviewDao . merge ( p ) ; } } ) ; } ","private void updatePeerReviewOrgReferences ( OrgEntity orgToReference , List < Long > orgIds ) { LOG . info ( ""Pointing peer reviews to org {}"" , orgToReference . getId ( ) ) ; List < PeerReviewEntity > peerReviews = peerReviewDao . getPeerReviewsReferencingOrgs ( orgIds ) ; LOG . info ( ""Found {} peer reviews referencing org"" , peerReviews . size ( ) ) ; peerReviews . forEach ( p -> { p . setOrg ( orgToReference ) ; if ( ! dryRun ) { LOG . info ( ""Updated peer review {}"" , p . getId ( ) ) ; peerReviewDao . merge ( p ) ; } } ) ; } " 667,"@ Test public void TestCreateDupGenericVnfFailure_1002 ( ) { new MockAAIGenericVnfSearch ( wireMockServer ) ; MockAAICreateGenericVnf ( wireMockServer ) ; MockAAIVfModulePUT ( wireMockServer , true ) ; Map < String , Object > variables = new HashMap < > ( ) ; variables . put ( ""mso-request-id"" , UUID . randomUUID ( ) . toString ( ) ) ; variables . put ( ""isDebugLogEnabled"" , ""true"" ) ; variables . put ( ""isVidRequest"" , ""false"" ) ; variables . put ( ""vnfName"" , ""STMTN5MMSC21"" ) ; variables . put ( ""serviceId"" , ""00000000-0000-0000-0000-000000000000"" ) ; variables . put ( ""personaModelId"" , ""973ed047-d251-4fb9-bf1a-65b8949e0a73"" ) ; variables . put ( ""personaModelVersion"" , ""1.0"" ) ; variables . put ( ""vfModuleName"" , ""STMTN5MMSC21-MMSC::module-0-0"" ) ; variables . put ( ""vfModuleModelName"" , ""MMSC::module-0"" ) ; String processId = invokeSubProcess ( ""CreateAAIVfModule"" , variables ) ; WorkflowException exception = BPMNUtil . getRawVariable ( processEngine , ""CreateAAIVfModule"" , ""WorkflowException"" , processId ) ; Assert . assertEquals ( 1002 , exception . getErrorCode ( ) ) ; Assert . assertEquals ( true , exception . getErrorMessage ( ) . contains ( ""Invalid request for new Generic VNF which already exists"" ) ) ; } ","@ Test public void TestCreateDupGenericVnfFailure_1002 ( ) { new MockAAIGenericVnfSearch ( wireMockServer ) ; MockAAICreateGenericVnf ( wireMockServer ) ; MockAAIVfModulePUT ( wireMockServer , true ) ; Map < String , Object > variables = new HashMap < > ( ) ; variables . put ( ""mso-request-id"" , UUID . randomUUID ( ) . toString ( ) ) ; variables . put ( ""isDebugLogEnabled"" , ""true"" ) ; variables . put ( ""isVidRequest"" , ""false"" ) ; variables . put ( ""vnfName"" , ""STMTN5MMSC21"" ) ; variables . put ( ""serviceId"" , ""00000000-0000-0000-0000-000000000000"" ) ; variables . put ( ""personaModelId"" , ""973ed047-d251-4fb9-bf1a-65b8949e0a73"" ) ; variables . put ( ""personaModelVersion"" , ""1.0"" ) ; variables . put ( ""vfModuleName"" , ""STMTN5MMSC21-MMSC::module-0-0"" ) ; variables . put ( ""vfModuleModelName"" , ""MMSC::module-0"" ) ; String processId = invokeSubProcess ( ""CreateAAIVfModule"" , variables ) ; WorkflowException exception = BPMNUtil . getRawVariable ( processEngine , ""CreateAAIVfModule"" , ""WorkflowException"" , processId ) ; Assert . assertEquals ( 1002 , exception . getErrorCode ( ) ) ; Assert . assertEquals ( true , exception . getErrorMessage ( ) . contains ( ""Invalid request for new Generic VNF which already exists"" ) ) ; logger . debug ( exception . getErrorMessage ( ) ) ; } " 668,"public synchronized void setMaxActive ( int maxActive ) { if ( maxActive != this . maxActive ) { maxActiveSemaphore = makeSemaphore ( maxActive ) ; this . maxActive = maxActive ; } } ","public synchronized void setMaxActive ( int maxActive ) { if ( maxActive != this . maxActive ) { log . debug ( ""change max [active] semaphore with new permit {}"" , maxActive ) ; maxActiveSemaphore = makeSemaphore ( maxActive ) ; this . maxActive = maxActive ; } } " 669,"public void onStartElement ( String namespace , String localName , String prefix , Attributes attributes , DeserializationContext context ) throws SAXException { if ( log . isDebugEnabled ( ) ) { } if ( context . isNil ( attributes ) ) { return ; } setValue ( new HashMap ( ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Exit: MapDeserializer::startElement()"" ) ; } } ","public void onStartElement ( String namespace , String localName , String prefix , Attributes attributes , DeserializationContext context ) throws SAXException { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Enter MapDeserializer::startElement()"" ) ; } if ( context . isNil ( attributes ) ) { return ; } setValue ( new HashMap ( ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Exit: MapDeserializer::startElement()"" ) ; } } " 670,"public void onStartElement ( String namespace , String localName , String prefix , Attributes attributes , DeserializationContext context ) throws SAXException { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Enter MapDeserializer::startElement()"" ) ; } if ( context . isNil ( attributes ) ) { return ; } setValue ( new HashMap ( ) ) ; if ( log . isDebugEnabled ( ) ) { } } ","public void onStartElement ( String namespace , String localName , String prefix , Attributes attributes , DeserializationContext context ) throws SAXException { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Enter MapDeserializer::startElement()"" ) ; } if ( context . isNil ( attributes ) ) { return ; } setValue ( new HashMap ( ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Exit: MapDeserializer::startElement()"" ) ; } } " 671,"public void publishApi ( Api api , IAsyncResultHandler < Void > handler ) { super . publishApi ( api , handler ) ; proxy . publishApi ( api ) ; } ","public void publishApi ( Api api , IAsyncResultHandler < Void > handler ) { super . publishApi ( api , handler ) ; proxy . publishApi ( api ) ; log . info ( ""Published an API {0}"" , api ) ; } " 672,"private void notifyFailure ( Stream stream , FailureFrame frame , Callback callback ) { Listener listener = this . listener ; if ( listener != null ) { try { listener . onFailure ( stream , frame . getError ( ) , frame . getReason ( ) , frame . getFailure ( ) , callback ) ; } catch ( Throwable x ) { callback . failed ( x ) ; } } else { callback . succeeded ( ) ; } } ","private void notifyFailure ( Stream stream , FailureFrame frame , Callback callback ) { Listener listener = this . listener ; if ( listener != null ) { try { listener . onFailure ( stream , frame . getError ( ) , frame . getReason ( ) , frame . getFailure ( ) , callback ) ; } catch ( Throwable x ) { LOG . info ( ""Failure while notifying listener {}"" , listener , x ) ; callback . failed ( x ) ; } } else { callback . succeeded ( ) ; } } " 673,"protected void doResume ( ) throws Exception { if ( ! initialized ) { doStart ( ) ; } else { if ( listenerContainer != null ) { startListenerContainer ( ) ; } else { } } } ","protected void doResume ( ) throws Exception { if ( ! initialized ) { doStart ( ) ; } else { if ( listenerContainer != null ) { startListenerContainer ( ) ; } else { LOG . warn ( ""The listenerContainer is not instantiated. Probably there was a timeout during the Suspend operation. Please restart your consumer route."" ) ; } } } " 674,"public void doExceptionCaughtListeners ( final long sessionId , final Throwable cause ) { runManagementTask ( new Runnable ( ) { @ Override public void run ( ) { try { final String exceptionMessage = Utils . getCauseString ( cause ) ; List < ServiceManagementListener > serviceListeners = getManagementListeners ( ) ; for ( final ServiceManagementListener listener : serviceListeners ) { listener . doExceptionCaught ( DefaultServiceManagementBean . this , sessionId , exceptionMessage ) ; } markChanged ( ) ; } catch ( Exception ex ) { } } } ) ; } ","public void doExceptionCaughtListeners ( final long sessionId , final Throwable cause ) { runManagementTask ( new Runnable ( ) { @ Override public void run ( ) { try { final String exceptionMessage = Utils . getCauseString ( cause ) ; List < ServiceManagementListener > serviceListeners = getManagementListeners ( ) ; for ( final ServiceManagementListener listener : serviceListeners ) { listener . doExceptionCaught ( DefaultServiceManagementBean . this , sessionId , exceptionMessage ) ; } markChanged ( ) ; } catch ( Exception ex ) { logger . warn ( ""Error during doExceptionCaught service listener notifications:"" , ex ) ; } } } ) ; } " 675,"protected MsoException runtimeExceptionToMsoException ( RuntimeException e , String context ) { MsoAdapterException me = new MsoAdapterException ( e . getMessage ( ) , e ) ; me . addContext ( context ) ; me . setCategory ( MsoExceptionCategory . INTERNAL ) ; return me ; } ","protected MsoException runtimeExceptionToMsoException ( RuntimeException e , String context ) { MsoAdapterException me = new MsoAdapterException ( e . getMessage ( ) , e ) ; me . addContext ( context ) ; me . setCategory ( MsoExceptionCategory . INTERNAL ) ; logger . error ( ""{} {} An exception occured on {}: "" , MessageEnum . RA_GENERAL_EXCEPTION_ARG , ErrorCode . DataError . getValue ( ) , context , e ) ; return me ; } " 676,"public void initialize ( ) throws FalconException { String serviceClassNames = StartupProperties . get ( ) . getProperty ( ""application.services"" , ""org.apache.falcon.entity.store.ConfigurationStore"" ) ; for ( String serviceClassName : serviceClassNames . split ( "","" ) ) { serviceClassName = serviceClassName . trim ( ) ; if ( serviceClassName . isEmpty ( ) ) { continue ; } FalconService service = ReflectionUtils . getInstanceByClassName ( serviceClassName ) ; services . register ( service ) ; try { service . init ( ) ; } catch ( Throwable t ) { LOG . error ( ""Failed to initialize service {}"" , serviceClassName , t ) ; throw new FalconException ( t ) ; } LOG . info ( ""Service initialized: {}"" , serviceClassName ) ; } } ","public void initialize ( ) throws FalconException { String serviceClassNames = StartupProperties . get ( ) . getProperty ( ""application.services"" , ""org.apache.falcon.entity.store.ConfigurationStore"" ) ; for ( String serviceClassName : serviceClassNames . split ( "","" ) ) { serviceClassName = serviceClassName . trim ( ) ; if ( serviceClassName . isEmpty ( ) ) { continue ; } FalconService service = ReflectionUtils . getInstanceByClassName ( serviceClassName ) ; services . register ( service ) ; LOG . info ( ""Initializing service: {}"" , serviceClassName ) ; try { service . init ( ) ; } catch ( Throwable t ) { LOG . error ( ""Failed to initialize service {}"" , serviceClassName , t ) ; throw new FalconException ( t ) ; } LOG . info ( ""Service initialized: {}"" , serviceClassName ) ; } } " 677,"public void initialize ( ) throws FalconException { String serviceClassNames = StartupProperties . get ( ) . getProperty ( ""application.services"" , ""org.apache.falcon.entity.store.ConfigurationStore"" ) ; for ( String serviceClassName : serviceClassNames . split ( "","" ) ) { serviceClassName = serviceClassName . trim ( ) ; if ( serviceClassName . isEmpty ( ) ) { continue ; } FalconService service = ReflectionUtils . getInstanceByClassName ( serviceClassName ) ; services . register ( service ) ; LOG . info ( ""Initializing service: {}"" , serviceClassName ) ; try { service . init ( ) ; } catch ( Throwable t ) { throw new FalconException ( t ) ; } LOG . info ( ""Service initialized: {}"" , serviceClassName ) ; } } ","public void initialize ( ) throws FalconException { String serviceClassNames = StartupProperties . get ( ) . getProperty ( ""application.services"" , ""org.apache.falcon.entity.store.ConfigurationStore"" ) ; for ( String serviceClassName : serviceClassNames . split ( "","" ) ) { serviceClassName = serviceClassName . trim ( ) ; if ( serviceClassName . isEmpty ( ) ) { continue ; } FalconService service = ReflectionUtils . getInstanceByClassName ( serviceClassName ) ; services . register ( service ) ; LOG . info ( ""Initializing service: {}"" , serviceClassName ) ; try { service . init ( ) ; } catch ( Throwable t ) { LOG . error ( ""Failed to initialize service {}"" , serviceClassName , t ) ; throw new FalconException ( t ) ; } LOG . info ( ""Service initialized: {}"" , serviceClassName ) ; } } " 678,"public void initialize ( ) throws FalconException { String serviceClassNames = StartupProperties . get ( ) . getProperty ( ""application.services"" , ""org.apache.falcon.entity.store.ConfigurationStore"" ) ; for ( String serviceClassName : serviceClassNames . split ( "","" ) ) { serviceClassName = serviceClassName . trim ( ) ; if ( serviceClassName . isEmpty ( ) ) { continue ; } FalconService service = ReflectionUtils . getInstanceByClassName ( serviceClassName ) ; services . register ( service ) ; LOG . info ( ""Initializing service: {}"" , serviceClassName ) ; try { service . init ( ) ; } catch ( Throwable t ) { LOG . error ( ""Failed to initialize service {}"" , serviceClassName , t ) ; throw new FalconException ( t ) ; } } } ","public void initialize ( ) throws FalconException { String serviceClassNames = StartupProperties . get ( ) . getProperty ( ""application.services"" , ""org.apache.falcon.entity.store.ConfigurationStore"" ) ; for ( String serviceClassName : serviceClassNames . split ( "","" ) ) { serviceClassName = serviceClassName . trim ( ) ; if ( serviceClassName . isEmpty ( ) ) { continue ; } FalconService service = ReflectionUtils . getInstanceByClassName ( serviceClassName ) ; services . register ( service ) ; LOG . info ( ""Initializing service: {}"" , serviceClassName ) ; try { service . init ( ) ; } catch ( Throwable t ) { LOG . error ( ""Failed to initialize service {}"" , serviceClassName , t ) ; throw new FalconException ( t ) ; } LOG . info ( ""Service initialized: {}"" , serviceClassName ) ; } } " 679,"public Policy resolvePolicy ( Policy policy , String ref , Class < ? extends Policy > type ) { if ( policy != null ) { return policy ; } if ( org . apache . camel . util . ObjectHelper . isNotEmpty ( ref ) ) { return mandatoryLookup ( ref , Policy . class ) ; } Policy answer = null ; if ( type != null ) { Map < String , ? > types = findByTypeWithName ( type ) ; if ( types . size ( ) == 1 ) { Object found = types . values ( ) . iterator ( ) . next ( ) ; if ( type . isInstance ( found ) ) { return type . cast ( found ) ; } } } if ( type == TransactedPolicy . class ) { answer = lookup ( PROPAGATION_REQUIRED , TransactedPolicy . class ) ; } if ( answer == null && type == TransactedPolicy . class ) { Class < ? > tmClazz = camelContext . getClassResolver ( ) . resolveClass ( ""org.springframework.transaction.PlatformTransactionManager"" ) ; if ( tmClazz != null ) { Map < String , ? > maps = findByTypeWithName ( tmClazz ) ; if ( maps . size ( ) == 1 ) { Object transactionManager = maps . values ( ) . iterator ( ) . next ( ) ; Class < ? > txClazz = camelContext . getClassResolver ( ) . resolveClass ( ""org.apache.camel.spring.spi.SpringTransactionPolicy"" ) ; if ( txClazz != null ) { LOG . debug ( ""Creating a new temporary SpringTransactionPolicy using the PlatformTransactionManager: {}"" , transactionManager ) ; TransactedPolicy txPolicy = org . apache . camel . support . ObjectHelper . newInstance ( txClazz , TransactedPolicy . class ) ; Method method ; try { method = txClazz . getMethod ( ""setTransactionManager"" , tmClazz ) ; } catch ( NoSuchMethodException e ) { throw new RuntimeCamelException ( ""Cannot get method setTransactionManager(PlatformTransactionManager) on class: "" + txClazz ) ; } org . apache . camel . support . ObjectHelper . invokeMethod ( method , txPolicy , transactionManager ) ; return txPolicy ; } else { throw new RuntimeCamelException ( ""Cannot create a transacted policy as camel-spring.jar is not on the classpath!"" ) ; } } else { if ( maps . isEmpty ( ) ) { throw new NoSuchBeanException ( null , ""PlatformTransactionManager"" ) ; } else { throw new IllegalArgumentException ( ""Found "" + maps . size ( ) + "" PlatformTransactionManager in registry. "" + ""Cannot determine which one to use. Please configure a TransactionTemplate on the transacted policy."" ) ; } } } } return answer ; } ","public Policy resolvePolicy ( Policy policy , String ref , Class < ? extends Policy > type ) { if ( policy != null ) { return policy ; } if ( org . apache . camel . util . ObjectHelper . isNotEmpty ( ref ) ) { return mandatoryLookup ( ref , Policy . class ) ; } Policy answer = null ; if ( type != null ) { Map < String , ? > types = findByTypeWithName ( type ) ; if ( types . size ( ) == 1 ) { Object found = types . values ( ) . iterator ( ) . next ( ) ; if ( type . isInstance ( found ) ) { return type . cast ( found ) ; } } } if ( type == TransactedPolicy . class ) { answer = lookup ( PROPAGATION_REQUIRED , TransactedPolicy . class ) ; } if ( answer == null && type == TransactedPolicy . class ) { Class < ? > tmClazz = camelContext . getClassResolver ( ) . resolveClass ( ""org.springframework.transaction.PlatformTransactionManager"" ) ; if ( tmClazz != null ) { Map < String , ? > maps = findByTypeWithName ( tmClazz ) ; if ( maps . size ( ) == 1 ) { Object transactionManager = maps . values ( ) . iterator ( ) . next ( ) ; LOG . debug ( ""One instance of PlatformTransactionManager found in registry: {}"" , transactionManager ) ; Class < ? > txClazz = camelContext . getClassResolver ( ) . resolveClass ( ""org.apache.camel.spring.spi.SpringTransactionPolicy"" ) ; if ( txClazz != null ) { LOG . debug ( ""Creating a new temporary SpringTransactionPolicy using the PlatformTransactionManager: {}"" , transactionManager ) ; TransactedPolicy txPolicy = org . apache . camel . support . ObjectHelper . newInstance ( txClazz , TransactedPolicy . class ) ; Method method ; try { method = txClazz . getMethod ( ""setTransactionManager"" , tmClazz ) ; } catch ( NoSuchMethodException e ) { throw new RuntimeCamelException ( ""Cannot get method setTransactionManager(PlatformTransactionManager) on class: "" + txClazz ) ; } org . apache . camel . support . ObjectHelper . invokeMethod ( method , txPolicy , transactionManager ) ; return txPolicy ; } else { throw new RuntimeCamelException ( ""Cannot create a transacted policy as camel-spring.jar is not on the classpath!"" ) ; } } else { if ( maps . isEmpty ( ) ) { throw new NoSuchBeanException ( null , ""PlatformTransactionManager"" ) ; } else { throw new IllegalArgumentException ( ""Found "" + maps . size ( ) + "" PlatformTransactionManager in registry. "" + ""Cannot determine which one to use. Please configure a TransactionTemplate on the transacted policy."" ) ; } } } } return answer ; } " 680,"public Policy resolvePolicy ( Policy policy , String ref , Class < ? extends Policy > type ) { if ( policy != null ) { return policy ; } if ( org . apache . camel . util . ObjectHelper . isNotEmpty ( ref ) ) { return mandatoryLookup ( ref , Policy . class ) ; } Policy answer = null ; if ( type != null ) { Map < String , ? > types = findByTypeWithName ( type ) ; if ( types . size ( ) == 1 ) { Object found = types . values ( ) . iterator ( ) . next ( ) ; if ( type . isInstance ( found ) ) { return type . cast ( found ) ; } } } if ( type == TransactedPolicy . class ) { answer = lookup ( PROPAGATION_REQUIRED , TransactedPolicy . class ) ; } if ( answer == null && type == TransactedPolicy . class ) { Class < ? > tmClazz = camelContext . getClassResolver ( ) . resolveClass ( ""org.springframework.transaction.PlatformTransactionManager"" ) ; if ( tmClazz != null ) { Map < String , ? > maps = findByTypeWithName ( tmClazz ) ; if ( maps . size ( ) == 1 ) { Object transactionManager = maps . values ( ) . iterator ( ) . next ( ) ; LOG . debug ( ""One instance of PlatformTransactionManager found in registry: {}"" , transactionManager ) ; Class < ? > txClazz = camelContext . getClassResolver ( ) . resolveClass ( ""org.apache.camel.spring.spi.SpringTransactionPolicy"" ) ; if ( txClazz != null ) { TransactedPolicy txPolicy = org . apache . camel . support . ObjectHelper . newInstance ( txClazz , TransactedPolicy . class ) ; Method method ; try { method = txClazz . getMethod ( ""setTransactionManager"" , tmClazz ) ; } catch ( NoSuchMethodException e ) { throw new RuntimeCamelException ( ""Cannot get method setTransactionManager(PlatformTransactionManager) on class: "" + txClazz ) ; } org . apache . camel . support . ObjectHelper . invokeMethod ( method , txPolicy , transactionManager ) ; return txPolicy ; } else { throw new RuntimeCamelException ( ""Cannot create a transacted policy as camel-spring.jar is not on the classpath!"" ) ; } } else { if ( maps . isEmpty ( ) ) { throw new NoSuchBeanException ( null , ""PlatformTransactionManager"" ) ; } else { throw new IllegalArgumentException ( ""Found "" + maps . size ( ) + "" PlatformTransactionManager in registry. "" + ""Cannot determine which one to use. Please configure a TransactionTemplate on the transacted policy."" ) ; } } } } return answer ; } ","public Policy resolvePolicy ( Policy policy , String ref , Class < ? extends Policy > type ) { if ( policy != null ) { return policy ; } if ( org . apache . camel . util . ObjectHelper . isNotEmpty ( ref ) ) { return mandatoryLookup ( ref , Policy . class ) ; } Policy answer = null ; if ( type != null ) { Map < String , ? > types = findByTypeWithName ( type ) ; if ( types . size ( ) == 1 ) { Object found = types . values ( ) . iterator ( ) . next ( ) ; if ( type . isInstance ( found ) ) { return type . cast ( found ) ; } } } if ( type == TransactedPolicy . class ) { answer = lookup ( PROPAGATION_REQUIRED , TransactedPolicy . class ) ; } if ( answer == null && type == TransactedPolicy . class ) { Class < ? > tmClazz = camelContext . getClassResolver ( ) . resolveClass ( ""org.springframework.transaction.PlatformTransactionManager"" ) ; if ( tmClazz != null ) { Map < String , ? > maps = findByTypeWithName ( tmClazz ) ; if ( maps . size ( ) == 1 ) { Object transactionManager = maps . values ( ) . iterator ( ) . next ( ) ; LOG . debug ( ""One instance of PlatformTransactionManager found in registry: {}"" , transactionManager ) ; Class < ? > txClazz = camelContext . getClassResolver ( ) . resolveClass ( ""org.apache.camel.spring.spi.SpringTransactionPolicy"" ) ; if ( txClazz != null ) { LOG . debug ( ""Creating a new temporary SpringTransactionPolicy using the PlatformTransactionManager: {}"" , transactionManager ) ; TransactedPolicy txPolicy = org . apache . camel . support . ObjectHelper . newInstance ( txClazz , TransactedPolicy . class ) ; Method method ; try { method = txClazz . getMethod ( ""setTransactionManager"" , tmClazz ) ; } catch ( NoSuchMethodException e ) { throw new RuntimeCamelException ( ""Cannot get method setTransactionManager(PlatformTransactionManager) on class: "" + txClazz ) ; } org . apache . camel . support . ObjectHelper . invokeMethod ( method , txPolicy , transactionManager ) ; return txPolicy ; } else { throw new RuntimeCamelException ( ""Cannot create a transacted policy as camel-spring.jar is not on the classpath!"" ) ; } } else { if ( maps . isEmpty ( ) ) { throw new NoSuchBeanException ( null , ""PlatformTransactionManager"" ) ; } else { throw new IllegalArgumentException ( ""Found "" + maps . size ( ) + "" PlatformTransactionManager in registry. "" + ""Cannot determine which one to use. Please configure a TransactionTemplate on the transacted policy."" ) ; } } } } return answer ; } " 681,"public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } ","public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } " 682,"public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } ","public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } " 683,"public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } ","public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } " 684,"public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } ","public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } " 685,"public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } ","public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } " 686,"public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } ","public CalendarEventSet getEvents ( CalendarConfiguration calendarConfiguration , Interval interval , PortletRequest request ) throws CalendarException { String url = this . urlCreator . constructUrl ( calendarConfiguration , interval , request ) ; log . debug ( ""generated url: "" + url ) ; String intermediateCacheKey = cacheKeyGenerator . getKey ( calendarConfiguration , interval , request , cacheKeyPrefix . concat ( ""."" ) . concat ( url ) ) ; T calendar ; Element cachedCalendar = this . cache . get ( intermediateCacheKey ) ; if ( cachedCalendar == null ) { Credentials credentials = credentialsExtractor . getCredentials ( request ) ; InputStream stream = retrieveCalendarHttp ( url , credentials ) ; try { calendar = ( T ) contentProcessor . getIntermediateCalendar ( interval , stream ) ; } catch ( CalendarException e ) { log . error ( ""Calendar parsing exception: "" + e . getCause ( ) . getMessage ( ) + "" from calendar at "" + url ) ; throw e ; } cachedCalendar = new Element ( intermediateCacheKey , calendar ) ; this . cache . put ( cachedCalendar ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( ""Storing calendar cache, key:"" + intermediateCacheKey ) ; } } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar from cache, key:"" + intermediateCacheKey ) ; } calendar = ( T ) cachedCalendar . getObjectValue ( ) ; } String processorCacheKey = getIntervalSpecificCacheKey ( intermediateCacheKey , interval ) ; CalendarEventSet eventSet ; Element cachedElement = this . cache . get ( processorCacheKey ) ; if ( cachedElement == null ) { Set < VEvent > events = contentProcessor . getEvents ( interval , calendar ) ; log . debug ( ""contentProcessor found "" + events . size ( ) + "" events"" ) ; int timeToLiveInSeconds = - 1 ; long currentTime = System . currentTimeMillis ( ) ; if ( cachedCalendar . getExpirationTime ( ) > currentTime ) { long timeToLiveInMilliseconds = cachedCalendar . getExpirationTime ( ) - currentTime ; timeToLiveInSeconds = ( int ) timeToLiveInMilliseconds / 1000 ; } eventSet = insertCalendarEventSetIntoCache ( this . cache , processorCacheKey , events , timeToLiveInSeconds > 0 ? timeToLiveInSeconds : - 1 ) ; } else { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Retrieving calendar event set from cache, key:"" + processorCacheKey ) ; } eventSet = ( CalendarEventSet ) cachedElement . getObjectValue ( ) ; } return eventSet ; } " 687,"private void processCMessage ( CMessage cMessage ) { DeviceConfiguration c = null ; for ( DeviceConfiguration conf : configurations ) { if ( conf . getSerialNumber ( ) . equalsIgnoreCase ( cMessage . getSerialNumber ( ) ) ) { c = conf ; break ; } } if ( c == null ) { configurations . add ( DeviceConfiguration . create ( cMessage ) ) ; } else { c . setValues ( cMessage ) ; Device di = getDevice ( cMessage . getSerialNumber ( ) ) ; if ( di != null ) { di . setProperties ( cMessage . getProperties ( ) ) ; } } if ( exclusive ) { for ( DeviceStatusListener deviceStatusListener : deviceStatusListeners ) { try { Device di = getDevice ( cMessage . getSerialNumber ( ) ) ; if ( di != null ) { deviceStatusListener . onDeviceConfigUpdate ( getThing ( ) , di ) ; } } catch ( NullPointerException e ) { } catch ( Exception e ) { logger . error ( ""An exception occurred while calling the DeviceStatusListener"" , e ) ; unregisterDeviceStatusListener ( deviceStatusListener ) ; } } } } ","private void processCMessage ( CMessage cMessage ) { DeviceConfiguration c = null ; for ( DeviceConfiguration conf : configurations ) { if ( conf . getSerialNumber ( ) . equalsIgnoreCase ( cMessage . getSerialNumber ( ) ) ) { c = conf ; break ; } } if ( c == null ) { configurations . add ( DeviceConfiguration . create ( cMessage ) ) ; } else { c . setValues ( cMessage ) ; Device di = getDevice ( cMessage . getSerialNumber ( ) ) ; if ( di != null ) { di . setProperties ( cMessage . getProperties ( ) ) ; } } if ( exclusive ) { for ( DeviceStatusListener deviceStatusListener : deviceStatusListeners ) { try { Device di = getDevice ( cMessage . getSerialNumber ( ) ) ; if ( di != null ) { deviceStatusListener . onDeviceConfigUpdate ( getThing ( ) , di ) ; } } catch ( NullPointerException e ) { logger . debug ( ""Unexpected NPE cought. Please report stacktrace"" , e ) ; } catch ( Exception e ) { logger . error ( ""An exception occurred while calling the DeviceStatusListener"" , e ) ; unregisterDeviceStatusListener ( deviceStatusListener ) ; } } } } " 688,"private void processCMessage ( CMessage cMessage ) { DeviceConfiguration c = null ; for ( DeviceConfiguration conf : configurations ) { if ( conf . getSerialNumber ( ) . equalsIgnoreCase ( cMessage . getSerialNumber ( ) ) ) { c = conf ; break ; } } if ( c == null ) { configurations . add ( DeviceConfiguration . create ( cMessage ) ) ; } else { c . setValues ( cMessage ) ; Device di = getDevice ( cMessage . getSerialNumber ( ) ) ; if ( di != null ) { di . setProperties ( cMessage . getProperties ( ) ) ; } } if ( exclusive ) { for ( DeviceStatusListener deviceStatusListener : deviceStatusListeners ) { try { Device di = getDevice ( cMessage . getSerialNumber ( ) ) ; if ( di != null ) { deviceStatusListener . onDeviceConfigUpdate ( getThing ( ) , di ) ; } } catch ( NullPointerException e ) { logger . debug ( ""Unexpected NPE cought. Please report stacktrace"" , e ) ; } catch ( Exception e ) { unregisterDeviceStatusListener ( deviceStatusListener ) ; } } } } ","private void processCMessage ( CMessage cMessage ) { DeviceConfiguration c = null ; for ( DeviceConfiguration conf : configurations ) { if ( conf . getSerialNumber ( ) . equalsIgnoreCase ( cMessage . getSerialNumber ( ) ) ) { c = conf ; break ; } } if ( c == null ) { configurations . add ( DeviceConfiguration . create ( cMessage ) ) ; } else { c . setValues ( cMessage ) ; Device di = getDevice ( cMessage . getSerialNumber ( ) ) ; if ( di != null ) { di . setProperties ( cMessage . getProperties ( ) ) ; } } if ( exclusive ) { for ( DeviceStatusListener deviceStatusListener : deviceStatusListeners ) { try { Device di = getDevice ( cMessage . getSerialNumber ( ) ) ; if ( di != null ) { deviceStatusListener . onDeviceConfigUpdate ( getThing ( ) , di ) ; } } catch ( NullPointerException e ) { logger . debug ( ""Unexpected NPE cought. Please report stacktrace"" , e ) ; } catch ( Exception e ) { logger . error ( ""An exception occurred while calling the DeviceStatusListener"" , e ) ; unregisterDeviceStatusListener ( deviceStatusListener ) ; } } } } " 689,"public IRODSFile getTrashHomeForLoggedInUser ( ) throws JargonException { log . info ( ""for user:{}"" , getIRODSAccount ( ) ) ; String trashHomePath = MiscIRODSUtils . buildTrashHome ( getIRODSAccount ( ) . getUserName ( ) , getIRODSAccount ( ) . getZone ( ) ) ; log . info ( ""getting file at:{}"" , trashHomePath ) ; IRODSFile trashFile = getIRODSAccessObjectFactory ( ) . getIRODSFileFactory ( getIRODSAccount ( ) ) . instanceIRODSFile ( trashHomePath ) ; return trashFile ; } ","public IRODSFile getTrashHomeForLoggedInUser ( ) throws JargonException { log . info ( ""getTrashHomeForLoggedInUser())"" ) ; log . info ( ""for user:{}"" , getIRODSAccount ( ) ) ; String trashHomePath = MiscIRODSUtils . buildTrashHome ( getIRODSAccount ( ) . getUserName ( ) , getIRODSAccount ( ) . getZone ( ) ) ; log . info ( ""getting file at:{}"" , trashHomePath ) ; IRODSFile trashFile = getIRODSAccessObjectFactory ( ) . getIRODSFileFactory ( getIRODSAccount ( ) ) . instanceIRODSFile ( trashHomePath ) ; return trashFile ; } " 690,"public IRODSFile getTrashHomeForLoggedInUser ( ) throws JargonException { log . info ( ""getTrashHomeForLoggedInUser())"" ) ; String trashHomePath = MiscIRODSUtils . buildTrashHome ( getIRODSAccount ( ) . getUserName ( ) , getIRODSAccount ( ) . getZone ( ) ) ; log . info ( ""getting file at:{}"" , trashHomePath ) ; IRODSFile trashFile = getIRODSAccessObjectFactory ( ) . getIRODSFileFactory ( getIRODSAccount ( ) ) . instanceIRODSFile ( trashHomePath ) ; return trashFile ; } ","public IRODSFile getTrashHomeForLoggedInUser ( ) throws JargonException { log . info ( ""getTrashHomeForLoggedInUser())"" ) ; log . info ( ""for user:{}"" , getIRODSAccount ( ) ) ; String trashHomePath = MiscIRODSUtils . buildTrashHome ( getIRODSAccount ( ) . getUserName ( ) , getIRODSAccount ( ) . getZone ( ) ) ; log . info ( ""getting file at:{}"" , trashHomePath ) ; IRODSFile trashFile = getIRODSAccessObjectFactory ( ) . getIRODSFileFactory ( getIRODSAccount ( ) ) . instanceIRODSFile ( trashHomePath ) ; return trashFile ; } " 691,"public IRODSFile getTrashHomeForLoggedInUser ( ) throws JargonException { log . info ( ""getTrashHomeForLoggedInUser())"" ) ; log . info ( ""for user:{}"" , getIRODSAccount ( ) ) ; String trashHomePath = MiscIRODSUtils . buildTrashHome ( getIRODSAccount ( ) . getUserName ( ) , getIRODSAccount ( ) . getZone ( ) ) ; IRODSFile trashFile = getIRODSAccessObjectFactory ( ) . getIRODSFileFactory ( getIRODSAccount ( ) ) . instanceIRODSFile ( trashHomePath ) ; return trashFile ; } ","public IRODSFile getTrashHomeForLoggedInUser ( ) throws JargonException { log . info ( ""getTrashHomeForLoggedInUser())"" ) ; log . info ( ""for user:{}"" , getIRODSAccount ( ) ) ; String trashHomePath = MiscIRODSUtils . buildTrashHome ( getIRODSAccount ( ) . getUserName ( ) , getIRODSAccount ( ) . getZone ( ) ) ; log . info ( ""getting file at:{}"" , trashHomePath ) ; IRODSFile trashFile = getIRODSAccessObjectFactory ( ) . getIRODSFileFactory ( getIRODSAccount ( ) ) . instanceIRODSFile ( trashHomePath ) ; return trashFile ; } " 692,"public synchronized void individualAcknowledge ( Transaction tx , final long messageID ) throws Exception { if ( browseOnly ) { return ; } boolean startedTransaction = false ; if ( logger . isTraceEnabled ( ) ) { } if ( tx == null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""individualACK starting new TX"" ) ; } startedTransaction = true ; tx = new TransactionImpl ( storageManager ) ; } try { MessageReference ref ; ref = removeReferenceByID ( messageID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""ACKing ref "" + ref + "" on tx= "" + tx + "", consumer="" + this ) ; } if ( ref == null ) { ActiveMQIllegalStateException ils = ActiveMQMessageBundle . BUNDLE . consumerNoReference ( id , messageID , messageQueue . getName ( ) ) ; tx . markAsRollbackOnly ( ils ) ; throw ils ; } ref . acknowledge ( tx , this ) ; acks ++ ; if ( startedTransaction ) { tx . commit ( ) ; } } catch ( ActiveMQException e ) { if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( e ) ; } throw e ; } catch ( Throwable e ) { ActiveMQServerLogger . LOGGER . errorAckingMessage ( ( Exception ) e ) ; ActiveMQIllegalStateException hqex = new ActiveMQIllegalStateException ( e . getMessage ( ) ) ; if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( hqex ) ; } throw hqex ; } } ","public synchronized void individualAcknowledge ( Transaction tx , final long messageID ) throws Exception { if ( browseOnly ) { return ; } boolean startedTransaction = false ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""individualACK messageID="" + messageID ) ; } if ( tx == null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""individualACK starting new TX"" ) ; } startedTransaction = true ; tx = new TransactionImpl ( storageManager ) ; } try { MessageReference ref ; ref = removeReferenceByID ( messageID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""ACKing ref "" + ref + "" on tx= "" + tx + "", consumer="" + this ) ; } if ( ref == null ) { ActiveMQIllegalStateException ils = ActiveMQMessageBundle . BUNDLE . consumerNoReference ( id , messageID , messageQueue . getName ( ) ) ; tx . markAsRollbackOnly ( ils ) ; throw ils ; } ref . acknowledge ( tx , this ) ; acks ++ ; if ( startedTransaction ) { tx . commit ( ) ; } } catch ( ActiveMQException e ) { if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( e ) ; } throw e ; } catch ( Throwable e ) { ActiveMQServerLogger . LOGGER . errorAckingMessage ( ( Exception ) e ) ; ActiveMQIllegalStateException hqex = new ActiveMQIllegalStateException ( e . getMessage ( ) ) ; if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( hqex ) ; } throw hqex ; } } " 693,"public synchronized void individualAcknowledge ( Transaction tx , final long messageID ) throws Exception { if ( browseOnly ) { return ; } boolean startedTransaction = false ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""individualACK messageID="" + messageID ) ; } if ( tx == null ) { if ( logger . isTraceEnabled ( ) ) { } startedTransaction = true ; tx = new TransactionImpl ( storageManager ) ; } try { MessageReference ref ; ref = removeReferenceByID ( messageID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""ACKing ref "" + ref + "" on tx= "" + tx + "", consumer="" + this ) ; } if ( ref == null ) { ActiveMQIllegalStateException ils = ActiveMQMessageBundle . BUNDLE . consumerNoReference ( id , messageID , messageQueue . getName ( ) ) ; tx . markAsRollbackOnly ( ils ) ; throw ils ; } ref . acknowledge ( tx , this ) ; acks ++ ; if ( startedTransaction ) { tx . commit ( ) ; } } catch ( ActiveMQException e ) { if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( e ) ; } throw e ; } catch ( Throwable e ) { ActiveMQServerLogger . LOGGER . errorAckingMessage ( ( Exception ) e ) ; ActiveMQIllegalStateException hqex = new ActiveMQIllegalStateException ( e . getMessage ( ) ) ; if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( hqex ) ; } throw hqex ; } } ","public synchronized void individualAcknowledge ( Transaction tx , final long messageID ) throws Exception { if ( browseOnly ) { return ; } boolean startedTransaction = false ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""individualACK messageID="" + messageID ) ; } if ( tx == null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""individualACK starting new TX"" ) ; } startedTransaction = true ; tx = new TransactionImpl ( storageManager ) ; } try { MessageReference ref ; ref = removeReferenceByID ( messageID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""ACKing ref "" + ref + "" on tx= "" + tx + "", consumer="" + this ) ; } if ( ref == null ) { ActiveMQIllegalStateException ils = ActiveMQMessageBundle . BUNDLE . consumerNoReference ( id , messageID , messageQueue . getName ( ) ) ; tx . markAsRollbackOnly ( ils ) ; throw ils ; } ref . acknowledge ( tx , this ) ; acks ++ ; if ( startedTransaction ) { tx . commit ( ) ; } } catch ( ActiveMQException e ) { if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( e ) ; } throw e ; } catch ( Throwable e ) { ActiveMQServerLogger . LOGGER . errorAckingMessage ( ( Exception ) e ) ; ActiveMQIllegalStateException hqex = new ActiveMQIllegalStateException ( e . getMessage ( ) ) ; if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( hqex ) ; } throw hqex ; } } " 694,"public synchronized void individualAcknowledge ( Transaction tx , final long messageID ) throws Exception { if ( browseOnly ) { return ; } boolean startedTransaction = false ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""individualACK messageID="" + messageID ) ; } if ( tx == null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""individualACK starting new TX"" ) ; } startedTransaction = true ; tx = new TransactionImpl ( storageManager ) ; } try { MessageReference ref ; ref = removeReferenceByID ( messageID ) ; if ( logger . isTraceEnabled ( ) ) { } if ( ref == null ) { ActiveMQIllegalStateException ils = ActiveMQMessageBundle . BUNDLE . consumerNoReference ( id , messageID , messageQueue . getName ( ) ) ; tx . markAsRollbackOnly ( ils ) ; throw ils ; } ref . acknowledge ( tx , this ) ; acks ++ ; if ( startedTransaction ) { tx . commit ( ) ; } } catch ( ActiveMQException e ) { if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( e ) ; } throw e ; } catch ( Throwable e ) { ActiveMQServerLogger . LOGGER . errorAckingMessage ( ( Exception ) e ) ; ActiveMQIllegalStateException hqex = new ActiveMQIllegalStateException ( e . getMessage ( ) ) ; if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( hqex ) ; } throw hqex ; } } ","public synchronized void individualAcknowledge ( Transaction tx , final long messageID ) throws Exception { if ( browseOnly ) { return ; } boolean startedTransaction = false ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""individualACK messageID="" + messageID ) ; } if ( tx == null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""individualACK starting new TX"" ) ; } startedTransaction = true ; tx = new TransactionImpl ( storageManager ) ; } try { MessageReference ref ; ref = removeReferenceByID ( messageID ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ""ACKing ref "" + ref + "" on tx= "" + tx + "", consumer="" + this ) ; } if ( ref == null ) { ActiveMQIllegalStateException ils = ActiveMQMessageBundle . BUNDLE . consumerNoReference ( id , messageID , messageQueue . getName ( ) ) ; tx . markAsRollbackOnly ( ils ) ; throw ils ; } ref . acknowledge ( tx , this ) ; acks ++ ; if ( startedTransaction ) { tx . commit ( ) ; } } catch ( ActiveMQException e ) { if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( e ) ; } throw e ; } catch ( Throwable e ) { ActiveMQServerLogger . LOGGER . errorAckingMessage ( ( Exception ) e ) ; ActiveMQIllegalStateException hqex = new ActiveMQIllegalStateException ( e . getMessage ( ) ) ; if ( startedTransaction ) { tx . rollback ( ) ; } else if ( tx != null ) { tx . markAsRollbackOnly ( hqex ) ; } throw hqex ; } } " 695,"public static NotebookAuthorization getInstance ( ) { if ( instance == null ) { init ( ZeppelinConfiguration . create ( ) ) ; } return instance ; } ","public static NotebookAuthorization getInstance ( ) { if ( instance == null ) { LOG . warn ( ""Notebook authorization module was called without initialization,"" + "" initializing with default configuration"" ) ; init ( ZeppelinConfiguration . create ( ) ) ; } return instance ; } " 696,"public static < O extends ObjectType > PrismObject < O > reconstructObject ( Class < O > type , String oid , String eventIdentifier , Task task , OperationResult result ) { try { MidPointApplication application = ( MidPointApplication ) MidPointApplication . get ( ) ; return application . getAuditService ( ) . reconstructObject ( type , oid , eventIdentifier , task , result ) ; } catch ( Exception ex ) { } return null ; } ","public static < O extends ObjectType > PrismObject < O > reconstructObject ( Class < O > type , String oid , String eventIdentifier , Task task , OperationResult result ) { try { MidPointApplication application = ( MidPointApplication ) MidPointApplication . get ( ) ; return application . getAuditService ( ) . reconstructObject ( type , oid , eventIdentifier , task , result ) ; } catch ( Exception ex ) { LOGGER . debug ( ""Error occurred while reconsructing the object, "" + ex . getMessage ( ) ) ; } return null ; } " 697,"protected Pattern createNonProxyPattern ( String nonProxyHosts ) { if ( nonProxyHosts == null || nonProxyHosts . isEmpty ( ) ) return null ; nonProxyHosts = nonProxyHosts . replaceAll ( ""\\."" , ""\\\\."" ) . replaceAll ( ""\\*"" , "".*?"" ) ; nonProxyHosts = ""("" + nonProxyHosts . replaceAll ( ""\\|"" , "")|("" ) + "")"" ; try { return Pattern . compile ( nonProxyHosts ) ; } catch ( Exception e ) { return null ; } } ","protected Pattern createNonProxyPattern ( String nonProxyHosts ) { if ( nonProxyHosts == null || nonProxyHosts . isEmpty ( ) ) return null ; nonProxyHosts = nonProxyHosts . replaceAll ( ""\\."" , ""\\\\."" ) . replaceAll ( ""\\*"" , "".*?"" ) ; nonProxyHosts = ""("" + nonProxyHosts . replaceAll ( ""\\|"" , "")|("" ) + "")"" ; try { return Pattern . compile ( nonProxyHosts ) ; } catch ( Exception e ) { logger . error ( ""Creating the nonProxyHosts pattern failed for http.nonProxyHosts="" + nonProxyHosts , e ) ; return null ; } } " 698,"public void call ( final Object ... args ) { handleError ( Socket . EVENT_DISCONNECT , args ) ; isConnected = false ; } ","public void call ( final Object ... args ) { logger . debug ( ""Listener: Disconnected from the ambient weather service)"" ) ; handleError ( Socket . EVENT_DISCONNECT , args ) ; isConnected = false ; } " 699,"@ ClientCacheEntryExpired public void expired ( ClientCacheEntryExpiredEvent e ) { for ( ExpiredListener listener : expired ) { try { listener . expired ( e . getKey ( ) , null ) ; } catch ( Exception ex ) { } } } ","@ ClientCacheEntryExpired public void expired ( ClientCacheEntryExpiredEvent e ) { for ( ExpiredListener listener : expired ) { try { listener . expired ( e . getKey ( ) , null ) ; } catch ( Exception ex ) { log . error ( ""Listener "" + listener + "" has thrown an exception"" , ex ) ; } } } " 700,"public Set < String > getRoles ( String username ) throws AccountException { if ( logger . isDebugEnabled ( ) ) { } Set < String > roles = new LinkedHashSet < String > ( ) ; Connection conn = null ; PreparedStatement ps = null ; ResultSet rs = null ; try { conn = getConnection ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Executing query: "" + rolesQuery + "", with username: "" + username ) ; } ps = conn . prepareStatement ( rolesQuery ) ; try { ps . setString ( 1 , username ) ; } catch ( ArrayIndexOutOfBoundsException ignore ) { } rs = ps . executeQuery ( ) ; if ( rs . next ( ) == false ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""No roles found"" ) ; } return roles ; } do { String roleName = rs . getString ( 1 ) ; roles . add ( roleName ) ; } while ( rs . next ( ) ) ; } catch ( SQLException ex ) { AccountException ae = new AccountException ( ""Query failed"" ) ; ae . initCause ( ex ) ; throw ae ; } catch ( Exception e ) { AccountException ae = new AccountException ( ""unknown exception"" ) ; ae . initCause ( e ) ; throw ae ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } if ( ps != null ) { try { ps . close ( ) ; } catch ( SQLException e ) { } } if ( conn != null ) { try { conn . close ( ) ; } catch ( Exception ex ) { } } } return roles ; } ","public Set < String > getRoles ( String username ) throws AccountException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""getRoleSets using rolesQuery: "" + rolesQuery + "", username: "" + username ) ; } Set < String > roles = new LinkedHashSet < String > ( ) ; Connection conn = null ; PreparedStatement ps = null ; ResultSet rs = null ; try { conn = getConnection ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Executing query: "" + rolesQuery + "", with username: "" + username ) ; } ps = conn . prepareStatement ( rolesQuery ) ; try { ps . setString ( 1 , username ) ; } catch ( ArrayIndexOutOfBoundsException ignore ) { } rs = ps . executeQuery ( ) ; if ( rs . next ( ) == false ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""No roles found"" ) ; } return roles ; } do { String roleName = rs . getString ( 1 ) ; roles . add ( roleName ) ; } while ( rs . next ( ) ) ; } catch ( SQLException ex ) { AccountException ae = new AccountException ( ""Query failed"" ) ; ae . initCause ( ex ) ; throw ae ; } catch ( Exception e ) { AccountException ae = new AccountException ( ""unknown exception"" ) ; ae . initCause ( e ) ; throw ae ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } if ( ps != null ) { try { ps . close ( ) ; } catch ( SQLException e ) { } } if ( conn != null ) { try { conn . close ( ) ; } catch ( Exception ex ) { } } } return roles ; } " 701,"public Set < String > getRoles ( String username ) throws AccountException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""getRoleSets using rolesQuery: "" + rolesQuery + "", username: "" + username ) ; } Set < String > roles = new LinkedHashSet < String > ( ) ; Connection conn = null ; PreparedStatement ps = null ; ResultSet rs = null ; try { conn = getConnection ( ) ; if ( logger . isDebugEnabled ( ) ) { } ps = conn . prepareStatement ( rolesQuery ) ; try { ps . setString ( 1 , username ) ; } catch ( ArrayIndexOutOfBoundsException ignore ) { } rs = ps . executeQuery ( ) ; if ( rs . next ( ) == false ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""No roles found"" ) ; } return roles ; } do { String roleName = rs . getString ( 1 ) ; roles . add ( roleName ) ; } while ( rs . next ( ) ) ; } catch ( SQLException ex ) { AccountException ae = new AccountException ( ""Query failed"" ) ; ae . initCause ( ex ) ; throw ae ; } catch ( Exception e ) { AccountException ae = new AccountException ( ""unknown exception"" ) ; ae . initCause ( e ) ; throw ae ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } if ( ps != null ) { try { ps . close ( ) ; } catch ( SQLException e ) { } } if ( conn != null ) { try { conn . close ( ) ; } catch ( Exception ex ) { } } } return roles ; } ","public Set < String > getRoles ( String username ) throws AccountException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""getRoleSets using rolesQuery: "" + rolesQuery + "", username: "" + username ) ; } Set < String > roles = new LinkedHashSet < String > ( ) ; Connection conn = null ; PreparedStatement ps = null ; ResultSet rs = null ; try { conn = getConnection ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Executing query: "" + rolesQuery + "", with username: "" + username ) ; } ps = conn . prepareStatement ( rolesQuery ) ; try { ps . setString ( 1 , username ) ; } catch ( ArrayIndexOutOfBoundsException ignore ) { } rs = ps . executeQuery ( ) ; if ( rs . next ( ) == false ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""No roles found"" ) ; } return roles ; } do { String roleName = rs . getString ( 1 ) ; roles . add ( roleName ) ; } while ( rs . next ( ) ) ; } catch ( SQLException ex ) { AccountException ae = new AccountException ( ""Query failed"" ) ; ae . initCause ( ex ) ; throw ae ; } catch ( Exception e ) { AccountException ae = new AccountException ( ""unknown exception"" ) ; ae . initCause ( e ) ; throw ae ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } if ( ps != null ) { try { ps . close ( ) ; } catch ( SQLException e ) { } } if ( conn != null ) { try { conn . close ( ) ; } catch ( Exception ex ) { } } } return roles ; } " 702,"public Set < String > getRoles ( String username ) throws AccountException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""getRoleSets using rolesQuery: "" + rolesQuery + "", username: "" + username ) ; } Set < String > roles = new LinkedHashSet < String > ( ) ; Connection conn = null ; PreparedStatement ps = null ; ResultSet rs = null ; try { conn = getConnection ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Executing query: "" + rolesQuery + "", with username: "" + username ) ; } ps = conn . prepareStatement ( rolesQuery ) ; try { ps . setString ( 1 , username ) ; } catch ( ArrayIndexOutOfBoundsException ignore ) { } rs = ps . executeQuery ( ) ; if ( rs . next ( ) == false ) { if ( logger . isDebugEnabled ( ) ) { } return roles ; } do { String roleName = rs . getString ( 1 ) ; roles . add ( roleName ) ; } while ( rs . next ( ) ) ; } catch ( SQLException ex ) { AccountException ae = new AccountException ( ""Query failed"" ) ; ae . initCause ( ex ) ; throw ae ; } catch ( Exception e ) { AccountException ae = new AccountException ( ""unknown exception"" ) ; ae . initCause ( e ) ; throw ae ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } if ( ps != null ) { try { ps . close ( ) ; } catch ( SQLException e ) { } } if ( conn != null ) { try { conn . close ( ) ; } catch ( Exception ex ) { } } } return roles ; } ","public Set < String > getRoles ( String username ) throws AccountException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""getRoleSets using rolesQuery: "" + rolesQuery + "", username: "" + username ) ; } Set < String > roles = new LinkedHashSet < String > ( ) ; Connection conn = null ; PreparedStatement ps = null ; ResultSet rs = null ; try { conn = getConnection ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""Executing query: "" + rolesQuery + "", with username: "" + username ) ; } ps = conn . prepareStatement ( rolesQuery ) ; try { ps . setString ( 1 , username ) ; } catch ( ArrayIndexOutOfBoundsException ignore ) { } rs = ps . executeQuery ( ) ; if ( rs . next ( ) == false ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ""No roles found"" ) ; } return roles ; } do { String roleName = rs . getString ( 1 ) ; roles . add ( roleName ) ; } while ( rs . next ( ) ) ; } catch ( SQLException ex ) { AccountException ae = new AccountException ( ""Query failed"" ) ; ae . initCause ( ex ) ; throw ae ; } catch ( Exception e ) { AccountException ae = new AccountException ( ""unknown exception"" ) ; ae . initCause ( e ) ; throw ae ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } if ( ps != null ) { try { ps . close ( ) ; } catch ( SQLException e ) { } } if ( conn != null ) { try { conn . close ( ) ; } catch ( Exception ex ) { } } } return roles ; } " 703,"public boolean saveAddress ( AddressType address ) throws LoadTestDataException { SaveAddressRequestMessageType request = new SaveAddressRequestMessageType ( ) ; request . setConfigAssertion ( buildConfigAssertion ( ) ) ; request . setAddress ( address ) ; try { LoadTestDataSimpleResponseMessageType response = ( LoadTestDataSimpleResponseMessageType ) invokeClientPort ( AdminWSConstants . ADMIN_LTD_SAVEADDRESS , request ) ; logDebug ( AdminWSConstants . ADMIN_LTD_SAVEADDRESS , response . isStatus ( ) , response . getMessage ( ) ) ; return response . isStatus ( ) ; } catch ( Exception e ) { } return false ; } ","public boolean saveAddress ( AddressType address ) throws LoadTestDataException { SaveAddressRequestMessageType request = new SaveAddressRequestMessageType ( ) ; request . setConfigAssertion ( buildConfigAssertion ( ) ) ; request . setAddress ( address ) ; try { LoadTestDataSimpleResponseMessageType response = ( LoadTestDataSimpleResponseMessageType ) invokeClientPort ( AdminWSConstants . ADMIN_LTD_SAVEADDRESS , request ) ; logDebug ( AdminWSConstants . ADMIN_LTD_SAVEADDRESS , response . isStatus ( ) , response . getMessage ( ) ) ; return response . isStatus ( ) ; } catch ( Exception e ) { LOG . error ( ""error during save address: {}"" , e . getLocalizedMessage ( ) , e ) ; } return false ; } " 704,"public static com . liferay . commerce . inventory . model . CommerceInventoryWarehouseItemSoap addCommerceInventoryWarehouseItem ( long userId , long commerceInventoryWarehouseId , String sku , int quantity ) throws RemoteException { try { com . liferay . commerce . inventory . model . CommerceInventoryWarehouseItem returnValue = CommerceInventoryWarehouseItemServiceUtil . addCommerceInventoryWarehouseItem ( userId , commerceInventoryWarehouseId , sku , quantity ) ; return com . liferay . commerce . inventory . model . CommerceInventoryWarehouseItemSoap . toSoapModel ( returnValue ) ; } catch ( Exception exception ) { throw new RemoteException ( exception . getMessage ( ) ) ; } } ","public static com . liferay . commerce . inventory . model . CommerceInventoryWarehouseItemSoap addCommerceInventoryWarehouseItem ( long userId , long commerceInventoryWarehouseId , String sku , int quantity ) throws RemoteException { try { com . liferay . commerce . inventory . model . CommerceInventoryWarehouseItem returnValue = CommerceInventoryWarehouseItemServiceUtil . addCommerceInventoryWarehouseItem ( userId , commerceInventoryWarehouseId , sku , quantity ) ; return com . liferay . commerce . inventory . model . CommerceInventoryWarehouseItemSoap . toSoapModel ( returnValue ) ; } catch ( Exception exception ) { _log . error ( exception , exception ) ; throw new RemoteException ( exception . getMessage ( ) ) ; } } " 705,"public void handleMessage ( SoapMessage message ) throws Fault { try { MDCSetup mdcSetup = new MDCSetup ( ) ; Exception ex = message . getContent ( Exception . class ) ; if ( ex == null ) { MDC . put ( ONAPLogConstants . MDCs . RESPONSE_STATUS_CODE , ONAPLogConstants . ResponseStatus . COMPLETE . toString ( ) ) ; } else { int responseCode = 0 ; responseCode = ( int ) message . get ( Message . RESPONSE_CODE ) ; if ( responseCode != 0 ) MDC . put ( ONAPLogConstants . MDCs . RESPONSE_CODE , String . valueOf ( responseCode ) ) ; else MDC . put ( ONAPLogConstants . MDCs . RESPONSE_CODE , _500 ) ; MDC . put ( ONAPLogConstants . MDCs . RESPONSE_STATUS_CODE , ONAPLogConstants . ResponseStatus . ERROR . toString ( ) ) ; } mdcSetup . setLogTimestamp ( ) ; mdcSetup . setElapsedTime ( ) ; } catch ( Exception e ) { logger . warn ( ""Error in incoming SOAP Message Inteceptor"" , e ) ; } } ","public void handleMessage ( SoapMessage message ) throws Fault { try { MDCSetup mdcSetup = new MDCSetup ( ) ; Exception ex = message . getContent ( Exception . class ) ; if ( ex == null ) { MDC . put ( ONAPLogConstants . MDCs . RESPONSE_STATUS_CODE , ONAPLogConstants . ResponseStatus . COMPLETE . toString ( ) ) ; } else { int responseCode = 0 ; responseCode = ( int ) message . get ( Message . RESPONSE_CODE ) ; if ( responseCode != 0 ) MDC . put ( ONAPLogConstants . MDCs . RESPONSE_CODE , String . valueOf ( responseCode ) ) ; else MDC . put ( ONAPLogConstants . MDCs . RESPONSE_CODE , _500 ) ; MDC . put ( ONAPLogConstants . MDCs . RESPONSE_STATUS_CODE , ONAPLogConstants . ResponseStatus . ERROR . toString ( ) ) ; } mdcSetup . setLogTimestamp ( ) ; mdcSetup . setElapsedTime ( ) ; logger . info ( ONAPLogConstants . Markers . EXIT , ""Exiting"" ) ; } catch ( Exception e ) { logger . warn ( ""Error in incoming SOAP Message Inteceptor"" , e ) ; } } " 706,"public void handleMessage ( SoapMessage message ) throws Fault { try { MDCSetup mdcSetup = new MDCSetup ( ) ; Exception ex = message . getContent ( Exception . class ) ; if ( ex == null ) { MDC . put ( ONAPLogConstants . MDCs . RESPONSE_STATUS_CODE , ONAPLogConstants . ResponseStatus . COMPLETE . toString ( ) ) ; } else { int responseCode = 0 ; responseCode = ( int ) message . get ( Message . RESPONSE_CODE ) ; if ( responseCode != 0 ) MDC . put ( ONAPLogConstants . MDCs . RESPONSE_CODE , String . valueOf ( responseCode ) ) ; else MDC . put ( ONAPLogConstants . MDCs . RESPONSE_CODE , _500 ) ; MDC . put ( ONAPLogConstants . MDCs . RESPONSE_STATUS_CODE , ONAPLogConstants . ResponseStatus . ERROR . toString ( ) ) ; } mdcSetup . setLogTimestamp ( ) ; mdcSetup . setElapsedTime ( ) ; logger . info ( ONAPLogConstants . Markers . EXIT , ""Exiting"" ) ; } catch ( Exception e ) { } } ","public void handleMessage ( SoapMessage message ) throws Fault { try { MDCSetup mdcSetup = new MDCSetup ( ) ; Exception ex = message . getContent ( Exception . class ) ; if ( ex == null ) { MDC . put ( ONAPLogConstants . MDCs . RESPONSE_STATUS_CODE , ONAPLogConstants . ResponseStatus . COMPLETE . toString ( ) ) ; } else { int responseCode = 0 ; responseCode = ( int ) message . get ( Message . RESPONSE_CODE ) ; if ( responseCode != 0 ) MDC . put ( ONAPLogConstants . MDCs . RESPONSE_CODE , String . valueOf ( responseCode ) ) ; else MDC . put ( ONAPLogConstants . MDCs . RESPONSE_CODE , _500 ) ; MDC . put ( ONAPLogConstants . MDCs . RESPONSE_STATUS_CODE , ONAPLogConstants . ResponseStatus . ERROR . toString ( ) ) ; } mdcSetup . setLogTimestamp ( ) ; mdcSetup . setElapsedTime ( ) ; logger . info ( ONAPLogConstants . Markers . EXIT , ""Exiting"" ) ; } catch ( Exception e ) { logger . warn ( ""Error in incoming SOAP Message Inteceptor"" , e ) ; } } " 707,"public void onActivityTestGPRSRequest ( ActivityTestGPRSRequest ind ) { TestEvent te = TestEvent . createReceivedEvent ( EventType . ActivityTestGPRSRequest , ind , sequence ++ ) ; this . observerdEvents . add ( te ) ; } ","public void onActivityTestGPRSRequest ( ActivityTestGPRSRequest ind ) { this . logger . debug ( ""ActivityTestGPRSRequest"" ) ; TestEvent te = TestEvent . createReceivedEvent ( EventType . ActivityTestGPRSRequest , ind , sequence ++ ) ; this . observerdEvents . add ( te ) ; } " 708,"@ Test public void testSendSlowClientSuccess ( ) throws Exception { try ( SiteToSiteClient client = getDefaultBuilder ( ) . idleExpiration ( 1000 , TimeUnit . MILLISECONDS ) . portName ( ""input-running"" ) . build ( ) ) { final Transaction transaction = client . createTransaction ( TransferDirection . SEND ) ; assertNotNull ( transaction ) ; serverChecksum = ""3882825556"" ; for ( int i = 0 ; i < 3 ; i ++ ) { DataPacket packet = new DataPacketBuilder ( ) . contents ( ""Example contents from client."" ) . attr ( ""Client attr 1"" , ""Client attr 1 value"" ) . attr ( ""Client attr 2"" , ""Client attr 2 value"" ) . build ( ) ; transaction . send ( packet ) ; long written = ( ( Peer ) transaction . getCommunicant ( ) ) . getCommunicationsSession ( ) . getBytesWritten ( ) ; Thread . sleep ( 50 ) ; } transaction . confirm ( ) ; transaction . complete ( ) ; } } ","@ Test public void testSendSlowClientSuccess ( ) throws Exception { try ( SiteToSiteClient client = getDefaultBuilder ( ) . idleExpiration ( 1000 , TimeUnit . MILLISECONDS ) . portName ( ""input-running"" ) . build ( ) ) { final Transaction transaction = client . createTransaction ( TransferDirection . SEND ) ; assertNotNull ( transaction ) ; serverChecksum = ""3882825556"" ; for ( int i = 0 ; i < 3 ; i ++ ) { DataPacket packet = new DataPacketBuilder ( ) . contents ( ""Example contents from client."" ) . attr ( ""Client attr 1"" , ""Client attr 1 value"" ) . attr ( ""Client attr 2"" , ""Client attr 2 value"" ) . build ( ) ; transaction . send ( packet ) ; long written = ( ( Peer ) transaction . getCommunicant ( ) ) . getCommunicationsSession ( ) . getBytesWritten ( ) ; logger . info ( ""{} bytes have been written."" , written ) ; Thread . sleep ( 50 ) ; } transaction . confirm ( ) ; transaction . complete ( ) ; } } " 709,"public List < UUID > testEntityCollections ( UUID applicationId , UUID entityId , String entityType , String collectionName , int expectedCount ) throws Exception { logger . info ( ""----------------------------------------------------"" ) ; EntityManager em = setup . getEmf ( ) . getEntityManager ( applicationId ) ; Entity en = em . get ( new SimpleEntityRef ( entityType , entityId ) ) ; int i = 0 ; Results entities = em . getCollection ( en , collectionName , null , 100 , Level . IDS , false ) ; for ( UUID id : entities . getIds ( ) ) { logger . info ( ( i ++ ) + "" "" + id . toString ( ) ) ; } logger . info ( ""----------------------------------------------------"" ) ; assertEquals ( ""Expected "" + expectedCount + "" connections"" , expectedCount , entities . getIds ( ) != null ? entities . getIds ( ) . size ( ) : 0 ) ; return entities . getIds ( ) ; } ","public List < UUID > testEntityCollections ( UUID applicationId , UUID entityId , String entityType , String collectionName , int expectedCount ) throws Exception { logger . info ( ""----------------------------------------------------"" ) ; logger . info ( ""Checking collection "" + collectionName + "" for "" + entityId . toString ( ) ) ; EntityManager em = setup . getEmf ( ) . getEntityManager ( applicationId ) ; Entity en = em . get ( new SimpleEntityRef ( entityType , entityId ) ) ; int i = 0 ; Results entities = em . getCollection ( en , collectionName , null , 100 , Level . IDS , false ) ; for ( UUID id : entities . getIds ( ) ) { logger . info ( ( i ++ ) + "" "" + id . toString ( ) ) ; } logger . info ( ""----------------------------------------------------"" ) ; assertEquals ( ""Expected "" + expectedCount + "" connections"" , expectedCount , entities . getIds ( ) != null ? entities . getIds ( ) . size ( ) : 0 ) ; return entities . getIds ( ) ; } " 710,"public List < UUID > testEntityCollections ( UUID applicationId , UUID entityId , String entityType , String collectionName , int expectedCount ) throws Exception { logger . info ( ""----------------------------------------------------"" ) ; logger . info ( ""Checking collection "" + collectionName + "" for "" + entityId . toString ( ) ) ; EntityManager em = setup . getEmf ( ) . getEntityManager ( applicationId ) ; Entity en = em . get ( new SimpleEntityRef ( entityType , entityId ) ) ; int i = 0 ; Results entities = em . getCollection ( en , collectionName , null , 100 , Level . IDS , false ) ; for ( UUID id : entities . getIds ( ) ) { } logger . info ( ""----------------------------------------------------"" ) ; assertEquals ( ""Expected "" + expectedCount + "" connections"" , expectedCount , entities . getIds ( ) != null ? entities . getIds ( ) . size ( ) : 0 ) ; return entities . getIds ( ) ; } ","public List < UUID > testEntityCollections ( UUID applicationId , UUID entityId , String entityType , String collectionName , int expectedCount ) throws Exception { logger . info ( ""----------------------------------------------------"" ) ; logger . info ( ""Checking collection "" + collectionName + "" for "" + entityId . toString ( ) ) ; EntityManager em = setup . getEmf ( ) . getEntityManager ( applicationId ) ; Entity en = em . get ( new SimpleEntityRef ( entityType , entityId ) ) ; int i = 0 ; Results entities = em . getCollection ( en , collectionName , null , 100 , Level . IDS , false ) ; for ( UUID id : entities . getIds ( ) ) { logger . info ( ( i ++ ) + "" "" + id . toString ( ) ) ; } logger . info ( ""----------------------------------------------------"" ) ; assertEquals ( ""Expected "" + expectedCount + "" connections"" , expectedCount , entities . getIds ( ) != null ? entities . getIds ( ) . size ( ) : 0 ) ; return entities . getIds ( ) ; } " 711,"public void run ( ) { synchronized ( this ) { if ( retryTimer . isPresent ( ) ) { retryTimer = Optional . empty ( ) ; } else { return ; } } cancelToResume ( ) ; } ","public void run ( ) { synchronized ( this ) { if ( retryTimer . isPresent ( ) ) { LOG . warn ( ""Snapshot restore timed out, failed to restore snapshot for %s, snapshot %s"" , queryId . getId ( ) , lastTriedId . toString ( ) ) ; retryTimer = Optional . empty ( ) ; } else { return ; } } cancelToResume ( ) ; } " 712,"public void work ( ) { openUserSession ( ) ; List < Blob > blobList = new ArrayList < > ( ) ; DownloadService downloadService = Framework . getService ( DownloadService . class ) ; for ( String docId : docIds ) { DocumentRef docRef = new IdRef ( docId ) ; if ( ! session . exists ( docRef ) ) { if ( log . isDebugEnabled ( ) ) { } continue ; } DocumentModel doc = session . getDocument ( docRef ) ; Blob blob = downloadService . resolveBlob ( doc ) ; if ( blob == null ) { log . trace ( ""Not able to resolve blob"" ) ; continue ; } else if ( ! downloadService . checkPermission ( doc , null , blob , ""download"" , Collections . emptyMap ( ) ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Not allowed to bulk download blob for document %s"" , doc . getPathAsString ( ) ) ) ; } continue ; } blobList . add ( blob ) ; } if ( blobList . isEmpty ( ) ) { log . debug ( ""No blob to be zipped"" ) ; updateAndCompleteStoreEntry ( Collections . emptyList ( ) ) ; return ; } Blob blob ; String finalFilename = StringUtils . isNotBlank ( this . filename ) ? this . filename : this . id ; try { blob = BlobUtils . zip ( blobList , finalFilename ) ; } catch ( IOException e ) { TransientStore ts = getTransientStore ( ) ; ts . putParameter ( key , DownloadService . TRANSIENT_STORE_PARAM_ERROR , e . getMessage ( ) ) ; throw new NuxeoException ( ""Exception while zipping blob list"" , e ) ; } updateAndCompleteStoreEntry ( Collections . singletonList ( blob ) ) ; } ","public void work ( ) { openUserSession ( ) ; List < Blob > blobList = new ArrayList < > ( ) ; DownloadService downloadService = Framework . getService ( DownloadService . class ) ; for ( String docId : docIds ) { DocumentRef docRef = new IdRef ( docId ) ; if ( ! session . exists ( docRef ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Cannot retrieve document '%s', probably deleted in the meanwhile"" , docId ) ) ; } continue ; } DocumentModel doc = session . getDocument ( docRef ) ; Blob blob = downloadService . resolveBlob ( doc ) ; if ( blob == null ) { log . trace ( ""Not able to resolve blob"" ) ; continue ; } else if ( ! downloadService . checkPermission ( doc , null , blob , ""download"" , Collections . emptyMap ( ) ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Not allowed to bulk download blob for document %s"" , doc . getPathAsString ( ) ) ) ; } continue ; } blobList . add ( blob ) ; } if ( blobList . isEmpty ( ) ) { log . debug ( ""No blob to be zipped"" ) ; updateAndCompleteStoreEntry ( Collections . emptyList ( ) ) ; return ; } Blob blob ; String finalFilename = StringUtils . isNotBlank ( this . filename ) ? this . filename : this . id ; try { blob = BlobUtils . zip ( blobList , finalFilename ) ; } catch ( IOException e ) { TransientStore ts = getTransientStore ( ) ; ts . putParameter ( key , DownloadService . TRANSIENT_STORE_PARAM_ERROR , e . getMessage ( ) ) ; throw new NuxeoException ( ""Exception while zipping blob list"" , e ) ; } updateAndCompleteStoreEntry ( Collections . singletonList ( blob ) ) ; } " 713,"public void work ( ) { openUserSession ( ) ; List < Blob > blobList = new ArrayList < > ( ) ; DownloadService downloadService = Framework . getService ( DownloadService . class ) ; for ( String docId : docIds ) { DocumentRef docRef = new IdRef ( docId ) ; if ( ! session . exists ( docRef ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Cannot retrieve document '%s', probably deleted in the meanwhile"" , docId ) ) ; } continue ; } DocumentModel doc = session . getDocument ( docRef ) ; Blob blob = downloadService . resolveBlob ( doc ) ; if ( blob == null ) { continue ; } else if ( ! downloadService . checkPermission ( doc , null , blob , ""download"" , Collections . emptyMap ( ) ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Not allowed to bulk download blob for document %s"" , doc . getPathAsString ( ) ) ) ; } continue ; } blobList . add ( blob ) ; } if ( blobList . isEmpty ( ) ) { log . debug ( ""No blob to be zipped"" ) ; updateAndCompleteStoreEntry ( Collections . emptyList ( ) ) ; return ; } Blob blob ; String finalFilename = StringUtils . isNotBlank ( this . filename ) ? this . filename : this . id ; try { blob = BlobUtils . zip ( blobList , finalFilename ) ; } catch ( IOException e ) { TransientStore ts = getTransientStore ( ) ; ts . putParameter ( key , DownloadService . TRANSIENT_STORE_PARAM_ERROR , e . getMessage ( ) ) ; throw new NuxeoException ( ""Exception while zipping blob list"" , e ) ; } updateAndCompleteStoreEntry ( Collections . singletonList ( blob ) ) ; } ","public void work ( ) { openUserSession ( ) ; List < Blob > blobList = new ArrayList < > ( ) ; DownloadService downloadService = Framework . getService ( DownloadService . class ) ; for ( String docId : docIds ) { DocumentRef docRef = new IdRef ( docId ) ; if ( ! session . exists ( docRef ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Cannot retrieve document '%s', probably deleted in the meanwhile"" , docId ) ) ; } continue ; } DocumentModel doc = session . getDocument ( docRef ) ; Blob blob = downloadService . resolveBlob ( doc ) ; if ( blob == null ) { log . trace ( ""Not able to resolve blob"" ) ; continue ; } else if ( ! downloadService . checkPermission ( doc , null , blob , ""download"" , Collections . emptyMap ( ) ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Not allowed to bulk download blob for document %s"" , doc . getPathAsString ( ) ) ) ; } continue ; } blobList . add ( blob ) ; } if ( blobList . isEmpty ( ) ) { log . debug ( ""No blob to be zipped"" ) ; updateAndCompleteStoreEntry ( Collections . emptyList ( ) ) ; return ; } Blob blob ; String finalFilename = StringUtils . isNotBlank ( this . filename ) ? this . filename : this . id ; try { blob = BlobUtils . zip ( blobList , finalFilename ) ; } catch ( IOException e ) { TransientStore ts = getTransientStore ( ) ; ts . putParameter ( key , DownloadService . TRANSIENT_STORE_PARAM_ERROR , e . getMessage ( ) ) ; throw new NuxeoException ( ""Exception while zipping blob list"" , e ) ; } updateAndCompleteStoreEntry ( Collections . singletonList ( blob ) ) ; } " 714,"public void work ( ) { openUserSession ( ) ; List < Blob > blobList = new ArrayList < > ( ) ; DownloadService downloadService = Framework . getService ( DownloadService . class ) ; for ( String docId : docIds ) { DocumentRef docRef = new IdRef ( docId ) ; if ( ! session . exists ( docRef ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Cannot retrieve document '%s', probably deleted in the meanwhile"" , docId ) ) ; } continue ; } DocumentModel doc = session . getDocument ( docRef ) ; Blob blob = downloadService . resolveBlob ( doc ) ; if ( blob == null ) { log . trace ( ""Not able to resolve blob"" ) ; continue ; } else if ( ! downloadService . checkPermission ( doc , null , blob , ""download"" , Collections . emptyMap ( ) ) ) { if ( log . isDebugEnabled ( ) ) { } continue ; } blobList . add ( blob ) ; } if ( blobList . isEmpty ( ) ) { log . debug ( ""No blob to be zipped"" ) ; updateAndCompleteStoreEntry ( Collections . emptyList ( ) ) ; return ; } Blob blob ; String finalFilename = StringUtils . isNotBlank ( this . filename ) ? this . filename : this . id ; try { blob = BlobUtils . zip ( blobList , finalFilename ) ; } catch ( IOException e ) { TransientStore ts = getTransientStore ( ) ; ts . putParameter ( key , DownloadService . TRANSIENT_STORE_PARAM_ERROR , e . getMessage ( ) ) ; throw new NuxeoException ( ""Exception while zipping blob list"" , e ) ; } updateAndCompleteStoreEntry ( Collections . singletonList ( blob ) ) ; } ","public void work ( ) { openUserSession ( ) ; List < Blob > blobList = new ArrayList < > ( ) ; DownloadService downloadService = Framework . getService ( DownloadService . class ) ; for ( String docId : docIds ) { DocumentRef docRef = new IdRef ( docId ) ; if ( ! session . exists ( docRef ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Cannot retrieve document '%s', probably deleted in the meanwhile"" , docId ) ) ; } continue ; } DocumentModel doc = session . getDocument ( docRef ) ; Blob blob = downloadService . resolveBlob ( doc ) ; if ( blob == null ) { log . trace ( ""Not able to resolve blob"" ) ; continue ; } else if ( ! downloadService . checkPermission ( doc , null , blob , ""download"" , Collections . emptyMap ( ) ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Not allowed to bulk download blob for document %s"" , doc . getPathAsString ( ) ) ) ; } continue ; } blobList . add ( blob ) ; } if ( blobList . isEmpty ( ) ) { log . debug ( ""No blob to be zipped"" ) ; updateAndCompleteStoreEntry ( Collections . emptyList ( ) ) ; return ; } Blob blob ; String finalFilename = StringUtils . isNotBlank ( this . filename ) ? this . filename : this . id ; try { blob = BlobUtils . zip ( blobList , finalFilename ) ; } catch ( IOException e ) { TransientStore ts = getTransientStore ( ) ; ts . putParameter ( key , DownloadService . TRANSIENT_STORE_PARAM_ERROR , e . getMessage ( ) ) ; throw new NuxeoException ( ""Exception while zipping blob list"" , e ) ; } updateAndCompleteStoreEntry ( Collections . singletonList ( blob ) ) ; } " 715,"public void work ( ) { openUserSession ( ) ; List < Blob > blobList = new ArrayList < > ( ) ; DownloadService downloadService = Framework . getService ( DownloadService . class ) ; for ( String docId : docIds ) { DocumentRef docRef = new IdRef ( docId ) ; if ( ! session . exists ( docRef ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Cannot retrieve document '%s', probably deleted in the meanwhile"" , docId ) ) ; } continue ; } DocumentModel doc = session . getDocument ( docRef ) ; Blob blob = downloadService . resolveBlob ( doc ) ; if ( blob == null ) { log . trace ( ""Not able to resolve blob"" ) ; continue ; } else if ( ! downloadService . checkPermission ( doc , null , blob , ""download"" , Collections . emptyMap ( ) ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Not allowed to bulk download blob for document %s"" , doc . getPathAsString ( ) ) ) ; } continue ; } blobList . add ( blob ) ; } if ( blobList . isEmpty ( ) ) { updateAndCompleteStoreEntry ( Collections . emptyList ( ) ) ; return ; } Blob blob ; String finalFilename = StringUtils . isNotBlank ( this . filename ) ? this . filename : this . id ; try { blob = BlobUtils . zip ( blobList , finalFilename ) ; } catch ( IOException e ) { TransientStore ts = getTransientStore ( ) ; ts . putParameter ( key , DownloadService . TRANSIENT_STORE_PARAM_ERROR , e . getMessage ( ) ) ; throw new NuxeoException ( ""Exception while zipping blob list"" , e ) ; } updateAndCompleteStoreEntry ( Collections . singletonList ( blob ) ) ; } ","public void work ( ) { openUserSession ( ) ; List < Blob > blobList = new ArrayList < > ( ) ; DownloadService downloadService = Framework . getService ( DownloadService . class ) ; for ( String docId : docIds ) { DocumentRef docRef = new IdRef ( docId ) ; if ( ! session . exists ( docRef ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Cannot retrieve document '%s', probably deleted in the meanwhile"" , docId ) ) ; } continue ; } DocumentModel doc = session . getDocument ( docRef ) ; Blob blob = downloadService . resolveBlob ( doc ) ; if ( blob == null ) { log . trace ( ""Not able to resolve blob"" ) ; continue ; } else if ( ! downloadService . checkPermission ( doc , null , blob , ""download"" , Collections . emptyMap ( ) ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( ""Not allowed to bulk download blob for document %s"" , doc . getPathAsString ( ) ) ) ; } continue ; } blobList . add ( blob ) ; } if ( blobList . isEmpty ( ) ) { log . debug ( ""No blob to be zipped"" ) ; updateAndCompleteStoreEntry ( Collections . emptyList ( ) ) ; return ; } Blob blob ; String finalFilename = StringUtils . isNotBlank ( this . filename ) ? this . filename : this . id ; try { blob = BlobUtils . zip ( blobList , finalFilename ) ; } catch ( IOException e ) { TransientStore ts = getTransientStore ( ) ; ts . putParameter ( key , DownloadService . TRANSIENT_STORE_PARAM_ERROR , e . getMessage ( ) ) ; throw new NuxeoException ( ""Exception while zipping blob list"" , e ) ; } updateAndCompleteStoreEntry ( Collections . singletonList ( blob ) ) ; } " 716,"public static void deleteKeycloak ( String namespace ) { Exec . exec ( true , ""/bin/bash"" , PATH_TO_KEYCLOAK_TEARDOWN_SCRIPT , namespace ) ; } ","public static void deleteKeycloak ( String namespace ) { LOGGER . info ( ""Teardown Keycloak in namespace: {}"" , namespace ) ; Exec . exec ( true , ""/bin/bash"" , PATH_TO_KEYCLOAK_TEARDOWN_SCRIPT , namespace ) ; } " 717,"public Map < String , Metric > getMetrics ( ) { final Map < String , Metric > gauges = new HashMap < > ( ) ; for ( String pool : POOLS ) { for ( int i = 0 ; i < ATTRIBUTES . length ; i ++ ) { final String attribute = ATTRIBUTES [ i ] ; final String name = NAMES [ i ] ; try { final ObjectName on = new ObjectName ( ""java.nio:type=BufferPool,name="" + pool ) ; mBeanServer . getMBeanInfo ( on ) ; gauges . put ( name ( pool , name ) , new JmxAttributeGauge ( mBeanServer , on , attribute ) ) ; } catch ( JMException ignored ) { } } } return Collections . unmodifiableMap ( gauges ) ; } ","public Map < String , Metric > getMetrics ( ) { final Map < String , Metric > gauges = new HashMap < > ( ) ; for ( String pool : POOLS ) { for ( int i = 0 ; i < ATTRIBUTES . length ; i ++ ) { final String attribute = ATTRIBUTES [ i ] ; final String name = NAMES [ i ] ; try { final ObjectName on = new ObjectName ( ""java.nio:type=BufferPool,name="" + pool ) ; mBeanServer . getMBeanInfo ( on ) ; gauges . put ( name ( pool , name ) , new JmxAttributeGauge ( mBeanServer , on , attribute ) ) ; } catch ( JMException ignored ) { LOGGER . debug ( ""Unable to load buffer pool MBeans, possibly running on Java 6"" ) ; } } } return Collections . unmodifiableMap ( gauges ) ; } " 718,"public Answer execute ( final OvsDestroyBridgeCommand command , final CitrixResourceBase citrixResourceBase ) { try { final Connection conn = citrixResourceBase . getConnection ( ) ; final Network nw = citrixResourceBase . findOrCreateTunnelNetwork ( conn , command . getBridgeName ( ) ) ; citrixResourceBase . cleanUpTmpDomVif ( conn , nw ) ; citrixResourceBase . destroyTunnelNetwork ( conn , nw , command . getHostId ( ) ) ; return new Answer ( command , true , null ) ; } catch ( final Exception e ) { s_logger . warn ( ""caught execption when destroying ovs bridge"" , e ) ; return new Answer ( command , false , e . getMessage ( ) ) ; } } ","public Answer execute ( final OvsDestroyBridgeCommand command , final CitrixResourceBase citrixResourceBase ) { try { final Connection conn = citrixResourceBase . getConnection ( ) ; final Network nw = citrixResourceBase . findOrCreateTunnelNetwork ( conn , command . getBridgeName ( ) ) ; citrixResourceBase . cleanUpTmpDomVif ( conn , nw ) ; citrixResourceBase . destroyTunnelNetwork ( conn , nw , command . getHostId ( ) ) ; s_logger . debug ( ""OVS Bridge destroyed"" ) ; return new Answer ( command , true , null ) ; } catch ( final Exception e ) { s_logger . warn ( ""caught execption when destroying ovs bridge"" , e ) ; return new Answer ( command , false , e . getMessage ( ) ) ; } } " 719,"public Answer execute ( final OvsDestroyBridgeCommand command , final CitrixResourceBase citrixResourceBase ) { try { final Connection conn = citrixResourceBase . getConnection ( ) ; final Network nw = citrixResourceBase . findOrCreateTunnelNetwork ( conn , command . getBridgeName ( ) ) ; citrixResourceBase . cleanUpTmpDomVif ( conn , nw ) ; citrixResourceBase . destroyTunnelNetwork ( conn , nw , command . getHostId ( ) ) ; s_logger . debug ( ""OVS Bridge destroyed"" ) ; return new Answer ( command , true , null ) ; } catch ( final Exception e ) { return new Answer ( command , false , e . getMessage ( ) ) ; } } ","public Answer execute ( final OvsDestroyBridgeCommand command , final CitrixResourceBase citrixResourceBase ) { try { final Connection conn = citrixResourceBase . getConnection ( ) ; final Network nw = citrixResourceBase . findOrCreateTunnelNetwork ( conn , command . getBridgeName ( ) ) ; citrixResourceBase . cleanUpTmpDomVif ( conn , nw ) ; citrixResourceBase . destroyTunnelNetwork ( conn , nw , command . getHostId ( ) ) ; s_logger . debug ( ""OVS Bridge destroyed"" ) ; return new Answer ( command , true , null ) ; } catch ( final Exception e ) { s_logger . warn ( ""caught execption when destroying ovs bridge"" , e ) ; return new Answer ( command , false , e . getMessage ( ) ) ; } } " 720,"public static void updateJobCredentialProviders ( Configuration jobConf ) { if ( jobConf == null ) { return ; } String jobKeyStoreLocation = jobConf . get ( HiveConf . ConfVars . HIVE_SERVER2_JOB_CREDENTIAL_PROVIDER_PATH . varname ) ; String oldKeyStoreLocation = jobConf . get ( Constants . HADOOP_CREDENTIAL_PROVIDER_PATH_CONFIG ) ; if ( StringUtils . isNotBlank ( jobKeyStoreLocation ) ) { jobConf . set ( Constants . HADOOP_CREDENTIAL_PROVIDER_PATH_CONFIG , jobKeyStoreLocation ) ; } String credstorePassword = getJobCredentialProviderPassword ( jobConf ) ; if ( credstorePassword != null ) { String execEngine = jobConf . get ( ConfVars . HIVE_EXECUTION_ENGINE . varname ) ; if ( ""mr"" . equalsIgnoreCase ( execEngine ) ) { Collection < String > redactedProperties = jobConf . getStringCollection ( MRJobConfig . MR_JOB_REDACTED_PROPERTIES ) ; Stream . of ( JobConf . MAPRED_MAP_TASK_ENV , JobConf . MAPRED_REDUCE_TASK_ENV , MRJobConfig . MR_AM_ADMIN_USER_ENV ) . forEach ( property -> { addKeyValuePair ( jobConf , property , Constants . HADOOP_CREDENTIAL_PASSWORD_ENVVAR , credstorePassword ) ; redactedProperties . add ( property ) ; } ) ; jobConf . set ( MRJobConfig . MR_JOB_REDACTED_PROPERTIES , StringUtils . join ( redactedProperties , COMMA ) ) ; } } } ","public static void updateJobCredentialProviders ( Configuration jobConf ) { if ( jobConf == null ) { return ; } String jobKeyStoreLocation = jobConf . get ( HiveConf . ConfVars . HIVE_SERVER2_JOB_CREDENTIAL_PROVIDER_PATH . varname ) ; String oldKeyStoreLocation = jobConf . get ( Constants . HADOOP_CREDENTIAL_PROVIDER_PATH_CONFIG ) ; if ( StringUtils . isNotBlank ( jobKeyStoreLocation ) ) { jobConf . set ( Constants . HADOOP_CREDENTIAL_PROVIDER_PATH_CONFIG , jobKeyStoreLocation ) ; LOG . debug ( ""Setting job conf credstore location to "" + jobKeyStoreLocation + "" previous location was "" + oldKeyStoreLocation ) ; } String credstorePassword = getJobCredentialProviderPassword ( jobConf ) ; if ( credstorePassword != null ) { String execEngine = jobConf . get ( ConfVars . HIVE_EXECUTION_ENGINE . varname ) ; if ( ""mr"" . equalsIgnoreCase ( execEngine ) ) { Collection < String > redactedProperties = jobConf . getStringCollection ( MRJobConfig . MR_JOB_REDACTED_PROPERTIES ) ; Stream . of ( JobConf . MAPRED_MAP_TASK_ENV , JobConf . MAPRED_REDUCE_TASK_ENV , MRJobConfig . MR_AM_ADMIN_USER_ENV ) . forEach ( property -> { addKeyValuePair ( jobConf , property , Constants . HADOOP_CREDENTIAL_PASSWORD_ENVVAR , credstorePassword ) ; redactedProperties . add ( property ) ; } ) ; jobConf . set ( MRJobConfig . MR_JOB_REDACTED_PROPERTIES , StringUtils . join ( redactedProperties , COMMA ) ) ; } } } " 721,"private void onReceiveServerStopInstanceReq ( ServerStopInstanceReq req ) { TaskTracker taskTracker = TaskTrackerPool . getTaskTrackerPool ( req . getInstanceId ( ) ) ; if ( taskTracker == null ) { return ; } taskTracker . destroy ( ) ; } ","private void onReceiveServerStopInstanceReq ( ServerStopInstanceReq req ) { TaskTracker taskTracker = TaskTrackerPool . getTaskTrackerPool ( req . getInstanceId ( ) ) ; if ( taskTracker == null ) { log . warn ( ""[TaskTrackerActor] receive ServerStopInstanceReq({}) but system can't find TaskTracker."" , req ) ; return ; } taskTracker . destroy ( ) ; } " 722,"public UpdatePkgLocalizationResult updatePkgLocalization ( UpdatePkgLocalizationRequest updatePkgLocalizationRequest ) { Preconditions . checkArgument ( null != updatePkgLocalizationRequest ) ; Preconditions . checkArgument ( ! Strings . isNullOrEmpty ( updatePkgLocalizationRequest . pkgName ) , ""the package name must be supplied"" ) ; final ObjectContext context = serverRuntime . newContext ( ) ; Pkg pkg = getPkg ( context , updatePkgLocalizationRequest . pkgName ) ; User authUser = obtainAuthenticatedUser ( context ) ; if ( ! permissionEvaluator . hasPermission ( SecurityContextHolder . getContext ( ) . getAuthentication ( ) , pkg , Permission . PKG_EDITLOCALIZATION ) ) { throw new AccessDeniedException ( ""unable to edit the package localization for ["" + pkg + ""]"" ) ; } for ( org . haiku . haikudepotserver . api1 . model . pkg . PkgLocalization requestPkgVersionLocalization : updatePkgLocalizationRequest . pkgLocalizations ) { NaturalLanguage naturalLanguage = getNaturalLanguage ( context , requestPkgVersionLocalization . naturalLanguageCode ) ; pkgLocalizationService . updatePkgLocalization ( context , pkg . getPkgSupplement ( ) , naturalLanguage , requestPkgVersionLocalization . title , requestPkgVersionLocalization . summary , requestPkgVersionLocalization . description ) ; } context . commitChanges ( ) ; return new UpdatePkgLocalizationResult ( ) ; } ","public UpdatePkgLocalizationResult updatePkgLocalization ( UpdatePkgLocalizationRequest updatePkgLocalizationRequest ) { Preconditions . checkArgument ( null != updatePkgLocalizationRequest ) ; Preconditions . checkArgument ( ! Strings . isNullOrEmpty ( updatePkgLocalizationRequest . pkgName ) , ""the package name must be supplied"" ) ; final ObjectContext context = serverRuntime . newContext ( ) ; Pkg pkg = getPkg ( context , updatePkgLocalizationRequest . pkgName ) ; User authUser = obtainAuthenticatedUser ( context ) ; if ( ! permissionEvaluator . hasPermission ( SecurityContextHolder . getContext ( ) . getAuthentication ( ) , pkg , Permission . PKG_EDITLOCALIZATION ) ) { throw new AccessDeniedException ( ""unable to edit the package localization for ["" + pkg + ""]"" ) ; } for ( org . haiku . haikudepotserver . api1 . model . pkg . PkgLocalization requestPkgVersionLocalization : updatePkgLocalizationRequest . pkgLocalizations ) { NaturalLanguage naturalLanguage = getNaturalLanguage ( context , requestPkgVersionLocalization . naturalLanguageCode ) ; pkgLocalizationService . updatePkgLocalization ( context , pkg . getPkgSupplement ( ) , naturalLanguage , requestPkgVersionLocalization . title , requestPkgVersionLocalization . summary , requestPkgVersionLocalization . description ) ; } context . commitChanges ( ) ; LOGGER . info ( ""did update the localization for pkg {} for {} natural languages"" , pkg . getName ( ) , updatePkgLocalizationRequest . pkgLocalizations . size ( ) ) ; return new UpdatePkgLocalizationResult ( ) ; } " 723,"@ SuppressWarnings ( ""deprecation"" ) @ SneakyThrows ( InterruptedException . class ) protected void initialize ( AbstractConfiguration < ? > conf , StatsLogger statsLogger , RetryPolicy zkRetryPolicy , Optional < Object > optionalCtx ) throws MetadataException { this . conf = conf ; this . acls = ZkUtils . getACLs ( conf ) ; if ( optionalCtx . isPresent ( ) && optionalCtx . get ( ) instanceof ZooKeeper ) { this . ledgersRootPath = conf . getZkLedgersRootPath ( ) ; this . zk = ( ZooKeeper ) ( optionalCtx . get ( ) ) ; this . ownZKHandle = false ; } else { final String metadataServiceUriStr ; try { metadataServiceUriStr = conf . getMetadataServiceUri ( ) ; } catch ( ConfigurationException e ) { log . error ( ""Failed to retrieve metadata service uri from configuration"" , e ) ; throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , e ) ; } URI metadataServiceUri = URI . create ( metadataServiceUriStr ) ; this . ledgersRootPath = metadataServiceUri . getPath ( ) ; final String bookieRegistrationPath = ledgersRootPath + ""/"" + AVAILABLE_NODE ; final String bookieReadonlyRegistrationPath = bookieRegistrationPath + ""/"" + READONLY ; final String zkServers ; try { zkServers = getZKServersFromServiceUri ( metadataServiceUri ) ; } catch ( IllegalArgumentException ex ) { throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , ex ) ; } log . info ( ""Initialize zookeeper metadata driver at metadata service uri {} :"" + "" zkServers = {}, ledgersRootPath = {}."" , metadataServiceUriStr , zkServers , ledgersRootPath ) ; try { this . zk = ZooKeeperClient . newBuilder ( ) . connectString ( zkServers ) . sessionTimeoutMs ( conf . getZkTimeout ( ) ) . operationRetryPolicy ( zkRetryPolicy ) . requestRateLimit ( conf . getZkRequestRateLimit ( ) ) . statsLogger ( statsLogger ) . build ( ) ; if ( null == zk . exists ( bookieReadonlyRegistrationPath , false ) ) { try { zk . create ( bookieReadonlyRegistrationPath , EMPTY_BYTE_ARRAY , acls , CreateMode . PERSISTENT ) ; } catch ( KeeperException . NodeExistsException e ) { } catch ( KeeperException . NoNodeException e ) { } } } catch ( IOException | KeeperException e ) { log . error ( ""Failed to create zookeeper client to {}"" , zkServers , e ) ; MetadataException me = new MetadataException ( Code . METADATA_SERVICE_ERROR , ""Failed to create zookeeper client to "" + zkServers , e ) ; me . fillInStackTrace ( ) ; throw me ; } this . ownZKHandle = true ; } this . layoutManager = new ZkLayoutManager ( zk , ledgersRootPath , acls ) ; } ","@ SuppressWarnings ( ""deprecation"" ) @ SneakyThrows ( InterruptedException . class ) protected void initialize ( AbstractConfiguration < ? > conf , StatsLogger statsLogger , RetryPolicy zkRetryPolicy , Optional < Object > optionalCtx ) throws MetadataException { this . conf = conf ; this . acls = ZkUtils . getACLs ( conf ) ; if ( optionalCtx . isPresent ( ) && optionalCtx . get ( ) instanceof ZooKeeper ) { this . ledgersRootPath = conf . getZkLedgersRootPath ( ) ; log . info ( ""Initialize zookeeper metadata driver with external zookeeper client : ledgersRootPath = {}."" , ledgersRootPath ) ; this . zk = ( ZooKeeper ) ( optionalCtx . get ( ) ) ; this . ownZKHandle = false ; } else { final String metadataServiceUriStr ; try { metadataServiceUriStr = conf . getMetadataServiceUri ( ) ; } catch ( ConfigurationException e ) { log . error ( ""Failed to retrieve metadata service uri from configuration"" , e ) ; throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , e ) ; } URI metadataServiceUri = URI . create ( metadataServiceUriStr ) ; this . ledgersRootPath = metadataServiceUri . getPath ( ) ; final String bookieRegistrationPath = ledgersRootPath + ""/"" + AVAILABLE_NODE ; final String bookieReadonlyRegistrationPath = bookieRegistrationPath + ""/"" + READONLY ; final String zkServers ; try { zkServers = getZKServersFromServiceUri ( metadataServiceUri ) ; } catch ( IllegalArgumentException ex ) { throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , ex ) ; } log . info ( ""Initialize zookeeper metadata driver at metadata service uri {} :"" + "" zkServers = {}, ledgersRootPath = {}."" , metadataServiceUriStr , zkServers , ledgersRootPath ) ; try { this . zk = ZooKeeperClient . newBuilder ( ) . connectString ( zkServers ) . sessionTimeoutMs ( conf . getZkTimeout ( ) ) . operationRetryPolicy ( zkRetryPolicy ) . requestRateLimit ( conf . getZkRequestRateLimit ( ) ) . statsLogger ( statsLogger ) . build ( ) ; if ( null == zk . exists ( bookieReadonlyRegistrationPath , false ) ) { try { zk . create ( bookieReadonlyRegistrationPath , EMPTY_BYTE_ARRAY , acls , CreateMode . PERSISTENT ) ; } catch ( KeeperException . NodeExistsException e ) { } catch ( KeeperException . NoNodeException e ) { } } } catch ( IOException | KeeperException e ) { log . error ( ""Failed to create zookeeper client to {}"" , zkServers , e ) ; MetadataException me = new MetadataException ( Code . METADATA_SERVICE_ERROR , ""Failed to create zookeeper client to "" + zkServers , e ) ; me . fillInStackTrace ( ) ; throw me ; } this . ownZKHandle = true ; } this . layoutManager = new ZkLayoutManager ( zk , ledgersRootPath , acls ) ; } " 724,"@ SuppressWarnings ( ""deprecation"" ) @ SneakyThrows ( InterruptedException . class ) protected void initialize ( AbstractConfiguration < ? > conf , StatsLogger statsLogger , RetryPolicy zkRetryPolicy , Optional < Object > optionalCtx ) throws MetadataException { this . conf = conf ; this . acls = ZkUtils . getACLs ( conf ) ; if ( optionalCtx . isPresent ( ) && optionalCtx . get ( ) instanceof ZooKeeper ) { this . ledgersRootPath = conf . getZkLedgersRootPath ( ) ; log . info ( ""Initialize zookeeper metadata driver with external zookeeper client : ledgersRootPath = {}."" , ledgersRootPath ) ; this . zk = ( ZooKeeper ) ( optionalCtx . get ( ) ) ; this . ownZKHandle = false ; } else { final String metadataServiceUriStr ; try { metadataServiceUriStr = conf . getMetadataServiceUri ( ) ; } catch ( ConfigurationException e ) { throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , e ) ; } URI metadataServiceUri = URI . create ( metadataServiceUriStr ) ; this . ledgersRootPath = metadataServiceUri . getPath ( ) ; final String bookieRegistrationPath = ledgersRootPath + ""/"" + AVAILABLE_NODE ; final String bookieReadonlyRegistrationPath = bookieRegistrationPath + ""/"" + READONLY ; final String zkServers ; try { zkServers = getZKServersFromServiceUri ( metadataServiceUri ) ; } catch ( IllegalArgumentException ex ) { throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , ex ) ; } log . info ( ""Initialize zookeeper metadata driver at metadata service uri {} :"" + "" zkServers = {}, ledgersRootPath = {}."" , metadataServiceUriStr , zkServers , ledgersRootPath ) ; try { this . zk = ZooKeeperClient . newBuilder ( ) . connectString ( zkServers ) . sessionTimeoutMs ( conf . getZkTimeout ( ) ) . operationRetryPolicy ( zkRetryPolicy ) . requestRateLimit ( conf . getZkRequestRateLimit ( ) ) . statsLogger ( statsLogger ) . build ( ) ; if ( null == zk . exists ( bookieReadonlyRegistrationPath , false ) ) { try { zk . create ( bookieReadonlyRegistrationPath , EMPTY_BYTE_ARRAY , acls , CreateMode . PERSISTENT ) ; } catch ( KeeperException . NodeExistsException e ) { } catch ( KeeperException . NoNodeException e ) { } } } catch ( IOException | KeeperException e ) { log . error ( ""Failed to create zookeeper client to {}"" , zkServers , e ) ; MetadataException me = new MetadataException ( Code . METADATA_SERVICE_ERROR , ""Failed to create zookeeper client to "" + zkServers , e ) ; me . fillInStackTrace ( ) ; throw me ; } this . ownZKHandle = true ; } this . layoutManager = new ZkLayoutManager ( zk , ledgersRootPath , acls ) ; } ","@ SuppressWarnings ( ""deprecation"" ) @ SneakyThrows ( InterruptedException . class ) protected void initialize ( AbstractConfiguration < ? > conf , StatsLogger statsLogger , RetryPolicy zkRetryPolicy , Optional < Object > optionalCtx ) throws MetadataException { this . conf = conf ; this . acls = ZkUtils . getACLs ( conf ) ; if ( optionalCtx . isPresent ( ) && optionalCtx . get ( ) instanceof ZooKeeper ) { this . ledgersRootPath = conf . getZkLedgersRootPath ( ) ; log . info ( ""Initialize zookeeper metadata driver with external zookeeper client : ledgersRootPath = {}."" , ledgersRootPath ) ; this . zk = ( ZooKeeper ) ( optionalCtx . get ( ) ) ; this . ownZKHandle = false ; } else { final String metadataServiceUriStr ; try { metadataServiceUriStr = conf . getMetadataServiceUri ( ) ; } catch ( ConfigurationException e ) { log . error ( ""Failed to retrieve metadata service uri from configuration"" , e ) ; throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , e ) ; } URI metadataServiceUri = URI . create ( metadataServiceUriStr ) ; this . ledgersRootPath = metadataServiceUri . getPath ( ) ; final String bookieRegistrationPath = ledgersRootPath + ""/"" + AVAILABLE_NODE ; final String bookieReadonlyRegistrationPath = bookieRegistrationPath + ""/"" + READONLY ; final String zkServers ; try { zkServers = getZKServersFromServiceUri ( metadataServiceUri ) ; } catch ( IllegalArgumentException ex ) { throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , ex ) ; } log . info ( ""Initialize zookeeper metadata driver at metadata service uri {} :"" + "" zkServers = {}, ledgersRootPath = {}."" , metadataServiceUriStr , zkServers , ledgersRootPath ) ; try { this . zk = ZooKeeperClient . newBuilder ( ) . connectString ( zkServers ) . sessionTimeoutMs ( conf . getZkTimeout ( ) ) . operationRetryPolicy ( zkRetryPolicy ) . requestRateLimit ( conf . getZkRequestRateLimit ( ) ) . statsLogger ( statsLogger ) . build ( ) ; if ( null == zk . exists ( bookieReadonlyRegistrationPath , false ) ) { try { zk . create ( bookieReadonlyRegistrationPath , EMPTY_BYTE_ARRAY , acls , CreateMode . PERSISTENT ) ; } catch ( KeeperException . NodeExistsException e ) { } catch ( KeeperException . NoNodeException e ) { } } } catch ( IOException | KeeperException e ) { log . error ( ""Failed to create zookeeper client to {}"" , zkServers , e ) ; MetadataException me = new MetadataException ( Code . METADATA_SERVICE_ERROR , ""Failed to create zookeeper client to "" + zkServers , e ) ; me . fillInStackTrace ( ) ; throw me ; } this . ownZKHandle = true ; } this . layoutManager = new ZkLayoutManager ( zk , ledgersRootPath , acls ) ; } " 725,"@ SuppressWarnings ( ""deprecation"" ) @ SneakyThrows ( InterruptedException . class ) protected void initialize ( AbstractConfiguration < ? > conf , StatsLogger statsLogger , RetryPolicy zkRetryPolicy , Optional < Object > optionalCtx ) throws MetadataException { this . conf = conf ; this . acls = ZkUtils . getACLs ( conf ) ; if ( optionalCtx . isPresent ( ) && optionalCtx . get ( ) instanceof ZooKeeper ) { this . ledgersRootPath = conf . getZkLedgersRootPath ( ) ; log . info ( ""Initialize zookeeper metadata driver with external zookeeper client : ledgersRootPath = {}."" , ledgersRootPath ) ; this . zk = ( ZooKeeper ) ( optionalCtx . get ( ) ) ; this . ownZKHandle = false ; } else { final String metadataServiceUriStr ; try { metadataServiceUriStr = conf . getMetadataServiceUri ( ) ; } catch ( ConfigurationException e ) { log . error ( ""Failed to retrieve metadata service uri from configuration"" , e ) ; throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , e ) ; } URI metadataServiceUri = URI . create ( metadataServiceUriStr ) ; this . ledgersRootPath = metadataServiceUri . getPath ( ) ; final String bookieRegistrationPath = ledgersRootPath + ""/"" + AVAILABLE_NODE ; final String bookieReadonlyRegistrationPath = bookieRegistrationPath + ""/"" + READONLY ; final String zkServers ; try { zkServers = getZKServersFromServiceUri ( metadataServiceUri ) ; } catch ( IllegalArgumentException ex ) { throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , ex ) ; } try { this . zk = ZooKeeperClient . newBuilder ( ) . connectString ( zkServers ) . sessionTimeoutMs ( conf . getZkTimeout ( ) ) . operationRetryPolicy ( zkRetryPolicy ) . requestRateLimit ( conf . getZkRequestRateLimit ( ) ) . statsLogger ( statsLogger ) . build ( ) ; if ( null == zk . exists ( bookieReadonlyRegistrationPath , false ) ) { try { zk . create ( bookieReadonlyRegistrationPath , EMPTY_BYTE_ARRAY , acls , CreateMode . PERSISTENT ) ; } catch ( KeeperException . NodeExistsException e ) { } catch ( KeeperException . NoNodeException e ) { } } } catch ( IOException | KeeperException e ) { log . error ( ""Failed to create zookeeper client to {}"" , zkServers , e ) ; MetadataException me = new MetadataException ( Code . METADATA_SERVICE_ERROR , ""Failed to create zookeeper client to "" + zkServers , e ) ; me . fillInStackTrace ( ) ; throw me ; } this . ownZKHandle = true ; } this . layoutManager = new ZkLayoutManager ( zk , ledgersRootPath , acls ) ; } ","@ SuppressWarnings ( ""deprecation"" ) @ SneakyThrows ( InterruptedException . class ) protected void initialize ( AbstractConfiguration < ? > conf , StatsLogger statsLogger , RetryPolicy zkRetryPolicy , Optional < Object > optionalCtx ) throws MetadataException { this . conf = conf ; this . acls = ZkUtils . getACLs ( conf ) ; if ( optionalCtx . isPresent ( ) && optionalCtx . get ( ) instanceof ZooKeeper ) { this . ledgersRootPath = conf . getZkLedgersRootPath ( ) ; log . info ( ""Initialize zookeeper metadata driver with external zookeeper client : ledgersRootPath = {}."" , ledgersRootPath ) ; this . zk = ( ZooKeeper ) ( optionalCtx . get ( ) ) ; this . ownZKHandle = false ; } else { final String metadataServiceUriStr ; try { metadataServiceUriStr = conf . getMetadataServiceUri ( ) ; } catch ( ConfigurationException e ) { log . error ( ""Failed to retrieve metadata service uri from configuration"" , e ) ; throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , e ) ; } URI metadataServiceUri = URI . create ( metadataServiceUriStr ) ; this . ledgersRootPath = metadataServiceUri . getPath ( ) ; final String bookieRegistrationPath = ledgersRootPath + ""/"" + AVAILABLE_NODE ; final String bookieReadonlyRegistrationPath = bookieRegistrationPath + ""/"" + READONLY ; final String zkServers ; try { zkServers = getZKServersFromServiceUri ( metadataServiceUri ) ; } catch ( IllegalArgumentException ex ) { throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , ex ) ; } log . info ( ""Initialize zookeeper metadata driver at metadata service uri {} :"" + "" zkServers = {}, ledgersRootPath = {}."" , metadataServiceUriStr , zkServers , ledgersRootPath ) ; try { this . zk = ZooKeeperClient . newBuilder ( ) . connectString ( zkServers ) . sessionTimeoutMs ( conf . getZkTimeout ( ) ) . operationRetryPolicy ( zkRetryPolicy ) . requestRateLimit ( conf . getZkRequestRateLimit ( ) ) . statsLogger ( statsLogger ) . build ( ) ; if ( null == zk . exists ( bookieReadonlyRegistrationPath , false ) ) { try { zk . create ( bookieReadonlyRegistrationPath , EMPTY_BYTE_ARRAY , acls , CreateMode . PERSISTENT ) ; } catch ( KeeperException . NodeExistsException e ) { } catch ( KeeperException . NoNodeException e ) { } } } catch ( IOException | KeeperException e ) { log . error ( ""Failed to create zookeeper client to {}"" , zkServers , e ) ; MetadataException me = new MetadataException ( Code . METADATA_SERVICE_ERROR , ""Failed to create zookeeper client to "" + zkServers , e ) ; me . fillInStackTrace ( ) ; throw me ; } this . ownZKHandle = true ; } this . layoutManager = new ZkLayoutManager ( zk , ledgersRootPath , acls ) ; } " 726,"@ SuppressWarnings ( ""deprecation"" ) @ SneakyThrows ( InterruptedException . class ) protected void initialize ( AbstractConfiguration < ? > conf , StatsLogger statsLogger , RetryPolicy zkRetryPolicy , Optional < Object > optionalCtx ) throws MetadataException { this . conf = conf ; this . acls = ZkUtils . getACLs ( conf ) ; if ( optionalCtx . isPresent ( ) && optionalCtx . get ( ) instanceof ZooKeeper ) { this . ledgersRootPath = conf . getZkLedgersRootPath ( ) ; log . info ( ""Initialize zookeeper metadata driver with external zookeeper client : ledgersRootPath = {}."" , ledgersRootPath ) ; this . zk = ( ZooKeeper ) ( optionalCtx . get ( ) ) ; this . ownZKHandle = false ; } else { final String metadataServiceUriStr ; try { metadataServiceUriStr = conf . getMetadataServiceUri ( ) ; } catch ( ConfigurationException e ) { log . error ( ""Failed to retrieve metadata service uri from configuration"" , e ) ; throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , e ) ; } URI metadataServiceUri = URI . create ( metadataServiceUriStr ) ; this . ledgersRootPath = metadataServiceUri . getPath ( ) ; final String bookieRegistrationPath = ledgersRootPath + ""/"" + AVAILABLE_NODE ; final String bookieReadonlyRegistrationPath = bookieRegistrationPath + ""/"" + READONLY ; final String zkServers ; try { zkServers = getZKServersFromServiceUri ( metadataServiceUri ) ; } catch ( IllegalArgumentException ex ) { throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , ex ) ; } log . info ( ""Initialize zookeeper metadata driver at metadata service uri {} :"" + "" zkServers = {}, ledgersRootPath = {}."" , metadataServiceUriStr , zkServers , ledgersRootPath ) ; try { this . zk = ZooKeeperClient . newBuilder ( ) . connectString ( zkServers ) . sessionTimeoutMs ( conf . getZkTimeout ( ) ) . operationRetryPolicy ( zkRetryPolicy ) . requestRateLimit ( conf . getZkRequestRateLimit ( ) ) . statsLogger ( statsLogger ) . build ( ) ; if ( null == zk . exists ( bookieReadonlyRegistrationPath , false ) ) { try { zk . create ( bookieReadonlyRegistrationPath , EMPTY_BYTE_ARRAY , acls , CreateMode . PERSISTENT ) ; } catch ( KeeperException . NodeExistsException e ) { } catch ( KeeperException . NoNodeException e ) { } } } catch ( IOException | KeeperException e ) { MetadataException me = new MetadataException ( Code . METADATA_SERVICE_ERROR , ""Failed to create zookeeper client to "" + zkServers , e ) ; me . fillInStackTrace ( ) ; throw me ; } this . ownZKHandle = true ; } this . layoutManager = new ZkLayoutManager ( zk , ledgersRootPath , acls ) ; } ","@ SuppressWarnings ( ""deprecation"" ) @ SneakyThrows ( InterruptedException . class ) protected void initialize ( AbstractConfiguration < ? > conf , StatsLogger statsLogger , RetryPolicy zkRetryPolicy , Optional < Object > optionalCtx ) throws MetadataException { this . conf = conf ; this . acls = ZkUtils . getACLs ( conf ) ; if ( optionalCtx . isPresent ( ) && optionalCtx . get ( ) instanceof ZooKeeper ) { this . ledgersRootPath = conf . getZkLedgersRootPath ( ) ; log . info ( ""Initialize zookeeper metadata driver with external zookeeper client : ledgersRootPath = {}."" , ledgersRootPath ) ; this . zk = ( ZooKeeper ) ( optionalCtx . get ( ) ) ; this . ownZKHandle = false ; } else { final String metadataServiceUriStr ; try { metadataServiceUriStr = conf . getMetadataServiceUri ( ) ; } catch ( ConfigurationException e ) { log . error ( ""Failed to retrieve metadata service uri from configuration"" , e ) ; throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , e ) ; } URI metadataServiceUri = URI . create ( metadataServiceUriStr ) ; this . ledgersRootPath = metadataServiceUri . getPath ( ) ; final String bookieRegistrationPath = ledgersRootPath + ""/"" + AVAILABLE_NODE ; final String bookieReadonlyRegistrationPath = bookieRegistrationPath + ""/"" + READONLY ; final String zkServers ; try { zkServers = getZKServersFromServiceUri ( metadataServiceUri ) ; } catch ( IllegalArgumentException ex ) { throw new MetadataException ( Code . INVALID_METADATA_SERVICE_URI , ex ) ; } log . info ( ""Initialize zookeeper metadata driver at metadata service uri {} :"" + "" zkServers = {}, ledgersRootPath = {}."" , metadataServiceUriStr , zkServers , ledgersRootPath ) ; try { this . zk = ZooKeeperClient . newBuilder ( ) . connectString ( zkServers ) . sessionTimeoutMs ( conf . getZkTimeout ( ) ) . operationRetryPolicy ( zkRetryPolicy ) . requestRateLimit ( conf . getZkRequestRateLimit ( ) ) . statsLogger ( statsLogger ) . build ( ) ; if ( null == zk . exists ( bookieReadonlyRegistrationPath , false ) ) { try { zk . create ( bookieReadonlyRegistrationPath , EMPTY_BYTE_ARRAY , acls , CreateMode . PERSISTENT ) ; } catch ( KeeperException . NodeExistsException e ) { } catch ( KeeperException . NoNodeException e ) { } } } catch ( IOException | KeeperException e ) { log . error ( ""Failed to create zookeeper client to {}"" , zkServers , e ) ; MetadataException me = new MetadataException ( Code . METADATA_SERVICE_ERROR , ""Failed to create zookeeper client to "" + zkServers , e ) ; me . fillInStackTrace ( ) ; throw me ; } this . ownZKHandle = true ; } this . layoutManager = new ZkLayoutManager ( zk , ledgersRootPath , acls ) ; } " 727,"private static KapuaMessage < ? , ? > convertToKapuaMessage ( Class < ? extends DeviceMessage < ? , ? > > deviceMessageType , Class < ? extends KapuaMessage < ? , ? > > kapuaMessageType , byte [ ] messageBody , String jmsTopic , Date queuedOn , String clientId ) throws KapuaException { Translator < JmsMessage , DeviceMessage < ? , ? > > translatorFromJms = Translator . getTranslatorFor ( JmsMessage . class , deviceMessageType ) ; DeviceMessage < ? , ? > deviceMessage = translatorFromJms . translate ( new JmsMessage ( new JmsTopic ( jmsTopic ) , queuedOn , new JmsPayload ( messageBody ) ) ) ; Translator < DeviceMessage < ? , ? > , KapuaMessage < ? , ? > > translatorToKapua = Translator . getTranslatorFor ( deviceMessageType , kapuaMessageType ) ; KapuaMessage < ? , ? > message = translatorToKapua . translate ( deviceMessage ) ; if ( StringUtils . isEmpty ( message . getClientId ( ) ) ) { message . setClientId ( clientId ) ; } return message ; } ","private static KapuaMessage < ? , ? > convertToKapuaMessage ( Class < ? extends DeviceMessage < ? , ? > > deviceMessageType , Class < ? extends KapuaMessage < ? , ? > > kapuaMessageType , byte [ ] messageBody , String jmsTopic , Date queuedOn , String clientId ) throws KapuaException { Translator < JmsMessage , DeviceMessage < ? , ? > > translatorFromJms = Translator . getTranslatorFor ( JmsMessage . class , deviceMessageType ) ; DeviceMessage < ? , ? > deviceMessage = translatorFromJms . translate ( new JmsMessage ( new JmsTopic ( jmsTopic ) , queuedOn , new JmsPayload ( messageBody ) ) ) ; Translator < DeviceMessage < ? , ? > , KapuaMessage < ? , ? > > translatorToKapua = Translator . getTranslatorFor ( deviceMessageType , kapuaMessageType ) ; KapuaMessage < ? , ? > message = translatorToKapua . translate ( deviceMessage ) ; if ( StringUtils . isEmpty ( message . getClientId ( ) ) ) { logger . debug ( ""Updating client id since the received value is null (new value {})"" , clientId ) ; message . setClientId ( clientId ) ; } return message ; } " 728,"@ Test public void testStartNodes ( ) throws Exception { for ( int i = 0 ; i < ITERATIONS ; i ++ ) { try { doTest ( ) ; } finally { stopAllGrids ( true ) ; } } } ","@ Test public void testStartNodes ( ) throws Exception { for ( int i = 0 ; i < ITERATIONS ; i ++ ) { try { log . info ( ""Iteration: "" + ( i + 1 ) + '/' + ITERATIONS ) ; doTest ( ) ; } finally { stopAllGrids ( true ) ; } } } " 729,"private void jsonWriteTo ( OutputStream out ) throws IOException { if ( out != null ) { Gson gson = new Gson ( ) ; ArrayList < HashMap < String , Object > > jsonTuples = new ArrayList < HashMap < String , Object > > ( ) ; for ( Object [ ] tuple : buffer . second ) { HashMap < String , Object > tupleMap = new HashMap < String , Object > ( ) ; for ( int i = 0 ; i < buffer . first . size ( ) ; ++ i ) { tupleMap . put ( buffer . first . get ( i ) [ 0 ] , tuple [ i ] ) ; } jsonTuples . add ( tupleMap ) ; } out . write ( gson . toJson ( jsonTuples ) . getBytes ( ) ) ; } log . debug ( ""Ending Producing Stream Data Thread ..."" ) ; } ","private void jsonWriteTo ( OutputStream out ) throws IOException { log . debug ( ""Starting Producing Stream Data In Json Format Thread ..."" ) ; if ( out != null ) { Gson gson = new Gson ( ) ; ArrayList < HashMap < String , Object > > jsonTuples = new ArrayList < HashMap < String , Object > > ( ) ; for ( Object [ ] tuple : buffer . second ) { HashMap < String , Object > tupleMap = new HashMap < String , Object > ( ) ; for ( int i = 0 ; i < buffer . first . size ( ) ; ++ i ) { tupleMap . put ( buffer . first . get ( i ) [ 0 ] , tuple [ i ] ) ; } jsonTuples . add ( tupleMap ) ; } out . write ( gson . toJson ( jsonTuples ) . getBytes ( ) ) ; } log . debug ( ""Ending Producing Stream Data Thread ..."" ) ; } " 730,"private void jsonWriteTo ( OutputStream out ) throws IOException { log . debug ( ""Starting Producing Stream Data In Json Format Thread ..."" ) ; if ( out != null ) { Gson gson = new Gson ( ) ; ArrayList < HashMap < String , Object > > jsonTuples = new ArrayList < HashMap < String , Object > > ( ) ; for ( Object [ ] tuple : buffer . second ) { HashMap < String , Object > tupleMap = new HashMap < String , Object > ( ) ; for ( int i = 0 ; i < buffer . first . size ( ) ; ++ i ) { tupleMap . put ( buffer . first . get ( i ) [ 0 ] , tuple [ i ] ) ; } jsonTuples . add ( tupleMap ) ; } out . write ( gson . toJson ( jsonTuples ) . getBytes ( ) ) ; } } ","private void jsonWriteTo ( OutputStream out ) throws IOException { log . debug ( ""Starting Producing Stream Data In Json Format Thread ..."" ) ; if ( out != null ) { Gson gson = new Gson ( ) ; ArrayList < HashMap < String , Object > > jsonTuples = new ArrayList < HashMap < String , Object > > ( ) ; for ( Object [ ] tuple : buffer . second ) { HashMap < String , Object > tupleMap = new HashMap < String , Object > ( ) ; for ( int i = 0 ; i < buffer . first . size ( ) ; ++ i ) { tupleMap . put ( buffer . first . get ( i ) [ 0 ] , tuple [ i ] ) ; } jsonTuples . add ( tupleMap ) ; } out . write ( gson . toJson ( jsonTuples ) . getBytes ( ) ) ; } log . debug ( ""Ending Producing Stream Data Thread ..."" ) ; } " 731,"public SysImport merge ( SysImport detachedInstance ) { try { SysImport result = ( SysImport ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; log . debug ( ""merge successful"" ) ; return result ; } catch ( RuntimeException re ) { log . error ( ""merge failed"" , re ) ; throw re ; } } ","public SysImport merge ( SysImport detachedInstance ) { log . debug ( ""merging SysImport instance"" ) ; try { SysImport result = ( SysImport ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; log . debug ( ""merge successful"" ) ; return result ; } catch ( RuntimeException re ) { log . error ( ""merge failed"" , re ) ; throw re ; } } " 732,"public SysImport merge ( SysImport detachedInstance ) { log . debug ( ""merging SysImport instance"" ) ; try { SysImport result = ( SysImport ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; return result ; } catch ( RuntimeException re ) { log . error ( ""merge failed"" , re ) ; throw re ; } } ","public SysImport merge ( SysImport detachedInstance ) { log . debug ( ""merging SysImport instance"" ) ; try { SysImport result = ( SysImport ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; log . debug ( ""merge successful"" ) ; return result ; } catch ( RuntimeException re ) { log . error ( ""merge failed"" , re ) ; throw re ; } } " 733,"public SysImport merge ( SysImport detachedInstance ) { log . debug ( ""merging SysImport instance"" ) ; try { SysImport result = ( SysImport ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; log . debug ( ""merge successful"" ) ; return result ; } catch ( RuntimeException re ) { throw re ; } } ","public SysImport merge ( SysImport detachedInstance ) { log . debug ( ""merging SysImport instance"" ) ; try { SysImport result = ( SysImport ) sessionFactory . getCurrentSession ( ) . merge ( detachedInstance ) ; log . debug ( ""merge successful"" ) ; return result ; } catch ( RuntimeException re ) { log . error ( ""merge failed"" , re ) ; throw re ; } } " 734,"public void run ( ) { try { generateJobs ( new Date ( ) ) ; } catch ( Exception e ) { } } ","public void run ( ) { try { generateJobs ( new Date ( ) ) ; } catch ( Exception e ) { log . info ( ""Exception caught at fault barrier while generating jobs."" , e ) ; } } " 735,"public static void main ( String [ ] args ) throws IOException { Options options = createOptions ( ) ; CommandLineParser parser = new DefaultParser ( ) ; HelpFormatter formatter = new HelpFormatter ( ) ; File inputFile = null ; File outputFile = null ; Model verdictDataModel = null ; VDMInstrumentor threat_instrumentor = null ; try { CommandLine cmdLine = parser . parse ( options , args ) ; if ( cmdLine . hasOption ( ""i"" ) ) { String inputPath = cmdLine . getOptionValue ( ""i"" ) ; inputFile = new File ( inputPath ) ; verdictDataModel = VdmTranslator . unmarshalFromXml ( inputFile ) ; threat_instrumentor = new VDMInstrumentor ( verdictDataModel ) ; } if ( cmdLine . hasOption ( ""o"" ) ) { String outputPath = cmdLine . getOptionValue ( ""o"" ) ; LOGGER . info ( outputPath ) ; outputFile = new File ( outputPath ) ; threat_instrumentor . instrument ( verdictDataModel , cmdLine ) ; VdmTranslator . marshalToXml ( verdictDataModel , outputFile ) ; } } catch ( ParseException exp ) { LOGGER . error ( ""Error:"" ) ; LOGGER . error ( exp . getMessage ( ) ) ; formatter . printHelp ( ""VERDICT-Instrumentor"" , options ) ; System . exit ( - 1 ) ; } } ","public static void main ( String [ ] args ) throws IOException { Options options = createOptions ( ) ; CommandLineParser parser = new DefaultParser ( ) ; HelpFormatter formatter = new HelpFormatter ( ) ; File inputFile = null ; File outputFile = null ; Model verdictDataModel = null ; VDMInstrumentor threat_instrumentor = null ; try { CommandLine cmdLine = parser . parse ( options , args ) ; if ( cmdLine . hasOption ( ""i"" ) ) { String inputPath = cmdLine . getOptionValue ( ""i"" ) ; LOGGER . info ( inputPath ) ; inputFile = new File ( inputPath ) ; verdictDataModel = VdmTranslator . unmarshalFromXml ( inputFile ) ; threat_instrumentor = new VDMInstrumentor ( verdictDataModel ) ; } if ( cmdLine . hasOption ( ""o"" ) ) { String outputPath = cmdLine . getOptionValue ( ""o"" ) ; LOGGER . info ( outputPath ) ; outputFile = new File ( outputPath ) ; threat_instrumentor . instrument ( verdictDataModel , cmdLine ) ; VdmTranslator . marshalToXml ( verdictDataModel , outputFile ) ; } } catch ( ParseException exp ) { LOGGER . error ( ""Error:"" ) ; LOGGER . error ( exp . getMessage ( ) ) ; formatter . printHelp ( ""VERDICT-Instrumentor"" , options ) ; System . exit ( - 1 ) ; } } " 736,"public static void main ( String [ ] args ) throws IOException { Options options = createOptions ( ) ; CommandLineParser parser = new DefaultParser ( ) ; HelpFormatter formatter = new HelpFormatter ( ) ; File inputFile = null ; File outputFile = null ; Model verdictDataModel = null ; VDMInstrumentor threat_instrumentor = null ; try { CommandLine cmdLine = parser . parse ( options , args ) ; if ( cmdLine . hasOption ( ""i"" ) ) { String inputPath = cmdLine . getOptionValue ( ""i"" ) ; LOGGER . info ( inputPath ) ; inputFile = new File ( inputPath ) ; verdictDataModel = VdmTranslator . unmarshalFromXml ( inputFile ) ; threat_instrumentor = new VDMInstrumentor ( verdictDataModel ) ; } if ( cmdLine . hasOption ( ""o"" ) ) { String outputPath = cmdLine . getOptionValue ( ""o"" ) ; outputFile = new File ( outputPath ) ; threat_instrumentor . instrument ( verdictDataModel , cmdLine ) ; VdmTranslator . marshalToXml ( verdictDataModel , outputFile ) ; } } catch ( ParseException exp ) { LOGGER . error ( ""Error:"" ) ; LOGGER . error ( exp . getMessage ( ) ) ; formatter . printHelp ( ""VERDICT-Instrumentor"" , options ) ; System . exit ( - 1 ) ; } } ","public static void main ( String [ ] args ) throws IOException { Options options = createOptions ( ) ; CommandLineParser parser = new DefaultParser ( ) ; HelpFormatter formatter = new HelpFormatter ( ) ; File inputFile = null ; File outputFile = null ; Model verdictDataModel = null ; VDMInstrumentor threat_instrumentor = null ; try { CommandLine cmdLine = parser . parse ( options , args ) ; if ( cmdLine . hasOption ( ""i"" ) ) { String inputPath = cmdLine . getOptionValue ( ""i"" ) ; LOGGER . info ( inputPath ) ; inputFile = new File ( inputPath ) ; verdictDataModel = VdmTranslator . unmarshalFromXml ( inputFile ) ; threat_instrumentor = new VDMInstrumentor ( verdictDataModel ) ; } if ( cmdLine . hasOption ( ""o"" ) ) { String outputPath = cmdLine . getOptionValue ( ""o"" ) ; LOGGER . info ( outputPath ) ; outputFile = new File ( outputPath ) ; threat_instrumentor . instrument ( verdictDataModel , cmdLine ) ; VdmTranslator . marshalToXml ( verdictDataModel , outputFile ) ; } } catch ( ParseException exp ) { LOGGER . error ( ""Error:"" ) ; LOGGER . error ( exp . getMessage ( ) ) ; formatter . printHelp ( ""VERDICT-Instrumentor"" , options ) ; System . exit ( - 1 ) ; } } " 737,"public static void main ( String [ ] args ) throws IOException { Options options = createOptions ( ) ; CommandLineParser parser = new DefaultParser ( ) ; HelpFormatter formatter = new HelpFormatter ( ) ; File inputFile = null ; File outputFile = null ; Model verdictDataModel = null ; VDMInstrumentor threat_instrumentor = null ; try { CommandLine cmdLine = parser . parse ( options , args ) ; if ( cmdLine . hasOption ( ""i"" ) ) { String inputPath = cmdLine . getOptionValue ( ""i"" ) ; LOGGER . info ( inputPath ) ; inputFile = new File ( inputPath ) ; verdictDataModel = VdmTranslator . unmarshalFromXml ( inputFile ) ; threat_instrumentor = new VDMInstrumentor ( verdictDataModel ) ; } if ( cmdLine . hasOption ( ""o"" ) ) { String outputPath = cmdLine . getOptionValue ( ""o"" ) ; LOGGER . info ( outputPath ) ; outputFile = new File ( outputPath ) ; threat_instrumentor . instrument ( verdictDataModel , cmdLine ) ; VdmTranslator . marshalToXml ( verdictDataModel , outputFile ) ; } } catch ( ParseException exp ) { LOGGER . error ( exp . getMessage ( ) ) ; formatter . printHelp ( ""VERDICT-Instrumentor"" , options ) ; System . exit ( - 1 ) ; } } ","public static void main ( String [ ] args ) throws IOException { Options options = createOptions ( ) ; CommandLineParser parser = new DefaultParser ( ) ; HelpFormatter formatter = new HelpFormatter ( ) ; File inputFile = null ; File outputFile = null ; Model verdictDataModel = null ; VDMInstrumentor threat_instrumentor = null ; try { CommandLine cmdLine = parser . parse ( options , args ) ; if ( cmdLine . hasOption ( ""i"" ) ) { String inputPath = cmdLine . getOptionValue ( ""i"" ) ; LOGGER . info ( inputPath ) ; inputFile = new File ( inputPath ) ; verdictDataModel = VdmTranslator . unmarshalFromXml ( inputFile ) ; threat_instrumentor = new VDMInstrumentor ( verdictDataModel ) ; } if ( cmdLine . hasOption ( ""o"" ) ) { String outputPath = cmdLine . getOptionValue ( ""o"" ) ; LOGGER . info ( outputPath ) ; outputFile = new File ( outputPath ) ; threat_instrumentor . instrument ( verdictDataModel , cmdLine ) ; VdmTranslator . marshalToXml ( verdictDataModel , outputFile ) ; } } catch ( ParseException exp ) { LOGGER . error ( ""Error:"" ) ; LOGGER . error ( exp . getMessage ( ) ) ; formatter . printHelp ( ""VERDICT-Instrumentor"" , options ) ; System . exit ( - 1 ) ; } } " 738,"public static void main ( String [ ] args ) throws IOException { Options options = createOptions ( ) ; CommandLineParser parser = new DefaultParser ( ) ; HelpFormatter formatter = new HelpFormatter ( ) ; File inputFile = null ; File outputFile = null ; Model verdictDataModel = null ; VDMInstrumentor threat_instrumentor = null ; try { CommandLine cmdLine = parser . parse ( options , args ) ; if ( cmdLine . hasOption ( ""i"" ) ) { String inputPath = cmdLine . getOptionValue ( ""i"" ) ; LOGGER . info ( inputPath ) ; inputFile = new File ( inputPath ) ; verdictDataModel = VdmTranslator . unmarshalFromXml ( inputFile ) ; threat_instrumentor = new VDMInstrumentor ( verdictDataModel ) ; } if ( cmdLine . hasOption ( ""o"" ) ) { String outputPath = cmdLine . getOptionValue ( ""o"" ) ; LOGGER . info ( outputPath ) ; outputFile = new File ( outputPath ) ; threat_instrumentor . instrument ( verdictDataModel , cmdLine ) ; VdmTranslator . marshalToXml ( verdictDataModel , outputFile ) ; } } catch ( ParseException exp ) { LOGGER . error ( ""Error:"" ) ; formatter . printHelp ( ""VERDICT-Instrumentor"" , options ) ; System . exit ( - 1 ) ; } } ","public static void main ( String [ ] args ) throws IOException { Options options = createOptions ( ) ; CommandLineParser parser = new DefaultParser ( ) ; HelpFormatter formatter = new HelpFormatter ( ) ; File inputFile = null ; File outputFile = null ; Model verdictDataModel = null ; VDMInstrumentor threat_instrumentor = null ; try { CommandLine cmdLine = parser . parse ( options , args ) ; if ( cmdLine . hasOption ( ""i"" ) ) { String inputPath = cmdLine . getOptionValue ( ""i"" ) ; LOGGER . info ( inputPath ) ; inputFile = new File ( inputPath ) ; verdictDataModel = VdmTranslator . unmarshalFromXml ( inputFile ) ; threat_instrumentor = new VDMInstrumentor ( verdictDataModel ) ; } if ( cmdLine . hasOption ( ""o"" ) ) { String outputPath = cmdLine . getOptionValue ( ""o"" ) ; LOGGER . info ( outputPath ) ; outputFile = new File ( outputPath ) ; threat_instrumentor . instrument ( verdictDataModel , cmdLine ) ; VdmTranslator . marshalToXml ( verdictDataModel , outputFile ) ; } } catch ( ParseException exp ) { LOGGER . error ( ""Error:"" ) ; LOGGER . error ( exp . getMessage ( ) ) ; formatter . printHelp ( ""VERDICT-Instrumentor"" , options ) ; System . exit ( - 1 ) ; } } " 739,"public void exceptionCaught ( IoSession session , Throwable cause ) throws Exception { if ( session . isClosing ( ) && cause instanceof ClosedChannelException ) { if ( logger . isDebugEnabled ( ) ) { } } else { LoggingUtils . log ( session , logger , ""Unexpected exception in broadcast service handler"" , cause ) ; } } ","public void exceptionCaught ( IoSession session , Throwable cause ) throws Exception { if ( session . isClosing ( ) && cause instanceof ClosedChannelException ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( String . format ( ""BroadcastServiceHandler: caught exception %s, probably because session was closed with pending writes"" , cause ) ) ; } } else { LoggingUtils . log ( session , logger , ""Unexpected exception in broadcast service handler"" , cause ) ; } } " 740,"private void doHeuristicCompletionWithRestart ( final boolean isCommit ) throws Exception { Configuration configuration = createDefaultInVMConfig ( ) . setJMXManagementEnabled ( true ) ; ActiveMQServer server = createServer ( true , configuration ) ; server . setMBeanServer ( mbeanServer ) ; server . start ( ) ; Xid xid = newXID ( ) ; ClientSessionFactory sf = createSessionFactory ( locator ) ; ClientSession session = sf . createSession ( true , false , false ) ; session . createQueue ( new QueueConfiguration ( ADDRESS ) ) ; session . start ( xid , XAResource . TMNOFLAGS ) ; ClientProducer producer = session . createProducer ( ADDRESS ) ; ClientMessage msg = session . createMessage ( true ) ; msg . getBodyBuffer ( ) . writeString ( body ) ; producer . send ( msg ) ; session . end ( xid , XAResource . TMSUCCESS ) ; session . prepare ( xid ) ; session . close ( ) ; ActiveMQServerControl jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; String [ ] preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 1 , preparedTransactions . length ) ; if ( isCommit ) { jmxServer . commitPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } else { jmxServer . rollbackPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 0 , preparedTransactions . length ) ; if ( isCommit ) { assertMessageInQueueThenReceiveAndCheckContent ( server , sf ) ; } Assert . assertEquals ( 0 , getMessageCount ( ( ( Queue ) server . getPostOffice ( ) . getBinding ( ADDRESS ) . getBindable ( ) ) ) ) ; server . stop ( ) ; server . start ( ) ; jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; if ( isCommit ) { String [ ] listHeuristicCommittedTransactions = jmxServer . listHeuristicCommittedTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicCommittedTransactions . length ) ; instanceLog . debug ( listHeuristicCommittedTransactions [ 0 ] ) ; } else { String [ ] listHeuristicRolledBackTransactions = jmxServer . listHeuristicRolledBackTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicRolledBackTransactions . length ) ; instanceLog . debug ( listHeuristicRolledBackTransactions [ 0 ] ) ; } } ","private void doHeuristicCompletionWithRestart ( final boolean isCommit ) throws Exception { Configuration configuration = createDefaultInVMConfig ( ) . setJMXManagementEnabled ( true ) ; ActiveMQServer server = createServer ( true , configuration ) ; server . setMBeanServer ( mbeanServer ) ; server . start ( ) ; Xid xid = newXID ( ) ; ClientSessionFactory sf = createSessionFactory ( locator ) ; ClientSession session = sf . createSession ( true , false , false ) ; session . createQueue ( new QueueConfiguration ( ADDRESS ) ) ; session . start ( xid , XAResource . TMNOFLAGS ) ; ClientProducer producer = session . createProducer ( ADDRESS ) ; ClientMessage msg = session . createMessage ( true ) ; msg . getBodyBuffer ( ) . writeString ( body ) ; producer . send ( msg ) ; session . end ( xid , XAResource . TMSUCCESS ) ; session . prepare ( xid ) ; session . close ( ) ; ActiveMQServerControl jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; String [ ] preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 1 , preparedTransactions . length ) ; instanceLog . debug ( preparedTransactions [ 0 ] ) ; if ( isCommit ) { jmxServer . commitPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } else { jmxServer . rollbackPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 0 , preparedTransactions . length ) ; if ( isCommit ) { assertMessageInQueueThenReceiveAndCheckContent ( server , sf ) ; } Assert . assertEquals ( 0 , getMessageCount ( ( ( Queue ) server . getPostOffice ( ) . getBinding ( ADDRESS ) . getBindable ( ) ) ) ) ; server . stop ( ) ; server . start ( ) ; jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; if ( isCommit ) { String [ ] listHeuristicCommittedTransactions = jmxServer . listHeuristicCommittedTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicCommittedTransactions . length ) ; instanceLog . debug ( listHeuristicCommittedTransactions [ 0 ] ) ; } else { String [ ] listHeuristicRolledBackTransactions = jmxServer . listHeuristicRolledBackTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicRolledBackTransactions . length ) ; instanceLog . debug ( listHeuristicRolledBackTransactions [ 0 ] ) ; } } " 741,"private void doHeuristicCompletionWithRestart ( final boolean isCommit ) throws Exception { Configuration configuration = createDefaultInVMConfig ( ) . setJMXManagementEnabled ( true ) ; ActiveMQServer server = createServer ( true , configuration ) ; server . setMBeanServer ( mbeanServer ) ; server . start ( ) ; Xid xid = newXID ( ) ; ClientSessionFactory sf = createSessionFactory ( locator ) ; ClientSession session = sf . createSession ( true , false , false ) ; session . createQueue ( new QueueConfiguration ( ADDRESS ) ) ; session . start ( xid , XAResource . TMNOFLAGS ) ; ClientProducer producer = session . createProducer ( ADDRESS ) ; ClientMessage msg = session . createMessage ( true ) ; msg . getBodyBuffer ( ) . writeString ( body ) ; producer . send ( msg ) ; session . end ( xid , XAResource . TMSUCCESS ) ; session . prepare ( xid ) ; session . close ( ) ; ActiveMQServerControl jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; String [ ] preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 1 , preparedTransactions . length ) ; instanceLog . debug ( preparedTransactions [ 0 ] ) ; if ( isCommit ) { jmxServer . commitPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } else { jmxServer . rollbackPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 0 , preparedTransactions . length ) ; if ( isCommit ) { assertMessageInQueueThenReceiveAndCheckContent ( server , sf ) ; } Assert . assertEquals ( 0 , getMessageCount ( ( ( Queue ) server . getPostOffice ( ) . getBinding ( ADDRESS ) . getBindable ( ) ) ) ) ; server . stop ( ) ; server . start ( ) ; jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; if ( isCommit ) { String [ ] listHeuristicCommittedTransactions = jmxServer . listHeuristicCommittedTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicCommittedTransactions . length ) ; } else { String [ ] listHeuristicRolledBackTransactions = jmxServer . listHeuristicRolledBackTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicRolledBackTransactions . length ) ; instanceLog . debug ( listHeuristicRolledBackTransactions [ 0 ] ) ; } } ","private void doHeuristicCompletionWithRestart ( final boolean isCommit ) throws Exception { Configuration configuration = createDefaultInVMConfig ( ) . setJMXManagementEnabled ( true ) ; ActiveMQServer server = createServer ( true , configuration ) ; server . setMBeanServer ( mbeanServer ) ; server . start ( ) ; Xid xid = newXID ( ) ; ClientSessionFactory sf = createSessionFactory ( locator ) ; ClientSession session = sf . createSession ( true , false , false ) ; session . createQueue ( new QueueConfiguration ( ADDRESS ) ) ; session . start ( xid , XAResource . TMNOFLAGS ) ; ClientProducer producer = session . createProducer ( ADDRESS ) ; ClientMessage msg = session . createMessage ( true ) ; msg . getBodyBuffer ( ) . writeString ( body ) ; producer . send ( msg ) ; session . end ( xid , XAResource . TMSUCCESS ) ; session . prepare ( xid ) ; session . close ( ) ; ActiveMQServerControl jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; String [ ] preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 1 , preparedTransactions . length ) ; instanceLog . debug ( preparedTransactions [ 0 ] ) ; if ( isCommit ) { jmxServer . commitPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } else { jmxServer . rollbackPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 0 , preparedTransactions . length ) ; if ( isCommit ) { assertMessageInQueueThenReceiveAndCheckContent ( server , sf ) ; } Assert . assertEquals ( 0 , getMessageCount ( ( ( Queue ) server . getPostOffice ( ) . getBinding ( ADDRESS ) . getBindable ( ) ) ) ) ; server . stop ( ) ; server . start ( ) ; jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; if ( isCommit ) { String [ ] listHeuristicCommittedTransactions = jmxServer . listHeuristicCommittedTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicCommittedTransactions . length ) ; instanceLog . debug ( listHeuristicCommittedTransactions [ 0 ] ) ; } else { String [ ] listHeuristicRolledBackTransactions = jmxServer . listHeuristicRolledBackTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicRolledBackTransactions . length ) ; instanceLog . debug ( listHeuristicRolledBackTransactions [ 0 ] ) ; } } " 742,"private void doHeuristicCompletionWithRestart ( final boolean isCommit ) throws Exception { Configuration configuration = createDefaultInVMConfig ( ) . setJMXManagementEnabled ( true ) ; ActiveMQServer server = createServer ( true , configuration ) ; server . setMBeanServer ( mbeanServer ) ; server . start ( ) ; Xid xid = newXID ( ) ; ClientSessionFactory sf = createSessionFactory ( locator ) ; ClientSession session = sf . createSession ( true , false , false ) ; session . createQueue ( new QueueConfiguration ( ADDRESS ) ) ; session . start ( xid , XAResource . TMNOFLAGS ) ; ClientProducer producer = session . createProducer ( ADDRESS ) ; ClientMessage msg = session . createMessage ( true ) ; msg . getBodyBuffer ( ) . writeString ( body ) ; producer . send ( msg ) ; session . end ( xid , XAResource . TMSUCCESS ) ; session . prepare ( xid ) ; session . close ( ) ; ActiveMQServerControl jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; String [ ] preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 1 , preparedTransactions . length ) ; instanceLog . debug ( preparedTransactions [ 0 ] ) ; if ( isCommit ) { jmxServer . commitPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } else { jmxServer . rollbackPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 0 , preparedTransactions . length ) ; if ( isCommit ) { assertMessageInQueueThenReceiveAndCheckContent ( server , sf ) ; } Assert . assertEquals ( 0 , getMessageCount ( ( ( Queue ) server . getPostOffice ( ) . getBinding ( ADDRESS ) . getBindable ( ) ) ) ) ; server . stop ( ) ; server . start ( ) ; jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; if ( isCommit ) { String [ ] listHeuristicCommittedTransactions = jmxServer . listHeuristicCommittedTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicCommittedTransactions . length ) ; instanceLog . debug ( listHeuristicCommittedTransactions [ 0 ] ) ; } else { String [ ] listHeuristicRolledBackTransactions = jmxServer . listHeuristicRolledBackTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicRolledBackTransactions . length ) ; } } ","private void doHeuristicCompletionWithRestart ( final boolean isCommit ) throws Exception { Configuration configuration = createDefaultInVMConfig ( ) . setJMXManagementEnabled ( true ) ; ActiveMQServer server = createServer ( true , configuration ) ; server . setMBeanServer ( mbeanServer ) ; server . start ( ) ; Xid xid = newXID ( ) ; ClientSessionFactory sf = createSessionFactory ( locator ) ; ClientSession session = sf . createSession ( true , false , false ) ; session . createQueue ( new QueueConfiguration ( ADDRESS ) ) ; session . start ( xid , XAResource . TMNOFLAGS ) ; ClientProducer producer = session . createProducer ( ADDRESS ) ; ClientMessage msg = session . createMessage ( true ) ; msg . getBodyBuffer ( ) . writeString ( body ) ; producer . send ( msg ) ; session . end ( xid , XAResource . TMSUCCESS ) ; session . prepare ( xid ) ; session . close ( ) ; ActiveMQServerControl jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; String [ ] preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 1 , preparedTransactions . length ) ; instanceLog . debug ( preparedTransactions [ 0 ] ) ; if ( isCommit ) { jmxServer . commitPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } else { jmxServer . rollbackPreparedTransaction ( XidImpl . toBase64String ( xid ) ) ; } preparedTransactions = jmxServer . listPreparedTransactions ( ) ; Assert . assertEquals ( 0 , preparedTransactions . length ) ; if ( isCommit ) { assertMessageInQueueThenReceiveAndCheckContent ( server , sf ) ; } Assert . assertEquals ( 0 , getMessageCount ( ( ( Queue ) server . getPostOffice ( ) . getBinding ( ADDRESS ) . getBindable ( ) ) ) ) ; server . stop ( ) ; server . start ( ) ; jmxServer = ManagementControlHelper . createActiveMQServerControl ( mbeanServer ) ; if ( isCommit ) { String [ ] listHeuristicCommittedTransactions = jmxServer . listHeuristicCommittedTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicCommittedTransactions . length ) ; instanceLog . debug ( listHeuristicCommittedTransactions [ 0 ] ) ; } else { String [ ] listHeuristicRolledBackTransactions = jmxServer . listHeuristicRolledBackTransactions ( ) ; Assert . assertEquals ( 1 , listHeuristicRolledBackTransactions . length ) ; instanceLog . debug ( listHeuristicRolledBackTransactions [ 0 ] ) ; } } " 743,"public String download ( ) { this . bundleResponse = bundleRequestService . lookupValidationRequest ( getId ( ) ) ; if ( this . bundleResponse != null ) { this . downloadInputStream = new NYCFileUtils ( ) . read ( this . bundleResponse . getTmpDirectory ( ) + File . separator + this . downloadFilename ) ; return ""download"" ; } _log . error ( ""bundleResponse not found for id="" + id ) ; return ""error"" ; } ","public String download ( ) { this . bundleResponse = bundleRequestService . lookupValidationRequest ( getId ( ) ) ; _log . info ( ""download="" + this . downloadFilename + "" and id="" + id ) ; if ( this . bundleResponse != null ) { this . downloadInputStream = new NYCFileUtils ( ) . read ( this . bundleResponse . getTmpDirectory ( ) + File . separator + this . downloadFilename ) ; return ""download"" ; } _log . error ( ""bundleResponse not found for id="" + id ) ; return ""error"" ; } " 744,"public String download ( ) { this . bundleResponse = bundleRequestService . lookupValidationRequest ( getId ( ) ) ; _log . info ( ""download="" + this . downloadFilename + "" and id="" + id ) ; if ( this . bundleResponse != null ) { this . downloadInputStream = new NYCFileUtils ( ) . read ( this . bundleResponse . getTmpDirectory ( ) + File . separator + this . downloadFilename ) ; return ""download"" ; } return ""error"" ; } ","public String download ( ) { this . bundleResponse = bundleRequestService . lookupValidationRequest ( getId ( ) ) ; _log . info ( ""download="" + this . downloadFilename + "" and id="" + id ) ; if ( this . bundleResponse != null ) { this . downloadInputStream = new NYCFileUtils ( ) . read ( this . bundleResponse . getTmpDirectory ( ) + File . separator + this . downloadFilename ) ; return ""download"" ; } _log . error ( ""bundleResponse not found for id="" + id ) ; return ""error"" ; } " 745,"private void cleanupWorkspace ( URI ... workspaceURIs ) { for ( URI url : workspaceURIs ) { try { workspace . delete ( url ) ; } catch ( Exception e ) { } } } ","private void cleanupWorkspace ( URI ... workspaceURIs ) { for ( URI url : workspaceURIs ) { try { workspace . delete ( url ) ; } catch ( Exception e ) { logger . warn ( ""Could not delete {} from workspace: {}"" , url , e . getMessage ( ) ) ; } } } " 746,"private void dumpAvailableConsumers ( ) { Map < String , KnownRepositoryContentConsumer > availableConsumers = getConsumers ( ) ; for ( Map . Entry < String , KnownRepositoryContentConsumer > entry : availableConsumers . entrySet ( ) ) { String consumerHint = entry . getKey ( ) ; RepositoryContentConsumer consumer = entry . getValue ( ) ; LOGGER . info ( "" {} : {} ({})"" , consumerHint , consumer . getDescription ( ) , consumer . getClass ( ) . getName ( ) ) ; } } ","private void dumpAvailableConsumers ( ) { Map < String , KnownRepositoryContentConsumer > availableConsumers = getConsumers ( ) ; LOGGER . info ( "".\\ Available Consumer List \\.______________________________"" ) ; for ( Map . Entry < String , KnownRepositoryContentConsumer > entry : availableConsumers . entrySet ( ) ) { String consumerHint = entry . getKey ( ) ; RepositoryContentConsumer consumer = entry . getValue ( ) ; LOGGER . info ( "" {} : {} ({})"" , consumerHint , consumer . getDescription ( ) , consumer . getClass ( ) . getName ( ) ) ; } } " 747,"private void dumpAvailableConsumers ( ) { Map < String , KnownRepositoryContentConsumer > availableConsumers = getConsumers ( ) ; LOGGER . info ( "".\\ Available Consumer List \\.______________________________"" ) ; for ( Map . Entry < String , KnownRepositoryContentConsumer > entry : availableConsumers . entrySet ( ) ) { String consumerHint = entry . getKey ( ) ; RepositoryContentConsumer consumer = entry . getValue ( ) ; } } ","private void dumpAvailableConsumers ( ) { Map < String , KnownRepositoryContentConsumer > availableConsumers = getConsumers ( ) ; LOGGER . info ( "".\\ Available Consumer List \\.______________________________"" ) ; for ( Map . Entry < String , KnownRepositoryContentConsumer > entry : availableConsumers . entrySet ( ) ) { String consumerHint = entry . getKey ( ) ; RepositoryContentConsumer consumer = entry . getValue ( ) ; LOGGER . info ( "" {} : {} ({})"" , consumerHint , consumer . getDescription ( ) , consumer . getClass ( ) . getName ( ) ) ; } } " 748,"public void writeAndFlush ( ByteBuf output ) throws IOException { checkConnected ( output ) ; channel . writeAndFlush ( output , channel . voidPromise ( ) ) ; } ","public void writeAndFlush ( ByteBuf output ) throws IOException { checkConnected ( output ) ; LOG . trace ( ""Attempted write and flush of buffer: {}"" , output ) ; channel . writeAndFlush ( output , channel . voidPromise ( ) ) ; } " 749,"public void publish ( Object payload , DynamicOptions dynamicOptions , KafkaSinkState kafkaSinkState ) throws ConnectionUnavailableException { String key = keyOption . getValue ( dynamicOptions ) ; Object payloadToSend = null ; try { if ( payload instanceof String ) { if ( ! isBinaryMessage ) { StringBuilder strPayload = new StringBuilder ( ) ; strPayload . append ( sequenceId ) . append ( SEQ_NO_HEADER_FIELD_SEPERATOR ) . append ( kafkaSinkState . lastSentSequenceNo ) . append ( SEQ_NO_HEADER_DELIMITER ) . append ( payload . toString ( ) ) ; payloadToSend = strPayload . toString ( ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } else { byte [ ] byteEvents = payload . toString ( ) . getBytes ( ""UTF-8"" ) ; payloadToSend = getSequencedBinaryPayloadToSend ( byteEvents , kafkaSinkState ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } } else { byte [ ] byteEvents = ( ( ByteBuffer ) payload ) . array ( ) ; payloadToSend = getSequencedBinaryPayloadToSend ( byteEvents , kafkaSinkState ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } } catch ( UnsupportedEncodingException e ) { } for ( Producer producer : producers ) { try { producer . send ( new ProducerRecord < > ( topic , partitionNo , key , payloadToSend ) ) ; } catch ( Exception e ) { LOG . error ( String . format ( ""Failed to publish the message to [topic] %s. Error: %s. Sequence Number "" + "": %d"" , topic , e . getMessage ( ) , kafkaSinkState . lastSentSequenceNo . get ( ) - 1 ) , e ) ; } } } ","public void publish ( Object payload , DynamicOptions dynamicOptions , KafkaSinkState kafkaSinkState ) throws ConnectionUnavailableException { String key = keyOption . getValue ( dynamicOptions ) ; Object payloadToSend = null ; try { if ( payload instanceof String ) { if ( ! isBinaryMessage ) { StringBuilder strPayload = new StringBuilder ( ) ; strPayload . append ( sequenceId ) . append ( SEQ_NO_HEADER_FIELD_SEPERATOR ) . append ( kafkaSinkState . lastSentSequenceNo ) . append ( SEQ_NO_HEADER_DELIMITER ) . append ( payload . toString ( ) ) ; payloadToSend = strPayload . toString ( ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } else { byte [ ] byteEvents = payload . toString ( ) . getBytes ( ""UTF-8"" ) ; payloadToSend = getSequencedBinaryPayloadToSend ( byteEvents , kafkaSinkState ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } } else { byte [ ] byteEvents = ( ( ByteBuffer ) payload ) . array ( ) ; payloadToSend = getSequencedBinaryPayloadToSend ( byteEvents , kafkaSinkState ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } } catch ( UnsupportedEncodingException e ) { LOG . error ( ""Error while converting the received string payload to byte[]."" , e ) ; } for ( Producer producer : producers ) { try { producer . send ( new ProducerRecord < > ( topic , partitionNo , key , payloadToSend ) ) ; } catch ( Exception e ) { LOG . error ( String . format ( ""Failed to publish the message to [topic] %s. Error: %s. Sequence Number "" + "": %d"" , topic , e . getMessage ( ) , kafkaSinkState . lastSentSequenceNo . get ( ) - 1 ) , e ) ; } } } " 750,"public void publish ( Object payload , DynamicOptions dynamicOptions , KafkaSinkState kafkaSinkState ) throws ConnectionUnavailableException { String key = keyOption . getValue ( dynamicOptions ) ; Object payloadToSend = null ; try { if ( payload instanceof String ) { if ( ! isBinaryMessage ) { StringBuilder strPayload = new StringBuilder ( ) ; strPayload . append ( sequenceId ) . append ( SEQ_NO_HEADER_FIELD_SEPERATOR ) . append ( kafkaSinkState . lastSentSequenceNo ) . append ( SEQ_NO_HEADER_DELIMITER ) . append ( payload . toString ( ) ) ; payloadToSend = strPayload . toString ( ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } else { byte [ ] byteEvents = payload . toString ( ) . getBytes ( ""UTF-8"" ) ; payloadToSend = getSequencedBinaryPayloadToSend ( byteEvents , kafkaSinkState ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } } else { byte [ ] byteEvents = ( ( ByteBuffer ) payload ) . array ( ) ; payloadToSend = getSequencedBinaryPayloadToSend ( byteEvents , kafkaSinkState ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } } catch ( UnsupportedEncodingException e ) { LOG . error ( ""Error while converting the received string payload to byte[]."" , e ) ; } for ( Producer producer : producers ) { try { producer . send ( new ProducerRecord < > ( topic , partitionNo , key , payloadToSend ) ) ; } catch ( Exception e ) { } } } ","public void publish ( Object payload , DynamicOptions dynamicOptions , KafkaSinkState kafkaSinkState ) throws ConnectionUnavailableException { String key = keyOption . getValue ( dynamicOptions ) ; Object payloadToSend = null ; try { if ( payload instanceof String ) { if ( ! isBinaryMessage ) { StringBuilder strPayload = new StringBuilder ( ) ; strPayload . append ( sequenceId ) . append ( SEQ_NO_HEADER_FIELD_SEPERATOR ) . append ( kafkaSinkState . lastSentSequenceNo ) . append ( SEQ_NO_HEADER_DELIMITER ) . append ( payload . toString ( ) ) ; payloadToSend = strPayload . toString ( ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } else { byte [ ] byteEvents = payload . toString ( ) . getBytes ( ""UTF-8"" ) ; payloadToSend = getSequencedBinaryPayloadToSend ( byteEvents , kafkaSinkState ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } } else { byte [ ] byteEvents = ( ( ByteBuffer ) payload ) . array ( ) ; payloadToSend = getSequencedBinaryPayloadToSend ( byteEvents , kafkaSinkState ) ; kafkaSinkState . lastSentSequenceNo . incrementAndGet ( ) ; } } catch ( UnsupportedEncodingException e ) { LOG . error ( ""Error while converting the received string payload to byte[]."" , e ) ; } for ( Producer producer : producers ) { try { producer . send ( new ProducerRecord < > ( topic , partitionNo , key , payloadToSend ) ) ; } catch ( Exception e ) { LOG . error ( String . format ( ""Failed to publish the message to [topic] %s. Error: %s. Sequence Number "" + "": %d"" , topic , e . getMessage ( ) , kafkaSinkState . lastSentSequenceNo . get ( ) - 1 ) , e ) ; } } } " 751,"protected Function < InternalEvent , InternalEvent > doBefore ( SourceInterceptor interceptor , Component component , Map < String , String > dslParameters ) { return event -> { final InternalEvent eventWithResolvedParams = addResolvedParameters ( event , component , dslParameters ) ; DefaultInterceptionEvent interceptionEvent = new DefaultInterceptionEvent ( eventWithResolvedParams ) ; try { Thread currentThread = currentThread ( ) ; ClassLoader originalTCCL = currentThread . getContextClassLoader ( ) ; ClassLoader ctxClassLoader = interceptor . getClass ( ) . getClassLoader ( ) ; setContextClassLoader ( currentThread , originalTCCL , ctxClassLoader ) ; try { interceptor . beforeCallback ( component . getLocation ( ) , getResolvedParams ( eventWithResolvedParams ) , interceptionEvent ) ; } finally { setContextClassLoader ( currentThread , ctxClassLoader , originalTCCL ) ; } return interceptionEvent . resolve ( ) ; } catch ( Exception e ) { throw propagate ( new MessagingException ( interceptionEvent . resolve ( ) , e . getCause ( ) , component ) ) ; } } ; } ","protected Function < InternalEvent , InternalEvent > doBefore ( SourceInterceptor interceptor , Component component , Map < String , String > dslParameters ) { return event -> { final InternalEvent eventWithResolvedParams = addResolvedParameters ( event , component , dslParameters ) ; DefaultInterceptionEvent interceptionEvent = new DefaultInterceptionEvent ( eventWithResolvedParams ) ; LOGGER . debug ( ""Calling before() for '{}' in processor '{}'..."" , interceptor , component . getLocation ( ) . getLocation ( ) ) ; try { Thread currentThread = currentThread ( ) ; ClassLoader originalTCCL = currentThread . getContextClassLoader ( ) ; ClassLoader ctxClassLoader = interceptor . getClass ( ) . getClassLoader ( ) ; setContextClassLoader ( currentThread , originalTCCL , ctxClassLoader ) ; try { interceptor . beforeCallback ( component . getLocation ( ) , getResolvedParams ( eventWithResolvedParams ) , interceptionEvent ) ; } finally { setContextClassLoader ( currentThread , ctxClassLoader , originalTCCL ) ; } return interceptionEvent . resolve ( ) ; } catch ( Exception e ) { throw propagate ( new MessagingException ( interceptionEvent . resolve ( ) , e . getCause ( ) , component ) ) ; } } ; } " 752,"public int doStartTag ( ) throws JspException { if ( attachment == null ) { return SKIP_BODY ; } if ( attachment . getAttachmentType ( ) != AttachmentType . CLEARING_REPORT && attachment . getAttachmentType ( ) != AttachmentType . COMPONENT_LICENSE_INFO_XML ) { LOGGER . error ( ""Invalid attachment type: "" + attachment . getAttachmentType ( ) + "". Expected CLEARING_REPORT("" + AttachmentType . CLEARING_REPORT . getValue ( ) + "") or COMPONENT_LICENSE_INFO_XML("" + AttachmentType . COMPONENT_LICENSE_INFO_XML . getValue ( ) + ""."" ) ; return SKIP_BODY ; } if ( attachment . getCheckStatus ( ) != CheckStatus . ACCEPTED ) { LOGGER . info ( ""Attachment with content id "" + attachment . getAttachmentContentId ( ) + "" is of correct type to be displayed as clearing report, but is not yet accepted. So not dispaying it."" ) ; return SKIP_BODY ; } return super . doStartTag ( ) ; } ","public int doStartTag ( ) throws JspException { if ( attachment == null ) { LOGGER . error ( ""No attachment given!"" ) ; return SKIP_BODY ; } if ( attachment . getAttachmentType ( ) != AttachmentType . CLEARING_REPORT && attachment . getAttachmentType ( ) != AttachmentType . COMPONENT_LICENSE_INFO_XML ) { LOGGER . error ( ""Invalid attachment type: "" + attachment . getAttachmentType ( ) + "". Expected CLEARING_REPORT("" + AttachmentType . CLEARING_REPORT . getValue ( ) + "") or COMPONENT_LICENSE_INFO_XML("" + AttachmentType . COMPONENT_LICENSE_INFO_XML . getValue ( ) + ""."" ) ; return SKIP_BODY ; } if ( attachment . getCheckStatus ( ) != CheckStatus . ACCEPTED ) { LOGGER . info ( ""Attachment with content id "" + attachment . getAttachmentContentId ( ) + "" is of correct type to be displayed as clearing report, but is not yet accepted. So not dispaying it."" ) ; return SKIP_BODY ; } return super . doStartTag ( ) ; } " 753,"public int doStartTag ( ) throws JspException { if ( attachment == null ) { LOGGER . error ( ""No attachment given!"" ) ; return SKIP_BODY ; } if ( attachment . getAttachmentType ( ) != AttachmentType . CLEARING_REPORT && attachment . getAttachmentType ( ) != AttachmentType . COMPONENT_LICENSE_INFO_XML ) { return SKIP_BODY ; } if ( attachment . getCheckStatus ( ) != CheckStatus . ACCEPTED ) { LOGGER . info ( ""Attachment with content id "" + attachment . getAttachmentContentId ( ) + "" is of correct type to be displayed as clearing report, but is not yet accepted. So not dispaying it."" ) ; return SKIP_BODY ; } return super . doStartTag ( ) ; } ","public int doStartTag ( ) throws JspException { if ( attachment == null ) { LOGGER . error ( ""No attachment given!"" ) ; return SKIP_BODY ; } if ( attachment . getAttachmentType ( ) != AttachmentType . CLEARING_REPORT && attachment . getAttachmentType ( ) != AttachmentType . COMPONENT_LICENSE_INFO_XML ) { LOGGER . error ( ""Invalid attachment type: "" + attachment . getAttachmentType ( ) + "". Expected CLEARING_REPORT("" + AttachmentType . CLEARING_REPORT . getValue ( ) + "") or COMPONENT_LICENSE_INFO_XML("" + AttachmentType . COMPONENT_LICENSE_INFO_XML . getValue ( ) + ""."" ) ; return SKIP_BODY ; } if ( attachment . getCheckStatus ( ) != CheckStatus . ACCEPTED ) { LOGGER . info ( ""Attachment with content id "" + attachment . getAttachmentContentId ( ) + "" is of correct type to be displayed as clearing report, but is not yet accepted. So not dispaying it."" ) ; return SKIP_BODY ; } return super . doStartTag ( ) ; } " 754,"public int doStartTag ( ) throws JspException { if ( attachment == null ) { LOGGER . error ( ""No attachment given!"" ) ; return SKIP_BODY ; } if ( attachment . getAttachmentType ( ) != AttachmentType . CLEARING_REPORT && attachment . getAttachmentType ( ) != AttachmentType . COMPONENT_LICENSE_INFO_XML ) { LOGGER . error ( ""Invalid attachment type: "" + attachment . getAttachmentType ( ) + "". Expected CLEARING_REPORT("" + AttachmentType . CLEARING_REPORT . getValue ( ) + "") or COMPONENT_LICENSE_INFO_XML("" + AttachmentType . COMPONENT_LICENSE_INFO_XML . getValue ( ) + ""."" ) ; return SKIP_BODY ; } if ( attachment . getCheckStatus ( ) != CheckStatus . ACCEPTED ) { return SKIP_BODY ; } return super . doStartTag ( ) ; } ","public int doStartTag ( ) throws JspException { if ( attachment == null ) { LOGGER . error ( ""No attachment given!"" ) ; return SKIP_BODY ; } if ( attachment . getAttachmentType ( ) != AttachmentType . CLEARING_REPORT && attachment . getAttachmentType ( ) != AttachmentType . COMPONENT_LICENSE_INFO_XML ) { LOGGER . error ( ""Invalid attachment type: "" + attachment . getAttachmentType ( ) + "". Expected CLEARING_REPORT("" + AttachmentType . CLEARING_REPORT . getValue ( ) + "") or COMPONENT_LICENSE_INFO_XML("" + AttachmentType . COMPONENT_LICENSE_INFO_XML . getValue ( ) + ""."" ) ; return SKIP_BODY ; } if ( attachment . getCheckStatus ( ) != CheckStatus . ACCEPTED ) { LOGGER . info ( ""Attachment with content id "" + attachment . getAttachmentContentId ( ) + "" is of correct type to be displayed as clearing report, but is not yet accepted. So not dispaying it."" ) ; return SKIP_BODY ; } return super . doStartTag ( ) ; } " 755,"public void loadBundles ( Map < String , Bundle > bundlesByLocation ) { for ( String loc : bundleLocations ) { if ( bundlesByLocation . containsKey ( loc ) ) { if ( bundlesByLocation . get ( loc ) . getState ( ) == Bundle . ACTIVE ) { bundles . add ( bundleToBundleInfo ( bundlesByLocation . get ( loc ) ) ) ; } else { } } } } ","public void loadBundles ( Map < String , Bundle > bundlesByLocation ) { for ( String loc : bundleLocations ) { if ( bundlesByLocation . containsKey ( loc ) ) { if ( bundlesByLocation . get ( loc ) . getState ( ) == Bundle . ACTIVE ) { bundles . add ( bundleToBundleInfo ( bundlesByLocation . get ( loc ) ) ) ; } else { LOGGER . debug ( ""Unable to find bundle {} of app {} in system."" , loc , name ) ; } } } } " 756,"private void removeNode ( final Node node ) { Futures . addCallback ( resolveDisconnectedNode ( node ) , new FutureCallback < Boolean > ( ) { @ Override public void onSuccess ( @ Nullable Boolean result ) { if ( Boolean . TRUE . equals ( result ) ) { } else { LOG . warn ( ""Failed to remove node {}"" , node . getNodeId ( ) . getValue ( ) ) ; } } @ Override public void onFailure ( @ Nullable Throwable throwable ) { LOG . warn ( ""Exception thrown when removing node... {}"" , throwable ) ; } } , MoreExecutors . directExecutor ( ) ) ; } ","private void removeNode ( final Node node ) { Futures . addCallback ( resolveDisconnectedNode ( node ) , new FutureCallback < Boolean > ( ) { @ Override public void onSuccess ( @ Nullable Boolean result ) { if ( Boolean . TRUE . equals ( result ) ) { LOG . info ( ""Node {} has been removed"" , node . getNodeId ( ) . getValue ( ) ) ; } else { LOG . warn ( ""Failed to remove node {}"" , node . getNodeId ( ) . getValue ( ) ) ; } } @ Override public void onFailure ( @ Nullable Throwable throwable ) { LOG . warn ( ""Exception thrown when removing node... {}"" , throwable ) ; } } , MoreExecutors . directExecutor ( ) ) ; } " 757,"private void removeNode ( final Node node ) { Futures . addCallback ( resolveDisconnectedNode ( node ) , new FutureCallback < Boolean > ( ) { @ Override public void onSuccess ( @ Nullable Boolean result ) { if ( Boolean . TRUE . equals ( result ) ) { LOG . info ( ""Node {} has been removed"" , node . getNodeId ( ) . getValue ( ) ) ; } else { } } @ Override public void onFailure ( @ Nullable Throwable throwable ) { LOG . warn ( ""Exception thrown when removing node... {}"" , throwable ) ; } } , MoreExecutors . directExecutor ( ) ) ; } ","private void removeNode ( final Node node ) { Futures . addCallback ( resolveDisconnectedNode ( node ) , new FutureCallback < Boolean > ( ) { @ Override public void onSuccess ( @ Nullable Boolean result ) { if ( Boolean . TRUE . equals ( result ) ) { LOG . info ( ""Node {} has been removed"" , node . getNodeId ( ) . getValue ( ) ) ; } else { LOG . warn ( ""Failed to remove node {}"" , node . getNodeId ( ) . getValue ( ) ) ; } } @ Override public void onFailure ( @ Nullable Throwable throwable ) { LOG . warn ( ""Exception thrown when removing node... {}"" , throwable ) ; } } , MoreExecutors . directExecutor ( ) ) ; } " 758,"private void removeNode ( final Node node ) { Futures . addCallback ( resolveDisconnectedNode ( node ) , new FutureCallback < Boolean > ( ) { @ Override public void onSuccess ( @ Nullable Boolean result ) { if ( Boolean . TRUE . equals ( result ) ) { LOG . info ( ""Node {} has been removed"" , node . getNodeId ( ) . getValue ( ) ) ; } else { LOG . warn ( ""Failed to remove node {}"" , node . getNodeId ( ) . getValue ( ) ) ; } } @ Override public void onFailure ( @ Nullable Throwable throwable ) { } } , MoreExecutors . directExecutor ( ) ) ; } ","private void removeNode ( final Node node ) { Futures . addCallback ( resolveDisconnectedNode ( node ) , new FutureCallback < Boolean > ( ) { @ Override public void onSuccess ( @ Nullable Boolean result ) { if ( Boolean . TRUE . equals ( result ) ) { LOG . info ( ""Node {} has been removed"" , node . getNodeId ( ) . getValue ( ) ) ; } else { LOG . warn ( ""Failed to remove node {}"" , node . getNodeId ( ) . getValue ( ) ) ; } } @ Override public void onFailure ( @ Nullable Throwable throwable ) { LOG . warn ( ""Exception thrown when removing node... {}"" , throwable ) ; } } , MoreExecutors . directExecutor ( ) ) ; } " 759,"public boolean canReuse ( ActionForm form ) { if ( form != null ) { if ( this . getDynamic ( ) ) { String className = ( ( DynaBean ) form ) . getDynaClass ( ) . getName ( ) ; if ( className . equals ( this . getName ( ) ) ) { return ( true ) ; } } else { try { Class formClass = form . getClass ( ) ; if ( form instanceof BeanValidatorForm ) { BeanValidatorForm beanValidatorForm = ( BeanValidatorForm ) form ; if ( beanValidatorForm . getInstance ( ) instanceof DynaBean ) { String formName = beanValidatorForm . getStrutsConfigFormName ( ) ; if ( getName ( ) . equals ( formName ) ) { log . debug ( ""Can reuse existing instance (BeanValidatorForm)"" ) ; return true ; } else { return false ; } } formClass = beanValidatorForm . getInstance ( ) . getClass ( ) ; } Class configClass = ClassUtils . getApplicationClass ( this . getType ( ) ) ; if ( configClass . isAssignableFrom ( formClass ) ) { log . debug ( ""Can reuse existing instance (non-dynamic)"" ) ; return ( true ) ; } } catch ( Exception e ) { log . debug ( ""Error testing existing instance for reusability; just create a new instance"" , e ) ; } } } return false ; } ","public boolean canReuse ( ActionForm form ) { if ( form != null ) { if ( this . getDynamic ( ) ) { String className = ( ( DynaBean ) form ) . getDynaClass ( ) . getName ( ) ; if ( className . equals ( this . getName ( ) ) ) { log . debug ( ""Can reuse existing instance (dynamic)"" ) ; return ( true ) ; } } else { try { Class formClass = form . getClass ( ) ; if ( form instanceof BeanValidatorForm ) { BeanValidatorForm beanValidatorForm = ( BeanValidatorForm ) form ; if ( beanValidatorForm . getInstance ( ) instanceof DynaBean ) { String formName = beanValidatorForm . getStrutsConfigFormName ( ) ; if ( getName ( ) . equals ( formName ) ) { log . debug ( ""Can reuse existing instance (BeanValidatorForm)"" ) ; return true ; } else { return false ; } } formClass = beanValidatorForm . getInstance ( ) . getClass ( ) ; } Class configClass = ClassUtils . getApplicationClass ( this . getType ( ) ) ; if ( configClass . isAssignableFrom ( formClass ) ) { log . debug ( ""Can reuse existing instance (non-dynamic)"" ) ; return ( true ) ; } } catch ( Exception e ) { log . debug ( ""Error testing existing instance for reusability; just create a new instance"" , e ) ; } } } return false ; } " 760,"public boolean canReuse ( ActionForm form ) { if ( form != null ) { if ( this . getDynamic ( ) ) { String className = ( ( DynaBean ) form ) . getDynaClass ( ) . getName ( ) ; if ( className . equals ( this . getName ( ) ) ) { log . debug ( ""Can reuse existing instance (dynamic)"" ) ; return ( true ) ; } } else { try { Class formClass = form . getClass ( ) ; if ( form instanceof BeanValidatorForm ) { BeanValidatorForm beanValidatorForm = ( BeanValidatorForm ) form ; if ( beanValidatorForm . getInstance ( ) instanceof DynaBean ) { String formName = beanValidatorForm . getStrutsConfigFormName ( ) ; if ( getName ( ) . equals ( formName ) ) { return true ; } else { return false ; } } formClass = beanValidatorForm . getInstance ( ) . getClass ( ) ; } Class configClass = ClassUtils . getApplicationClass ( this . getType ( ) ) ; if ( configClass . isAssignableFrom ( formClass ) ) { log . debug ( ""Can reuse existing instance (non-dynamic)"" ) ; return ( true ) ; } } catch ( Exception e ) { log . debug ( ""Error testing existing instance for reusability; just create a new instance"" , e ) ; } } } return false ; } ","public boolean canReuse ( ActionForm form ) { if ( form != null ) { if ( this . getDynamic ( ) ) { String className = ( ( DynaBean ) form ) . getDynaClass ( ) . getName ( ) ; if ( className . equals ( this . getName ( ) ) ) { log . debug ( ""Can reuse existing instance (dynamic)"" ) ; return ( true ) ; } } else { try { Class formClass = form . getClass ( ) ; if ( form instanceof BeanValidatorForm ) { BeanValidatorForm beanValidatorForm = ( BeanValidatorForm ) form ; if ( beanValidatorForm . getInstance ( ) instanceof DynaBean ) { String formName = beanValidatorForm . getStrutsConfigFormName ( ) ; if ( getName ( ) . equals ( formName ) ) { log . debug ( ""Can reuse existing instance (BeanValidatorForm)"" ) ; return true ; } else { return false ; } } formClass = beanValidatorForm . getInstance ( ) . getClass ( ) ; } Class configClass = ClassUtils . getApplicationClass ( this . getType ( ) ) ; if ( configClass . isAssignableFrom ( formClass ) ) { log . debug ( ""Can reuse existing instance (non-dynamic)"" ) ; return ( true ) ; } } catch ( Exception e ) { log . debug ( ""Error testing existing instance for reusability; just create a new instance"" , e ) ; } } } return false ; } " 761,"public boolean canReuse ( ActionForm form ) { if ( form != null ) { if ( this . getDynamic ( ) ) { String className = ( ( DynaBean ) form ) . getDynaClass ( ) . getName ( ) ; if ( className . equals ( this . getName ( ) ) ) { log . debug ( ""Can reuse existing instance (dynamic)"" ) ; return ( true ) ; } } else { try { Class formClass = form . getClass ( ) ; if ( form instanceof BeanValidatorForm ) { BeanValidatorForm beanValidatorForm = ( BeanValidatorForm ) form ; if ( beanValidatorForm . getInstance ( ) instanceof DynaBean ) { String formName = beanValidatorForm . getStrutsConfigFormName ( ) ; if ( getName ( ) . equals ( formName ) ) { log . debug ( ""Can reuse existing instance (BeanValidatorForm)"" ) ; return true ; } else { return false ; } } formClass = beanValidatorForm . getInstance ( ) . getClass ( ) ; } Class configClass = ClassUtils . getApplicationClass ( this . getType ( ) ) ; if ( configClass . isAssignableFrom ( formClass ) ) { return ( true ) ; } } catch ( Exception e ) { log . debug ( ""Error testing existing instance for reusability; just create a new instance"" , e ) ; } } } return false ; } ","public boolean canReuse ( ActionForm form ) { if ( form != null ) { if ( this . getDynamic ( ) ) { String className = ( ( DynaBean ) form ) . getDynaClass ( ) . getName ( ) ; if ( className . equals ( this . getName ( ) ) ) { log . debug ( ""Can reuse existing instance (dynamic)"" ) ; return ( true ) ; } } else { try { Class formClass = form . getClass ( ) ; if ( form instanceof BeanValidatorForm ) { BeanValidatorForm beanValidatorForm = ( BeanValidatorForm ) form ; if ( beanValidatorForm . getInstance ( ) instanceof DynaBean ) { String formName = beanValidatorForm . getStrutsConfigFormName ( ) ; if ( getName ( ) . equals ( formName ) ) { log . debug ( ""Can reuse existing instance (BeanValidatorForm)"" ) ; return true ; } else { return false ; } } formClass = beanValidatorForm . getInstance ( ) . getClass ( ) ; } Class configClass = ClassUtils . getApplicationClass ( this . getType ( ) ) ; if ( configClass . isAssignableFrom ( formClass ) ) { log . debug ( ""Can reuse existing instance (non-dynamic)"" ) ; return ( true ) ; } } catch ( Exception e ) { log . debug ( ""Error testing existing instance for reusability; just create a new instance"" , e ) ; } } } return false ; } " 762,"public boolean canReuse ( ActionForm form ) { if ( form != null ) { if ( this . getDynamic ( ) ) { String className = ( ( DynaBean ) form ) . getDynaClass ( ) . getName ( ) ; if ( className . equals ( this . getName ( ) ) ) { log . debug ( ""Can reuse existing instance (dynamic)"" ) ; return ( true ) ; } } else { try { Class formClass = form . getClass ( ) ; if ( form instanceof BeanValidatorForm ) { BeanValidatorForm beanValidatorForm = ( BeanValidatorForm ) form ; if ( beanValidatorForm . getInstance ( ) instanceof DynaBean ) { String formName = beanValidatorForm . getStrutsConfigFormName ( ) ; if ( getName ( ) . equals ( formName ) ) { log . debug ( ""Can reuse existing instance (BeanValidatorForm)"" ) ; return true ; } else { return false ; } } formClass = beanValidatorForm . getInstance ( ) . getClass ( ) ; } Class configClass = ClassUtils . getApplicationClass ( this . getType ( ) ) ; if ( configClass . isAssignableFrom ( formClass ) ) { log . debug ( ""Can reuse existing instance (non-dynamic)"" ) ; return ( true ) ; } } catch ( Exception e ) { } } } return false ; } ","public boolean canReuse ( ActionForm form ) { if ( form != null ) { if ( this . getDynamic ( ) ) { String className = ( ( DynaBean ) form ) . getDynaClass ( ) . getName ( ) ; if ( className . equals ( this . getName ( ) ) ) { log . debug ( ""Can reuse existing instance (dynamic)"" ) ; return ( true ) ; } } else { try { Class formClass = form . getClass ( ) ; if ( form instanceof BeanValidatorForm ) { BeanValidatorForm beanValidatorForm = ( BeanValidatorForm ) form ; if ( beanValidatorForm . getInstance ( ) instanceof DynaBean ) { String formName = beanValidatorForm . getStrutsConfigFormName ( ) ; if ( getName ( ) . equals ( formName ) ) { log . debug ( ""Can reuse existing instance (BeanValidatorForm)"" ) ; return true ; } else { return false ; } } formClass = beanValidatorForm . getInstance ( ) . getClass ( ) ; } Class configClass = ClassUtils . getApplicationClass ( this . getType ( ) ) ; if ( configClass . isAssignableFrom ( formClass ) ) { log . debug ( ""Can reuse existing instance (non-dynamic)"" ) ; return ( true ) ; } } catch ( Exception e ) { log . debug ( ""Error testing existing instance for reusability; just create a new instance"" , e ) ; } } } return false ; } " 763,"@ SuppressWarnings ( ""unchecked"" ) public ResidueSolvablePolynomial < C > parse ( Reader r ) { GenPolynomialTokenizer pt = new GenPolynomialTokenizer ( this , r ) ; ResidueSolvablePolynomial < C > p = null ; try { GenSolvablePolynomial < SolvableResidue < C > > s = pt . nextSolvablePolynomial ( ) ; p = new ResidueSolvablePolynomial < C > ( this , s ) ; } catch ( IOException e ) { p = ZERO ; } return p ; } ","@ SuppressWarnings ( ""unchecked"" ) public ResidueSolvablePolynomial < C > parse ( Reader r ) { GenPolynomialTokenizer pt = new GenPolynomialTokenizer ( this , r ) ; ResidueSolvablePolynomial < C > p = null ; try { GenSolvablePolynomial < SolvableResidue < C > > s = pt . nextSolvablePolynomial ( ) ; p = new ResidueSolvablePolynomial < C > ( this , s ) ; } catch ( IOException e ) { logger . error ( e . toString ( ) + "" parse "" + this ) ; p = ZERO ; } return p ; } " 764,"public void removeTenant ( String tenantId ) { tenantIds . remove ( tenantId ) ; } ","public void removeTenant ( String tenantId ) { tenantIds . remove ( tenantId ) ; log . info ( ""[TRACKER] tenantId "" + tenantId + "" removed."" ) ; } " 765,"public void abort ( AbortReason abortReason , Optional < Throwable > throwable ) { if ( ! aborting . getAndSet ( true ) ) { try { sendAbortNotification ( abortReason , throwable ) ; SingularityLifecycleManaged lifecycle = injector . getInstance ( SingularityLifecycleManaged . class ) ; SingularityPreJettyLifecycle preJettyLifecycle = injector . getInstance ( SingularityPreJettyLifecycle . class ) ; try { preJettyLifecycle . stop ( ) ; lifecycle . stop ( ) ; } catch ( Throwable t ) { } flushLogs ( ) ; } finally { exit ( ) ; } } } ","public void abort ( AbortReason abortReason , Optional < Throwable > throwable ) { if ( ! aborting . getAndSet ( true ) ) { try { sendAbortNotification ( abortReason , throwable ) ; SingularityLifecycleManaged lifecycle = injector . getInstance ( SingularityLifecycleManaged . class ) ; SingularityPreJettyLifecycle preJettyLifecycle = injector . getInstance ( SingularityPreJettyLifecycle . class ) ; try { preJettyLifecycle . stop ( ) ; lifecycle . stop ( ) ; } catch ( Throwable t ) { LOG . error ( ""While shutting down"" , t ) ; } flushLogs ( ) ; } finally { exit ( ) ; } } } " 766,"private void write ( final Collection < Long > items ) { if ( items . isEmpty ( ) ) { state . update ( c -> c . remove ( key ) ) ; } else { state . update ( b -> b . put ( key , items . stream ( ) . map ( String :: valueOf ) ) ) ; } var value = state . getValue ( key ) . orElse ( ""nothing"" ) ; } ","private void write ( final Collection < Long > items ) { if ( items . isEmpty ( ) ) { state . update ( c -> c . remove ( key ) ) ; } else { state . update ( b -> b . put ( key , items . stream ( ) . map ( String :: valueOf ) ) ) ; } var value = state . getValue ( key ) . orElse ( ""nothing"" ) ; LOGGER . trace ( ""'{}' wrote '{}'."" , key , value ) ; } " 767,"public CEFParserResult evaluate ( FunctionArgs args , EvaluationContext context ) { final String cef = valueParam . required ( args , context ) ; final boolean useFullNames = useFullNamesParam . optional ( args , context ) . orElse ( false ) ; final CEFParser parser = CEFParserFactory . create ( ) ; if ( cef == null || cef . isEmpty ( ) ) { return null ; } LOG . debug ( ""Running CEF parser for [{}]."" , cef ) ; final MappedMessage message ; try ( Timer . Context timer = parseTime . time ( ) ) { message = new MappedMessage ( parser . parse ( cef . trim ( ) ) , useFullNames ) ; } catch ( Exception e ) { LOG . error ( ""Error while parsing CEF message: {}"" , cef , e ) ; return null ; } final Map < String , Object > fields = new HashMap < > ( ) ; fields . put ( ""cef_version"" , message . cefVersion ( ) ) ; fields . put ( ""device_vendor"" , message . deviceVendor ( ) ) ; fields . put ( ""device_product"" , message . deviceProduct ( ) ) ; fields . put ( ""device_version"" , message . deviceVersion ( ) ) ; fields . put ( ""device_event_class_id"" , message . deviceEventClassId ( ) ) ; fields . put ( ""name"" , message . name ( ) ) ; fields . put ( ""severity"" , message . severity ( ) ) ; fields . putAll ( message . mappedExtensions ( ) ) ; return new CEFParserResult ( fields ) ; } ","public CEFParserResult evaluate ( FunctionArgs args , EvaluationContext context ) { final String cef = valueParam . required ( args , context ) ; final boolean useFullNames = useFullNamesParam . optional ( args , context ) . orElse ( false ) ; final CEFParser parser = CEFParserFactory . create ( ) ; if ( cef == null || cef . isEmpty ( ) ) { LOG . debug ( ""NULL or empty parameter passed to CEF parser function. Not evaluating."" ) ; return null ; } LOG . debug ( ""Running CEF parser for [{}]."" , cef ) ; final MappedMessage message ; try ( Timer . Context timer = parseTime . time ( ) ) { message = new MappedMessage ( parser . parse ( cef . trim ( ) ) , useFullNames ) ; } catch ( Exception e ) { LOG . error ( ""Error while parsing CEF message: {}"" , cef , e ) ; return null ; } final Map < String , Object > fields = new HashMap < > ( ) ; fields . put ( ""cef_version"" , message . cefVersion ( ) ) ; fields . put ( ""device_vendor"" , message . deviceVendor ( ) ) ; fields . put ( ""device_product"" , message . deviceProduct ( ) ) ; fields . put ( ""device_version"" , message . deviceVersion ( ) ) ; fields . put ( ""device_event_class_id"" , message . deviceEventClassId ( ) ) ; fields . put ( ""name"" , message . name ( ) ) ; fields . put ( ""severity"" , message . severity ( ) ) ; fields . putAll ( message . mappedExtensions ( ) ) ; return new CEFParserResult ( fields ) ; } " 768,"public CEFParserResult evaluate ( FunctionArgs args , EvaluationContext context ) { final String cef = valueParam . required ( args , context ) ; final boolean useFullNames = useFullNamesParam . optional ( args , context ) . orElse ( false ) ; final CEFParser parser = CEFParserFactory . create ( ) ; if ( cef == null || cef . isEmpty ( ) ) { LOG . debug ( ""NULL or empty parameter passed to CEF parser function. Not evaluating."" ) ; return null ; } final MappedMessage message ; try ( Timer . Context timer = parseTime . time ( ) ) { message = new MappedMessage ( parser . parse ( cef . trim ( ) ) , useFullNames ) ; } catch ( Exception e ) { LOG . error ( ""Error while parsing CEF message: {}"" , cef , e ) ; return null ; } final Map < String , Object > fields = new HashMap < > ( ) ; fields . put ( ""cef_version"" , message . cefVersion ( ) ) ; fields . put ( ""device_vendor"" , message . deviceVendor ( ) ) ; fields . put ( ""device_product"" , message . deviceProduct ( ) ) ; fields . put ( ""device_version"" , message . deviceVersion ( ) ) ; fields . put ( ""device_event_class_id"" , message . deviceEventClassId ( ) ) ; fields . put ( ""name"" , message . name ( ) ) ; fields . put ( ""severity"" , message . severity ( ) ) ; fields . putAll ( message . mappedExtensions ( ) ) ; return new CEFParserResult ( fields ) ; } ","public CEFParserResult evaluate ( FunctionArgs args , EvaluationContext context ) { final String cef = valueParam . required ( args , context ) ; final boolean useFullNames = useFullNamesParam . optional ( args , context ) . orElse ( false ) ; final CEFParser parser = CEFParserFactory . create ( ) ; if ( cef == null || cef . isEmpty ( ) ) { LOG . debug ( ""NULL or empty parameter passed to CEF parser function. Not evaluating."" ) ; return null ; } LOG . debug ( ""Running CEF parser for [{}]."" , cef ) ; final MappedMessage message ; try ( Timer . Context timer = parseTime . time ( ) ) { message = new MappedMessage ( parser . parse ( cef . trim ( ) ) , useFullNames ) ; } catch ( Exception e ) { LOG . error ( ""Error while parsing CEF message: {}"" , cef , e ) ; return null ; } final Map < String , Object > fields = new HashMap < > ( ) ; fields . put ( ""cef_version"" , message . cefVersion ( ) ) ; fields . put ( ""device_vendor"" , message . deviceVendor ( ) ) ; fields . put ( ""device_product"" , message . deviceProduct ( ) ) ; fields . put ( ""device_version"" , message . deviceVersion ( ) ) ; fields . put ( ""device_event_class_id"" , message . deviceEventClassId ( ) ) ; fields . put ( ""name"" , message . name ( ) ) ; fields . put ( ""severity"" , message . severity ( ) ) ; fields . putAll ( message . mappedExtensions ( ) ) ; return new CEFParserResult ( fields ) ; } " 769,"public CEFParserResult evaluate ( FunctionArgs args , EvaluationContext context ) { final String cef = valueParam . required ( args , context ) ; final boolean useFullNames = useFullNamesParam . optional ( args , context ) . orElse ( false ) ; final CEFParser parser = CEFParserFactory . create ( ) ; if ( cef == null || cef . isEmpty ( ) ) { LOG . debug ( ""NULL or empty parameter passed to CEF parser function. Not evaluating."" ) ; return null ; } LOG . debug ( ""Running CEF parser for [{}]."" , cef ) ; final MappedMessage message ; try ( Timer . Context timer = parseTime . time ( ) ) { message = new MappedMessage ( parser . parse ( cef . trim ( ) ) , useFullNames ) ; } catch ( Exception e ) { return null ; } final Map < String , Object > fields = new HashMap < > ( ) ; fields . put ( ""cef_version"" , message . cefVersion ( ) ) ; fields . put ( ""device_vendor"" , message . deviceVendor ( ) ) ; fields . put ( ""device_product"" , message . deviceProduct ( ) ) ; fields . put ( ""device_version"" , message . deviceVersion ( ) ) ; fields . put ( ""device_event_class_id"" , message . deviceEventClassId ( ) ) ; fields . put ( ""name"" , message . name ( ) ) ; fields . put ( ""severity"" , message . severity ( ) ) ; fields . putAll ( message . mappedExtensions ( ) ) ; return new CEFParserResult ( fields ) ; } ","public CEFParserResult evaluate ( FunctionArgs args , EvaluationContext context ) { final String cef = valueParam . required ( args , context ) ; final boolean useFullNames = useFullNamesParam . optional ( args , context ) . orElse ( false ) ; final CEFParser parser = CEFParserFactory . create ( ) ; if ( cef == null || cef . isEmpty ( ) ) { LOG . debug ( ""NULL or empty parameter passed to CEF parser function. Not evaluating."" ) ; return null ; } LOG . debug ( ""Running CEF parser for [{}]."" , cef ) ; final MappedMessage message ; try ( Timer . Context timer = parseTime . time ( ) ) { message = new MappedMessage ( parser . parse ( cef . trim ( ) ) , useFullNames ) ; } catch ( Exception e ) { LOG . error ( ""Error while parsing CEF message: {}"" , cef , e ) ; return null ; } final Map < String , Object > fields = new HashMap < > ( ) ; fields . put ( ""cef_version"" , message . cefVersion ( ) ) ; fields . put ( ""device_vendor"" , message . deviceVendor ( ) ) ; fields . put ( ""device_product"" , message . deviceProduct ( ) ) ; fields . put ( ""device_version"" , message . deviceVersion ( ) ) ; fields . put ( ""device_event_class_id"" , message . deviceEventClassId ( ) ) ; fields . put ( ""name"" , message . name ( ) ) ; fields . put ( ""severity"" , message . severity ( ) ) ; fields . putAll ( message . mappedExtensions ( ) ) ; return new CEFParserResult ( fields ) ; } " 770,"private List < Record > transformRecords ( Dataset dataset , Collection < Record > records , String xsltUrl ) throws XsltSetupException { final XsltTransformer transformer ; final EuropeanaIdCreator europeanIdCreator ; try { final TransformationParameters transformationParameters = new TransformationParameters ( dataset ) ; transformer = new XsltTransformer ( xsltUrl , transformationParameters . getDatasetName ( ) , transformationParameters . getEdmCountry ( ) , transformationParameters . getEdmLanguage ( ) ) ; europeanIdCreator = new EuropeanaIdCreator ( ) ; } catch ( TransformationException e ) { throw new XsltSetupException ( ""Could not setup XSL transformation."" , e ) ; } catch ( EuropeanaIdException e ) { throw new XsltSetupException ( CommonStringValues . EUROPEANA_ID_CREATOR_INITIALIZATION_FAILED , e ) ; } return records . stream ( ) . map ( record -> { try { EuropeanaGeneratedIdsMap europeanaGeneratedIdsMap = europeanIdCreator . constructEuropeanaId ( record . getXmlRecord ( ) , dataset . getDatasetId ( ) ) ; return new Record ( record . getEcloudId ( ) , transformer . transform ( record . getXmlRecord ( ) . getBytes ( StandardCharsets . UTF_8 ) , europeanaGeneratedIdsMap ) . toString ( ) ) ; } catch ( TransformationException e ) { return new Record ( record . getEcloudId ( ) , e . getMessage ( ) ) ; } catch ( EuropeanaIdException e ) { LOGGER . info ( CommonStringValues . EUROPEANA_ID_CREATOR_INITIALIZATION_FAILED , e ) ; return new Record ( record . getEcloudId ( ) , e . getMessage ( ) ) ; } } ) . collect ( Collectors . toList ( ) ) ; } ","private List < Record > transformRecords ( Dataset dataset , Collection < Record > records , String xsltUrl ) throws XsltSetupException { final XsltTransformer transformer ; final EuropeanaIdCreator europeanIdCreator ; try { final TransformationParameters transformationParameters = new TransformationParameters ( dataset ) ; transformer = new XsltTransformer ( xsltUrl , transformationParameters . getDatasetName ( ) , transformationParameters . getEdmCountry ( ) , transformationParameters . getEdmLanguage ( ) ) ; europeanIdCreator = new EuropeanaIdCreator ( ) ; } catch ( TransformationException e ) { throw new XsltSetupException ( ""Could not setup XSL transformation."" , e ) ; } catch ( EuropeanaIdException e ) { throw new XsltSetupException ( CommonStringValues . EUROPEANA_ID_CREATOR_INITIALIZATION_FAILED , e ) ; } return records . stream ( ) . map ( record -> { try { EuropeanaGeneratedIdsMap europeanaGeneratedIdsMap = europeanIdCreator . constructEuropeanaId ( record . getXmlRecord ( ) , dataset . getDatasetId ( ) ) ; return new Record ( record . getEcloudId ( ) , transformer . transform ( record . getXmlRecord ( ) . getBytes ( StandardCharsets . UTF_8 ) , europeanaGeneratedIdsMap ) . toString ( ) ) ; } catch ( TransformationException e ) { LOGGER . info ( ""Record from list failed transformation"" , e ) ; return new Record ( record . getEcloudId ( ) , e . getMessage ( ) ) ; } catch ( EuropeanaIdException e ) { LOGGER . info ( CommonStringValues . EUROPEANA_ID_CREATOR_INITIALIZATION_FAILED , e ) ; return new Record ( record . getEcloudId ( ) , e . getMessage ( ) ) ; } } ) . collect ( Collectors . toList ( ) ) ; } " 771,"private List < Record > transformRecords ( Dataset dataset , Collection < Record > records , String xsltUrl ) throws XsltSetupException { final XsltTransformer transformer ; final EuropeanaIdCreator europeanIdCreator ; try { final TransformationParameters transformationParameters = new TransformationParameters ( dataset ) ; transformer = new XsltTransformer ( xsltUrl , transformationParameters . getDatasetName ( ) , transformationParameters . getEdmCountry ( ) , transformationParameters . getEdmLanguage ( ) ) ; europeanIdCreator = new EuropeanaIdCreator ( ) ; } catch ( TransformationException e ) { throw new XsltSetupException ( ""Could not setup XSL transformation."" , e ) ; } catch ( EuropeanaIdException e ) { throw new XsltSetupException ( CommonStringValues . EUROPEANA_ID_CREATOR_INITIALIZATION_FAILED , e ) ; } return records . stream ( ) . map ( record -> { try { EuropeanaGeneratedIdsMap europeanaGeneratedIdsMap = europeanIdCreator . constructEuropeanaId ( record . getXmlRecord ( ) , dataset . getDatasetId ( ) ) ; return new Record ( record . getEcloudId ( ) , transformer . transform ( record . getXmlRecord ( ) . getBytes ( StandardCharsets . UTF_8 ) , europeanaGeneratedIdsMap ) . toString ( ) ) ; } catch ( TransformationException e ) { LOGGER . info ( ""Record from list failed transformation"" , e ) ; return new Record ( record . getEcloudId ( ) , e . getMessage ( ) ) ; } catch ( EuropeanaIdException e ) { return new Record ( record . getEcloudId ( ) , e . getMessage ( ) ) ; } } ) . collect ( Collectors . toList ( ) ) ; } ","private List < Record > transformRecords ( Dataset dataset , Collection < Record > records , String xsltUrl ) throws XsltSetupException { final XsltTransformer transformer ; final EuropeanaIdCreator europeanIdCreator ; try { final TransformationParameters transformationParameters = new TransformationParameters ( dataset ) ; transformer = new XsltTransformer ( xsltUrl , transformationParameters . getDatasetName ( ) , transformationParameters . getEdmCountry ( ) , transformationParameters . getEdmLanguage ( ) ) ; europeanIdCreator = new EuropeanaIdCreator ( ) ; } catch ( TransformationException e ) { throw new XsltSetupException ( ""Could not setup XSL transformation."" , e ) ; } catch ( EuropeanaIdException e ) { throw new XsltSetupException ( CommonStringValues . EUROPEANA_ID_CREATOR_INITIALIZATION_FAILED , e ) ; } return records . stream ( ) . map ( record -> { try { EuropeanaGeneratedIdsMap europeanaGeneratedIdsMap = europeanIdCreator . constructEuropeanaId ( record . getXmlRecord ( ) , dataset . getDatasetId ( ) ) ; return new Record ( record . getEcloudId ( ) , transformer . transform ( record . getXmlRecord ( ) . getBytes ( StandardCharsets . UTF_8 ) , europeanaGeneratedIdsMap ) . toString ( ) ) ; } catch ( TransformationException e ) { LOGGER . info ( ""Record from list failed transformation"" , e ) ; return new Record ( record . getEcloudId ( ) , e . getMessage ( ) ) ; } catch ( EuropeanaIdException e ) { LOGGER . info ( CommonStringValues . EUROPEANA_ID_CREATOR_INITIALIZATION_FAILED , e ) ; return new Record ( record . getEcloudId ( ) , e . getMessage ( ) ) ; } } ) . collect ( Collectors . toList ( ) ) ; } " 772,"public void onClick ( final AjaxRequestTarget target , final PrivilegeTO ignore ) { try { application . getPrivileges ( ) . remove ( model . getObject ( ) ) ; ApplicationRestClient . update ( application ) ; SyncopeConsoleSession . get ( ) . success ( getString ( Constants . OPERATION_SUCCEEDED ) ) ; customActionOnFinishCallback ( target ) ; } catch ( SyncopeClientException e ) { SyncopeConsoleSession . get ( ) . onException ( e ) ; } ( ( BaseWebPage ) pageRef . getPage ( ) ) . getNotificationPanel ( ) . refresh ( target ) ; } ","public void onClick ( final AjaxRequestTarget target , final PrivilegeTO ignore ) { try { application . getPrivileges ( ) . remove ( model . getObject ( ) ) ; ApplicationRestClient . update ( application ) ; SyncopeConsoleSession . get ( ) . success ( getString ( Constants . OPERATION_SUCCEEDED ) ) ; customActionOnFinishCallback ( target ) ; } catch ( SyncopeClientException e ) { LOG . error ( ""While deleting {}"" , model . getObject ( ) . getKey ( ) , e ) ; SyncopeConsoleSession . get ( ) . onException ( e ) ; } ( ( BaseWebPage ) pageRef . getPage ( ) ) . getNotificationPanel ( ) . refresh ( target ) ; } " 773,"public void onNext ( RaftClientReplyProto proto ) { final long callId = proto . getRpcReply ( ) . getCallId ( ) ; try { final RaftClientReply reply = ClientProtoUtils . toRaftClientReply ( proto ) ; final NotLeaderException nle = reply . getNotLeaderException ( ) ; if ( nle != null ) { completeReplyExceptionally ( nle , NotLeaderException . class . getName ( ) ) ; return ; } final LeaderNotReadyException lnre = reply . getLeaderNotReadyException ( ) ; if ( lnre != null ) { completeReplyExceptionally ( lnre , LeaderNotReadyException . class . getName ( ) ) ; return ; } handleReplyFuture ( callId , f -> f . complete ( reply ) ) ; } catch ( Exception e ) { handleReplyFuture ( callId , f -> f . completeExceptionally ( e ) ) ; } } ","public void onNext ( RaftClientReplyProto proto ) { final long callId = proto . getRpcReply ( ) . getCallId ( ) ; try { final RaftClientReply reply = ClientProtoUtils . toRaftClientReply ( proto ) ; LOG . trace ( ""{}: receive {}"" , getName ( ) , reply ) ; final NotLeaderException nle = reply . getNotLeaderException ( ) ; if ( nle != null ) { completeReplyExceptionally ( nle , NotLeaderException . class . getName ( ) ) ; return ; } final LeaderNotReadyException lnre = reply . getLeaderNotReadyException ( ) ; if ( lnre != null ) { completeReplyExceptionally ( lnre , LeaderNotReadyException . class . getName ( ) ) ; return ; } handleReplyFuture ( callId , f -> f . complete ( reply ) ) ; } catch ( Exception e ) { handleReplyFuture ( callId , f -> f . completeExceptionally ( e ) ) ; } } " 774,"public List < RecommendedItem > recommend ( long userID , int howMany , IDRescorer rescorer ) throws TasteException { Preconditions . checkArgument ( howMany >= 1 , ""howMany must be at least 1"" ) ; long [ ] theNeighborhood = neighborhood . getUserNeighborhood ( userID ) ; if ( theNeighborhood . length == 0 ) { return Collections . emptyList ( ) ; } FastIDSet allItemIDs = getAllOtherItems ( theNeighborhood , userID ) ; TopItems . Estimator < Long > estimator = new Estimator ( userID , theNeighborhood ) ; List < RecommendedItem > topItems = TopItems . getTopItems ( howMany , allItemIDs . iterator ( ) , rescorer , estimator ) ; log . debug ( ""Recommendations are: {}"" , topItems ) ; return topItems ; } ","public List < RecommendedItem > recommend ( long userID , int howMany , IDRescorer rescorer ) throws TasteException { Preconditions . checkArgument ( howMany >= 1 , ""howMany must be at least 1"" ) ; log . debug ( ""Recommending items for user ID '{}'"" , userID ) ; long [ ] theNeighborhood = neighborhood . getUserNeighborhood ( userID ) ; if ( theNeighborhood . length == 0 ) { return Collections . emptyList ( ) ; } FastIDSet allItemIDs = getAllOtherItems ( theNeighborhood , userID ) ; TopItems . Estimator < Long > estimator = new Estimator ( userID , theNeighborhood ) ; List < RecommendedItem > topItems = TopItems . getTopItems ( howMany , allItemIDs . iterator ( ) , rescorer , estimator ) ; log . debug ( ""Recommendations are: {}"" , topItems ) ; return topItems ; } " 775,"public List < RecommendedItem > recommend ( long userID , int howMany , IDRescorer rescorer ) throws TasteException { Preconditions . checkArgument ( howMany >= 1 , ""howMany must be at least 1"" ) ; log . debug ( ""Recommending items for user ID '{}'"" , userID ) ; long [ ] theNeighborhood = neighborhood . getUserNeighborhood ( userID ) ; if ( theNeighborhood . length == 0 ) { return Collections . emptyList ( ) ; } FastIDSet allItemIDs = getAllOtherItems ( theNeighborhood , userID ) ; TopItems . Estimator < Long > estimator = new Estimator ( userID , theNeighborhood ) ; List < RecommendedItem > topItems = TopItems . getTopItems ( howMany , allItemIDs . iterator ( ) , rescorer , estimator ) ; return topItems ; } ","public List < RecommendedItem > recommend ( long userID , int howMany , IDRescorer rescorer ) throws TasteException { Preconditions . checkArgument ( howMany >= 1 , ""howMany must be at least 1"" ) ; log . debug ( ""Recommending items for user ID '{}'"" , userID ) ; long [ ] theNeighborhood = neighborhood . getUserNeighborhood ( userID ) ; if ( theNeighborhood . length == 0 ) { return Collections . emptyList ( ) ; } FastIDSet allItemIDs = getAllOtherItems ( theNeighborhood , userID ) ; TopItems . Estimator < Long > estimator = new Estimator ( userID , theNeighborhood ) ; List < RecommendedItem > topItems = TopItems . getTopItems ( howMany , allItemIDs . iterator ( ) , rescorer , estimator ) ; log . debug ( ""Recommendations are: {}"" , topItems ) ; return topItems ; } " 776,"public MessageResponse handleMissingPayload ( final URI affectedResource , final URI issuerConnector , final URI messageId ) { if ( log . isDebugEnabled ( ) ) { } return ErrorResponse . withDefaultHeader ( RejectionReason . BAD_PARAMETERS , ""Missing resource in payload."" , connectorService . getConnectorId ( ) , connectorService . getOutboundModelVersion ( ) ) ; } ","public MessageResponse handleMissingPayload ( final URI affectedResource , final URI issuerConnector , final URI messageId ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Missing resource in payload. [resource=({}), issuer=({}), "" + ""messageId=({})]"" , affectedResource , issuerConnector , messageId ) ; } return ErrorResponse . withDefaultHeader ( RejectionReason . BAD_PARAMETERS , ""Missing resource in payload."" , connectorService . getConnectorId ( ) , connectorService . getOutboundModelVersion ( ) ) ; } " 777,"private Map < String , Long > getTopicOffsets ( List < String > topics ) { ArrayList < HostAndPort > nodes = new ArrayList < > ( config . getNodes ( ) ) ; Collections . shuffle ( nodes ) ; SimpleConsumer simpleConsumer = consumerManager . getConsumer ( nodes . get ( 0 ) ) ; TopicMetadataRequest topicMetadataRequest = new TopicMetadataRequest ( topics ) ; TopicMetadataResponse topicMetadataResponse = simpleConsumer . send ( topicMetadataRequest ) ; ImmutableMap . Builder < String , Long > builder = ImmutableMap . builder ( ) ; for ( TopicMetadata metadata : topicMetadataResponse . topicsMetadata ( ) ) { for ( PartitionMetadata part : metadata . partitionsMetadata ( ) ) { Broker leader = part . leader ( ) ; if ( leader == null ) { LOGGER . warn ( format ( ""No leader for partition %s/%s found!"" , metadata . topic ( ) , part . partitionId ( ) ) ) ; } else { HostAndPort leaderHost = HostAndPort . fromParts ( leader . host ( ) , leader . port ( ) ) ; SimpleConsumer leaderConsumer = consumerManager . getConsumer ( leaderHost ) ; long offset = findAllOffsets ( leaderConsumer , metadata . topic ( ) , part . partitionId ( ) ) [ 0 ] ; builder . put ( metadata . topic ( ) , offset ) ; } } } return builder . build ( ) ; } ","private Map < String , Long > getTopicOffsets ( List < String > topics ) { ArrayList < HostAndPort > nodes = new ArrayList < > ( config . getNodes ( ) ) ; Collections . shuffle ( nodes ) ; SimpleConsumer simpleConsumer = consumerManager . getConsumer ( nodes . get ( 0 ) ) ; TopicMetadataRequest topicMetadataRequest = new TopicMetadataRequest ( topics ) ; TopicMetadataResponse topicMetadataResponse = simpleConsumer . send ( topicMetadataRequest ) ; ImmutableMap . Builder < String , Long > builder = ImmutableMap . builder ( ) ; for ( TopicMetadata metadata : topicMetadataResponse . topicsMetadata ( ) ) { for ( PartitionMetadata part : metadata . partitionsMetadata ( ) ) { LOGGER . debug ( format ( ""Adding Partition %s/%s"" , metadata . topic ( ) , part . partitionId ( ) ) ) ; Broker leader = part . leader ( ) ; if ( leader == null ) { LOGGER . warn ( format ( ""No leader for partition %s/%s found!"" , metadata . topic ( ) , part . partitionId ( ) ) ) ; } else { HostAndPort leaderHost = HostAndPort . fromParts ( leader . host ( ) , leader . port ( ) ) ; SimpleConsumer leaderConsumer = consumerManager . getConsumer ( leaderHost ) ; long offset = findAllOffsets ( leaderConsumer , metadata . topic ( ) , part . partitionId ( ) ) [ 0 ] ; builder . put ( metadata . topic ( ) , offset ) ; } } } return builder . build ( ) ; } " 778,"private Map < String , Long > getTopicOffsets ( List < String > topics ) { ArrayList < HostAndPort > nodes = new ArrayList < > ( config . getNodes ( ) ) ; Collections . shuffle ( nodes ) ; SimpleConsumer simpleConsumer = consumerManager . getConsumer ( nodes . get ( 0 ) ) ; TopicMetadataRequest topicMetadataRequest = new TopicMetadataRequest ( topics ) ; TopicMetadataResponse topicMetadataResponse = simpleConsumer . send ( topicMetadataRequest ) ; ImmutableMap . Builder < String , Long > builder = ImmutableMap . builder ( ) ; for ( TopicMetadata metadata : topicMetadataResponse . topicsMetadata ( ) ) { for ( PartitionMetadata part : metadata . partitionsMetadata ( ) ) { LOGGER . debug ( format ( ""Adding Partition %s/%s"" , metadata . topic ( ) , part . partitionId ( ) ) ) ; Broker leader = part . leader ( ) ; if ( leader == null ) { } else { HostAndPort leaderHost = HostAndPort . fromParts ( leader . host ( ) , leader . port ( ) ) ; SimpleConsumer leaderConsumer = consumerManager . getConsumer ( leaderHost ) ; long offset = findAllOffsets ( leaderConsumer , metadata . topic ( ) , part . partitionId ( ) ) [ 0 ] ; builder . put ( metadata . topic ( ) , offset ) ; } } } return builder . build ( ) ; } ","private Map < String , Long > getTopicOffsets ( List < String > topics ) { ArrayList < HostAndPort > nodes = new ArrayList < > ( config . getNodes ( ) ) ; Collections . shuffle ( nodes ) ; SimpleConsumer simpleConsumer = consumerManager . getConsumer ( nodes . get ( 0 ) ) ; TopicMetadataRequest topicMetadataRequest = new TopicMetadataRequest ( topics ) ; TopicMetadataResponse topicMetadataResponse = simpleConsumer . send ( topicMetadataRequest ) ; ImmutableMap . Builder < String , Long > builder = ImmutableMap . builder ( ) ; for ( TopicMetadata metadata : topicMetadataResponse . topicsMetadata ( ) ) { for ( PartitionMetadata part : metadata . partitionsMetadata ( ) ) { LOGGER . debug ( format ( ""Adding Partition %s/%s"" , metadata . topic ( ) , part . partitionId ( ) ) ) ; Broker leader = part . leader ( ) ; if ( leader == null ) { LOGGER . warn ( format ( ""No leader for partition %s/%s found!"" , metadata . topic ( ) , part . partitionId ( ) ) ) ; } else { HostAndPort leaderHost = HostAndPort . fromParts ( leader . host ( ) , leader . port ( ) ) ; SimpleConsumer leaderConsumer = consumerManager . getConsumer ( leaderHost ) ; long offset = findAllOffsets ( leaderConsumer , metadata . topic ( ) , part . partitionId ( ) ) [ 0 ] ; builder . put ( metadata . topic ( ) , offset ) ; } } } return builder . build ( ) ; } " 779,"public void activate ( ComponentContext cc ) { super . activate ( cc ) ; properties = cc . getProperties ( ) ; if ( properties != null ) { String commandString = ( String ) properties . get ( COMMANDS_ALLOWED_PROPERTY ) ; if ( StringUtils . isNotBlank ( commandString ) ) { for ( String command : commandString . split ( ""\\s+"" ) ) allowedCommands . add ( command ) ; } } this . bundleContext = cc . getBundleContext ( ) ; } ","public void activate ( ComponentContext cc ) { super . activate ( cc ) ; properties = cc . getProperties ( ) ; if ( properties != null ) { String commandString = ( String ) properties . get ( COMMANDS_ALLOWED_PROPERTY ) ; if ( StringUtils . isNotBlank ( commandString ) ) { logger . info ( ""Execute Service permitted commands: {}"" , commandString ) ; for ( String command : commandString . split ( ""\\s+"" ) ) allowedCommands . add ( command ) ; } } this . bundleContext = cc . getBundleContext ( ) ; } " 780,"public synchronized void onLeaderElection ( ) { bulletinRepository . addBulletin ( BulletinFactory . createBulletin ( ""Cluster Coordinator"" , Severity . INFO . name ( ) , participantId + "" has been elected the Cluster Coordinator"" ) ) ; FlowController . this . heartbeatMonitor . purgeHeartbeats ( ) ; } ","public synchronized void onLeaderElection ( ) { LOG . info ( ""This node elected Active Cluster Coordinator"" ) ; bulletinRepository . addBulletin ( BulletinFactory . createBulletin ( ""Cluster Coordinator"" , Severity . INFO . name ( ) , participantId + "" has been elected the Cluster Coordinator"" ) ) ; FlowController . this . heartbeatMonitor . purgeHeartbeats ( ) ; } " 781,"public ValidationResult testGetDriveUser ( ) { ValidationResultMutable vr = new ValidationResultMutable ( Result . OK , messages . getMessage ( ""message.connectionSuccessful"" ) ) ; ExecutorService executor = Executors . newSingleThreadExecutor ( ) ; Future < String > future = executor . submit ( new Callable ( ) { public String call ( ) throws Exception { User u = getDriveService ( ) . about ( ) . get ( ) . setFields ( ""user"" ) . execute ( ) . getUser ( ) ; return u . toPrettyString ( ) ; } } ) ; try { String user = future . get ( 30 , java . util . concurrent . TimeUnit . SECONDS ) ; } catch ( ExecutionException ee ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.failure"" , ee . getMessage ( ) ) ) ; LOG . error ( ""[testGetDriveUser] Execution error: {}."" , ee . getMessage ( ) ) ; } catch ( TimeoutException | InterruptedException e ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.timeout"" ) ) ; LOG . error ( ""[testGetDriveUser] Operation Timeout."" ) ; } executor . shutdownNow ( ) ; return vr ; } ","public ValidationResult testGetDriveUser ( ) { ValidationResultMutable vr = new ValidationResultMutable ( Result . OK , messages . getMessage ( ""message.connectionSuccessful"" ) ) ; ExecutorService executor = Executors . newSingleThreadExecutor ( ) ; Future < String > future = executor . submit ( new Callable ( ) { public String call ( ) throws Exception { User u = getDriveService ( ) . about ( ) . get ( ) . setFields ( ""user"" ) . execute ( ) . getUser ( ) ; return u . toPrettyString ( ) ; } } ) ; try { String user = future . get ( 30 , java . util . concurrent . TimeUnit . SECONDS ) ; LOG . debug ( ""[testGetDriveUser] Testing User properties: {}."" , user ) ; } catch ( ExecutionException ee ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.failure"" , ee . getMessage ( ) ) ) ; LOG . error ( ""[testGetDriveUser] Execution error: {}."" , ee . getMessage ( ) ) ; } catch ( TimeoutException | InterruptedException e ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.timeout"" ) ) ; LOG . error ( ""[testGetDriveUser] Operation Timeout."" ) ; } executor . shutdownNow ( ) ; return vr ; } " 782,"public ValidationResult testGetDriveUser ( ) { ValidationResultMutable vr = new ValidationResultMutable ( Result . OK , messages . getMessage ( ""message.connectionSuccessful"" ) ) ; ExecutorService executor = Executors . newSingleThreadExecutor ( ) ; Future < String > future = executor . submit ( new Callable ( ) { public String call ( ) throws Exception { User u = getDriveService ( ) . about ( ) . get ( ) . setFields ( ""user"" ) . execute ( ) . getUser ( ) ; return u . toPrettyString ( ) ; } } ) ; try { String user = future . get ( 30 , java . util . concurrent . TimeUnit . SECONDS ) ; LOG . debug ( ""[testGetDriveUser] Testing User properties: {}."" , user ) ; } catch ( ExecutionException ee ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.failure"" , ee . getMessage ( ) ) ) ; } catch ( TimeoutException | InterruptedException e ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.timeout"" ) ) ; LOG . error ( ""[testGetDriveUser] Operation Timeout."" ) ; } executor . shutdownNow ( ) ; return vr ; } ","public ValidationResult testGetDriveUser ( ) { ValidationResultMutable vr = new ValidationResultMutable ( Result . OK , messages . getMessage ( ""message.connectionSuccessful"" ) ) ; ExecutorService executor = Executors . newSingleThreadExecutor ( ) ; Future < String > future = executor . submit ( new Callable ( ) { public String call ( ) throws Exception { User u = getDriveService ( ) . about ( ) . get ( ) . setFields ( ""user"" ) . execute ( ) . getUser ( ) ; return u . toPrettyString ( ) ; } } ) ; try { String user = future . get ( 30 , java . util . concurrent . TimeUnit . SECONDS ) ; LOG . debug ( ""[testGetDriveUser] Testing User properties: {}."" , user ) ; } catch ( ExecutionException ee ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.failure"" , ee . getMessage ( ) ) ) ; LOG . error ( ""[testGetDriveUser] Execution error: {}."" , ee . getMessage ( ) ) ; } catch ( TimeoutException | InterruptedException e ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.timeout"" ) ) ; LOG . error ( ""[testGetDriveUser] Operation Timeout."" ) ; } executor . shutdownNow ( ) ; return vr ; } " 783,"public ValidationResult testGetDriveUser ( ) { ValidationResultMutable vr = new ValidationResultMutable ( Result . OK , messages . getMessage ( ""message.connectionSuccessful"" ) ) ; ExecutorService executor = Executors . newSingleThreadExecutor ( ) ; Future < String > future = executor . submit ( new Callable ( ) { public String call ( ) throws Exception { User u = getDriveService ( ) . about ( ) . get ( ) . setFields ( ""user"" ) . execute ( ) . getUser ( ) ; return u . toPrettyString ( ) ; } } ) ; try { String user = future . get ( 30 , java . util . concurrent . TimeUnit . SECONDS ) ; LOG . debug ( ""[testGetDriveUser] Testing User properties: {}."" , user ) ; } catch ( ExecutionException ee ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.failure"" , ee . getMessage ( ) ) ) ; LOG . error ( ""[testGetDriveUser] Execution error: {}."" , ee . getMessage ( ) ) ; } catch ( TimeoutException | InterruptedException e ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.timeout"" ) ) ; } executor . shutdownNow ( ) ; return vr ; } ","public ValidationResult testGetDriveUser ( ) { ValidationResultMutable vr = new ValidationResultMutable ( Result . OK , messages . getMessage ( ""message.connectionSuccessful"" ) ) ; ExecutorService executor = Executors . newSingleThreadExecutor ( ) ; Future < String > future = executor . submit ( new Callable ( ) { public String call ( ) throws Exception { User u = getDriveService ( ) . about ( ) . get ( ) . setFields ( ""user"" ) . execute ( ) . getUser ( ) ; return u . toPrettyString ( ) ; } } ) ; try { String user = future . get ( 30 , java . util . concurrent . TimeUnit . SECONDS ) ; LOG . debug ( ""[testGetDriveUser] Testing User properties: {}."" , user ) ; } catch ( ExecutionException ee ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.failure"" , ee . getMessage ( ) ) ) ; LOG . error ( ""[testGetDriveUser] Execution error: {}."" , ee . getMessage ( ) ) ; } catch ( TimeoutException | InterruptedException e ) { vr . setStatus ( Result . ERROR ) . setMessage ( messages . getMessage ( ""error.testConnection.timeout"" ) ) ; LOG . error ( ""[testGetDriveUser] Operation Timeout."" ) ; } executor . shutdownNow ( ) ; return vr ; } " 784,"public boolean login ( String username ) { try { LoginContext context = new SecondaryLoginContext ( ) ; ( ( WaspSession ) Session . get ( ) ) . login ( context ) ; continueToOriginalDestination ( ) ; setResponsePage ( Application . get ( ) . getHomePage ( ) ) ; return true ; } catch ( LoginException e ) { } return false ; } ","public boolean login ( String username ) { try { LoginContext context = new SecondaryLoginContext ( ) ; ( ( WaspSession ) Session . get ( ) ) . login ( context ) ; continueToOriginalDestination ( ) ; setResponsePage ( Application . get ( ) . getHomePage ( ) ) ; return true ; } catch ( LoginException e ) { log . error ( e . getMessage ( ) , e ) ; } return false ; } " 785,"public void showTree ( String prefix ) { LOGGER . debug ( prefix + ""Argument 0: DocIdSet - "" ) ; _docIdSetPlanNode . showTree ( prefix + "" "" ) ; int i = 0 ; for ( String column : _dataSourcePlanNodeMap . keySet ( ) ) { LOGGER . debug ( prefix + ""Argument "" + ( i + 1 ) + "": DataSourceOperator"" ) ; _dataSourcePlanNodeMap . get ( column ) . showTree ( prefix + "" "" ) ; i ++ ; } } ","public void showTree ( String prefix ) { LOGGER . debug ( prefix + ""Operator: MProjectionOperator"" ) ; LOGGER . debug ( prefix + ""Argument 0: DocIdSet - "" ) ; _docIdSetPlanNode . showTree ( prefix + "" "" ) ; int i = 0 ; for ( String column : _dataSourcePlanNodeMap . keySet ( ) ) { LOGGER . debug ( prefix + ""Argument "" + ( i + 1 ) + "": DataSourceOperator"" ) ; _dataSourcePlanNodeMap . get ( column ) . showTree ( prefix + "" "" ) ; i ++ ; } } " 786,"public void showTree ( String prefix ) { LOGGER . debug ( prefix + ""Operator: MProjectionOperator"" ) ; _docIdSetPlanNode . showTree ( prefix + "" "" ) ; int i = 0 ; for ( String column : _dataSourcePlanNodeMap . keySet ( ) ) { LOGGER . debug ( prefix + ""Argument "" + ( i + 1 ) + "": DataSourceOperator"" ) ; _dataSourcePlanNodeMap . get ( column ) . showTree ( prefix + "" "" ) ; i ++ ; } } ","public void showTree ( String prefix ) { LOGGER . debug ( prefix + ""Operator: MProjectionOperator"" ) ; LOGGER . debug ( prefix + ""Argument 0: DocIdSet - "" ) ; _docIdSetPlanNode . showTree ( prefix + "" "" ) ; int i = 0 ; for ( String column : _dataSourcePlanNodeMap . keySet ( ) ) { LOGGER . debug ( prefix + ""Argument "" + ( i + 1 ) + "": DataSourceOperator"" ) ; _dataSourcePlanNodeMap . get ( column ) . showTree ( prefix + "" "" ) ; i ++ ; } } " 787,"public void showTree ( String prefix ) { LOGGER . debug ( prefix + ""Operator: MProjectionOperator"" ) ; LOGGER . debug ( prefix + ""Argument 0: DocIdSet - "" ) ; _docIdSetPlanNode . showTree ( prefix + "" "" ) ; int i = 0 ; for ( String column : _dataSourcePlanNodeMap . keySet ( ) ) { _dataSourcePlanNodeMap . get ( column ) . showTree ( prefix + "" "" ) ; i ++ ; } } ","public void showTree ( String prefix ) { LOGGER . debug ( prefix + ""Operator: MProjectionOperator"" ) ; LOGGER . debug ( prefix + ""Argument 0: DocIdSet - "" ) ; _docIdSetPlanNode . showTree ( prefix + "" "" ) ; int i = 0 ; for ( String column : _dataSourcePlanNodeMap . keySet ( ) ) { LOGGER . debug ( prefix + ""Argument "" + ( i + 1 ) + "": DataSourceOperator"" ) ; _dataSourcePlanNodeMap . get ( column ) . showTree ( prefix + "" "" ) ; i ++ ; } } " 788,"public void userQuitTournamentSubTables ( UUID userId ) { for ( TableController controller : getControllers ( ) ) { if ( controller . getTable ( ) != null ) { if ( controller . getTable ( ) . isTournamentSubTable ( ) ) { controller . leaveTable ( userId ) ; } } else { } } } ","public void userQuitTournamentSubTables ( UUID userId ) { for ( TableController controller : getControllers ( ) ) { if ( controller . getTable ( ) != null ) { if ( controller . getTable ( ) . isTournamentSubTable ( ) ) { controller . leaveTable ( userId ) ; } } else { logger . error ( ""TableManagerImpl.userQuitTournamentSubTables table == null - userId "" + userId ) ; } } } " 789,"@ Test public void testI01RexCompat ( ) { setup ( VehicleType . ELECTRIC_REX . toString ( ) , false ) ; String content = FileReader . readFileInString ( ""src/test/resources/api/vehicle/vehicle-ccm.json"" ) ; VehicleAttributesContainer vac = Converter . getGson ( ) . fromJson ( content , VehicleAttributesContainer . class ) ; assertTrue ( testVehicle ( Converter . transformLegacyStatus ( vac ) , STATUS_ELECTRIC + DOORS + RANGE_HYBRID + SERVICE_AVAILABLE + CHECK_AVAILABLE + POSITION , Optional . empty ( ) ) ) ; } ","@ Test public void testI01RexCompat ( ) { logger . info ( ""{}"" , Thread . currentThread ( ) . getStackTrace ( ) [ 1 ] . getMethodName ( ) ) ; setup ( VehicleType . ELECTRIC_REX . toString ( ) , false ) ; String content = FileReader . readFileInString ( ""src/test/resources/api/vehicle/vehicle-ccm.json"" ) ; VehicleAttributesContainer vac = Converter . getGson ( ) . fromJson ( content , VehicleAttributesContainer . class ) ; assertTrue ( testVehicle ( Converter . transformLegacyStatus ( vac ) , STATUS_ELECTRIC + DOORS + RANGE_HYBRID + SERVICE_AVAILABLE + CHECK_AVAILABLE + POSITION , Optional . empty ( ) ) ) ; } " 790,"public Map < String , Object > parseMap ( String field ) { Map < String , Object > metadata = null ; try { JsonNode jsonNode = MAPPER . readValue ( field , JsonNode . class ) ; metadata = MAPPER . convertValue ( jsonNode , Map . class ) ; } catch ( Exception ex ) { } return metadata ; } ","public Map < String , Object > parseMap ( String field ) { Map < String , Object > metadata = null ; try { JsonNode jsonNode = MAPPER . readValue ( field , JsonNode . class ) ; metadata = MAPPER . convertValue ( jsonNode , Map . class ) ; } catch ( Exception ex ) { LOGGER . warn ( ""failed in parseMap: "" + ex . getMessage ( ) ) ; } return metadata ; } " 791,"private void bindCustomPorts ( @ Nonnull BuiltInServer server ) { if ( myApplication . isUnitTestMode ( ) ) { return ; } for ( CustomPortServerManager customPortServerManager : CustomPortServerManager . EP_NAME . getExtensionList ( ) ) { try { new SubServer ( customPortServerManager , server ) . bind ( customPortServerManager . getPort ( ) ) ; } catch ( Throwable e ) { } } } ","private void bindCustomPorts ( @ Nonnull BuiltInServer server ) { if ( myApplication . isUnitTestMode ( ) ) { return ; } for ( CustomPortServerManager customPortServerManager : CustomPortServerManager . EP_NAME . getExtensionList ( ) ) { try { new SubServer ( customPortServerManager , server ) . bind ( customPortServerManager . getPort ( ) ) ; } catch ( Throwable e ) { LOG . error ( e ) ; } } } " 792,"public static boolean syncWorkflowState ( ServiceContext < PoxPayloadIn , PoxPayloadOut > ctx , AuthorityResource authorityResource , String sasWorkflowState , String localParentCsid , String localItemCsid , DocumentModel localItemDocModel ) throws Exception { String localItemWorkflowState = localItemDocModel . getCurrentLifeCycleState ( ) ; List < String > transitionList = AuthorityServiceUtils . getTransitionList ( sasWorkflowState , localItemWorkflowState ) ; if ( ! transitionList . isEmpty ( ) ) { try { for ( String transition : transitionList ) { authorityResource . updateItemWorkflowWithTransition ( ctx , localParentCsid , localItemCsid , transition , AuthorityServiceUtils . DONT_UPDATE_REV , AuthorityServiceUtils . DONT_ROLLBACK_ON_EXCEPTION ) ; } } catch ( DocumentReferenceException de ) { localItemDocModel . refresh ( ) ; AuthorityServiceUtils . setAuthorityItemDeprecated ( ctx , authorityResource , localParentCsid , localItemCsid , localItemDocModel ) ; } } return true ; } ","public static boolean syncWorkflowState ( ServiceContext < PoxPayloadIn , PoxPayloadOut > ctx , AuthorityResource authorityResource , String sasWorkflowState , String localParentCsid , String localItemCsid , DocumentModel localItemDocModel ) throws Exception { String localItemWorkflowState = localItemDocModel . getCurrentLifeCycleState ( ) ; List < String > transitionList = AuthorityServiceUtils . getTransitionList ( sasWorkflowState , localItemWorkflowState ) ; if ( ! transitionList . isEmpty ( ) ) { try { for ( String transition : transitionList ) { authorityResource . updateItemWorkflowWithTransition ( ctx , localParentCsid , localItemCsid , transition , AuthorityServiceUtils . DONT_UPDATE_REV , AuthorityServiceUtils . DONT_ROLLBACK_ON_EXCEPTION ) ; } } catch ( DocumentReferenceException de ) { logger . info ( String . format ( ""Failed to soft-delete %s (transition from %s to %s): item is referenced, and will be deprecated instead"" , localItemCsid , localItemWorkflowState , sasWorkflowState ) ) ; localItemDocModel . refresh ( ) ; AuthorityServiceUtils . setAuthorityItemDeprecated ( ctx , authorityResource , localParentCsid , localItemCsid , localItemDocModel ) ; } } return true ; } " 793,"public BpmWidgetInfo getBpmWidgetInfo ( int id ) throws ApsSystemException { BpmWidgetInfo bpmWidgetInfo = null ; try { bpmWidgetInfo = this . getBpmWidgetInfoDAO ( ) . loadBpmWidgetInfo ( id ) ; } catch ( Throwable t ) { throw new ApsSystemException ( ""Error loading bpmWidgetInfo with id: "" + id , t ) ; } return bpmWidgetInfo ; } ","public BpmWidgetInfo getBpmWidgetInfo ( int id ) throws ApsSystemException { BpmWidgetInfo bpmWidgetInfo = null ; try { bpmWidgetInfo = this . getBpmWidgetInfoDAO ( ) . loadBpmWidgetInfo ( id ) ; } catch ( Throwable t ) { _logger . error ( ""Error loading bpmWidgetInfo with id '{}'"" , id , t ) ; throw new ApsSystemException ( ""Error loading bpmWidgetInfo with id: "" + id , t ) ; } return bpmWidgetInfo ; } " 794,"public List < CertificateDTO > getEntitlementCertificates ( @ Verify ( Consumer . class ) String consumerUuid , String serials ) { Principal principal = ResteasyContext . getContextData ( Principal . class ) ; if ( principal instanceof ConsumerPrincipal ) { ConsumerPrincipal p = ( ConsumerPrincipal ) principal ; consumerCurator . updateLastCheckin ( p . getConsumer ( ) ) ; } Consumer consumer = consumerCurator . verifyAndLookupConsumer ( consumerUuid ) ; ConsumerType ctype = this . consumerTypeCurator . getConsumerType ( consumer ) ; revokeOnGuestMigration ( consumer ) ; poolManager . regenerateDirtyEntitlements ( consumer ) ; Set < Long > serialSet = this . extractSerials ( serials ) ; List < CertificateDTO > returnCerts = new LinkedList < > ( ) ; List < EntitlementCertificate > allCerts = entCertService . listForConsumer ( consumer ) ; for ( EntitlementCertificate cert : allCerts ) { if ( serialSet . isEmpty ( ) || serialSet . contains ( cert . getSerial ( ) . getId ( ) ) ) { returnCerts . add ( translator . translate ( cert , CertificateDTO . class ) ) ; } } try { Certificate cert = this . contentAccessManager . getCertificate ( consumer ) ; if ( cert != null ) { returnCerts . add ( translator . translate ( cert , CertificateDTO . class ) ) ; } } catch ( IOException ioe ) { throw new BadRequestException ( i18n . tr ( ""Cannot retrieve content access certificate"" ) , ioe ) ; } catch ( GeneralSecurityException gse ) { throw new BadRequestException ( i18n . tr ( ""Cannot retrieve content access certificate"" ) , gse ) ; } return returnCerts ; } ","public List < CertificateDTO > getEntitlementCertificates ( @ Verify ( Consumer . class ) String consumerUuid , String serials ) { log . debug ( ""Getting client certificates for consumer: {}"" , consumerUuid ) ; Principal principal = ResteasyContext . getContextData ( Principal . class ) ; if ( principal instanceof ConsumerPrincipal ) { ConsumerPrincipal p = ( ConsumerPrincipal ) principal ; consumerCurator . updateLastCheckin ( p . getConsumer ( ) ) ; } Consumer consumer = consumerCurator . verifyAndLookupConsumer ( consumerUuid ) ; ConsumerType ctype = this . consumerTypeCurator . getConsumerType ( consumer ) ; revokeOnGuestMigration ( consumer ) ; poolManager . regenerateDirtyEntitlements ( consumer ) ; Set < Long > serialSet = this . extractSerials ( serials ) ; List < CertificateDTO > returnCerts = new LinkedList < > ( ) ; List < EntitlementCertificate > allCerts = entCertService . listForConsumer ( consumer ) ; for ( EntitlementCertificate cert : allCerts ) { if ( serialSet . isEmpty ( ) || serialSet . contains ( cert . getSerial ( ) . getId ( ) ) ) { returnCerts . add ( translator . translate ( cert , CertificateDTO . class ) ) ; } } try { Certificate cert = this . contentAccessManager . getCertificate ( consumer ) ; if ( cert != null ) { returnCerts . add ( translator . translate ( cert , CertificateDTO . class ) ) ; } } catch ( IOException ioe ) { throw new BadRequestException ( i18n . tr ( ""Cannot retrieve content access certificate"" ) , ioe ) ; } catch ( GeneralSecurityException gse ) { throw new BadRequestException ( i18n . tr ( ""Cannot retrieve content access certificate"" ) , gse ) ; } return returnCerts ; } " 795,"public static void main ( String [ ] args ) throws IOException { Collection c = new SimpleXMLCollection ( ) ; while ( c . nextDocument ( ) ) { Document d = c . getDocument ( ) ; if ( logger . isInfoEnabled ( ) ) { } if ( logger . isInfoEnabled ( ) ) { while ( ! d . endOfDocument ( ) ) { System . out . println ( d . getNextTerm ( ) ) ; } } } c . close ( ) ; } ","public static void main ( String [ ] args ) throws IOException { Collection c = new SimpleXMLCollection ( ) ; while ( c . nextDocument ( ) ) { Document d = c . getDocument ( ) ; if ( logger . isInfoEnabled ( ) ) { logger . info ( ""DOCID: "" + d . getProperty ( ""docno"" ) ) ; } if ( logger . isInfoEnabled ( ) ) { while ( ! d . endOfDocument ( ) ) { System . out . println ( d . getNextTerm ( ) ) ; } } } c . close ( ) ; } " 796,"public void generateJson ( String prefix , PrintWriter pw , VWorkspace vWorkspace ) { JSONObject outputObject = new JSONObject ( ) ; try { outputObject . put ( JsonKeys . updateType . name ( ) , ""PublishPresetUpdate"" ) ; outputObject . put ( JsonKeys . fileUrl . name ( ) , contextParameters . getParameterValue ( ContextParameter . JSON_PUBLISH_RELATIVE_DIR ) + jsonFileName ) ; outputObject . put ( JsonKeys . worksheetId . name ( ) , wsht . getId ( ) ) ; pw . println ( outputObject . toString ( 4 ) ) ; } catch ( JSONException e ) { } } ","public void generateJson ( String prefix , PrintWriter pw , VWorkspace vWorkspace ) { JSONObject outputObject = new JSONObject ( ) ; try { outputObject . put ( JsonKeys . updateType . name ( ) , ""PublishPresetUpdate"" ) ; outputObject . put ( JsonKeys . fileUrl . name ( ) , contextParameters . getParameterValue ( ContextParameter . JSON_PUBLISH_RELATIVE_DIR ) + jsonFileName ) ; outputObject . put ( JsonKeys . worksheetId . name ( ) , wsht . getId ( ) ) ; pw . println ( outputObject . toString ( 4 ) ) ; } catch ( JSONException e ) { logger . error ( ""Error occured while generating JSON!"" ) ; } } " 797,"protected void stopIptablesImpl ( final SshMachineLocation machine ) { List < String > cmds = ImmutableList . < String > of ( ) ; Task < Integer > checkFirewall = checkLocationFirewall ( machine ) ; if ( checkFirewall . getUnchecked ( ) == 0 ) { cmds = ImmutableList . of ( IptablesCommands . firewalldServiceStop ( ) , IptablesCommands . firewalldServiceStatus ( ) ) ; } else { cmds = ImmutableList . of ( IptablesCommands . iptablesServiceStop ( ) , IptablesCommands . iptablesServiceStatus ( ) ) ; } subTaskHelperAllowingNonZeroExitCode ( ""execute stop iptables"" , machine , cmds . toArray ( new String [ cmds . size ( ) ] ) ) ; } ","protected void stopIptablesImpl ( final SshMachineLocation machine ) { log . info ( ""Stopping iptables for {} at {}"" , entity ( ) , machine ) ; List < String > cmds = ImmutableList . < String > of ( ) ; Task < Integer > checkFirewall = checkLocationFirewall ( machine ) ; if ( checkFirewall . getUnchecked ( ) == 0 ) { cmds = ImmutableList . of ( IptablesCommands . firewalldServiceStop ( ) , IptablesCommands . firewalldServiceStatus ( ) ) ; } else { cmds = ImmutableList . of ( IptablesCommands . iptablesServiceStop ( ) , IptablesCommands . iptablesServiceStatus ( ) ) ; } subTaskHelperAllowingNonZeroExitCode ( ""execute stop iptables"" , machine , cmds . toArray ( new String [ cmds . size ( ) ] ) ) ; } " 798,"public XAResource [ ] getXAResources ( ActivationSpec [ ] specs ) { return null ; } ","public XAResource [ ] getXAResources ( ActivationSpec [ ] specs ) { logger . debug ( ""Returning XAResource [null]..."" ) ; return null ; } " 799,"@ SuppressWarnings ( ""unchecked"" ) public static < T > T invokeWithDefault ( @ Nullable Method method , Object obj , T defaultValue , @ Nullable Object ... args ) { if ( method == null ) { return defaultValue ; } try { Object value = method . invoke ( obj , args ) ; if ( value == null ) { return defaultValue ; } return ( T ) value ; } catch ( Throwable t ) { return defaultValue ; } } ","@ SuppressWarnings ( ""unchecked"" ) public static < T > T invokeWithDefault ( @ Nullable Method method , Object obj , T defaultValue , @ Nullable Object ... args ) { if ( method == null ) { return defaultValue ; } try { Object value = method . invoke ( obj , args ) ; if ( value == null ) { return defaultValue ; } return ( T ) value ; } catch ( Throwable t ) { logger . warn ( ""error calling {}.{}()"" , method . getDeclaringClass ( ) . getName ( ) , method . getName ( ) , t ) ; return defaultValue ; } } " 800,"public boolean before ( Locale locale , String filename ) throws Exception { Locale . setDefault ( locale ) ; LOG . info ( ""Set default locale to: "" + locale ) ; LOG . info ( ""Messages file: "" + filename ) ; InputStream is = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; if ( is == null ) { return false ; } properties . load ( is ) ; return getExpectedNumberOfMethods ( ) == properties . size ( ) ; } ","public boolean before ( Locale locale , String filename ) throws Exception { LOG . info ( ""default locale: "" + Locale . getDefault ( ) ) ; Locale . setDefault ( locale ) ; LOG . info ( ""Set default locale to: "" + locale ) ; LOG . info ( ""Messages file: "" + filename ) ; InputStream is = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; if ( is == null ) { return false ; } properties . load ( is ) ; return getExpectedNumberOfMethods ( ) == properties . size ( ) ; } " 801,"public boolean before ( Locale locale , String filename ) throws Exception { LOG . info ( ""default locale: "" + Locale . getDefault ( ) ) ; Locale . setDefault ( locale ) ; LOG . info ( ""Messages file: "" + filename ) ; InputStream is = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; if ( is == null ) { return false ; } properties . load ( is ) ; return getExpectedNumberOfMethods ( ) == properties . size ( ) ; } ","public boolean before ( Locale locale , String filename ) throws Exception { LOG . info ( ""default locale: "" + Locale . getDefault ( ) ) ; Locale . setDefault ( locale ) ; LOG . info ( ""Set default locale to: "" + locale ) ; LOG . info ( ""Messages file: "" + filename ) ; InputStream is = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; if ( is == null ) { return false ; } properties . load ( is ) ; return getExpectedNumberOfMethods ( ) == properties . size ( ) ; } " 802,"public boolean before ( Locale locale , String filename ) throws Exception { LOG . info ( ""default locale: "" + Locale . getDefault ( ) ) ; Locale . setDefault ( locale ) ; LOG . info ( ""Set default locale to: "" + locale ) ; InputStream is = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; if ( is == null ) { return false ; } properties . load ( is ) ; return getExpectedNumberOfMethods ( ) == properties . size ( ) ; } ","public boolean before ( Locale locale , String filename ) throws Exception { LOG . info ( ""default locale: "" + Locale . getDefault ( ) ) ; Locale . setDefault ( locale ) ; LOG . info ( ""Set default locale to: "" + locale ) ; LOG . info ( ""Messages file: "" + filename ) ; InputStream is = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; if ( is == null ) { return false ; } properties . load ( is ) ; return getExpectedNumberOfMethods ( ) == properties . size ( ) ; } " 803,"@ Transactional ( rollbackFor = ArrowheadException . class ) public ChoreographerWorklog createWorklog ( final String message , final String exception ) { try { if ( Utilities . isEmpty ( message ) ) { throw new InvalidParameterException ( ""Message is null or blank."" ) ; } return choreographerWorklogRepository . saveAndFlush ( new ChoreographerWorklog ( message , exception ) ) ; } catch ( InvalidParameterException ex ) { throw ex ; } catch ( final Exception ex ) { logger . debug ( ex . getMessage ( ) , ex ) ; throw new ArrowheadException ( CoreCommonConstants . DATABASE_OPERATION_EXCEPTION_MSG ) ; } } ","@ Transactional ( rollbackFor = ArrowheadException . class ) public ChoreographerWorklog createWorklog ( final String message , final String exception ) { logger . debug ( ""createWorklog started..."" ) ; try { if ( Utilities . isEmpty ( message ) ) { throw new InvalidParameterException ( ""Message is null or blank."" ) ; } return choreographerWorklogRepository . saveAndFlush ( new ChoreographerWorklog ( message , exception ) ) ; } catch ( InvalidParameterException ex ) { throw ex ; } catch ( final Exception ex ) { logger . debug ( ex . getMessage ( ) , ex ) ; throw new ArrowheadException ( CoreCommonConstants . DATABASE_OPERATION_EXCEPTION_MSG ) ; } } " 804,"@ Transactional ( rollbackFor = ArrowheadException . class ) public ChoreographerWorklog createWorklog ( final String message , final String exception ) { logger . debug ( ""createWorklog started..."" ) ; try { if ( Utilities . isEmpty ( message ) ) { throw new InvalidParameterException ( ""Message is null or blank."" ) ; } return choreographerWorklogRepository . saveAndFlush ( new ChoreographerWorklog ( message , exception ) ) ; } catch ( InvalidParameterException ex ) { throw ex ; } catch ( final Exception ex ) { throw new ArrowheadException ( CoreCommonConstants . DATABASE_OPERATION_EXCEPTION_MSG ) ; } } ","@ Transactional ( rollbackFor = ArrowheadException . class ) public ChoreographerWorklog createWorklog ( final String message , final String exception ) { logger . debug ( ""createWorklog started..."" ) ; try { if ( Utilities . isEmpty ( message ) ) { throw new InvalidParameterException ( ""Message is null or blank."" ) ; } return choreographerWorklogRepository . saveAndFlush ( new ChoreographerWorklog ( message , exception ) ) ; } catch ( InvalidParameterException ex ) { throw ex ; } catch ( final Exception ex ) { logger . debug ( ex . getMessage ( ) , ex ) ; throw new ArrowheadException ( CoreCommonConstants . DATABASE_OPERATION_EXCEPTION_MSG ) ; } } " 805,"public static void indexStream ( Indexer index , String url ) throws IOException , GerbilException { Set < String > downloads = getDownloadsOfUrl ( url , DOWNLOAD_SUFFIX ) ; String fileName = UUID . randomUUID ( ) . toString ( ) ; SameAsCollectorStreamFile sink = new SameAsCollectorStreamFile ( fileName ) ; for ( String download : downloads ) { File current = null ; try { current = downloadUrl ( new URL ( download ) ) ; try ( InputStream fi = Files . newInputStream ( current . toPath ( ) ) ; InputStream bi = new BufferedInputStream ( fi ) ; InputStream bzip2is = new BZip2CompressorInputStream ( bi ) ) { indexStream ( index , bzip2is , sink ) ; LOGGER . info ( ""...finished"" ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { if ( current != null ) current . delete ( ) ; } } sink . close ( ) ; File sorted = new File ( sink . getFile ( ) . getName ( ) + ""_sorted"" ) ; ExternalSort . mergeSortedFiles ( ExternalSort . sortInBatch ( sink . getFile ( ) ) , sorted ) ; indexSortedFile ( index , sorted . getAbsolutePath ( ) ) ; sink . getFile ( ) . delete ( ) ; } ","public static void indexStream ( Indexer index , String url ) throws IOException , GerbilException { Set < String > downloads = getDownloadsOfUrl ( url , DOWNLOAD_SUFFIX ) ; String fileName = UUID . randomUUID ( ) . toString ( ) ; SameAsCollectorStreamFile sink = new SameAsCollectorStreamFile ( fileName ) ; for ( String download : downloads ) { File current = null ; try { LOGGER . info ( ""Searching in {} ..."" , download ) ; current = downloadUrl ( new URL ( download ) ) ; try ( InputStream fi = Files . newInputStream ( current . toPath ( ) ) ; InputStream bi = new BufferedInputStream ( fi ) ; InputStream bzip2is = new BZip2CompressorInputStream ( bi ) ) { indexStream ( index , bzip2is , sink ) ; LOGGER . info ( ""...finished"" ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { if ( current != null ) current . delete ( ) ; } } sink . close ( ) ; File sorted = new File ( sink . getFile ( ) . getName ( ) + ""_sorted"" ) ; ExternalSort . mergeSortedFiles ( ExternalSort . sortInBatch ( sink . getFile ( ) ) , sorted ) ; indexSortedFile ( index , sorted . getAbsolutePath ( ) ) ; sink . getFile ( ) . delete ( ) ; } " 806,"public static void indexStream ( Indexer index , String url ) throws IOException , GerbilException { Set < String > downloads = getDownloadsOfUrl ( url , DOWNLOAD_SUFFIX ) ; String fileName = UUID . randomUUID ( ) . toString ( ) ; SameAsCollectorStreamFile sink = new SameAsCollectorStreamFile ( fileName ) ; for ( String download : downloads ) { File current = null ; try { LOGGER . info ( ""Searching in {} ..."" , download ) ; current = downloadUrl ( new URL ( download ) ) ; try ( InputStream fi = Files . newInputStream ( current . toPath ( ) ) ; InputStream bi = new BufferedInputStream ( fi ) ; InputStream bzip2is = new BZip2CompressorInputStream ( bi ) ) { indexStream ( index , bzip2is , sink ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { if ( current != null ) current . delete ( ) ; } } sink . close ( ) ; File sorted = new File ( sink . getFile ( ) . getName ( ) + ""_sorted"" ) ; ExternalSort . mergeSortedFiles ( ExternalSort . sortInBatch ( sink . getFile ( ) ) , sorted ) ; indexSortedFile ( index , sorted . getAbsolutePath ( ) ) ; sink . getFile ( ) . delete ( ) ; } ","public static void indexStream ( Indexer index , String url ) throws IOException , GerbilException { Set < String > downloads = getDownloadsOfUrl ( url , DOWNLOAD_SUFFIX ) ; String fileName = UUID . randomUUID ( ) . toString ( ) ; SameAsCollectorStreamFile sink = new SameAsCollectorStreamFile ( fileName ) ; for ( String download : downloads ) { File current = null ; try { LOGGER . info ( ""Searching in {} ..."" , download ) ; current = downloadUrl ( new URL ( download ) ) ; try ( InputStream fi = Files . newInputStream ( current . toPath ( ) ) ; InputStream bi = new BufferedInputStream ( fi ) ; InputStream bzip2is = new BZip2CompressorInputStream ( bi ) ) { indexStream ( index , bzip2is , sink ) ; LOGGER . info ( ""...finished"" ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { if ( current != null ) current . delete ( ) ; } } sink . close ( ) ; File sorted = new File ( sink . getFile ( ) . getName ( ) + ""_sorted"" ) ; ExternalSort . mergeSortedFiles ( ExternalSort . sortInBatch ( sink . getFile ( ) ) , sorted ) ; indexSortedFile ( index , sorted . getAbsolutePath ( ) ) ; sink . getFile ( ) . delete ( ) ; } " 807,"private Iterator < IEntryPacket > getNextTieredBatch ( ) { UidQueryPacket template = ( ( TieredSpaceIteratorResult ) _iteratorResult ) . buildQueryPacket ( _spaceProxy , _batchSize , _queryResultType ) ; if ( template == null ) return null ; template . setProjectionTemplate ( _queryPacket . getProjectionTemplate ( ) ) ; try { Object [ ] entries = _spaceProxy . readMultiple ( template , _txn , template . getMultipleUIDs ( ) . length , _readModifiers ) ; if ( _logger . isDebugEnabled ( ) ) { } return ArrayIterator . wrap ( entries ) ; } catch ( RemoteException | UnusableEntryException | TransactionException e ) { processNextBatchFailure ( e ) ; } return null ; } ","private Iterator < IEntryPacket > getNextTieredBatch ( ) { UidQueryPacket template = ( ( TieredSpaceIteratorResult ) _iteratorResult ) . buildQueryPacket ( _spaceProxy , _batchSize , _queryResultType ) ; if ( template == null ) return null ; template . setProjectionTemplate ( _queryPacket . getProjectionTemplate ( ) ) ; try { Object [ ] entries = _spaceProxy . readMultiple ( template , _txn , template . getMultipleUIDs ( ) . length , _readModifiers ) ; if ( _logger . isDebugEnabled ( ) ) { _logger . debug ( ""getNextBatch returns with a buffer of "" + entries . length + "" entries."" ) ; } return ArrayIterator . wrap ( entries ) ; } catch ( RemoteException | UnusableEntryException | TransactionException e ) { processNextBatchFailure ( e ) ; } return null ; } " 808,"@ SuppressWarnings ( ""unchecked"" ) public < S extends T > S getByKey ( final KEY key , final Class < S > typeRef ) throws IllegalArgumentException { if ( key == null ) { throw new IllegalArgumentException ( ""Null key"" ) ; } final EntityUUID uuid = new EntityUUID ( this . baseURI , typeRef , key ) ; EntityInvocationHandler handler = getContext ( ) . entityContext ( ) . getEntity ( uuid ) ; if ( handler == null ) { final ClientEntity entity = getClient ( ) . getObjectFactory ( ) . newEntity ( new FullQualifiedName ( typeRef . getAnnotation ( Namespace . class ) . value ( ) , ClassUtils . getEntityTypeName ( typeRef ) ) ) ; handler = EntityInvocationHandler . getInstance ( key , entity , this . baseURI , typeRef , service ) ; } if ( isDeleted ( handler ) ) { LOG . debug ( ""Object '{}({})' has been deleted"" , typeRef . getSimpleName ( ) , uuid ) ; return null ; } else { handler . clearQueryOptions ( ) ; return ( S ) Proxy . newProxyInstance ( Thread . currentThread ( ) . getContextClassLoader ( ) , new Class < ? > [ ] { typeRef } , handler ) ; } } ","@ SuppressWarnings ( ""unchecked"" ) public < S extends T > S getByKey ( final KEY key , final Class < S > typeRef ) throws IllegalArgumentException { if ( key == null ) { throw new IllegalArgumentException ( ""Null key"" ) ; } final EntityUUID uuid = new EntityUUID ( this . baseURI , typeRef , key ) ; LOG . debug ( ""Ask for '{}({})'"" , typeRef . getSimpleName ( ) , key ) ; EntityInvocationHandler handler = getContext ( ) . entityContext ( ) . getEntity ( uuid ) ; if ( handler == null ) { final ClientEntity entity = getClient ( ) . getObjectFactory ( ) . newEntity ( new FullQualifiedName ( typeRef . getAnnotation ( Namespace . class ) . value ( ) , ClassUtils . getEntityTypeName ( typeRef ) ) ) ; handler = EntityInvocationHandler . getInstance ( key , entity , this . baseURI , typeRef , service ) ; } if ( isDeleted ( handler ) ) { LOG . debug ( ""Object '{}({})' has been deleted"" , typeRef . getSimpleName ( ) , uuid ) ; return null ; } else { handler . clearQueryOptions ( ) ; return ( S ) Proxy . newProxyInstance ( Thread . currentThread ( ) . getContextClassLoader ( ) , new Class < ? > [ ] { typeRef } , handler ) ; } } " 809,"@ SuppressWarnings ( ""unchecked"" ) public < S extends T > S getByKey ( final KEY key , final Class < S > typeRef ) throws IllegalArgumentException { if ( key == null ) { throw new IllegalArgumentException ( ""Null key"" ) ; } final EntityUUID uuid = new EntityUUID ( this . baseURI , typeRef , key ) ; LOG . debug ( ""Ask for '{}({})'"" , typeRef . getSimpleName ( ) , key ) ; EntityInvocationHandler handler = getContext ( ) . entityContext ( ) . getEntity ( uuid ) ; if ( handler == null ) { final ClientEntity entity = getClient ( ) . getObjectFactory ( ) . newEntity ( new FullQualifiedName ( typeRef . getAnnotation ( Namespace . class ) . value ( ) , ClassUtils . getEntityTypeName ( typeRef ) ) ) ; handler = EntityInvocationHandler . getInstance ( key , entity , this . baseURI , typeRef , service ) ; } if ( isDeleted ( handler ) ) { return null ; } else { handler . clearQueryOptions ( ) ; return ( S ) Proxy . newProxyInstance ( Thread . currentThread ( ) . getContextClassLoader ( ) , new Class < ? > [ ] { typeRef } , handler ) ; } } ","@ SuppressWarnings ( ""unchecked"" ) public < S extends T > S getByKey ( final KEY key , final Class < S > typeRef ) throws IllegalArgumentException { if ( key == null ) { throw new IllegalArgumentException ( ""Null key"" ) ; } final EntityUUID uuid = new EntityUUID ( this . baseURI , typeRef , key ) ; LOG . debug ( ""Ask for '{}({})'"" , typeRef . getSimpleName ( ) , key ) ; EntityInvocationHandler handler = getContext ( ) . entityContext ( ) . getEntity ( uuid ) ; if ( handler == null ) { final ClientEntity entity = getClient ( ) . getObjectFactory ( ) . newEntity ( new FullQualifiedName ( typeRef . getAnnotation ( Namespace . class ) . value ( ) , ClassUtils . getEntityTypeName ( typeRef ) ) ) ; handler = EntityInvocationHandler . getInstance ( key , entity , this . baseURI , typeRef , service ) ; } if ( isDeleted ( handler ) ) { LOG . debug ( ""Object '{}({})' has been deleted"" , typeRef . getSimpleName ( ) , uuid ) ; return null ; } else { handler . clearQueryOptions ( ) ; return ( S ) Proxy . newProxyInstance ( Thread . currentThread ( ) . getContextClassLoader ( ) , new Class < ? > [ ] { typeRef } , handler ) ; } } " 810,"public boolean activityTabIsSelected ( ) { return getDriver ( ) . findElements ( By . cssSelector ( ""#activity.is-active"" ) ) . size ( ) > 0 ; } ","public boolean activityTabIsSelected ( ) { log . info ( ""Query is Activity tab displayed"" ) ; return getDriver ( ) . findElements ( By . cssSelector ( ""#activity.is-active"" ) ) . size ( ) > 0 ; } " 811,"public boolean isValidName ( String name ) { if ( Validator . isNull ( name ) ) { return false ; } String [ ] charactersBlacklist = { } ; try { JournalServiceConfiguration journalServiceConfiguration = _configurationProvider . getCompanyConfiguration ( JournalServiceConfiguration . class , CompanyThreadLocal . getCompanyId ( ) ) ; charactersBlacklist = journalServiceConfiguration . charactersblacklist ( ) ; } catch ( Exception exception ) { } for ( String blacklistChar : charactersBlacklist ) { blacklistChar = StringEscapeUtils . unescapeJava ( blacklistChar ) ; if ( name . contains ( blacklistChar ) ) { return false ; } } return true ; } ","public boolean isValidName ( String name ) { if ( Validator . isNull ( name ) ) { return false ; } String [ ] charactersBlacklist = { } ; try { JournalServiceConfiguration journalServiceConfiguration = _configurationProvider . getCompanyConfiguration ( JournalServiceConfiguration . class , CompanyThreadLocal . getCompanyId ( ) ) ; charactersBlacklist = journalServiceConfiguration . charactersblacklist ( ) ; } catch ( Exception exception ) { _log . error ( exception , exception ) ; } for ( String blacklistChar : charactersBlacklist ) { blacklistChar = StringEscapeUtils . unescapeJava ( blacklistChar ) ; if ( name . contains ( blacklistChar ) ) { return false ; } } return true ; } " 812,"public void pauseQueue ( String queueName ) throws TimeoutException { doOperation ( ""queue."" + queueName , ""pause"" ) ; } ","public void pauseQueue ( String queueName ) throws TimeoutException { log . info ( ""Pausing queue {}"" , queueName ) ; doOperation ( ""queue."" + queueName , ""pause"" ) ; } " 813,"public void output ( LocalDocument document ) { } ","public void output ( LocalDocument document ) { logger . info ( ""Accepting document: "" + document . getID ( ) ) ; } " 814,"public static void changeCharsetToUtf ( JdbcConnection jdbcCon ) throws DatabaseException , SQLException { Statement stmt = jdbcCon . createStatement ( ) ; String dbName = jdbcCon . getCatalog ( ) ; String sql = String . format ( ""ALTER DATABASE `%s` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"" , dbName ) ; int result = stmt . executeUpdate ( sql ) ; } ","public static void changeCharsetToUtf ( JdbcConnection jdbcCon ) throws DatabaseException , SQLException { Statement stmt = jdbcCon . createStatement ( ) ; String dbName = jdbcCon . getCatalog ( ) ; String sql = String . format ( ""ALTER DATABASE `%s` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"" , dbName ) ; int result = stmt . executeUpdate ( sql ) ; LOGGER . info ( ""ALTER charset execute result: {}"" , result ) ; } " 815,"public void sendMessage ( Message message , User user ) throws MessageException { String address = user . getUserProperty ( OpenmrsConstants . USER_PROPERTY_NOTIFICATION_ADDRESS ) ; if ( address != null ) { message . addRecipient ( address ) ; } Context . getMessageService ( ) . sendMessage ( message ) ; } ","public void sendMessage ( Message message , User user ) throws MessageException { log . debug ( ""Sending message to user "" + user ) ; String address = user . getUserProperty ( OpenmrsConstants . USER_PROPERTY_NOTIFICATION_ADDRESS ) ; if ( address != null ) { message . addRecipient ( address ) ; } Context . getMessageService ( ) . sendMessage ( message ) ; } " 816,"private void setSystemProxy ( ) { try { URI serverUri = new URI ( getPreferences ( ) . getString ( PreferenceConstants . VNSERVER_URI ) ) ; IProxyService proxyService = getProxyService ( ) ; IProxyData [ ] proxyDataForHost = proxyService . select ( serverUri ) ; if ( proxyDataForHost == null || proxyDataForHost . length == 0 ) { clearSystemProxy ( ) ; } else { setSystemProxy ( proxyDataForHost ) ; } } catch ( Exception t ) { } } ","private void setSystemProxy ( ) { try { URI serverUri = new URI ( getPreferences ( ) . getString ( PreferenceConstants . VNSERVER_URI ) ) ; IProxyService proxyService = getProxyService ( ) ; IProxyData [ ] proxyDataForHost = proxyService . select ( serverUri ) ; if ( proxyDataForHost == null || proxyDataForHost . length == 0 ) { clearSystemProxy ( ) ; } else { setSystemProxy ( proxyDataForHost ) ; } } catch ( Exception t ) { LOG . error ( ""Error while setting proxy."" , t ) ; } } " 817,"public static int getShippingCommerceAddressesCount ( long companyId , String className , long classPK , String keywords ) throws RemoteException { try { int returnValue = CommerceAddressServiceUtil . getShippingCommerceAddressesCount ( companyId , className , classPK , keywords ) ; return returnValue ; } catch ( Exception exception ) { throw new RemoteException ( exception . getMessage ( ) ) ; } } ","public static int getShippingCommerceAddressesCount ( long companyId , String className , long classPK , String keywords ) throws RemoteException { try { int returnValue = CommerceAddressServiceUtil . getShippingCommerceAddressesCount ( companyId , className , classPK , keywords ) ; return returnValue ; } catch ( Exception exception ) { _log . error ( exception , exception ) ; throw new RemoteException ( exception . getMessage ( ) ) ; } } " 818,"public void close ( ) { if ( ! transaction . isOpen ( ) ) { } else if ( ownTransaction ) { if ( isSuccess . isPresent ( ) ) { if ( isSuccess . get ( ) ) { transaction . commit ( ) ; } else { transaction . rollback ( ) ; } } else { transaction . rollback ( ) ; if ( requireCommit ) { LOG . error ( ""Transaction was not closed, rolling back. Please add an explicit rollback so that we know this "" + ""was not a missing success()"" ) ; } } } } ","public void close ( ) { if ( ! transaction . isOpen ( ) ) { LOG . error ( ""Transaction was already closed!"" , new Throwable ( ) ) ; } else if ( ownTransaction ) { if ( isSuccess . isPresent ( ) ) { if ( isSuccess . get ( ) ) { transaction . commit ( ) ; } else { transaction . rollback ( ) ; } } else { transaction . rollback ( ) ; if ( requireCommit ) { LOG . error ( ""Transaction was not closed, rolling back. Please add an explicit rollback so that we know this "" + ""was not a missing success()"" ) ; } } } } " 819,"public void close ( ) { if ( ! transaction . isOpen ( ) ) { LOG . error ( ""Transaction was already closed!"" , new Throwable ( ) ) ; } else if ( ownTransaction ) { if ( isSuccess . isPresent ( ) ) { if ( isSuccess . get ( ) ) { transaction . commit ( ) ; } else { transaction . rollback ( ) ; } } else { transaction . rollback ( ) ; if ( requireCommit ) { } } } } ","public void close ( ) { if ( ! transaction . isOpen ( ) ) { LOG . error ( ""Transaction was already closed!"" , new Throwable ( ) ) ; } else if ( ownTransaction ) { if ( isSuccess . isPresent ( ) ) { if ( isSuccess . get ( ) ) { transaction . commit ( ) ; } else { transaction . rollback ( ) ; } } else { transaction . rollback ( ) ; if ( requireCommit ) { LOG . error ( ""Transaction was not closed, rolling back. Please add an explicit rollback so that we know this "" + ""was not a missing success()"" ) ; } } } } " 820,"protected ValidationResult validatePropertyNames ( final SchemaElementDefinition elementDef ) { final ValidationResult result = new ValidationResult ( ) ; for ( final String property : elementDef . getProperties ( ) ) { if ( ReservedPropertyNames . contains ( property ) ) { } } return result ; } ","protected ValidationResult validatePropertyNames ( final SchemaElementDefinition elementDef ) { final ValidationResult result = new ValidationResult ( ) ; for ( final String property : elementDef . getProperties ( ) ) { if ( ReservedPropertyNames . contains ( property ) ) { LOGGER . warn ( ""Element definition contains a reserved property name {}. "" + ""This may prevent some analytics from being used on this graph."" , property ) ; } } return result ; } " 821,"public void create ( String testName ) throws Exception { setupCreate ( ) ; AccountValue av = accValues . get ( ""acc-role-user1"" ) ; AccountRole accRole = createAccountRoleInstance ( av , roleValues . values ( ) , true , true ) ; AccountRoleClient client = new AccountRoleClient ( ) ; Response res = client . create ( av . getAccountId ( ) , accRole ) ; try { assertStatusCode ( res , testName ) ; knownResourceId = av . getAccountId ( ) ; if ( logger . isDebugEnabled ( ) ) { } } finally { if ( res != null ) { res . close ( ) ; } } } ","public void create ( String testName ) throws Exception { setupCreate ( ) ; AccountValue av = accValues . get ( ""acc-role-user1"" ) ; AccountRole accRole = createAccountRoleInstance ( av , roleValues . values ( ) , true , true ) ; AccountRoleClient client = new AccountRoleClient ( ) ; Response res = client . create ( av . getAccountId ( ) , accRole ) ; try { assertStatusCode ( res , testName ) ; knownResourceId = av . getAccountId ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( testName + "": Created an AccountRole instance for account with knownResourceId="" + knownResourceId ) ; } } finally { if ( res != null ) { res . close ( ) ; } } } " 822,"@ RequestMapping ( value = { ControllerConstants . Paths . ADMIN_INDEX , ControllerConstants . Paths . ADMIN_ROOT } , method = RequestMethod . GET ) public ModelAndView get ( ) { boolean warn = false ; Object principal = SecurityContextHolder . getContext ( ) . getAuthentication ( ) . getPrincipal ( ) ; if ( principal instanceof AdministratorUserPrinciple ) { AdministratorUserPrinciple administratorUserPrinciple = ( AdministratorUserPrinciple ) principal ; if ( administratorUserPrinciple . isDefaultAdmin ( ) ) { warn = true ; } } Map < String , String > metadata = new HashMap < > ( MetaDataHandler . Metadata . values ( ) . length ) ; try { for ( MetaDataHandler . Metadata m : MetaDataHandler . Metadata . values ( ) ) { metadata . put ( m . name ( ) , getMetaDataHandler ( ) . get ( m ) ) ; } } catch ( ConfigurationError ex ) { } Map < String , Object > model = new HashMap < > ( 2 ) ; model . put ( ""metadata"" , metadata ) ; model . put ( ""warning"" , warn ) ; return new ModelAndView ( ControllerConstants . Views . ADMIN_INDEX , model ) ; } ","@ RequestMapping ( value = { ControllerConstants . Paths . ADMIN_INDEX , ControllerConstants . Paths . ADMIN_ROOT } , method = RequestMethod . GET ) public ModelAndView get ( ) { boolean warn = false ; Object principal = SecurityContextHolder . getContext ( ) . getAuthentication ( ) . getPrincipal ( ) ; if ( principal instanceof AdministratorUserPrinciple ) { AdministratorUserPrinciple administratorUserPrinciple = ( AdministratorUserPrinciple ) principal ; if ( administratorUserPrinciple . isDefaultAdmin ( ) ) { warn = true ; } } Map < String , String > metadata = new HashMap < > ( MetaDataHandler . Metadata . values ( ) . length ) ; try { for ( MetaDataHandler . Metadata m : MetaDataHandler . Metadata . values ( ) ) { metadata . put ( m . name ( ) , getMetaDataHandler ( ) . get ( m ) ) ; } } catch ( ConfigurationError ex ) { LOG . error ( ""Error reading metadata properties"" , ex ) ; } Map < String , Object > model = new HashMap < > ( 2 ) ; model . put ( ""metadata"" , metadata ) ; model . put ( ""warning"" , warn ) ; return new ModelAndView ( ControllerConstants . Views . ADMIN_INDEX , model ) ; } " 823,"private void disposeEncoder ( IoSession session ) { ProtocolEncoder encoder = ( ProtocolEncoder ) session . removeAttribute ( ENCODER ) ; if ( encoder == null ) { return ; } try { encoder . dispose ( session ) ; } catch ( Throwable t ) { } } ","private void disposeEncoder ( IoSession session ) { ProtocolEncoder encoder = ( ProtocolEncoder ) session . removeAttribute ( ENCODER ) ; if ( encoder == null ) { return ; } try { encoder . dispose ( session ) ; } catch ( Throwable t ) { LOGGER . warn ( ""Failed to dispose: "" + encoder . getClass ( ) . getName ( ) + "" ("" + encoder + ')' ) ; } } " 824,"public List < ActivityFrequencyScheduleBean > getQuestionnaireFrequencyDetailsForOneTime ( QuestionnairesDto questionaire , List < ActivityFrequencyScheduleBean > runDetailsBean ) throws DAOException { LOGGER . entry ( ""begin getQuestionnaireFrequencyDetailsForOneTime()"" ) ; try { if ( questionaire != null ) { ActivityFrequencyScheduleBean oneTimeBean = new ActivityFrequencyScheduleBean ( ) ; oneTimeBean . setStartTime ( StudyMetaDataUtil . getFormattedDateTimeZone ( questionaire . getStudyLifetimeStart ( ) , StudyMetaDataConstants . SDF_DATE_PATTERN , StudyMetaDataConstants . SDF_DATE_TIME_TIMEZONE_MILLISECONDS_PATTERN ) ) ; oneTimeBean . setEndTime ( StudyMetaDataUtil . getFormattedDateTimeZone ( questionaire . getStudyLifetimeEnd ( ) , StudyMetaDataConstants . SDF_DATE_PATTERN , StudyMetaDataConstants . SDF_DATE_TIME_TIMEZONE_MILLISECONDS_PATTERN ) ) ; runDetailsBean . add ( oneTimeBean ) ; } } catch ( Exception e ) { } LOGGER . exit ( ""getQuestionnaireFrequencyDetailsForOneTime() :: Ends"" ) ; return runDetailsBean ; } ","public List < ActivityFrequencyScheduleBean > getQuestionnaireFrequencyDetailsForOneTime ( QuestionnairesDto questionaire , List < ActivityFrequencyScheduleBean > runDetailsBean ) throws DAOException { LOGGER . entry ( ""begin getQuestionnaireFrequencyDetailsForOneTime()"" ) ; try { if ( questionaire != null ) { ActivityFrequencyScheduleBean oneTimeBean = new ActivityFrequencyScheduleBean ( ) ; oneTimeBean . setStartTime ( StudyMetaDataUtil . getFormattedDateTimeZone ( questionaire . getStudyLifetimeStart ( ) , StudyMetaDataConstants . SDF_DATE_PATTERN , StudyMetaDataConstants . SDF_DATE_TIME_TIMEZONE_MILLISECONDS_PATTERN ) ) ; oneTimeBean . setEndTime ( StudyMetaDataUtil . getFormattedDateTimeZone ( questionaire . getStudyLifetimeEnd ( ) , StudyMetaDataConstants . SDF_DATE_PATTERN , StudyMetaDataConstants . SDF_DATE_TIME_TIMEZONE_MILLISECONDS_PATTERN ) ) ; runDetailsBean . add ( oneTimeBean ) ; } } catch ( Exception e ) { LOGGER . error ( ""ActivityMetaDataDao - getQuestionnaireFrequencyDetailsForOneTime() :: ERROR"" , e ) ; } LOGGER . exit ( ""getQuestionnaireFrequencyDetailsForOneTime() :: Ends"" ) ; return runDetailsBean ; } " 825,"@ Test public void testTraceWithNArguments ( ) { buf . setLength ( 0 ) ; final VitamUILogger logger = VitamUILoggerFactory . getInstance ( VitamUITraceLoggerTest . class ) ; final String message = ""message"" ; final String format = message + "" {} {} {}"" ; final Integer object1 = 1 ; final Integer object2 = 2 ; final Integer object3 = 3 ; assertTrue ( ""Log message should be written."" , buf . length ( ) > 0 ) ; assertTrue ( ""Log message should be written."" , buf . lastIndexOf ( message ) > 0 ) ; assertTrue ( ""Log message should be written."" , buf . lastIndexOf ( message + "" "" + object1 . toString ( ) + "" "" + object2 . toString ( ) + "" "" + object3 . toString ( ) ) > 0 ) ; } ","@ Test public void testTraceWithNArguments ( ) { buf . setLength ( 0 ) ; final VitamUILogger logger = VitamUILoggerFactory . getInstance ( VitamUITraceLoggerTest . class ) ; final String message = ""message"" ; final String format = message + "" {} {} {}"" ; final Integer object1 = 1 ; final Integer object2 = 2 ; final Integer object3 = 3 ; logger . trace ( format , object1 , object2 , object3 ) ; assertTrue ( ""Log message should be written."" , buf . length ( ) > 0 ) ; assertTrue ( ""Log message should be written."" , buf . lastIndexOf ( message ) > 0 ) ; assertTrue ( ""Log message should be written."" , buf . lastIndexOf ( message + "" "" + object1 . toString ( ) + "" "" + object2 . toString ( ) + "" "" + object3 . toString ( ) ) > 0 ) ; } " 826,"public void channelConnected ( ChannelHandlerContext ctx , ChannelStateEvent e ) throws Exception { } ","public void channelConnected ( ChannelHandlerContext ctx , ChannelStateEvent e ) throws Exception { LOG . debug ( ""Channel connected {}"" , e ) ; } " 827,"public void execute ( Template . Fragment frag , Writer out ) throws IOException { String curVal = frag . execute ( ) ; if ( curVal != null && ! curVal . equals ( lastVal ) ) { out . write ( curVal ) ; lastVal = curVal ; } } ","public void execute ( Template . Fragment frag , Writer out ) throws IOException { String curVal = frag . execute ( ) ; LOGGER . debug ( ""[lastVal={}, curVal={}]"" , lastVal , curVal ) ; if ( curVal != null && ! curVal . equals ( lastVal ) ) { out . write ( curVal ) ; lastVal = curVal ; } } " 828,"public void cut ( ) { try { ( ( XulWindow ) this . getXulDomContainer ( ) . getDocumentRoot ( ) . getRootElement ( ) ) . cut ( ) ; paste . setDisabled ( false ) ; } catch ( XulException e ) { } } ","public void cut ( ) { try { ( ( XulWindow ) this . getXulDomContainer ( ) . getDocumentRoot ( ) . getRootElement ( ) ) . cut ( ) ; paste . setDisabled ( false ) ; } catch ( XulException e ) { logger . error ( e . getMessage ( ) , e ) ; } } " 829,"public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.config.bucketName"" ) ; if ( bucketName != null ) { _log . info ( ""servlet context provided config bucketName="" + bucketName ) ; setBucketName ( bucketName ) ; } else { _log . info ( ""servlet context missing bucketName, using "" + getBucketName ( ) ) ; } } } ","public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; _log . info ( ""servlet context provided s3.user="" + user ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.config.bucketName"" ) ; if ( bucketName != null ) { _log . info ( ""servlet context provided config bucketName="" + bucketName ) ; setBucketName ( bucketName ) ; } else { _log . info ( ""servlet context missing bucketName, using "" + getBucketName ( ) ) ; } } } " 830,"public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; _log . info ( ""servlet context provided s3.user="" + user ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.config.bucketName"" ) ; if ( bucketName != null ) { setBucketName ( bucketName ) ; } else { _log . info ( ""servlet context missing bucketName, using "" + getBucketName ( ) ) ; } } } ","public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; _log . info ( ""servlet context provided s3.user="" + user ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.config.bucketName"" ) ; if ( bucketName != null ) { _log . info ( ""servlet context provided config bucketName="" + bucketName ) ; setBucketName ( bucketName ) ; } else { _log . info ( ""servlet context missing bucketName, using "" + getBucketName ( ) ) ; } } } " 831,"public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; _log . info ( ""servlet context provided s3.user="" + user ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.config.bucketName"" ) ; if ( bucketName != null ) { _log . info ( ""servlet context provided config bucketName="" + bucketName ) ; setBucketName ( bucketName ) ; } else { } } } ","public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; _log . info ( ""servlet context provided s3.user="" + user ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.config.bucketName"" ) ; if ( bucketName != null ) { _log . info ( ""servlet context provided config bucketName="" + bucketName ) ; setBucketName ( bucketName ) ; } else { _log . info ( ""servlet context missing bucketName, using "" + getBucketName ( ) ) ; } } } " 832,"private static synchronized void overrideInstance ( ApplicationWarnings springInstance ) { if ( instance != null ) { List < String > warnings = instance . getWarnings ( ) ; springInstance . addWarnings ( warnings ) ; if ( ! warnings . isEmpty ( ) ) { } } instance = springInstance ; } ","private static synchronized void overrideInstance ( ApplicationWarnings springInstance ) { if ( instance != null ) { List < String > warnings = instance . getWarnings ( ) ; springInstance . addWarnings ( warnings ) ; if ( ! warnings . isEmpty ( ) ) { LOG . debug ( ""appending ["" + warnings . size ( ) + ""] warning(s)"" ) ; } } instance = springInstance ; } " 833,"public List < String > searchGroups ( FieldSearchFilter [ ] filters ) { List < String > groupsNames = null ; try { groupsNames = super . searchId ( filters ) ; } catch ( Throwable t ) { throw new RuntimeException ( ""error in search groups"" , t ) ; } return groupsNames ; } ","public List < String > searchGroups ( FieldSearchFilter [ ] filters ) { List < String > groupsNames = null ; try { groupsNames = super . searchId ( filters ) ; } catch ( Throwable t ) { logger . error ( ""error in search groups"" , t ) ; throw new RuntimeException ( ""error in search groups"" , t ) ; } return groupsNames ; } " 834,"void authenticationError ( ChannelHandlerContext ctx , int errorCode ) { ctx . fireExceptionCaught ( new AuthenticationException ( ""Auth failed with error "" + errorCode ) ) ; } ","void authenticationError ( ChannelHandlerContext ctx , int errorCode ) { LOG . error ( ""Error processing auth message, erroring connection {}"" , errorCode ) ; ctx . fireExceptionCaught ( new AuthenticationException ( ""Auth failed with error "" + errorCode ) ) ; } " 835,"@ VisibleForTesting protected void timeoutPendingSlotRequest ( SlotRequestId slotRequestId ) { final PendingRequest pendingRequest = removePendingRequest ( slotRequestId ) ; if ( pendingRequest != null ) { pendingRequest . getAllocatedSlotFuture ( ) . completeExceptionally ( new TimeoutException ( ""Pending slot request timed out in SlotPool."" ) ) ; } } ","@ VisibleForTesting protected void timeoutPendingSlotRequest ( SlotRequestId slotRequestId ) { log . info ( ""Pending slot request [{}] timed out."" , slotRequestId ) ; final PendingRequest pendingRequest = removePendingRequest ( slotRequestId ) ; if ( pendingRequest != null ) { pendingRequest . getAllocatedSlotFuture ( ) . completeExceptionally ( new TimeoutException ( ""Pending slot request timed out in SlotPool."" ) ) ; } } " 836,"public static void process ( ServiceMeshMetric . Builder data ) { try ( HistogramMetrics . Timer ignored = MESH_ANALYSIS_METRICS . createTimer ( ) ) { if ( data . getSourceServiceName ( ) != null ) { data . setSourceServiceName ( NAME_LENGTH_CONTROL . formatServiceName ( data . getSourceServiceName ( ) ) ) ; } if ( data . getSourceServiceInstance ( ) != null ) { data . setSourceServiceInstance ( NAME_LENGTH_CONTROL . formatInstanceName ( data . getSourceServiceInstance ( ) ) ) ; } if ( data . getDestServiceName ( ) != null ) { data . setDestServiceName ( NAME_LENGTH_CONTROL . formatServiceName ( data . getDestServiceName ( ) ) ) ; } if ( data . getDestServiceInstance ( ) != null ) { data . setDestServiceInstance ( NAME_LENGTH_CONTROL . formatInstanceName ( data . getDestServiceInstance ( ) ) ) ; } if ( data . getEndpoint ( ) != null ) { data . setEndpoint ( NAME_LENGTH_CONTROL . formatEndpointName ( data . getDestServiceName ( ) , data . getEndpoint ( ) ) ) ; } if ( data . getInternalErrorCode ( ) == null ) { data . setInternalErrorCode ( Const . EMPTY_STRING ) ; } doDispatch ( data ) ; } catch ( Exception e ) { MESH_ERROR_METRICS . inc ( ) ; } } ","public static void process ( ServiceMeshMetric . Builder data ) { try ( HistogramMetrics . Timer ignored = MESH_ANALYSIS_METRICS . createTimer ( ) ) { if ( data . getSourceServiceName ( ) != null ) { data . setSourceServiceName ( NAME_LENGTH_CONTROL . formatServiceName ( data . getSourceServiceName ( ) ) ) ; } if ( data . getSourceServiceInstance ( ) != null ) { data . setSourceServiceInstance ( NAME_LENGTH_CONTROL . formatInstanceName ( data . getSourceServiceInstance ( ) ) ) ; } if ( data . getDestServiceName ( ) != null ) { data . setDestServiceName ( NAME_LENGTH_CONTROL . formatServiceName ( data . getDestServiceName ( ) ) ) ; } if ( data . getDestServiceInstance ( ) != null ) { data . setDestServiceInstance ( NAME_LENGTH_CONTROL . formatInstanceName ( data . getDestServiceInstance ( ) ) ) ; } if ( data . getEndpoint ( ) != null ) { data . setEndpoint ( NAME_LENGTH_CONTROL . formatEndpointName ( data . getDestServiceName ( ) , data . getEndpoint ( ) ) ) ; } if ( data . getInternalErrorCode ( ) == null ) { data . setInternalErrorCode ( Const . EMPTY_STRING ) ; } doDispatch ( data ) ; } catch ( Exception e ) { MESH_ERROR_METRICS . inc ( ) ; log . error ( e . getMessage ( ) , e ) ; } } " 837,"private void executeProcesses ( ) { ThreadContext . put ( ""module"" , ""orchestra"" ) ; try { Assertion . check ( ) . isNotNull ( nodId , ""Node not already registered"" ) ; executeToDo ( ) ; nodeManager . updateHeartbeat ( nodId ) ; handleDeadNodeProcesses ( ) ; } catch ( final Throwable t ) { if ( t instanceof InterruptedException ) { throw t ; } } finally { ThreadContext . remove ( ""module"" ) ; } } ","private void executeProcesses ( ) { ThreadContext . put ( ""module"" , ""orchestra"" ) ; try { Assertion . check ( ) . isNotNull ( nodId , ""Node not already registered"" ) ; executeToDo ( ) ; nodeManager . updateHeartbeat ( nodId ) ; handleDeadNodeProcesses ( ) ; } catch ( final Throwable t ) { LOGGER . error ( ""Exception launching activities to executes"" , t ) ; if ( t instanceof InterruptedException ) { throw t ; } } finally { ThreadContext . remove ( ""module"" ) ; } } " 838,"public static String getCalendarBookingsRSS ( HttpPrincipal httpPrincipal , long calendarId , long startTime , long endTime , int max , String type , double version , String displayStyle , com . liferay . portal . kernel . theme . ThemeDisplay themeDisplay ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( CalendarBookingServiceUtil . class , ""getCalendarBookingsRSS"" , _getCalendarBookingsRSSParameterTypes14 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , calendarId , startTime , endTime , max , type , version , displayStyle , themeDisplay ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( String ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { throw systemException ; } } ","public static String getCalendarBookingsRSS ( HttpPrincipal httpPrincipal , long calendarId , long startTime , long endTime , int max , String type , double version , String displayStyle , com . liferay . portal . kernel . theme . ThemeDisplay themeDisplay ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( CalendarBookingServiceUtil . class , ""getCalendarBookingsRSS"" , _getCalendarBookingsRSSParameterTypes14 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , calendarId , startTime , endTime , max , type , version , displayStyle , themeDisplay ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( String ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { _log . error ( systemException , systemException ) ; throw systemException ; } } " 839,"public void setup ( SourceResolver resolver , Map objectmodel , String src , Parameters parameters ) throws ProcessingException , SAXException , IOException { this . resolver = resolver ; setFailSafe ( parameters . getParameterAsBoolean ( ""failsafe"" , false ) ) ; Store store = null ; try { this . grammar = src ; this . grammarSource = resolver . resolveURI ( this . grammar ) ; store = ( Store ) this . manager . lookup ( Store . TRANSIENT_STORE ) ; ParserAutomatonEntry entry = ( ParserAutomatonEntry ) store . get ( this . grammarSource . getURI ( ) ) ; if ( ( entry == null ) || ( entry . getValidity ( ) == null ) || ( ( entry . getValidity ( ) . isValid ( this . grammarSource . getValidity ( ) ) ) <= 0 ) ) { if ( this . grammarSource . getInputStream ( ) == null ) throw new ProcessingException ( ""Source '"" + this . grammarSource . getURI ( ) + ""' not found"" ) ; GrammarFactory factory = new GrammarFactory ( ) ; SourceUtil . toSAX ( this . manager , this . grammarSource , null , factory ) ; Grammar grammar = factory . getGrammar ( ) ; if ( grammar == null ) throw new ProcessingException ( ""Error while reading the grammar from "" + src ) ; ParserAutomatonBuilder builder = new ParserAutomatonBuilder ( grammar ) ; ParserAutomaton automaton = builder . getParserAutomaton ( ) ; setParserAutomaton ( builder . getParserAutomaton ( ) ) ; this . logger . info ( ""Store automaton into store for '"" + this . grammarSource . getURI ( ) + ""'"" ) ; store . store ( this . grammarSource . getURI ( ) , new ParserAutomatonEntry ( automaton , this . grammarSource . getValidity ( ) ) ) ; } else { this . logger . info ( ""Getting automaton from store for '"" + this . grammarSource . getURI ( ) + ""'"" ) ; setParserAutomaton ( entry . getParserAutomaton ( ) ) ; } } catch ( SourceException se ) { throw new ProcessingException ( ""Error during resolving of '"" + src + ""'."" , se ) ; } catch ( ServiceException se ) { throw new ProcessingException ( ""Could not lookup for service"" , se ) ; } finally { if ( store != null ) this . manager . release ( store ) ; } } ","public void setup ( SourceResolver resolver , Map objectmodel , String src , Parameters parameters ) throws ProcessingException , SAXException , IOException { this . resolver = resolver ; setFailSafe ( parameters . getParameterAsBoolean ( ""failsafe"" , false ) ) ; Store store = null ; try { this . grammar = src ; this . grammarSource = resolver . resolveURI ( this . grammar ) ; store = ( Store ) this . manager . lookup ( Store . TRANSIENT_STORE ) ; ParserAutomatonEntry entry = ( ParserAutomatonEntry ) store . get ( this . grammarSource . getURI ( ) ) ; if ( ( entry == null ) || ( entry . getValidity ( ) == null ) || ( ( entry . getValidity ( ) . isValid ( this . grammarSource . getValidity ( ) ) ) <= 0 ) ) { this . logger . info ( ""(Re)building the automaton from '"" + this . grammarSource . getURI ( ) + ""'"" ) ; if ( this . grammarSource . getInputStream ( ) == null ) throw new ProcessingException ( ""Source '"" + this . grammarSource . getURI ( ) + ""' not found"" ) ; GrammarFactory factory = new GrammarFactory ( ) ; SourceUtil . toSAX ( this . manager , this . grammarSource , null , factory ) ; Grammar grammar = factory . getGrammar ( ) ; if ( grammar == null ) throw new ProcessingException ( ""Error while reading the grammar from "" + src ) ; ParserAutomatonBuilder builder = new ParserAutomatonBuilder ( grammar ) ; ParserAutomaton automaton = builder . getParserAutomaton ( ) ; setParserAutomaton ( builder . getParserAutomaton ( ) ) ; this . logger . info ( ""Store automaton into store for '"" + this . grammarSource . getURI ( ) + ""'"" ) ; store . store ( this . grammarSource . getURI ( ) , new ParserAutomatonEntry ( automaton , this . grammarSource . getValidity ( ) ) ) ; } else { this . logger . info ( ""Getting automaton from store for '"" + this . grammarSource . getURI ( ) + ""'"" ) ; setParserAutomaton ( entry . getParserAutomaton ( ) ) ; } } catch ( SourceException se ) { throw new ProcessingException ( ""Error during resolving of '"" + src + ""'."" , se ) ; } catch ( ServiceException se ) { throw new ProcessingException ( ""Could not lookup for service"" , se ) ; } finally { if ( store != null ) this . manager . release ( store ) ; } } " 840,"public void setup ( SourceResolver resolver , Map objectmodel , String src , Parameters parameters ) throws ProcessingException , SAXException , IOException { this . resolver = resolver ; setFailSafe ( parameters . getParameterAsBoolean ( ""failsafe"" , false ) ) ; Store store = null ; try { this . grammar = src ; this . grammarSource = resolver . resolveURI ( this . grammar ) ; store = ( Store ) this . manager . lookup ( Store . TRANSIENT_STORE ) ; ParserAutomatonEntry entry = ( ParserAutomatonEntry ) store . get ( this . grammarSource . getURI ( ) ) ; if ( ( entry == null ) || ( entry . getValidity ( ) == null ) || ( ( entry . getValidity ( ) . isValid ( this . grammarSource . getValidity ( ) ) ) <= 0 ) ) { this . logger . info ( ""(Re)building the automaton from '"" + this . grammarSource . getURI ( ) + ""'"" ) ; if ( this . grammarSource . getInputStream ( ) == null ) throw new ProcessingException ( ""Source '"" + this . grammarSource . getURI ( ) + ""' not found"" ) ; GrammarFactory factory = new GrammarFactory ( ) ; SourceUtil . toSAX ( this . manager , this . grammarSource , null , factory ) ; Grammar grammar = factory . getGrammar ( ) ; if ( grammar == null ) throw new ProcessingException ( ""Error while reading the grammar from "" + src ) ; ParserAutomatonBuilder builder = new ParserAutomatonBuilder ( grammar ) ; ParserAutomaton automaton = builder . getParserAutomaton ( ) ; setParserAutomaton ( builder . getParserAutomaton ( ) ) ; store . store ( this . grammarSource . getURI ( ) , new ParserAutomatonEntry ( automaton , this . grammarSource . getValidity ( ) ) ) ; } else { this . logger . info ( ""Getting automaton from store for '"" + this . grammarSource . getURI ( ) + ""'"" ) ; setParserAutomaton ( entry . getParserAutomaton ( ) ) ; } } catch ( SourceException se ) { throw new ProcessingException ( ""Error during resolving of '"" + src + ""'."" , se ) ; } catch ( ServiceException se ) { throw new ProcessingException ( ""Could not lookup for service"" , se ) ; } finally { if ( store != null ) this . manager . release ( store ) ; } } ","public void setup ( SourceResolver resolver , Map objectmodel , String src , Parameters parameters ) throws ProcessingException , SAXException , IOException { this . resolver = resolver ; setFailSafe ( parameters . getParameterAsBoolean ( ""failsafe"" , false ) ) ; Store store = null ; try { this . grammar = src ; this . grammarSource = resolver . resolveURI ( this . grammar ) ; store = ( Store ) this . manager . lookup ( Store . TRANSIENT_STORE ) ; ParserAutomatonEntry entry = ( ParserAutomatonEntry ) store . get ( this . grammarSource . getURI ( ) ) ; if ( ( entry == null ) || ( entry . getValidity ( ) == null ) || ( ( entry . getValidity ( ) . isValid ( this . grammarSource . getValidity ( ) ) ) <= 0 ) ) { this . logger . info ( ""(Re)building the automaton from '"" + this . grammarSource . getURI ( ) + ""'"" ) ; if ( this . grammarSource . getInputStream ( ) == null ) throw new ProcessingException ( ""Source '"" + this . grammarSource . getURI ( ) + ""' not found"" ) ; GrammarFactory factory = new GrammarFactory ( ) ; SourceUtil . toSAX ( this . manager , this . grammarSource , null , factory ) ; Grammar grammar = factory . getGrammar ( ) ; if ( grammar == null ) throw new ProcessingException ( ""Error while reading the grammar from "" + src ) ; ParserAutomatonBuilder builder = new ParserAutomatonBuilder ( grammar ) ; ParserAutomaton automaton = builder . getParserAutomaton ( ) ; setParserAutomaton ( builder . getParserAutomaton ( ) ) ; this . logger . info ( ""Store automaton into store for '"" + this . grammarSource . getURI ( ) + ""'"" ) ; store . store ( this . grammarSource . getURI ( ) , new ParserAutomatonEntry ( automaton , this . grammarSource . getValidity ( ) ) ) ; } else { this . logger . info ( ""Getting automaton from store for '"" + this . grammarSource . getURI ( ) + ""'"" ) ; setParserAutomaton ( entry . getParserAutomaton ( ) ) ; } } catch ( SourceException se ) { throw new ProcessingException ( ""Error during resolving of '"" + src + ""'."" , se ) ; } catch ( ServiceException se ) { throw new ProcessingException ( ""Could not lookup for service"" , se ) ; } finally { if ( store != null ) this . manager . release ( store ) ; } } " 841,"public void setup ( SourceResolver resolver , Map objectmodel , String src , Parameters parameters ) throws ProcessingException , SAXException , IOException { this . resolver = resolver ; setFailSafe ( parameters . getParameterAsBoolean ( ""failsafe"" , false ) ) ; Store store = null ; try { this . grammar = src ; this . grammarSource = resolver . resolveURI ( this . grammar ) ; store = ( Store ) this . manager . lookup ( Store . TRANSIENT_STORE ) ; ParserAutomatonEntry entry = ( ParserAutomatonEntry ) store . get ( this . grammarSource . getURI ( ) ) ; if ( ( entry == null ) || ( entry . getValidity ( ) == null ) || ( ( entry . getValidity ( ) . isValid ( this . grammarSource . getValidity ( ) ) ) <= 0 ) ) { this . logger . info ( ""(Re)building the automaton from '"" + this . grammarSource . getURI ( ) + ""'"" ) ; if ( this . grammarSource . getInputStream ( ) == null ) throw new ProcessingException ( ""Source '"" + this . grammarSource . getURI ( ) + ""' not found"" ) ; GrammarFactory factory = new GrammarFactory ( ) ; SourceUtil . toSAX ( this . manager , this . grammarSource , null , factory ) ; Grammar grammar = factory . getGrammar ( ) ; if ( grammar == null ) throw new ProcessingException ( ""Error while reading the grammar from "" + src ) ; ParserAutomatonBuilder builder = new ParserAutomatonBuilder ( grammar ) ; ParserAutomaton automaton = builder . getParserAutomaton ( ) ; setParserAutomaton ( builder . getParserAutomaton ( ) ) ; this . logger . info ( ""Store automaton into store for '"" + this . grammarSource . getURI ( ) + ""'"" ) ; store . store ( this . grammarSource . getURI ( ) , new ParserAutomatonEntry ( automaton , this . grammarSource . getValidity ( ) ) ) ; } else { setParserAutomaton ( entry . getParserAutomaton ( ) ) ; } } catch ( SourceException se ) { throw new ProcessingException ( ""Error during resolving of '"" + src + ""'."" , se ) ; } catch ( ServiceException se ) { throw new ProcessingException ( ""Could not lookup for service"" , se ) ; } finally { if ( store != null ) this . manager . release ( store ) ; } } ","public void setup ( SourceResolver resolver , Map objectmodel , String src , Parameters parameters ) throws ProcessingException , SAXException , IOException { this . resolver = resolver ; setFailSafe ( parameters . getParameterAsBoolean ( ""failsafe"" , false ) ) ; Store store = null ; try { this . grammar = src ; this . grammarSource = resolver . resolveURI ( this . grammar ) ; store = ( Store ) this . manager . lookup ( Store . TRANSIENT_STORE ) ; ParserAutomatonEntry entry = ( ParserAutomatonEntry ) store . get ( this . grammarSource . getURI ( ) ) ; if ( ( entry == null ) || ( entry . getValidity ( ) == null ) || ( ( entry . getValidity ( ) . isValid ( this . grammarSource . getValidity ( ) ) ) <= 0 ) ) { this . logger . info ( ""(Re)building the automaton from '"" + this . grammarSource . getURI ( ) + ""'"" ) ; if ( this . grammarSource . getInputStream ( ) == null ) throw new ProcessingException ( ""Source '"" + this . grammarSource . getURI ( ) + ""' not found"" ) ; GrammarFactory factory = new GrammarFactory ( ) ; SourceUtil . toSAX ( this . manager , this . grammarSource , null , factory ) ; Grammar grammar = factory . getGrammar ( ) ; if ( grammar == null ) throw new ProcessingException ( ""Error while reading the grammar from "" + src ) ; ParserAutomatonBuilder builder = new ParserAutomatonBuilder ( grammar ) ; ParserAutomaton automaton = builder . getParserAutomaton ( ) ; setParserAutomaton ( builder . getParserAutomaton ( ) ) ; this . logger . info ( ""Store automaton into store for '"" + this . grammarSource . getURI ( ) + ""'"" ) ; store . store ( this . grammarSource . getURI ( ) , new ParserAutomatonEntry ( automaton , this . grammarSource . getValidity ( ) ) ) ; } else { this . logger . info ( ""Getting automaton from store for '"" + this . grammarSource . getURI ( ) + ""'"" ) ; setParserAutomaton ( entry . getParserAutomaton ( ) ) ; } } catch ( SourceException se ) { throw new ProcessingException ( ""Error during resolving of '"" + src + ""'."" , se ) ; } catch ( ServiceException se ) { throw new ProcessingException ( ""Could not lookup for service"" , se ) ; } finally { if ( store != null ) this . manager . release ( store ) ; } } " 842,"protected IgniteInternalFuture createAndRunConcurrentAction ( final AtomicBoolean finished , final long endTime ) { return GridTestUtils . runAsync ( new Callable ( ) { @ Override public Object call ( ) throws Exception { Thread . currentThread ( ) . setName ( ""restart-thread"" ) ; U . sleep ( 15_000 ) ; ThreadLocalRandom tlr = ThreadLocalRandom . current ( ) ; int idx = tlr . nextInt ( 1 , GRIDS_COUNT ) ; stopGrid ( idx ) ; IgniteEx ig0 = grid ( 0 ) ; ig0 . cluster ( ) . setBaselineTopology ( baselineNodes ( ig0 . cluster ( ) . forServers ( ) . nodes ( ) ) ) ; U . sleep ( 3_000 ) ; return null ; } } ) ; } ","protected IgniteInternalFuture createAndRunConcurrentAction ( final AtomicBoolean finished , final long endTime ) { return GridTestUtils . runAsync ( new Callable ( ) { @ Override public Object call ( ) throws Exception { Thread . currentThread ( ) . setName ( ""restart-thread"" ) ; U . sleep ( 15_000 ) ; ThreadLocalRandom tlr = ThreadLocalRandom . current ( ) ; int idx = tlr . nextInt ( 1 , GRIDS_COUNT ) ; log . info ( ""Stopping node "" + idx ) ; stopGrid ( idx ) ; IgniteEx ig0 = grid ( 0 ) ; ig0 . cluster ( ) . setBaselineTopology ( baselineNodes ( ig0 . cluster ( ) . forServers ( ) . nodes ( ) ) ) ; U . sleep ( 3_000 ) ; return null ; } } ) ; } " 843,"private void sendMessage ( final DistributionAutomationRequestMessage requestMessage ) { this . jmsTemplate . send ( new MessageCreator ( ) { @ Override public Message createMessage ( final Session session ) throws JMSException { final ObjectMessage objectMessage = session . createObjectMessage ( requestMessage . getRequest ( ) ) ; objectMessage . setJMSCorrelationID ( requestMessage . getCorrelationUid ( ) ) ; objectMessage . setJMSType ( requestMessage . getMessageType ( ) . name ( ) ) ; objectMessage . setStringProperty ( Constants . ORGANISATION_IDENTIFICATION , requestMessage . getOrganisationIdentification ( ) ) ; objectMessage . setStringProperty ( Constants . DEVICE_IDENTIFICATION , requestMessage . getDeviceIdentification ( ) ) ; return objectMessage ; } } ) ; } ","private void sendMessage ( final DistributionAutomationRequestMessage requestMessage ) { LOGGER . info ( ""Sending message to the da requests queue"" ) ; this . jmsTemplate . send ( new MessageCreator ( ) { @ Override public Message createMessage ( final Session session ) throws JMSException { final ObjectMessage objectMessage = session . createObjectMessage ( requestMessage . getRequest ( ) ) ; objectMessage . setJMSCorrelationID ( requestMessage . getCorrelationUid ( ) ) ; objectMessage . setJMSType ( requestMessage . getMessageType ( ) . name ( ) ) ; objectMessage . setStringProperty ( Constants . ORGANISATION_IDENTIFICATION , requestMessage . getOrganisationIdentification ( ) ) ; objectMessage . setStringProperty ( Constants . DEVICE_IDENTIFICATION , requestMessage . getDeviceIdentification ( ) ) ; return objectMessage ; } } ) ; } " 844,"private void assertDisabledDeduction ( Safeguard safeguard , BpRequirement requirement ) throws CommandException { assertEquals ( ""Must be option 'no'."" , ImplementationStatus . NO , requirement . getImplementationStatus ( ) ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Change the safeguard implementation status to: "" + ImplementationStatus . PARTIALLY ) ; } safeguard = updateSafeguard ( safeguard , ImplementationStatus . PARTIALLY ) ; assertEquals ( ""Must be option 'partially'."" , ImplementationStatus . PARTIALLY , requirement . getImplementationStatus ( ) ) ; if ( LOG . isDebugEnabled ( ) ) { } requirement . setPropertyValue ( requirement . getTypeId ( ) + IMPLEMENTATION_DEDUCE , ""0"" ) ; requirement . setImplementationStatus ( ImplementationStatus . YES ) ; UpdateElement < BpRequirement > command1 = new UpdateElement < > ( requirement , true , null ) ; commandService . executeCommand ( command1 ) ; requirement = command1 . getElement ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Change the safeguard implementation status to: "" + ImplementationStatus . PARTIALLY ) ; } safeguard = updateSafeguard ( safeguard , ImplementationStatus . NO ) ; assertEquals ( ""Must be option 'yes'."" , ImplementationStatus . YES , requirement . getImplementationStatus ( ) ) ; } ","private void assertDisabledDeduction ( Safeguard safeguard , BpRequirement requirement ) throws CommandException { assertEquals ( ""Must be option 'no'."" , ImplementationStatus . NO , requirement . getImplementationStatus ( ) ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Change the safeguard implementation status to: "" + ImplementationStatus . PARTIALLY ) ; } safeguard = updateSafeguard ( safeguard , ImplementationStatus . PARTIALLY ) ; assertEquals ( ""Must be option 'partially'."" , ImplementationStatus . PARTIALLY , requirement . getImplementationStatus ( ) ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Switch deduction off for the requirement."" ) ; } requirement . setPropertyValue ( requirement . getTypeId ( ) + IMPLEMENTATION_DEDUCE , ""0"" ) ; requirement . setImplementationStatus ( ImplementationStatus . YES ) ; UpdateElement < BpRequirement > command1 = new UpdateElement < > ( requirement , true , null ) ; commandService . executeCommand ( command1 ) ; requirement = command1 . getElement ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Change the safeguard implementation status to: "" + ImplementationStatus . PARTIALLY ) ; } safeguard = updateSafeguard ( safeguard , ImplementationStatus . NO ) ; assertEquals ( ""Must be option 'yes'."" , ImplementationStatus . YES , requirement . getImplementationStatus ( ) ) ; } " 845,"public void getOAuthAccessTokenAsync ( final String oauthVerifier ) { getDispatcher ( ) . invokeLater ( new AsyncTask ( OAUTH_ACCESS_TOKEN , listeners ) { @ Override public void invoke ( List < TwitterListener > listeners ) throws TwitterException { AccessToken token = twitter . getOAuthAccessToken ( oauthVerifier ) ; for ( TwitterListener listener : listeners ) { try { listener . gotOAuthAccessToken ( token ) ; } catch ( Exception e ) { } } } } ) ; } ","public void getOAuthAccessTokenAsync ( final String oauthVerifier ) { getDispatcher ( ) . invokeLater ( new AsyncTask ( OAUTH_ACCESS_TOKEN , listeners ) { @ Override public void invoke ( List < TwitterListener > listeners ) throws TwitterException { AccessToken token = twitter . getOAuthAccessToken ( oauthVerifier ) ; for ( TwitterListener listener : listeners ) { try { listener . gotOAuthAccessToken ( token ) ; } catch ( Exception e ) { logger . warn ( ""Exception at getOAuthRequestTokenAsync"" , e ) ; } } } } ) ; } " 846,"void parseAndDispatchEvents ( ) { try { String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { onLineReceived ( line ) ; } silentlyCloseReader ( ) ; onStreamClosedCallback . accept ( null ) ; } catch ( IOException exception ) { silentlyCloseReader ( ) ; if ( ! ( exception . getCause ( ) instanceof MieleWebserviceDisconnectSseException ) ) { logger . warn ( ""SSE connection failed unexpectedly: {}"" , exception . getMessage ( ) ) ; onStreamClosedCallback . accept ( exception . getCause ( ) ) ; } } logger . debug ( ""SSE stream closed."" ) ; } ","void parseAndDispatchEvents ( ) { try { String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { onLineReceived ( line ) ; } silentlyCloseReader ( ) ; logger . debug ( ""SSE stream ended. Closing stream."" ) ; onStreamClosedCallback . accept ( null ) ; } catch ( IOException exception ) { silentlyCloseReader ( ) ; if ( ! ( exception . getCause ( ) instanceof MieleWebserviceDisconnectSseException ) ) { logger . warn ( ""SSE connection failed unexpectedly: {}"" , exception . getMessage ( ) ) ; onStreamClosedCallback . accept ( exception . getCause ( ) ) ; } } logger . debug ( ""SSE stream closed."" ) ; } " 847,"void parseAndDispatchEvents ( ) { try { String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { onLineReceived ( line ) ; } silentlyCloseReader ( ) ; logger . debug ( ""SSE stream ended. Closing stream."" ) ; onStreamClosedCallback . accept ( null ) ; } catch ( IOException exception ) { silentlyCloseReader ( ) ; if ( ! ( exception . getCause ( ) instanceof MieleWebserviceDisconnectSseException ) ) { onStreamClosedCallback . accept ( exception . getCause ( ) ) ; } } logger . debug ( ""SSE stream closed."" ) ; } ","void parseAndDispatchEvents ( ) { try { String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { onLineReceived ( line ) ; } silentlyCloseReader ( ) ; logger . debug ( ""SSE stream ended. Closing stream."" ) ; onStreamClosedCallback . accept ( null ) ; } catch ( IOException exception ) { silentlyCloseReader ( ) ; if ( ! ( exception . getCause ( ) instanceof MieleWebserviceDisconnectSseException ) ) { logger . warn ( ""SSE connection failed unexpectedly: {}"" , exception . getMessage ( ) ) ; onStreamClosedCallback . accept ( exception . getCause ( ) ) ; } } logger . debug ( ""SSE stream closed."" ) ; } " 848,"void parseAndDispatchEvents ( ) { try { String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { onLineReceived ( line ) ; } silentlyCloseReader ( ) ; logger . debug ( ""SSE stream ended. Closing stream."" ) ; onStreamClosedCallback . accept ( null ) ; } catch ( IOException exception ) { silentlyCloseReader ( ) ; if ( ! ( exception . getCause ( ) instanceof MieleWebserviceDisconnectSseException ) ) { logger . warn ( ""SSE connection failed unexpectedly: {}"" , exception . getMessage ( ) ) ; onStreamClosedCallback . accept ( exception . getCause ( ) ) ; } } } ","void parseAndDispatchEvents ( ) { try { String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { onLineReceived ( line ) ; } silentlyCloseReader ( ) ; logger . debug ( ""SSE stream ended. Closing stream."" ) ; onStreamClosedCallback . accept ( null ) ; } catch ( IOException exception ) { silentlyCloseReader ( ) ; if ( ! ( exception . getCause ( ) instanceof MieleWebserviceDisconnectSseException ) ) { logger . warn ( ""SSE connection failed unexpectedly: {}"" , exception . getMessage ( ) ) ; onStreamClosedCallback . accept ( exception . getCause ( ) ) ; } } logger . debug ( ""SSE stream closed."" ) ; } " 849,"public boolean updateIndexMapping ( String indexName , final Map < String , Object > mapping ) throws IOException { indexName = formatIndexName ( indexName ) ; PutMappingRequest putMappingRequest = new PutMappingRequest ( indexName ) ; Gson gson = new Gson ( ) ; putMappingRequest . source ( gson . toJson ( mapping ) , XContentType . JSON ) ; putMappingRequest . type ( ""_doc"" ) ; AcknowledgedResponse response = client . indices ( ) . putMapping ( putMappingRequest , RequestOptions . DEFAULT ) ; return response . isAcknowledged ( ) ; } ","public boolean updateIndexMapping ( String indexName , final Map < String , Object > mapping ) throws IOException { indexName = formatIndexName ( indexName ) ; PutMappingRequest putMappingRequest = new PutMappingRequest ( indexName ) ; Gson gson = new Gson ( ) ; putMappingRequest . source ( gson . toJson ( mapping ) , XContentType . JSON ) ; putMappingRequest . type ( ""_doc"" ) ; AcknowledgedResponse response = client . indices ( ) . putMapping ( putMappingRequest , RequestOptions . DEFAULT ) ; log . debug ( ""put {} index mapping finished, isAcknowledged: {}"" , indexName , response . isAcknowledged ( ) ) ; return response . isAcknowledged ( ) ; } " 850,"public void close ( ) throws IOException { wasClosed = true ; while ( thread . isAlive ( ) ) { thread . interrupt ( ) ; try { thread . join ( ) ; } catch ( InterruptedException e ) { if ( ! thread . isAlive ( ) ) { Thread . currentThread ( ) . interrupt ( ) ; } } } if ( thrown != null ) { throw new IOException ( thrown ) ; } } ","public void close ( ) throws IOException { wasClosed = true ; while ( thread . isAlive ( ) ) { thread . interrupt ( ) ; try { thread . join ( ) ; } catch ( InterruptedException e ) { if ( ! thread . isAlive ( ) ) { Thread . currentThread ( ) . interrupt ( ) ; } LOG . debug ( taskName + "" interrupted while waiting for the writer thread to die"" , e ) ; } } if ( thrown != null ) { throw new IOException ( thrown ) ; } } " 851,"private boolean isNamingReadiness ( HttpServletRequest request ) { try { apiCommands . metrics ( request ) ; return true ; } catch ( Exception e ) { } return false ; } ","private boolean isNamingReadiness ( HttpServletRequest request ) { try { apiCommands . metrics ( request ) ; return true ; } catch ( Exception e ) { LOGGER . error ( ""Naming health check fail."" , e ) ; } return false ; } " 852,"private static Index indexJar ( JarFile file ) throws IOException { Indexer indexer = new Indexer ( ) ; Enumeration < JarEntry > e = file . entries ( ) ; boolean multiRelease = JarFiles . isMultiRelease ( file ) ; while ( e . hasMoreElements ( ) ) { JarEntry entry = e . nextElement ( ) ; if ( entry . getName ( ) . endsWith ( "".class"" ) ) { if ( multiRelease && entry . getName ( ) . startsWith ( META_INF_VERSIONS ) ) { String part = entry . getName ( ) . substring ( META_INF_VERSIONS . length ( ) ) ; int slash = part . indexOf ( ""/"" ) ; if ( slash != - 1 ) { try { int ver = Integer . parseInt ( part . substring ( 0 , slash ) ) ; if ( ver <= JAVA_VERSION ) { try ( InputStream inputStream = file . getInputStream ( entry ) ) { indexer . index ( inputStream ) ; } } } catch ( NumberFormatException ex ) { } } } else { try ( InputStream inputStream = file . getInputStream ( entry ) ) { indexer . index ( inputStream ) ; } } } } return indexer . complete ( ) ; } ","private static Index indexJar ( JarFile file ) throws IOException { Indexer indexer = new Indexer ( ) ; Enumeration < JarEntry > e = file . entries ( ) ; boolean multiRelease = JarFiles . isMultiRelease ( file ) ; while ( e . hasMoreElements ( ) ) { JarEntry entry = e . nextElement ( ) ; if ( entry . getName ( ) . endsWith ( "".class"" ) ) { if ( multiRelease && entry . getName ( ) . startsWith ( META_INF_VERSIONS ) ) { String part = entry . getName ( ) . substring ( META_INF_VERSIONS . length ( ) ) ; int slash = part . indexOf ( ""/"" ) ; if ( slash != - 1 ) { try { int ver = Integer . parseInt ( part . substring ( 0 , slash ) ) ; if ( ver <= JAVA_VERSION ) { try ( InputStream inputStream = file . getInputStream ( entry ) ) { indexer . index ( inputStream ) ; } } } catch ( NumberFormatException ex ) { log . debug ( ""Failed to parse META-INF/versions entry"" , ex ) ; } } } else { try ( InputStream inputStream = file . getInputStream ( entry ) ) { indexer . index ( inputStream ) ; } } } } return indexer . complete ( ) ; } " 853,"public boolean delete ( ) { try { return this . _storageAdaptor . deleteStoragePool ( this ) ; } catch ( Exception e ) { } return false ; } ","public boolean delete ( ) { try { return this . _storageAdaptor . deleteStoragePool ( this ) ; } catch ( Exception e ) { s_logger . debug ( ""Failed to delete storage pool"" , e ) ; } return false ; } " 854,"public void updated ( Map < String , Object > properties ) { synchronized ( updateLock ) { this . properties . clear ( ) ; HashMap < String , Object > decryptedPropertiesMap = new HashMap < > ( ) ; for ( Map . Entry < String , Object > entry : properties . entrySet ( ) ) { String key = entry . getKey ( ) ; Object value = entry . getValue ( ) ; if ( key . equals ( MQTT_PASSWORD_PROP_NAME ) ) { try { Password decryptedPassword = new Password ( this . cryptoService . decryptAes ( ( ( String ) value ) . toCharArray ( ) ) ) ; decryptedPropertiesMap . put ( key , decryptedPassword ) ; } catch ( Exception e ) { logger . info ( ""Password is not encrypted"" ) ; decryptedPropertiesMap . put ( key , new Password ( ( String ) value ) ) ; } } else { decryptedPropertiesMap . put ( key , value ) ; } } this . properties . putAll ( decryptedPropertiesMap ) ; } update ( ) ; } ","public void updated ( Map < String , Object > properties ) { synchronized ( updateLock ) { logger . info ( ""Updating {}..."" , properties . get ( ConfigurationService . KURA_SERVICE_PID ) ) ; this . properties . clear ( ) ; HashMap < String , Object > decryptedPropertiesMap = new HashMap < > ( ) ; for ( Map . Entry < String , Object > entry : properties . entrySet ( ) ) { String key = entry . getKey ( ) ; Object value = entry . getValue ( ) ; if ( key . equals ( MQTT_PASSWORD_PROP_NAME ) ) { try { Password decryptedPassword = new Password ( this . cryptoService . decryptAes ( ( ( String ) value ) . toCharArray ( ) ) ) ; decryptedPropertiesMap . put ( key , decryptedPassword ) ; } catch ( Exception e ) { logger . info ( ""Password is not encrypted"" ) ; decryptedPropertiesMap . put ( key , new Password ( ( String ) value ) ) ; } } else { decryptedPropertiesMap . put ( key , value ) ; } } this . properties . putAll ( decryptedPropertiesMap ) ; } update ( ) ; } " 855,"public void updated ( Map < String , Object > properties ) { synchronized ( updateLock ) { logger . info ( ""Updating {}..."" , properties . get ( ConfigurationService . KURA_SERVICE_PID ) ) ; this . properties . clear ( ) ; HashMap < String , Object > decryptedPropertiesMap = new HashMap < > ( ) ; for ( Map . Entry < String , Object > entry : properties . entrySet ( ) ) { String key = entry . getKey ( ) ; Object value = entry . getValue ( ) ; if ( key . equals ( MQTT_PASSWORD_PROP_NAME ) ) { try { Password decryptedPassword = new Password ( this . cryptoService . decryptAes ( ( ( String ) value ) . toCharArray ( ) ) ) ; decryptedPropertiesMap . put ( key , decryptedPassword ) ; } catch ( Exception e ) { decryptedPropertiesMap . put ( key , new Password ( ( String ) value ) ) ; } } else { decryptedPropertiesMap . put ( key , value ) ; } } this . properties . putAll ( decryptedPropertiesMap ) ; } update ( ) ; } ","public void updated ( Map < String , Object > properties ) { synchronized ( updateLock ) { logger . info ( ""Updating {}..."" , properties . get ( ConfigurationService . KURA_SERVICE_PID ) ) ; this . properties . clear ( ) ; HashMap < String , Object > decryptedPropertiesMap = new HashMap < > ( ) ; for ( Map . Entry < String , Object > entry : properties . entrySet ( ) ) { String key = entry . getKey ( ) ; Object value = entry . getValue ( ) ; if ( key . equals ( MQTT_PASSWORD_PROP_NAME ) ) { try { Password decryptedPassword = new Password ( this . cryptoService . decryptAes ( ( ( String ) value ) . toCharArray ( ) ) ) ; decryptedPropertiesMap . put ( key , decryptedPassword ) ; } catch ( Exception e ) { logger . info ( ""Password is not encrypted"" ) ; decryptedPropertiesMap . put ( key , new Password ( ( String ) value ) ) ; } } else { decryptedPropertiesMap . put ( key , value ) ; } } this . properties . putAll ( decryptedPropertiesMap ) ; } update ( ) ; } " 856,"private void updateContextWithTime ( WorkflowExecutionContext context ) { try { InstancesResult result = WorkflowEngineFactory . getWorkflowEngine ( ) . getJobDetails ( context . getClusterName ( ) , context . getWorkflowId ( ) ) ; Date startTime = result . getInstances ( ) [ 0 ] . startTime ; Date endTime = result . getInstances ( ) [ 0 ] . endTime ; Date now = new Date ( ) ; if ( startTime == null ) { startTime = now ; } if ( endTime == null ) { endTime = now ; } context . setValue ( WorkflowExecutionArgs . WF_START_TIME , Long . toString ( startTime . getTime ( ) ) ) ; context . setValue ( WorkflowExecutionArgs . WF_END_TIME , Long . toString ( endTime . getTime ( ) ) ) ; } catch ( FalconException e ) { } } ","private void updateContextWithTime ( WorkflowExecutionContext context ) { try { InstancesResult result = WorkflowEngineFactory . getWorkflowEngine ( ) . getJobDetails ( context . getClusterName ( ) , context . getWorkflowId ( ) ) ; Date startTime = result . getInstances ( ) [ 0 ] . startTime ; Date endTime = result . getInstances ( ) [ 0 ] . endTime ; Date now = new Date ( ) ; if ( startTime == null ) { startTime = now ; } if ( endTime == null ) { endTime = now ; } context . setValue ( WorkflowExecutionArgs . WF_START_TIME , Long . toString ( startTime . getTime ( ) ) ) ; context . setValue ( WorkflowExecutionArgs . WF_END_TIME , Long . toString ( endTime . getTime ( ) ) ) ; } catch ( FalconException e ) { LOG . error ( ""Unable to retrieve job details for "" + context . getWorkflowId ( ) + "" on cluster "" + context . getClusterName ( ) , e ) ; } } " 857,"public void start ( ) { JSONObject jObjResult = null ; String scalejsonChk = """" ; String awsServerChk = """" ; int iSetCount = 0 ; Map < String , Object > scaleCommon = new HashMap < String , Object > ( ) ; Map < String , Object > param = new HashMap < String , Object > ( ) ; context = new ClassPathXmlApplicationContext ( new String [ ] { ""context-tcontrol.xml"" } ) ; ScaleServiceImpl service = ( ScaleServiceImpl ) context . getBean ( ""ScaleService"" ) ; try { jObjResult = service . scaleAwsConnect ( null , ""scaleAwsChk"" , 0 , client , is , os ) ; if ( jObjResult != null ) { String resultCode = ( String ) jObjResult . get ( ProtocolID . RESULT_CODE ) ; if ( resultCode . equals ( ""0"" ) ) { scalejsonChk = ( String ) jObjResult . get ( ProtocolID . RESULT_SUB_DATA ) ; } } if ( scalejsonChk != null ) { scalejsonChk = scalejsonChk . trim ( ) ; if ( scalejsonChk . contains ( ""/usr/bin/aws"" ) ) { awsServerChk = ""Y"" ; } else { awsServerChk = ""N"" ; } } else { awsServerChk = ""N"" ; } iSetCount = scaleAwsAutoSetChk ( ) ; String strAutoScaleTime = """" ; if ( ""Y"" . equals ( awsServerChk ) ) { service . insertScaleServer ( ) ; if ( iSetCount > 0 ) { strAutoScaleTime = FileUtil . getPropertyValue ( ""context.properties"" , ""agent.scale_auto_exe_time"" ) ; JobDetail jobMons = newJob ( DXTcontrolScaleChogihwa . class ) . withIdentity ( ""jobName"" , ""group1"" ) . build ( ) ; CronTrigger triggerMons = newTrigger ( ) . withIdentity ( ""trggerName"" , ""group1"" ) . withSchedule ( cronSchedule ( strAutoScaleTime ) ) . build ( ) ; scheduler . scheduleJob ( jobMons , triggerMons ) ; scheduler . start ( ) ; strAutoScaleTime = FileUtil . getPropertyValue ( ""context.properties"" , ""agent.scale_auto_reset_time"" ) ; param . put ( ""db_svr_id"" , service . dbServerInfoSet ( ) ) ; scaleCommon = service . selectAutoScaleComCngInfo ( param ) ; if ( scaleCommon != null ) { if ( scaleCommon . get ( ""auto_run_cycle"" ) != null ) { int auto_run_cycle_num = Integer . parseInt ( scaleCommon . get ( ""auto_run_cycle"" ) . toString ( ) ) ; if ( auto_run_cycle_num > 0 ) { strAutoScaleTime = ""0 0/"" + auto_run_cycle_num + "" * 1/1 * ? *"" ; } } } JobDetail jobScale = newJob ( DXTcontrolScaleExecute . class ) . withIdentity ( ""jobName"" , ""group2"" ) . build ( ) ; CronTrigger triggerScale = newTrigger ( ) . withIdentity ( ""trggerName"" , ""group2"" ) . withSchedule ( cronSchedule ( strAutoScaleTime ) ) . build ( ) ; scheduler . scheduleJob ( jobScale , triggerScale ) ; scheduler . start ( ) ; } } } catch ( Exception e ) { e . printStackTrace ( ) ; } } ","public void start ( ) { JSONObject jObjResult = null ; String scalejsonChk = """" ; String awsServerChk = """" ; int iSetCount = 0 ; Map < String , Object > scaleCommon = new HashMap < String , Object > ( ) ; Map < String , Object > param = new HashMap < String , Object > ( ) ; context = new ClassPathXmlApplicationContext ( new String [ ] { ""context-tcontrol.xml"" } ) ; ScaleServiceImpl service = ( ScaleServiceImpl ) context . getBean ( ""ScaleService"" ) ; try { jObjResult = service . scaleAwsConnect ( null , ""scaleAwsChk"" , 0 , client , is , os ) ; if ( jObjResult != null ) { String resultCode = ( String ) jObjResult . get ( ProtocolID . RESULT_CODE ) ; if ( resultCode . equals ( ""0"" ) ) { scalejsonChk = ( String ) jObjResult . get ( ProtocolID . RESULT_SUB_DATA ) ; } } if ( scalejsonChk != null ) { scalejsonChk = scalejsonChk . trim ( ) ; if ( scalejsonChk . contains ( ""/usr/bin/aws"" ) ) { awsServerChk = ""Y"" ; } else { awsServerChk = ""N"" ; } } else { awsServerChk = ""N"" ; } iSetCount = scaleAwsAutoSetChk ( ) ; String strAutoScaleTime = """" ; if ( ""Y"" . equals ( awsServerChk ) ) { service . insertScaleServer ( ) ; if ( iSetCount > 0 ) { strAutoScaleTime = FileUtil . getPropertyValue ( ""context.properties"" , ""agent.scale_auto_exe_time"" ) ; JobDetail jobMons = newJob ( DXTcontrolScaleChogihwa . class ) . withIdentity ( ""jobName"" , ""group1"" ) . build ( ) ; CronTrigger triggerMons = newTrigger ( ) . withIdentity ( ""trggerName"" , ""group1"" ) . withSchedule ( cronSchedule ( strAutoScaleTime ) ) . build ( ) ; scheduler . scheduleJob ( jobMons , triggerMons ) ; scheduler . start ( ) ; strAutoScaleTime = FileUtil . getPropertyValue ( ""context.properties"" , ""agent.scale_auto_reset_time"" ) ; param . put ( ""db_svr_id"" , service . dbServerInfoSet ( ) ) ; scaleCommon = service . selectAutoScaleComCngInfo ( param ) ; if ( scaleCommon != null ) { if ( scaleCommon . get ( ""auto_run_cycle"" ) != null ) { int auto_run_cycle_num = Integer . parseInt ( scaleCommon . get ( ""auto_run_cycle"" ) . toString ( ) ) ; if ( auto_run_cycle_num > 0 ) { strAutoScaleTime = ""0 0/"" + auto_run_cycle_num + "" * 1/1 * ? *"" ; } } } socketLogger . info ( ""DXTcontrolScaleAwsExecute.strAutoScaleTime4 : "" + strAutoScaleTime ) ; JobDetail jobScale = newJob ( DXTcontrolScaleExecute . class ) . withIdentity ( ""jobName"" , ""group2"" ) . build ( ) ; CronTrigger triggerScale = newTrigger ( ) . withIdentity ( ""trggerName"" , ""group2"" ) . withSchedule ( cronSchedule ( strAutoScaleTime ) ) . build ( ) ; scheduler . scheduleJob ( jobScale , triggerScale ) ; scheduler . start ( ) ; } } } catch ( Exception e ) { e . printStackTrace ( ) ; } } " 858,"private void tryToStoreInSent ( UserDataRequest udr , SendEmail email , InputStream emailStream ) { try { emailStream . reset ( ) ; mailboxService . storeInSent ( udr , multipleTimesReadable ( emailStream , email . getMimeMessage ( ) . getCharset ( ) ) ) ; } catch ( CollectionNotFoundException e ) { } catch ( Throwable t ) { logger . error ( ""Cannot store an email in the Sent folder"" , t ) ; } } ","private void tryToStoreInSent ( UserDataRequest udr , SendEmail email , InputStream emailStream ) { try { emailStream . reset ( ) ; mailboxService . storeInSent ( udr , multipleTimesReadable ( emailStream , email . getMimeMessage ( ) . getCharset ( ) ) ) ; } catch ( CollectionNotFoundException e ) { logger . warn ( ""Cannot store an email in the Sent folder, the collection was not found: {}"" , e . getMessage ( ) ) ; } catch ( Throwable t ) { logger . error ( ""Cannot store an email in the Sent folder"" , t ) ; } } " 859,"private void tryToStoreInSent ( UserDataRequest udr , SendEmail email , InputStream emailStream ) { try { emailStream . reset ( ) ; mailboxService . storeInSent ( udr , multipleTimesReadable ( emailStream , email . getMimeMessage ( ) . getCharset ( ) ) ) ; } catch ( CollectionNotFoundException e ) { logger . warn ( ""Cannot store an email in the Sent folder, the collection was not found: {}"" , e . getMessage ( ) ) ; } catch ( Throwable t ) { } } ","private void tryToStoreInSent ( UserDataRequest udr , SendEmail email , InputStream emailStream ) { try { emailStream . reset ( ) ; mailboxService . storeInSent ( udr , multipleTimesReadable ( emailStream , email . getMimeMessage ( ) . getCharset ( ) ) ) ; } catch ( CollectionNotFoundException e ) { logger . warn ( ""Cannot store an email in the Sent folder, the collection was not found: {}"" , e . getMessage ( ) ) ; } catch ( Throwable t ) { logger . error ( ""Cannot store an email in the Sent folder"" , t ) ; } } " 860,"public void onError ( Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TBase msg ; unloadApplication_result result = new unloadApplication_result ( ) ; { msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TBase ) new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; } try { fcall . sendResponse ( fb , msg , msgType , seqid ) ; return ; } catch ( Exception ex ) { } fb . close ( ) ; } ","public void onError ( Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TBase msg ; unloadApplication_result result = new unloadApplication_result ( ) ; { msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TBase ) new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; } try { fcall . sendResponse ( fb , msg , msgType , seqid ) ; return ; } catch ( Exception ex ) { LOGGER . error ( ""Exception writing to internal frame buffer"" , ex ) ; } fb . close ( ) ; } " 861,"public static boolean npmVersionsMatch ( String current , String next ) { String left = current ; String right = next ; if ( left == null || right == null ) { return false ; } if ( left . equals ( right ) || ""*"" . equals ( left ) || ""*"" . equals ( right ) ) { return true ; } if ( left . contains ( "" "" ) ) { if ( right . contains ( "" "" ) ) { return false ; } if ( ! right . matches ( ""^\\d.*$"" ) ) { right = stripLeadingNonNumeric ( right ) ; if ( right == null ) { return false ; } } try { final Semver v = new Semver ( right , SemverType . NPM ) ; return v . satisfies ( left ) ; } catch ( SemverException ex ) { LOGGER . trace ( ""ignore"" , ex ) ; } } else { if ( ! left . matches ( ""^\\d.*$"" ) ) { left = stripLeadingNonNumeric ( left ) ; if ( left == null || left . isEmpty ( ) ) { return false ; } } try { Semver v = new Semver ( left , SemverType . NPM ) ; if ( ! right . isEmpty ( ) && v . satisfies ( right ) ) { return true ; } if ( ! right . contains ( "" "" ) ) { left = current ; right = stripLeadingNonNumeric ( right ) ; if ( right != null ) { v = new Semver ( right , SemverType . NPM ) ; return v . satisfies ( left ) ; } } } catch ( SemverException ex ) { LOGGER . trace ( ""ignore"" , ex ) ; } catch ( NullPointerException ex ) { LOGGER . debug ( ""SemVer comparison resulted in NPE"" , ex ) ; } } return false ; } ","public static boolean npmVersionsMatch ( String current , String next ) { String left = current ; String right = next ; if ( left == null || right == null ) { return false ; } if ( left . equals ( right ) || ""*"" . equals ( left ) || ""*"" . equals ( right ) ) { return true ; } if ( left . contains ( "" "" ) ) { if ( right . contains ( "" "" ) ) { return false ; } if ( ! right . matches ( ""^\\d.*$"" ) ) { right = stripLeadingNonNumeric ( right ) ; if ( right == null ) { return false ; } } try { final Semver v = new Semver ( right , SemverType . NPM ) ; return v . satisfies ( left ) ; } catch ( SemverException ex ) { LOGGER . trace ( ""ignore"" , ex ) ; } } else { if ( ! left . matches ( ""^\\d.*$"" ) ) { left = stripLeadingNonNumeric ( left ) ; if ( left == null || left . isEmpty ( ) ) { return false ; } } try { Semver v = new Semver ( left , SemverType . NPM ) ; if ( ! right . isEmpty ( ) && v . satisfies ( right ) ) { return true ; } if ( ! right . contains ( "" "" ) ) { left = current ; right = stripLeadingNonNumeric ( right ) ; if ( right != null ) { v = new Semver ( right , SemverType . NPM ) ; return v . satisfies ( left ) ; } } } catch ( SemverException ex ) { LOGGER . trace ( ""ignore"" , ex ) ; } catch ( NullPointerException ex ) { LOGGER . error ( ""SemVer comparison error: left:\""{}\"", right:\""{}\"""" , left , right ) ; LOGGER . debug ( ""SemVer comparison resulted in NPE"" , ex ) ; } } return false ; } " 862,"public static boolean npmVersionsMatch ( String current , String next ) { String left = current ; String right = next ; if ( left == null || right == null ) { return false ; } if ( left . equals ( right ) || ""*"" . equals ( left ) || ""*"" . equals ( right ) ) { return true ; } if ( left . contains ( "" "" ) ) { if ( right . contains ( "" "" ) ) { return false ; } if ( ! right . matches ( ""^\\d.*$"" ) ) { right = stripLeadingNonNumeric ( right ) ; if ( right == null ) { return false ; } } try { final Semver v = new Semver ( right , SemverType . NPM ) ; return v . satisfies ( left ) ; } catch ( SemverException ex ) { LOGGER . trace ( ""ignore"" , ex ) ; } } else { if ( ! left . matches ( ""^\\d.*$"" ) ) { left = stripLeadingNonNumeric ( left ) ; if ( left == null || left . isEmpty ( ) ) { return false ; } } try { Semver v = new Semver ( left , SemverType . NPM ) ; if ( ! right . isEmpty ( ) && v . satisfies ( right ) ) { return true ; } if ( ! right . contains ( "" "" ) ) { left = current ; right = stripLeadingNonNumeric ( right ) ; if ( right != null ) { v = new Semver ( right , SemverType . NPM ) ; return v . satisfies ( left ) ; } } } catch ( SemverException ex ) { LOGGER . trace ( ""ignore"" , ex ) ; } catch ( NullPointerException ex ) { LOGGER . error ( ""SemVer comparison error: left:\""{}\"", right:\""{}\"""" , left , right ) ; } } return false ; } ","public static boolean npmVersionsMatch ( String current , String next ) { String left = current ; String right = next ; if ( left == null || right == null ) { return false ; } if ( left . equals ( right ) || ""*"" . equals ( left ) || ""*"" . equals ( right ) ) { return true ; } if ( left . contains ( "" "" ) ) { if ( right . contains ( "" "" ) ) { return false ; } if ( ! right . matches ( ""^\\d.*$"" ) ) { right = stripLeadingNonNumeric ( right ) ; if ( right == null ) { return false ; } } try { final Semver v = new Semver ( right , SemverType . NPM ) ; return v . satisfies ( left ) ; } catch ( SemverException ex ) { LOGGER . trace ( ""ignore"" , ex ) ; } } else { if ( ! left . matches ( ""^\\d.*$"" ) ) { left = stripLeadingNonNumeric ( left ) ; if ( left == null || left . isEmpty ( ) ) { return false ; } } try { Semver v = new Semver ( left , SemverType . NPM ) ; if ( ! right . isEmpty ( ) && v . satisfies ( right ) ) { return true ; } if ( ! right . contains ( "" "" ) ) { left = current ; right = stripLeadingNonNumeric ( right ) ; if ( right != null ) { v = new Semver ( right , SemverType . NPM ) ; return v . satisfies ( left ) ; } } } catch ( SemverException ex ) { LOGGER . trace ( ""ignore"" , ex ) ; } catch ( NullPointerException ex ) { LOGGER . error ( ""SemVer comparison error: left:\""{}\"", right:\""{}\"""" , left , right ) ; LOGGER . debug ( ""SemVer comparison resulted in NPE"" , ex ) ; } } return false ; } " 863,"public static int calculateSizeOfValue ( Object value ) { if ( value instanceof String ) { return ( ( String ) value ) . length ( ) ; } else if ( value instanceof Boolean ) { return 4 ; } else if ( value instanceof Number || value instanceof Date ) { return 8 ; } else if ( value instanceof Collection ) { return calculateSizeOfCollection ( ( Collection < ? > ) value ) ; } else if ( value instanceof Map ) { return calculateSizeOfMap ( ( Map < ? , ? > ) value ) ; } else { return 100 ; } } ","public static int calculateSizeOfValue ( Object value ) { if ( value instanceof String ) { return ( ( String ) value ) . length ( ) ; } else if ( value instanceof Boolean ) { return 4 ; } else if ( value instanceof Number || value instanceof Date ) { return 8 ; } else if ( value instanceof Collection ) { return calculateSizeOfCollection ( ( Collection < ? > ) value ) ; } else if ( value instanceof Map ) { return calculateSizeOfMap ( ( Map < ? , ? > ) value ) ; } else { LOGGER . warn ( ""unhandled object to calculate size for: "" + value . getClass ( ) . getName ( ) + "", defaulting to 100"" ) ; return 100 ; } } " 864,"private void configureParagraph ( Paragraph p , Map < String , Object > newConfig , String user ) { if ( newConfig == null || newConfig . isEmpty ( ) ) { LOGGER . warn ( ""{} is trying to update paragraph {} of note {} with empty config"" , user , p . getId ( ) , p . getNote ( ) . getId ( ) ) ; throw new BadRequestException ( ""paragraph config cannot be empty"" ) ; } Map < String , Object > origConfig = p . getConfig ( ) ; for ( final Map . Entry < String , Object > entry : newConfig . entrySet ( ) ) { origConfig . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } p . setConfig ( origConfig ) ; } ","private void configureParagraph ( Paragraph p , Map < String , Object > newConfig , String user ) { LOGGER . info ( ""Configure Paragraph for user {}"" , user ) ; if ( newConfig == null || newConfig . isEmpty ( ) ) { LOGGER . warn ( ""{} is trying to update paragraph {} of note {} with empty config"" , user , p . getId ( ) , p . getNote ( ) . getId ( ) ) ; throw new BadRequestException ( ""paragraph config cannot be empty"" ) ; } Map < String , Object > origConfig = p . getConfig ( ) ; for ( final Map . Entry < String , Object > entry : newConfig . entrySet ( ) ) { origConfig . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } p . setConfig ( origConfig ) ; } " 865,"private void configureParagraph ( Paragraph p , Map < String , Object > newConfig , String user ) { LOGGER . info ( ""Configure Paragraph for user {}"" , user ) ; if ( newConfig == null || newConfig . isEmpty ( ) ) { throw new BadRequestException ( ""paragraph config cannot be empty"" ) ; } Map < String , Object > origConfig = p . getConfig ( ) ; for ( final Map . Entry < String , Object > entry : newConfig . entrySet ( ) ) { origConfig . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } p . setConfig ( origConfig ) ; } ","private void configureParagraph ( Paragraph p , Map < String , Object > newConfig , String user ) { LOGGER . info ( ""Configure Paragraph for user {}"" , user ) ; if ( newConfig == null || newConfig . isEmpty ( ) ) { LOGGER . warn ( ""{} is trying to update paragraph {} of note {} with empty config"" , user , p . getId ( ) , p . getNote ( ) . getId ( ) ) ; throw new BadRequestException ( ""paragraph config cannot be empty"" ) ; } Map < String , Object > origConfig = p . getConfig ( ) ; for ( final Map . Entry < String , Object > entry : newConfig . entrySet ( ) ) { origConfig . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } p . setConfig ( origConfig ) ; } " 866,"private boolean isOverSize ( String group , String tenant , int currentSize , int maxSize , boolean hasTenant ) { if ( currentSize > maxSize ) { if ( hasTenant ) { } else { LOGGER . warn ( ""[capacityManagement] group content is over maxSize, group: {}, maxSize: {}, currentSize: {}"" , group , maxSize , currentSize ) ; } return true ; } return false ; } ","private boolean isOverSize ( String group , String tenant , int currentSize , int maxSize , boolean hasTenant ) { if ( currentSize > maxSize ) { if ( hasTenant ) { LOGGER . warn ( ""[capacityManagement] tenant content is over maxSize, tenant: {}, maxSize: {}, currentSize: {}"" , tenant , maxSize , currentSize ) ; } else { LOGGER . warn ( ""[capacityManagement] group content is over maxSize, group: {}, maxSize: {}, currentSize: {}"" , group , maxSize , currentSize ) ; } return true ; } return false ; } " 867,"private boolean isOverSize ( String group , String tenant , int currentSize , int maxSize , boolean hasTenant ) { if ( currentSize > maxSize ) { if ( hasTenant ) { LOGGER . warn ( ""[capacityManagement] tenant content is over maxSize, tenant: {}, maxSize: {}, currentSize: {}"" , tenant , maxSize , currentSize ) ; } else { } return true ; } return false ; } ","private boolean isOverSize ( String group , String tenant , int currentSize , int maxSize , boolean hasTenant ) { if ( currentSize > maxSize ) { if ( hasTenant ) { LOGGER . warn ( ""[capacityManagement] tenant content is over maxSize, tenant: {}, maxSize: {}, currentSize: {}"" , tenant , maxSize , currentSize ) ; } else { LOGGER . warn ( ""[capacityManagement] group content is over maxSize, group: {}, maxSize: {}, currentSize: {}"" , group , maxSize , currentSize ) ; } return true ; } return false ; } " 868,"private void reconnect ( final long initialReconnectDelay ) { if ( connectLock . tryLock ( ) ) { try { Runnable r = new Runnable ( ) { public void run ( ) { boolean reconnected = false ; try { Thread . sleep ( initialReconnectDelay ) ; } catch ( InterruptedException e ) { } int attempt = 0 ; while ( ! ( isStopping ( ) || isStopped ( ) ) && ( session == null || session . getSessionState ( ) . equals ( SessionState . CLOSED ) ) && attempt < configuration . getMaxReconnect ( ) ) { try { attempt ++ ; LOG . info ( ""Trying to reconnect to {} - attempt #{}"" , getEndpoint ( ) . getConnectionString ( ) , attempt ) ; session = createSession ( ) ; reconnected = true ; } catch ( IOException e ) { LOG . warn ( ""Failed to reconnect to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; closeSession ( ) ; try { Thread . sleep ( configuration . getReconnectDelay ( ) ) ; } catch ( InterruptedException ee ) { } } } if ( reconnected ) { LOG . info ( ""Reconnected to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; } } } ; Thread t = new Thread ( r ) ; t . start ( ) ; t . join ( ) ; } catch ( InterruptedException e ) { } finally { connectLock . unlock ( ) ; } } } ","private void reconnect ( final long initialReconnectDelay ) { if ( connectLock . tryLock ( ) ) { try { Runnable r = new Runnable ( ) { public void run ( ) { boolean reconnected = false ; LOG . info ( ""Schedule reconnect after {} millis"" , initialReconnectDelay ) ; try { Thread . sleep ( initialReconnectDelay ) ; } catch ( InterruptedException e ) { } int attempt = 0 ; while ( ! ( isStopping ( ) || isStopped ( ) ) && ( session == null || session . getSessionState ( ) . equals ( SessionState . CLOSED ) ) && attempt < configuration . getMaxReconnect ( ) ) { try { attempt ++ ; LOG . info ( ""Trying to reconnect to {} - attempt #{}"" , getEndpoint ( ) . getConnectionString ( ) , attempt ) ; session = createSession ( ) ; reconnected = true ; } catch ( IOException e ) { LOG . warn ( ""Failed to reconnect to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; closeSession ( ) ; try { Thread . sleep ( configuration . getReconnectDelay ( ) ) ; } catch ( InterruptedException ee ) { } } } if ( reconnected ) { LOG . info ( ""Reconnected to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; } } } ; Thread t = new Thread ( r ) ; t . start ( ) ; t . join ( ) ; } catch ( InterruptedException e ) { } finally { connectLock . unlock ( ) ; } } } " 869,"private void reconnect ( final long initialReconnectDelay ) { if ( connectLock . tryLock ( ) ) { try { Runnable r = new Runnable ( ) { public void run ( ) { boolean reconnected = false ; LOG . info ( ""Schedule reconnect after {} millis"" , initialReconnectDelay ) ; try { Thread . sleep ( initialReconnectDelay ) ; } catch ( InterruptedException e ) { } int attempt = 0 ; while ( ! ( isStopping ( ) || isStopped ( ) ) && ( session == null || session . getSessionState ( ) . equals ( SessionState . CLOSED ) ) && attempt < configuration . getMaxReconnect ( ) ) { try { attempt ++ ; session = createSession ( ) ; reconnected = true ; } catch ( IOException e ) { LOG . warn ( ""Failed to reconnect to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; closeSession ( ) ; try { Thread . sleep ( configuration . getReconnectDelay ( ) ) ; } catch ( InterruptedException ee ) { } } } if ( reconnected ) { LOG . info ( ""Reconnected to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; } } } ; Thread t = new Thread ( r ) ; t . start ( ) ; t . join ( ) ; } catch ( InterruptedException e ) { } finally { connectLock . unlock ( ) ; } } } ","private void reconnect ( final long initialReconnectDelay ) { if ( connectLock . tryLock ( ) ) { try { Runnable r = new Runnable ( ) { public void run ( ) { boolean reconnected = false ; LOG . info ( ""Schedule reconnect after {} millis"" , initialReconnectDelay ) ; try { Thread . sleep ( initialReconnectDelay ) ; } catch ( InterruptedException e ) { } int attempt = 0 ; while ( ! ( isStopping ( ) || isStopped ( ) ) && ( session == null || session . getSessionState ( ) . equals ( SessionState . CLOSED ) ) && attempt < configuration . getMaxReconnect ( ) ) { try { attempt ++ ; LOG . info ( ""Trying to reconnect to {} - attempt #{}"" , getEndpoint ( ) . getConnectionString ( ) , attempt ) ; session = createSession ( ) ; reconnected = true ; } catch ( IOException e ) { LOG . warn ( ""Failed to reconnect to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; closeSession ( ) ; try { Thread . sleep ( configuration . getReconnectDelay ( ) ) ; } catch ( InterruptedException ee ) { } } } if ( reconnected ) { LOG . info ( ""Reconnected to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; } } } ; Thread t = new Thread ( r ) ; t . start ( ) ; t . join ( ) ; } catch ( InterruptedException e ) { } finally { connectLock . unlock ( ) ; } } } " 870,"private void reconnect ( final long initialReconnectDelay ) { if ( connectLock . tryLock ( ) ) { try { Runnable r = new Runnable ( ) { public void run ( ) { boolean reconnected = false ; LOG . info ( ""Schedule reconnect after {} millis"" , initialReconnectDelay ) ; try { Thread . sleep ( initialReconnectDelay ) ; } catch ( InterruptedException e ) { } int attempt = 0 ; while ( ! ( isStopping ( ) || isStopped ( ) ) && ( session == null || session . getSessionState ( ) . equals ( SessionState . CLOSED ) ) && attempt < configuration . getMaxReconnect ( ) ) { try { attempt ++ ; LOG . info ( ""Trying to reconnect to {} - attempt #{}"" , getEndpoint ( ) . getConnectionString ( ) , attempt ) ; session = createSession ( ) ; reconnected = true ; } catch ( IOException e ) { closeSession ( ) ; try { Thread . sleep ( configuration . getReconnectDelay ( ) ) ; } catch ( InterruptedException ee ) { } } } if ( reconnected ) { LOG . info ( ""Reconnected to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; } } } ; Thread t = new Thread ( r ) ; t . start ( ) ; t . join ( ) ; } catch ( InterruptedException e ) { } finally { connectLock . unlock ( ) ; } } } ","private void reconnect ( final long initialReconnectDelay ) { if ( connectLock . tryLock ( ) ) { try { Runnable r = new Runnable ( ) { public void run ( ) { boolean reconnected = false ; LOG . info ( ""Schedule reconnect after {} millis"" , initialReconnectDelay ) ; try { Thread . sleep ( initialReconnectDelay ) ; } catch ( InterruptedException e ) { } int attempt = 0 ; while ( ! ( isStopping ( ) || isStopped ( ) ) && ( session == null || session . getSessionState ( ) . equals ( SessionState . CLOSED ) ) && attempt < configuration . getMaxReconnect ( ) ) { try { attempt ++ ; LOG . info ( ""Trying to reconnect to {} - attempt #{}"" , getEndpoint ( ) . getConnectionString ( ) , attempt ) ; session = createSession ( ) ; reconnected = true ; } catch ( IOException e ) { LOG . warn ( ""Failed to reconnect to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; closeSession ( ) ; try { Thread . sleep ( configuration . getReconnectDelay ( ) ) ; } catch ( InterruptedException ee ) { } } } if ( reconnected ) { LOG . info ( ""Reconnected to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; } } } ; Thread t = new Thread ( r ) ; t . start ( ) ; t . join ( ) ; } catch ( InterruptedException e ) { } finally { connectLock . unlock ( ) ; } } } " 871,"private void reconnect ( final long initialReconnectDelay ) { if ( connectLock . tryLock ( ) ) { try { Runnable r = new Runnable ( ) { public void run ( ) { boolean reconnected = false ; LOG . info ( ""Schedule reconnect after {} millis"" , initialReconnectDelay ) ; try { Thread . sleep ( initialReconnectDelay ) ; } catch ( InterruptedException e ) { } int attempt = 0 ; while ( ! ( isStopping ( ) || isStopped ( ) ) && ( session == null || session . getSessionState ( ) . equals ( SessionState . CLOSED ) ) && attempt < configuration . getMaxReconnect ( ) ) { try { attempt ++ ; LOG . info ( ""Trying to reconnect to {} - attempt #{}"" , getEndpoint ( ) . getConnectionString ( ) , attempt ) ; session = createSession ( ) ; reconnected = true ; } catch ( IOException e ) { LOG . warn ( ""Failed to reconnect to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; closeSession ( ) ; try { Thread . sleep ( configuration . getReconnectDelay ( ) ) ; } catch ( InterruptedException ee ) { } } } if ( reconnected ) { } } } ; Thread t = new Thread ( r ) ; t . start ( ) ; t . join ( ) ; } catch ( InterruptedException e ) { } finally { connectLock . unlock ( ) ; } } } ","private void reconnect ( final long initialReconnectDelay ) { if ( connectLock . tryLock ( ) ) { try { Runnable r = new Runnable ( ) { public void run ( ) { boolean reconnected = false ; LOG . info ( ""Schedule reconnect after {} millis"" , initialReconnectDelay ) ; try { Thread . sleep ( initialReconnectDelay ) ; } catch ( InterruptedException e ) { } int attempt = 0 ; while ( ! ( isStopping ( ) || isStopped ( ) ) && ( session == null || session . getSessionState ( ) . equals ( SessionState . CLOSED ) ) && attempt < configuration . getMaxReconnect ( ) ) { try { attempt ++ ; LOG . info ( ""Trying to reconnect to {} - attempt #{}"" , getEndpoint ( ) . getConnectionString ( ) , attempt ) ; session = createSession ( ) ; reconnected = true ; } catch ( IOException e ) { LOG . warn ( ""Failed to reconnect to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; closeSession ( ) ; try { Thread . sleep ( configuration . getReconnectDelay ( ) ) ; } catch ( InterruptedException ee ) { } } } if ( reconnected ) { LOG . info ( ""Reconnected to {}"" , getEndpoint ( ) . getConnectionString ( ) ) ; } } } ; Thread t = new Thread ( r ) ; t . start ( ) ; t . join ( ) ; } catch ( InterruptedException e ) { } finally { connectLock . unlock ( ) ; } } } " 872,"private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } ","private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } " 873,"private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } ","private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } " 874,"private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } ","private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } " 875,"private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } ","private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } " 876,"private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } ","private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } " 877,"private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } } ","private void listen ( ) { SocketAddress sockAddr = ds . getLocalSocketAddress ( ) ; Connection . LOG . info ( ""Start UDP listener on {}"" , sockAddr ) ; byte [ ] data = new byte [ MAX_PACKAGE_LEN ] ; try { while ( ! ds . isClosed ( ) ) { Connection . LOG . debug ( ""Wait for UDP datagram package on {}"" , sockAddr ) ; DatagramPacket dp = new DatagramPacket ( data , MAX_PACKAGE_LEN ) ; ds . receive ( dp ) ; InetAddress senderAddr = dp . getAddress ( ) ; if ( conn . isBlackListed ( dp . getAddress ( ) ) ) { Connection . LOG . info ( ""Ignore UDP datagram package received from blacklisted {}"" , senderAddr ) ; } else { Connection . LOG . info ( ""Received UDP datagram package from {}"" , senderAddr ) ; try { handler . onReceive ( conn , dp ) ; } catch ( Throwable e ) { Connection . LOG . warn ( ""Exception processing UDP received from {}:"" , senderAddr , e ) ; } } } } catch ( Throwable e ) { if ( ! ds . isClosed ( ) ) Connection . LOG . error ( ""Exception on listing on {}:"" , sockAddr , e ) ; } Connection . LOG . info ( ""Stop UDP listener on {}"" , sockAddr ) ; } " 878,"public Jedis getJedisResource ( ) { Jedis subscriberJedis = null ; if ( isPoolSetup ( ) ) { try { subscriberJedis = JedisConnectionObject . pool . getResource ( ) ; connectionSetup = true ; } catch ( Exception e ) { subscriberJedis = null ; connectionSetup = false ; } if ( subscriberJedis != null ) { allotedJedis . put ( subscriberJedis , false ) ; logger . info ( ""Allocating jedis resource to caller: "" + subscriberJedis ) ; return subscriberJedis ; } } return null ; } ","public Jedis getJedisResource ( ) { Jedis subscriberJedis = null ; if ( isPoolSetup ( ) ) { try { subscriberJedis = JedisConnectionObject . pool . getResource ( ) ; connectionSetup = true ; } catch ( Exception e ) { subscriberJedis = null ; connectionSetup = false ; logger . error ( ""Fatal error! Could not get a resource from the pool."" ) ; } if ( subscriberJedis != null ) { allotedJedis . put ( subscriberJedis , false ) ; logger . info ( ""Allocating jedis resource to caller: "" + subscriberJedis ) ; return subscriberJedis ; } } return null ; } " 879,"public Jedis getJedisResource ( ) { Jedis subscriberJedis = null ; if ( isPoolSetup ( ) ) { try { subscriberJedis = JedisConnectionObject . pool . getResource ( ) ; connectionSetup = true ; } catch ( Exception e ) { subscriberJedis = null ; connectionSetup = false ; logger . error ( ""Fatal error! Could not get a resource from the pool."" ) ; } if ( subscriberJedis != null ) { allotedJedis . put ( subscriberJedis , false ) ; return subscriberJedis ; } } return null ; } ","public Jedis getJedisResource ( ) { Jedis subscriberJedis = null ; if ( isPoolSetup ( ) ) { try { subscriberJedis = JedisConnectionObject . pool . getResource ( ) ; connectionSetup = true ; } catch ( Exception e ) { subscriberJedis = null ; connectionSetup = false ; logger . error ( ""Fatal error! Could not get a resource from the pool."" ) ; } if ( subscriberJedis != null ) { allotedJedis . put ( subscriberJedis , false ) ; logger . info ( ""Allocating jedis resource to caller: "" + subscriberJedis ) ; return subscriberJedis ; } } return null ; } " 880,"protected void doProcessAction ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception { try { long groupId = ParamUtil . getLong ( actionRequest , ""groupId"" ) ; long classNameId = ParamUtil . getLong ( actionRequest , ""classNameId"" ) ; String className = _portal . getClassName ( classNameId ) ; long classPK = ParamUtil . getLong ( actionRequest , ""classPK"" ) ; InfoItemReference infoItemReference = new InfoItemReference ( className , classPK ) ; InfoItemObjectProvider < Object > infoItemObjectProvider = _infoItemServiceTracker . getFirstInfoItemService ( InfoItemObjectProvider . class , infoItemReference . getClassName ( ) ) ; InfoItemFieldValues infoItemFieldValues = InfoItemFieldValues . builder ( ) . infoItemReference ( infoItemReference ) . infoFieldValues ( _getInfoFieldValues ( actionRequest , className , infoItemObjectProvider . getInfoItem ( classPK ) ) ) . build ( ) ; ServiceContext serviceContext = ServiceContextFactory . getInstance ( actionRequest ) ; _translationEntryService . addOrUpdateTranslationEntry ( groupId , _getTargetLanguageId ( actionRequest ) , infoItemReference , infoItemFieldValues , serviceContext ) ; } catch ( Exception exception ) { SessionErrors . add ( actionRequest , exception . getClass ( ) , exception ) ; actionResponse . setRenderParameter ( ""mvcRenderCommandName"" , ""/translation/translate"" ) ; } } ","protected void doProcessAction ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception { try { long groupId = ParamUtil . getLong ( actionRequest , ""groupId"" ) ; long classNameId = ParamUtil . getLong ( actionRequest , ""classNameId"" ) ; String className = _portal . getClassName ( classNameId ) ; long classPK = ParamUtil . getLong ( actionRequest , ""classPK"" ) ; InfoItemReference infoItemReference = new InfoItemReference ( className , classPK ) ; InfoItemObjectProvider < Object > infoItemObjectProvider = _infoItemServiceTracker . getFirstInfoItemService ( InfoItemObjectProvider . class , infoItemReference . getClassName ( ) ) ; InfoItemFieldValues infoItemFieldValues = InfoItemFieldValues . builder ( ) . infoItemReference ( infoItemReference ) . infoFieldValues ( _getInfoFieldValues ( actionRequest , className , infoItemObjectProvider . getInfoItem ( classPK ) ) ) . build ( ) ; ServiceContext serviceContext = ServiceContextFactory . getInstance ( actionRequest ) ; _translationEntryService . addOrUpdateTranslationEntry ( groupId , _getTargetLanguageId ( actionRequest ) , infoItemReference , infoItemFieldValues , serviceContext ) ; } catch ( Exception exception ) { _log . error ( exception , exception ) ; SessionErrors . add ( actionRequest , exception . getClass ( ) , exception ) ; actionResponse . setRenderParameter ( ""mvcRenderCommandName"" , ""/translation/translate"" ) ; } } " 881,"@ Path ( ""/list"" ) @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Operation ( summary = ""Get all phasing only entities by using first/last index"" , description = ""Get all phasing only entities by using first/last index"" , tags = { ""accounts"" } , responses = { @ ApiResponse ( responseCode = ""200"" , description = ""Successful execution"" , content = @ Content ( mediaType = ""application/json"" , schema = @ Schema ( implementation = AccountControlPhasingResponse . class ) ) ) } ) @ PermitAll public Response getAllPhasingOnlyControls ( @ Parameter ( description = ""A zero-based index to the first, last asset ID to retrieve (optional)."" , schema = @ Schema ( implementation = FirstLastIndexBeanParam . class ) ) @ BeanParam FirstLastIndexBeanParam indexBeanParam ) { ResponseBuilder response = ResponseBuilder . startTiming ( ) ; indexBeanParam . adjustIndexes ( maxAPIFetchRecords ) ; AccountControlPhasingResponse dto = new AccountControlPhasingResponse ( ) ; dto . phasingOnlyControls = accountControlPhasingService . getAllStream ( indexBeanParam . getFirstIndex ( ) , indexBeanParam . getLastIndex ( ) ) . map ( item -> accountControlPhasingConverter . convert ( item ) ) . collect ( Collectors . toList ( ) ) ; log . trace ( ""getAllPhasingOnlyControls result: {}"" , dto ) ; return response . bind ( dto ) . build ( ) ; } ","@ Path ( ""/list"" ) @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Operation ( summary = ""Get all phasing only entities by using first/last index"" , description = ""Get all phasing only entities by using first/last index"" , tags = { ""accounts"" } , responses = { @ ApiResponse ( responseCode = ""200"" , description = ""Successful execution"" , content = @ Content ( mediaType = ""application/json"" , schema = @ Schema ( implementation = AccountControlPhasingResponse . class ) ) ) } ) @ PermitAll public Response getAllPhasingOnlyControls ( @ Parameter ( description = ""A zero-based index to the first, last asset ID to retrieve (optional)."" , schema = @ Schema ( implementation = FirstLastIndexBeanParam . class ) ) @ BeanParam FirstLastIndexBeanParam indexBeanParam ) { ResponseBuilder response = ResponseBuilder . startTiming ( ) ; indexBeanParam . adjustIndexes ( maxAPIFetchRecords ) ; log . trace ( ""Started getAllPhasingOnlyControls : \t indexBeanParam={}"" , indexBeanParam ) ; AccountControlPhasingResponse dto = new AccountControlPhasingResponse ( ) ; dto . phasingOnlyControls = accountControlPhasingService . getAllStream ( indexBeanParam . getFirstIndex ( ) , indexBeanParam . getLastIndex ( ) ) . map ( item -> accountControlPhasingConverter . convert ( item ) ) . collect ( Collectors . toList ( ) ) ; log . trace ( ""getAllPhasingOnlyControls result: {}"" , dto ) ; return response . bind ( dto ) . build ( ) ; } " 882,"@ Path ( ""/list"" ) @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Operation ( summary = ""Get all phasing only entities by using first/last index"" , description = ""Get all phasing only entities by using first/last index"" , tags = { ""accounts"" } , responses = { @ ApiResponse ( responseCode = ""200"" , description = ""Successful execution"" , content = @ Content ( mediaType = ""application/json"" , schema = @ Schema ( implementation = AccountControlPhasingResponse . class ) ) ) } ) @ PermitAll public Response getAllPhasingOnlyControls ( @ Parameter ( description = ""A zero-based index to the first, last asset ID to retrieve (optional)."" , schema = @ Schema ( implementation = FirstLastIndexBeanParam . class ) ) @ BeanParam FirstLastIndexBeanParam indexBeanParam ) { ResponseBuilder response = ResponseBuilder . startTiming ( ) ; indexBeanParam . adjustIndexes ( maxAPIFetchRecords ) ; log . trace ( ""Started getAllPhasingOnlyControls : \t indexBeanParam={}"" , indexBeanParam ) ; AccountControlPhasingResponse dto = new AccountControlPhasingResponse ( ) ; dto . phasingOnlyControls = accountControlPhasingService . getAllStream ( indexBeanParam . getFirstIndex ( ) , indexBeanParam . getLastIndex ( ) ) . map ( item -> accountControlPhasingConverter . convert ( item ) ) . collect ( Collectors . toList ( ) ) ; return response . bind ( dto ) . build ( ) ; } ","@ Path ( ""/list"" ) @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Operation ( summary = ""Get all phasing only entities by using first/last index"" , description = ""Get all phasing only entities by using first/last index"" , tags = { ""accounts"" } , responses = { @ ApiResponse ( responseCode = ""200"" , description = ""Successful execution"" , content = @ Content ( mediaType = ""application/json"" , schema = @ Schema ( implementation = AccountControlPhasingResponse . class ) ) ) } ) @ PermitAll public Response getAllPhasingOnlyControls ( @ Parameter ( description = ""A zero-based index to the first, last asset ID to retrieve (optional)."" , schema = @ Schema ( implementation = FirstLastIndexBeanParam . class ) ) @ BeanParam FirstLastIndexBeanParam indexBeanParam ) { ResponseBuilder response = ResponseBuilder . startTiming ( ) ; indexBeanParam . adjustIndexes ( maxAPIFetchRecords ) ; log . trace ( ""Started getAllPhasingOnlyControls : \t indexBeanParam={}"" , indexBeanParam ) ; AccountControlPhasingResponse dto = new AccountControlPhasingResponse ( ) ; dto . phasingOnlyControls = accountControlPhasingService . getAllStream ( indexBeanParam . getFirstIndex ( ) , indexBeanParam . getLastIndex ( ) ) . map ( item -> accountControlPhasingConverter . convert ( item ) ) . collect ( Collectors . toList ( ) ) ; log . trace ( ""getAllPhasingOnlyControls result: {}"" , dto ) ; return response . bind ( dto ) . build ( ) ; } " 883,"@ Activate public void activate ( ) { ScriptStandaloneSetup . doSetup ( scriptServiceUtil , this ) ; } ","@ Activate public void activate ( ) { ScriptStandaloneSetup . doSetup ( scriptServiceUtil , this ) ; logger . debug ( ""Registered 'script' configuration parser"" ) ; } " 884,"public Exchange receiveNoWait ( Endpoint endpoint ) { if ( camelContext . isStopped ( ) ) { throw new RejectedExecutionException ( ""CamelContext is stopped"" ) ; } PollingConsumer consumer = null ; try { consumer = acquirePollingConsumer ( endpoint ) ; return consumer . receiveNoWait ( ) ; } finally { if ( consumer != null ) { releasePollingConsumer ( endpoint , consumer ) ; } } } ","public Exchange receiveNoWait ( Endpoint endpoint ) { if ( camelContext . isStopped ( ) ) { throw new RejectedExecutionException ( ""CamelContext is stopped"" ) ; } LOG . debug ( ""<<<< {}"" , endpoint ) ; PollingConsumer consumer = null ; try { consumer = acquirePollingConsumer ( endpoint ) ; return consumer . receiveNoWait ( ) ; } finally { if ( consumer != null ) { releasePollingConsumer ( endpoint , consumer ) ; } } } " 885,"public IOpenField getField ( String fname ) { try { return getField ( fname , true ) ; } catch ( AmbiguousFieldException e ) { return null ; } } ","public IOpenField getField ( String fname ) { try { return getField ( fname , true ) ; } catch ( AmbiguousFieldException e ) { LOG . debug ( ""Ignored error: "" , e ) ; return null ; } } " 886,"private void executeBatch ( ) throws SQLException , IOException , InterruptedException { if ( records . isEmpty ( ) ) { return ; } if ( connection == null ) { connection = dataSource . getConnection ( ) ; connection . setAutoCommit ( false ) ; preparedStatement = connection . prepareStatement ( spec . getStatement ( ) . get ( ) ) ; } Sleeper sleeper = Sleeper . DEFAULT ; BackOff backoff = retryBackOff . backoff ( ) ; while ( true ) { try ( PreparedStatement preparedStatement = connection . prepareStatement ( spec . getStatement ( ) . get ( ) ) ) { try { for ( T record : records ) { processRecord ( record , preparedStatement ) ; } preparedStatement . executeBatch ( ) ; connection . commit ( ) ; break ; } catch ( SQLException exception ) { if ( ! spec . getRetryStrategy ( ) . apply ( exception ) ) { throw exception ; } preparedStatement . clearBatch ( ) ; connection . rollback ( ) ; if ( ! BackOffUtils . next ( sleeper , backoff ) ) { throw exception ; } } } } records . clear ( ) ; } ","private void executeBatch ( ) throws SQLException , IOException , InterruptedException { if ( records . isEmpty ( ) ) { return ; } if ( connection == null ) { connection = dataSource . getConnection ( ) ; connection . setAutoCommit ( false ) ; preparedStatement = connection . prepareStatement ( spec . getStatement ( ) . get ( ) ) ; } Sleeper sleeper = Sleeper . DEFAULT ; BackOff backoff = retryBackOff . backoff ( ) ; while ( true ) { try ( PreparedStatement preparedStatement = connection . prepareStatement ( spec . getStatement ( ) . get ( ) ) ) { try { for ( T record : records ) { processRecord ( record , preparedStatement ) ; } preparedStatement . executeBatch ( ) ; connection . commit ( ) ; break ; } catch ( SQLException exception ) { if ( ! spec . getRetryStrategy ( ) . apply ( exception ) ) { throw exception ; } LOG . warn ( ""Deadlock detected, retrying"" , exception ) ; preparedStatement . clearBatch ( ) ; connection . rollback ( ) ; if ( ! BackOffUtils . next ( sleeper , backoff ) ) { throw exception ; } } } } records . clear ( ) ; } " 887,"public void publish ( java . util . logging . LogRecord record ) { if ( record == null ) return ; Logger log4jLog = getLog4jLogger ( record ) ; Level level = toLevel ( record . getLevel ( ) ) ; String msg = julFormatter . formatMessage ( record ) ; Throwable thrown = record . getThrown ( ) ; if ( log4jLog instanceof ExtendedLogger ) { try { ( ( ExtendedLogger ) log4jLog ) . logIfEnabled ( FQCN , level , null , msg , thrown ) ; } catch ( NoClassDefFoundError e ) { log4jLog . log ( level , msg , thrown ) ; } } else log4jLog . log ( level , msg , thrown ) ; } ","public void publish ( java . util . logging . LogRecord record ) { if ( record == null ) return ; Logger log4jLog = getLog4jLogger ( record ) ; Level level = toLevel ( record . getLevel ( ) ) ; String msg = julFormatter . formatMessage ( record ) ; Throwable thrown = record . getThrown ( ) ; if ( log4jLog instanceof ExtendedLogger ) { try { ( ( ExtendedLogger ) log4jLog ) . logIfEnabled ( FQCN , level , null , msg , thrown ) ; } catch ( NoClassDefFoundError e ) { log4jLog . warn ( ""Log4jBridgeHandler: ignored exception when calling 'ExtendedLogger'"" , e ) ; log4jLog . log ( level , msg , thrown ) ; } } else log4jLog . log ( level , msg , thrown ) ; } " 888,"private void initWebKeys ( Conf conf ) { final String jwksUri = conf . getDynamic ( ) . getJwksUri ( ) ; if ( jwksUri . startsWith ( conf . getDynamic ( ) . getIssuer ( ) ) ) { if ( conf . getWebKeys ( ) != null ) { jwks = conf . getWebKeys ( ) ; } else { generateWebKeys ( ) ; } return ; } final JSONObject keys = JwtUtil . getJSONWebKeys ( jwksUri ) ; final JSONWebKeySet keySet = JSONWebKeySet . fromJSONObject ( keys ) ; jwks = new WebKeysConfiguration ( ) ; jwks . setKeys ( keySet . getKeys ( ) ) ; } ","private void initWebKeys ( Conf conf ) { final String jwksUri = conf . getDynamic ( ) . getJwksUri ( ) ; if ( jwksUri . startsWith ( conf . getDynamic ( ) . getIssuer ( ) ) ) { if ( conf . getWebKeys ( ) != null ) { jwks = conf . getWebKeys ( ) ; } else { generateWebKeys ( ) ; } return ; } final JSONObject keys = JwtUtil . getJSONWebKeys ( jwksUri ) ; log . trace ( ""Downloaded external keys from "" + jwksUri + "", keys: "" + keys ) ; final JSONWebKeySet keySet = JSONWebKeySet . fromJSONObject ( keys ) ; jwks = new WebKeysConfiguration ( ) ; jwks . setKeys ( keySet . getKeys ( ) ) ; } " 889,"@ Test public void testBoard ( ) throws IOException , DeploymentException , InterruptedException , ExecutionException { URI restUri = URI . create ( ""http://localhost:"" + server . port ( ) + ""/rest/board"" ) ; for ( String message : messages ) { restClient . post ( ) . uri ( restUri ) . submit ( message ) . thenAccept ( it -> assertThat ( it . status ( ) , is ( Http . Status . NO_CONTENT_204 ) ) ) . toCompletableFuture ( ) . get ( ) ; } URI websocketUri = URI . create ( ""ws://localhost:"" + server . port ( ) + ""/websocket/board"" ) ; CountDownLatch messageLatch = new CountDownLatch ( messages . length ) ; ClientEndpointConfig config = ClientEndpointConfig . Builder . create ( ) . build ( ) ; websocketClient . connectToServer ( new Endpoint ( ) { @ Override public void onOpen ( Session session , EndpointConfig EndpointConfig ) { try { session . addMessageHandler ( new MessageHandler . Whole < String > ( ) { @ Override public void onMessage ( String message ) { LOGGER . info ( ""Client OnMessage called '"" + message + ""'"" ) ; messageLatch . countDown ( ) ; if ( messageLatch . getCount ( ) == 0 ) { try { session . close ( ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } } } ) ; session . getBasicRemote ( ) . sendText ( ""SEND"" ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } @ Override public void onClose ( Session session , CloseReason closeReason ) { LOGGER . info ( ""Client OnClose called '"" + closeReason + ""'"" ) ; } @ Override public void onError ( Session session , Throwable thr ) { LOGGER . info ( ""Client OnError called '"" + thr + ""'"" ) ; } } , config , websocketUri ) ; messageLatch . await ( 1000000 , TimeUnit . SECONDS ) ; } ","@ Test public void testBoard ( ) throws IOException , DeploymentException , InterruptedException , ExecutionException { URI restUri = URI . create ( ""http://localhost:"" + server . port ( ) + ""/rest/board"" ) ; for ( String message : messages ) { restClient . post ( ) . uri ( restUri ) . submit ( message ) . thenAccept ( it -> assertThat ( it . status ( ) , is ( Http . Status . NO_CONTENT_204 ) ) ) . toCompletableFuture ( ) . get ( ) ; LOGGER . info ( ""Posting message '"" + message + ""'"" ) ; } URI websocketUri = URI . create ( ""ws://localhost:"" + server . port ( ) + ""/websocket/board"" ) ; CountDownLatch messageLatch = new CountDownLatch ( messages . length ) ; ClientEndpointConfig config = ClientEndpointConfig . Builder . create ( ) . build ( ) ; websocketClient . connectToServer ( new Endpoint ( ) { @ Override public void onOpen ( Session session , EndpointConfig EndpointConfig ) { try { session . addMessageHandler ( new MessageHandler . Whole < String > ( ) { @ Override public void onMessage ( String message ) { LOGGER . info ( ""Client OnMessage called '"" + message + ""'"" ) ; messageLatch . countDown ( ) ; if ( messageLatch . getCount ( ) == 0 ) { try { session . close ( ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } } } ) ; session . getBasicRemote ( ) . sendText ( ""SEND"" ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } @ Override public void onClose ( Session session , CloseReason closeReason ) { LOGGER . info ( ""Client OnClose called '"" + closeReason + ""'"" ) ; } @ Override public void onError ( Session session , Throwable thr ) { LOGGER . info ( ""Client OnError called '"" + thr + ""'"" ) ; } } , config , websocketUri ) ; messageLatch . await ( 1000000 , TimeUnit . SECONDS ) ; } " 890,"@ Test public void testBoard ( ) throws IOException , DeploymentException , InterruptedException , ExecutionException { URI restUri = URI . create ( ""http://localhost:"" + server . port ( ) + ""/rest/board"" ) ; for ( String message : messages ) { restClient . post ( ) . uri ( restUri ) . submit ( message ) . thenAccept ( it -> assertThat ( it . status ( ) , is ( Http . Status . NO_CONTENT_204 ) ) ) . toCompletableFuture ( ) . get ( ) ; LOGGER . info ( ""Posting message '"" + message + ""'"" ) ; } URI websocketUri = URI . create ( ""ws://localhost:"" + server . port ( ) + ""/websocket/board"" ) ; CountDownLatch messageLatch = new CountDownLatch ( messages . length ) ; ClientEndpointConfig config = ClientEndpointConfig . Builder . create ( ) . build ( ) ; websocketClient . connectToServer ( new Endpoint ( ) { @ Override public void onOpen ( Session session , EndpointConfig EndpointConfig ) { try { session . addMessageHandler ( new MessageHandler . Whole < String > ( ) { @ Override public void onMessage ( String message ) { messageLatch . countDown ( ) ; if ( messageLatch . getCount ( ) == 0 ) { try { session . close ( ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } } } ) ; session . getBasicRemote ( ) . sendText ( ""SEND"" ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } @ Override public void onClose ( Session session , CloseReason closeReason ) { LOGGER . info ( ""Client OnClose called '"" + closeReason + ""'"" ) ; } @ Override public void onError ( Session session , Throwable thr ) { LOGGER . info ( ""Client OnError called '"" + thr + ""'"" ) ; } } , config , websocketUri ) ; messageLatch . await ( 1000000 , TimeUnit . SECONDS ) ; } ","@ Test public void testBoard ( ) throws IOException , DeploymentException , InterruptedException , ExecutionException { URI restUri = URI . create ( ""http://localhost:"" + server . port ( ) + ""/rest/board"" ) ; for ( String message : messages ) { restClient . post ( ) . uri ( restUri ) . submit ( message ) . thenAccept ( it -> assertThat ( it . status ( ) , is ( Http . Status . NO_CONTENT_204 ) ) ) . toCompletableFuture ( ) . get ( ) ; LOGGER . info ( ""Posting message '"" + message + ""'"" ) ; } URI websocketUri = URI . create ( ""ws://localhost:"" + server . port ( ) + ""/websocket/board"" ) ; CountDownLatch messageLatch = new CountDownLatch ( messages . length ) ; ClientEndpointConfig config = ClientEndpointConfig . Builder . create ( ) . build ( ) ; websocketClient . connectToServer ( new Endpoint ( ) { @ Override public void onOpen ( Session session , EndpointConfig EndpointConfig ) { try { session . addMessageHandler ( new MessageHandler . Whole < String > ( ) { @ Override public void onMessage ( String message ) { LOGGER . info ( ""Client OnMessage called '"" + message + ""'"" ) ; messageLatch . countDown ( ) ; if ( messageLatch . getCount ( ) == 0 ) { try { session . close ( ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } } } ) ; session . getBasicRemote ( ) . sendText ( ""SEND"" ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } @ Override public void onClose ( Session session , CloseReason closeReason ) { LOGGER . info ( ""Client OnClose called '"" + closeReason + ""'"" ) ; } @ Override public void onError ( Session session , Throwable thr ) { LOGGER . info ( ""Client OnError called '"" + thr + ""'"" ) ; } } , config , websocketUri ) ; messageLatch . await ( 1000000 , TimeUnit . SECONDS ) ; } " 891,"@ Test public void testBoard ( ) throws IOException , DeploymentException , InterruptedException , ExecutionException { URI restUri = URI . create ( ""http://localhost:"" + server . port ( ) + ""/rest/board"" ) ; for ( String message : messages ) { restClient . post ( ) . uri ( restUri ) . submit ( message ) . thenAccept ( it -> assertThat ( it . status ( ) , is ( Http . Status . NO_CONTENT_204 ) ) ) . toCompletableFuture ( ) . get ( ) ; LOGGER . info ( ""Posting message '"" + message + ""'"" ) ; } URI websocketUri = URI . create ( ""ws://localhost:"" + server . port ( ) + ""/websocket/board"" ) ; CountDownLatch messageLatch = new CountDownLatch ( messages . length ) ; ClientEndpointConfig config = ClientEndpointConfig . Builder . create ( ) . build ( ) ; websocketClient . connectToServer ( new Endpoint ( ) { @ Override public void onOpen ( Session session , EndpointConfig EndpointConfig ) { try { session . addMessageHandler ( new MessageHandler . Whole < String > ( ) { @ Override public void onMessage ( String message ) { LOGGER . info ( ""Client OnMessage called '"" + message + ""'"" ) ; messageLatch . countDown ( ) ; if ( messageLatch . getCount ( ) == 0 ) { try { session . close ( ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } } } ) ; session . getBasicRemote ( ) . sendText ( ""SEND"" ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } @ Override public void onClose ( Session session , CloseReason closeReason ) { } @ Override public void onError ( Session session , Throwable thr ) { LOGGER . info ( ""Client OnError called '"" + thr + ""'"" ) ; } } , config , websocketUri ) ; messageLatch . await ( 1000000 , TimeUnit . SECONDS ) ; } ","@ Test public void testBoard ( ) throws IOException , DeploymentException , InterruptedException , ExecutionException { URI restUri = URI . create ( ""http://localhost:"" + server . port ( ) + ""/rest/board"" ) ; for ( String message : messages ) { restClient . post ( ) . uri ( restUri ) . submit ( message ) . thenAccept ( it -> assertThat ( it . status ( ) , is ( Http . Status . NO_CONTENT_204 ) ) ) . toCompletableFuture ( ) . get ( ) ; LOGGER . info ( ""Posting message '"" + message + ""'"" ) ; } URI websocketUri = URI . create ( ""ws://localhost:"" + server . port ( ) + ""/websocket/board"" ) ; CountDownLatch messageLatch = new CountDownLatch ( messages . length ) ; ClientEndpointConfig config = ClientEndpointConfig . Builder . create ( ) . build ( ) ; websocketClient . connectToServer ( new Endpoint ( ) { @ Override public void onOpen ( Session session , EndpointConfig EndpointConfig ) { try { session . addMessageHandler ( new MessageHandler . Whole < String > ( ) { @ Override public void onMessage ( String message ) { LOGGER . info ( ""Client OnMessage called '"" + message + ""'"" ) ; messageLatch . countDown ( ) ; if ( messageLatch . getCount ( ) == 0 ) { try { session . close ( ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } } } ) ; session . getBasicRemote ( ) . sendText ( ""SEND"" ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } @ Override public void onClose ( Session session , CloseReason closeReason ) { LOGGER . info ( ""Client OnClose called '"" + closeReason + ""'"" ) ; } @ Override public void onError ( Session session , Throwable thr ) { LOGGER . info ( ""Client OnError called '"" + thr + ""'"" ) ; } } , config , websocketUri ) ; messageLatch . await ( 1000000 , TimeUnit . SECONDS ) ; } " 892,"@ Test public void testBoard ( ) throws IOException , DeploymentException , InterruptedException , ExecutionException { URI restUri = URI . create ( ""http://localhost:"" + server . port ( ) + ""/rest/board"" ) ; for ( String message : messages ) { restClient . post ( ) . uri ( restUri ) . submit ( message ) . thenAccept ( it -> assertThat ( it . status ( ) , is ( Http . Status . NO_CONTENT_204 ) ) ) . toCompletableFuture ( ) . get ( ) ; LOGGER . info ( ""Posting message '"" + message + ""'"" ) ; } URI websocketUri = URI . create ( ""ws://localhost:"" + server . port ( ) + ""/websocket/board"" ) ; CountDownLatch messageLatch = new CountDownLatch ( messages . length ) ; ClientEndpointConfig config = ClientEndpointConfig . Builder . create ( ) . build ( ) ; websocketClient . connectToServer ( new Endpoint ( ) { @ Override public void onOpen ( Session session , EndpointConfig EndpointConfig ) { try { session . addMessageHandler ( new MessageHandler . Whole < String > ( ) { @ Override public void onMessage ( String message ) { LOGGER . info ( ""Client OnMessage called '"" + message + ""'"" ) ; messageLatch . countDown ( ) ; if ( messageLatch . getCount ( ) == 0 ) { try { session . close ( ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } } } ) ; session . getBasicRemote ( ) . sendText ( ""SEND"" ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } @ Override public void onClose ( Session session , CloseReason closeReason ) { LOGGER . info ( ""Client OnClose called '"" + closeReason + ""'"" ) ; } @ Override public void onError ( Session session , Throwable thr ) { } } , config , websocketUri ) ; messageLatch . await ( 1000000 , TimeUnit . SECONDS ) ; } ","@ Test public void testBoard ( ) throws IOException , DeploymentException , InterruptedException , ExecutionException { URI restUri = URI . create ( ""http://localhost:"" + server . port ( ) + ""/rest/board"" ) ; for ( String message : messages ) { restClient . post ( ) . uri ( restUri ) . submit ( message ) . thenAccept ( it -> assertThat ( it . status ( ) , is ( Http . Status . NO_CONTENT_204 ) ) ) . toCompletableFuture ( ) . get ( ) ; LOGGER . info ( ""Posting message '"" + message + ""'"" ) ; } URI websocketUri = URI . create ( ""ws://localhost:"" + server . port ( ) + ""/websocket/board"" ) ; CountDownLatch messageLatch = new CountDownLatch ( messages . length ) ; ClientEndpointConfig config = ClientEndpointConfig . Builder . create ( ) . build ( ) ; websocketClient . connectToServer ( new Endpoint ( ) { @ Override public void onOpen ( Session session , EndpointConfig EndpointConfig ) { try { session . addMessageHandler ( new MessageHandler . Whole < String > ( ) { @ Override public void onMessage ( String message ) { LOGGER . info ( ""Client OnMessage called '"" + message + ""'"" ) ; messageLatch . countDown ( ) ; if ( messageLatch . getCount ( ) == 0 ) { try { session . close ( ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } } } ) ; session . getBasicRemote ( ) . sendText ( ""SEND"" ) ; } catch ( IOException e ) { fail ( ""Unexpected exception "" + e ) ; } } @ Override public void onClose ( Session session , CloseReason closeReason ) { LOGGER . info ( ""Client OnClose called '"" + closeReason + ""'"" ) ; } @ Override public void onError ( Session session , Throwable thr ) { LOGGER . info ( ""Client OnError called '"" + thr + ""'"" ) ; } } , config , websocketUri ) ; messageLatch . await ( 1000000 , TimeUnit . SECONDS ) ; } " 893,"public boolean containsUndeclaredUnits ( ) { if ( isSetRefId ( ) ) { CallableSBase reference = getReferenceInstance ( ) ; if ( reference != null && reference instanceof QuantityWithUnit ) { return ! ( ( QuantityWithUnit ) reference ) . isSetUnits ( ) ; } else { return true ; } } return false ; } ","public boolean containsUndeclaredUnits ( ) { if ( isSetRefId ( ) ) { CallableSBase reference = getReferenceInstance ( ) ; if ( reference != null && reference instanceof QuantityWithUnit ) { return ! ( ( QuantityWithUnit ) reference ) . isSetUnits ( ) ; } else { logger . warn ( ""??"" ) ; return true ; } } return false ; } " 894,"@ Test public void playerAutoTerminationTest ( ) throws Exception { String id = uploadFile ( new File ( ""test-files/sample.txt"" ) ) ; RepositoryHttpPlayer player = getRepository ( ) . findRepositoryItemById ( id ) . createRepositoryHttpPlayer ( ) ; player . setAutoTerminationTimeout ( 1000 ) ; RestTemplate template = getRestTemplate ( ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 1 Passed"" ) ; Thread . sleep ( 300 ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 2 Passed"" ) ; Thread . sleep ( 1500 ) ; assertEquals ( HttpStatus . NOT_FOUND , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 3 Passed"" ) ; } ","@ Test public void playerAutoTerminationTest ( ) throws Exception { String id = uploadFile ( new File ( ""test-files/sample.txt"" ) ) ; log . debug ( ""File uploaded"" ) ; RepositoryHttpPlayer player = getRepository ( ) . findRepositoryItemById ( id ) . createRepositoryHttpPlayer ( ) ; player . setAutoTerminationTimeout ( 1000 ) ; RestTemplate template = getRestTemplate ( ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 1 Passed"" ) ; Thread . sleep ( 300 ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 2 Passed"" ) ; Thread . sleep ( 1500 ) ; assertEquals ( HttpStatus . NOT_FOUND , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 3 Passed"" ) ; } " 895,"@ Test public void playerAutoTerminationTest ( ) throws Exception { String id = uploadFile ( new File ( ""test-files/sample.txt"" ) ) ; log . debug ( ""File uploaded"" ) ; RepositoryHttpPlayer player = getRepository ( ) . findRepositoryItemById ( id ) . createRepositoryHttpPlayer ( ) ; player . setAutoTerminationTimeout ( 1000 ) ; RestTemplate template = getRestTemplate ( ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; Thread . sleep ( 300 ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 2 Passed"" ) ; Thread . sleep ( 1500 ) ; assertEquals ( HttpStatus . NOT_FOUND , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 3 Passed"" ) ; } ","@ Test public void playerAutoTerminationTest ( ) throws Exception { String id = uploadFile ( new File ( ""test-files/sample.txt"" ) ) ; log . debug ( ""File uploaded"" ) ; RepositoryHttpPlayer player = getRepository ( ) . findRepositoryItemById ( id ) . createRepositoryHttpPlayer ( ) ; player . setAutoTerminationTimeout ( 1000 ) ; RestTemplate template = getRestTemplate ( ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 1 Passed"" ) ; Thread . sleep ( 300 ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 2 Passed"" ) ; Thread . sleep ( 1500 ) ; assertEquals ( HttpStatus . NOT_FOUND , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 3 Passed"" ) ; } " 896,"@ Test public void playerAutoTerminationTest ( ) throws Exception { String id = uploadFile ( new File ( ""test-files/sample.txt"" ) ) ; log . debug ( ""File uploaded"" ) ; RepositoryHttpPlayer player = getRepository ( ) . findRepositoryItemById ( id ) . createRepositoryHttpPlayer ( ) ; player . setAutoTerminationTimeout ( 1000 ) ; RestTemplate template = getRestTemplate ( ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 1 Passed"" ) ; Thread . sleep ( 300 ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; Thread . sleep ( 1500 ) ; assertEquals ( HttpStatus . NOT_FOUND , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 3 Passed"" ) ; } ","@ Test public void playerAutoTerminationTest ( ) throws Exception { String id = uploadFile ( new File ( ""test-files/sample.txt"" ) ) ; log . debug ( ""File uploaded"" ) ; RepositoryHttpPlayer player = getRepository ( ) . findRepositoryItemById ( id ) . createRepositoryHttpPlayer ( ) ; player . setAutoTerminationTimeout ( 1000 ) ; RestTemplate template = getRestTemplate ( ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 1 Passed"" ) ; Thread . sleep ( 300 ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 2 Passed"" ) ; Thread . sleep ( 1500 ) ; assertEquals ( HttpStatus . NOT_FOUND , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 3 Passed"" ) ; } " 897,"@ Test public void playerAutoTerminationTest ( ) throws Exception { String id = uploadFile ( new File ( ""test-files/sample.txt"" ) ) ; log . debug ( ""File uploaded"" ) ; RepositoryHttpPlayer player = getRepository ( ) . findRepositoryItemById ( id ) . createRepositoryHttpPlayer ( ) ; player . setAutoTerminationTimeout ( 1000 ) ; RestTemplate template = getRestTemplate ( ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 1 Passed"" ) ; Thread . sleep ( 300 ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 2 Passed"" ) ; Thread . sleep ( 1500 ) ; assertEquals ( HttpStatus . NOT_FOUND , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; } ","@ Test public void playerAutoTerminationTest ( ) throws Exception { String id = uploadFile ( new File ( ""test-files/sample.txt"" ) ) ; log . debug ( ""File uploaded"" ) ; RepositoryHttpPlayer player = getRepository ( ) . findRepositoryItemById ( id ) . createRepositoryHttpPlayer ( ) ; player . setAutoTerminationTimeout ( 1000 ) ; RestTemplate template = getRestTemplate ( ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 1 Passed"" ) ; Thread . sleep ( 300 ) ; assertEquals ( HttpStatus . OK , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 2 Passed"" ) ; Thread . sleep ( 1500 ) ; assertEquals ( HttpStatus . NOT_FOUND , template . getForEntity ( player . getURL ( ) , byte [ ] . class ) . getStatusCode ( ) ) ; log . debug ( ""Request 3 Passed"" ) ; } " 898,"public void unscheduleRunOnceJob ( String subject , String externalId ) { if ( LOGGER . isDebugEnabled ( ) ) { } JobId jobId = new RunOnceJobId ( subject , externalId ) ; logObjectIfNotNull ( jobId ) ; unscheduleJob ( jobId . value ( ) ) ; } ","public void unscheduleRunOnceJob ( String subject , String externalId ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( format ( ""unscheduling run once job: "" + LOG_SUBJECT_EXTERNAL_ID , subject , externalId ) ) ; } JobId jobId = new RunOnceJobId ( subject , externalId ) ; logObjectIfNotNull ( jobId ) ; unscheduleJob ( jobId . value ( ) ) ; } " 899,"void removeLocalArtifacts ( Set < Artifact > artifacts ) { if ( localRepo != null ) { Iterator < Artifact > it = artifacts . iterator ( ) ; while ( it . hasNext ( ) ) { Artifact artifact = it . next ( ) ; if ( getFileInLocalRepo ( artifact . getFile ( ) ) != null ) { it . remove ( ) ; } } } } ","void removeLocalArtifacts ( Set < Artifact > artifacts ) { if ( localRepo != null ) { Iterator < Artifact > it = artifacts . iterator ( ) ; while ( it . hasNext ( ) ) { Artifact artifact = it . next ( ) ; if ( getFileInLocalRepo ( artifact . getFile ( ) ) != null ) { LOG . trace ( ""Removing artifact {}"" , artifact ) ; it . remove ( ) ; } } } } " 900,"public void open ( ) { String serviceEndpoint = getProperty ( SPARQL_SERVICE_ENDPOINT ) ; boolean replaceURIs = getProperty ( SPARQL_REPLACE_URIS ) != null && getProperty ( SPARQL_REPLACE_URIS ) . equals ( ""true"" ) ; boolean removeDatatypes = getProperty ( SPARQL_REMOVE_DATATYPES ) != null && getProperty ( SPARQL_REMOVE_DATATYPES ) . equals ( ""true"" ) ; String engineType = getProperty ( SPARQL_ENGINE_TYPE ) ; if ( SparqlEngineType . JENA . toString ( ) . equals ( engineType ) ) { engine = new JenaInterpreter ( serviceEndpoint , replaceURIs , removeDatatypes ) ; } } ","public void open ( ) { LOGGER . info ( ""Properties: {}"" , getProperties ( ) ) ; String serviceEndpoint = getProperty ( SPARQL_SERVICE_ENDPOINT ) ; boolean replaceURIs = getProperty ( SPARQL_REPLACE_URIS ) != null && getProperty ( SPARQL_REPLACE_URIS ) . equals ( ""true"" ) ; boolean removeDatatypes = getProperty ( SPARQL_REMOVE_DATATYPES ) != null && getProperty ( SPARQL_REMOVE_DATATYPES ) . equals ( ""true"" ) ; String engineType = getProperty ( SPARQL_ENGINE_TYPE ) ; if ( SparqlEngineType . JENA . toString ( ) . equals ( engineType ) ) { engine = new JenaInterpreter ( serviceEndpoint , replaceURIs , removeDatatypes ) ; } } " 901,"public boolean datenLesen ( Path xmlFilePath ) { boolean ret = false ; if ( Files . exists ( xmlFilePath ) ) { DatenPset datenPset = null ; XMLStreamReader parser = null ; try ( InputStream is = Files . newInputStream ( xmlFilePath ) ; InputStreamReader in = new InputStreamReader ( is , StandardCharsets . UTF_8 ) ) { parser = inFactory . createXMLStreamReader ( in ) ; while ( parser . hasNext ( ) ) { final int event = parser . next ( ) ; if ( event == XMLStreamConstants . START_ELEMENT ) { switch ( parser . getLocalName ( ) ) { case MVConfig . SYSTEM -> readSystemConfiguration ( parser ) ; case DatenPset . TAG -> { datenPset = new DatenPset ( ) ; if ( get ( parser , DatenPset . TAG , DatenPset . XML_NAMES , datenPset . arr ) ) { Daten . listePset . add ( datenPset ) ; } } case DatenProg . TAG -> { DatenProg datenProg = new DatenProg ( ) ; if ( get ( parser , DatenProg . TAG , DatenProg . XML_NAMES , datenProg . arr ) ) { if ( datenPset != null ) { datenPset . addProg ( datenProg ) ; } } } case ReplaceList . REPLACELIST -> readReplacementList ( parser ) ; case DatenAbo . TAG -> readAboEntry ( parser ) ; case DatenDownload . TAG -> readDownloadEntry ( parser ) ; case BlacklistRule . TAG -> readBlacklist ( parser ) ; case DatenMediaPath . TAG -> readMediaPath ( parser ) ; } } } ret = true ; } catch ( Exception ex ) { ret = false ; } finally { if ( parser != null ) { try { parser . close ( ) ; } catch ( XMLStreamException ignored ) { } } } sortLists ( ) ; MVConfig . loadSystemParameter ( ) ; } return ret ; } ","public boolean datenLesen ( Path xmlFilePath ) { boolean ret = false ; if ( Files . exists ( xmlFilePath ) ) { DatenPset datenPset = null ; XMLStreamReader parser = null ; try ( InputStream is = Files . newInputStream ( xmlFilePath ) ; InputStreamReader in = new InputStreamReader ( is , StandardCharsets . UTF_8 ) ) { parser = inFactory . createXMLStreamReader ( in ) ; while ( parser . hasNext ( ) ) { final int event = parser . next ( ) ; if ( event == XMLStreamConstants . START_ELEMENT ) { switch ( parser . getLocalName ( ) ) { case MVConfig . SYSTEM -> readSystemConfiguration ( parser ) ; case DatenPset . TAG -> { datenPset = new DatenPset ( ) ; if ( get ( parser , DatenPset . TAG , DatenPset . XML_NAMES , datenPset . arr ) ) { Daten . listePset . add ( datenPset ) ; } } case DatenProg . TAG -> { DatenProg datenProg = new DatenProg ( ) ; if ( get ( parser , DatenProg . TAG , DatenProg . XML_NAMES , datenProg . arr ) ) { if ( datenPset != null ) { datenPset . addProg ( datenProg ) ; } } } case ReplaceList . REPLACELIST -> readReplacementList ( parser ) ; case DatenAbo . TAG -> readAboEntry ( parser ) ; case DatenDownload . TAG -> readDownloadEntry ( parser ) ; case BlacklistRule . TAG -> readBlacklist ( parser ) ; case DatenMediaPath . TAG -> readMediaPath ( parser ) ; } } } ret = true ; } catch ( Exception ex ) { ret = false ; logger . error ( ""datenLesen"" , ex ) ; } finally { if ( parser != null ) { try { parser . close ( ) ; } catch ( XMLStreamException ignored ) { } } } sortLists ( ) ; MVConfig . loadSystemParameter ( ) ; } return ret ; } " 902,"public void deleteEverything ( SqlSession session ) { Collection < String > ops = new TreeSet < > ( db . getMyBatisConfiguration ( ) . getMappedStatementNames ( ) ) ; for ( String name : ops ) if ( name . startsWith ( ""deletedb-"" ) ) session . update ( name ) ; for ( String name : ops ) if ( name . startsWith ( ""resetIndex-"" ) ) session . update ( name ) ; log . info ( ""Database contents was completely deleted"" ) ; createRootGroup ( session ) ; } ","public void deleteEverything ( SqlSession session ) { log . info ( ""Database contents will be completely deleted"" ) ; Collection < String > ops = new TreeSet < > ( db . getMyBatisConfiguration ( ) . getMappedStatementNames ( ) ) ; for ( String name : ops ) if ( name . startsWith ( ""deletedb-"" ) ) session . update ( name ) ; for ( String name : ops ) if ( name . startsWith ( ""resetIndex-"" ) ) session . update ( name ) ; log . info ( ""Database contents was completely deleted"" ) ; createRootGroup ( session ) ; } " 903,"public void deleteEverything ( SqlSession session ) { log . info ( ""Database contents will be completely deleted"" ) ; Collection < String > ops = new TreeSet < > ( db . getMyBatisConfiguration ( ) . getMappedStatementNames ( ) ) ; for ( String name : ops ) if ( name . startsWith ( ""deletedb-"" ) ) session . update ( name ) ; for ( String name : ops ) if ( name . startsWith ( ""resetIndex-"" ) ) session . update ( name ) ; createRootGroup ( session ) ; } ","public void deleteEverything ( SqlSession session ) { log . info ( ""Database contents will be completely deleted"" ) ; Collection < String > ops = new TreeSet < > ( db . getMyBatisConfiguration ( ) . getMappedStatementNames ( ) ) ; for ( String name : ops ) if ( name . startsWith ( ""deletedb-"" ) ) session . update ( name ) ; for ( String name : ops ) if ( name . startsWith ( ""resetIndex-"" ) ) session . update ( name ) ; log . info ( ""Database contents was completely deleted"" ) ; createRootGroup ( session ) ; } " 904,"private synchronized void monitorConnection ( ) { if ( future == null || future . isDone ( ) || future . isCancelled ( ) ) { future = executorService . scheduleAtFixedRate ( this , 1 , monitorInterval , TimeUnit . MILLISECONDS ) ; } else { log . info ( ""Monitor already running."" ) ; } } ","private synchronized void monitorConnection ( ) { if ( future == null || future . isDone ( ) || future . isCancelled ( ) ) { log . info ( ""Scheduling connection retries."" ) ; future = executorService . scheduleAtFixedRate ( this , 1 , monitorInterval , TimeUnit . MILLISECONDS ) ; } else { log . info ( ""Monitor already running."" ) ; } } " 905,"private synchronized void monitorConnection ( ) { if ( future == null || future . isDone ( ) || future . isCancelled ( ) ) { log . info ( ""Scheduling connection retries."" ) ; future = executorService . scheduleAtFixedRate ( this , 1 , monitorInterval , TimeUnit . MILLISECONDS ) ; } else { } } ","private synchronized void monitorConnection ( ) { if ( future == null || future . isDone ( ) || future . isCancelled ( ) ) { log . info ( ""Scheduling connection retries."" ) ; future = executorService . scheduleAtFixedRate ( this , 1 , monitorInterval , TimeUnit . MILLISECONDS ) ; } else { log . info ( ""Monitor already running."" ) ; } } " 906,"public void open ( ) { try { Class . forName ( IGNITE_JDBC_DRIVER_NAME ) ; } catch ( ClassNotFoundException e ) { connEx = e ; return ; } try { logger . info ( ""connect to "" + getProperty ( IGNITE_JDBC_URL ) ) ; conn = DriverManager . getConnection ( getProperty ( IGNITE_JDBC_URL ) ) ; connEx = null ; logger . info ( ""Successfully created JDBC connection"" ) ; } catch ( Exception e ) { logger . error ( ""Can't open connection: "" , e ) ; connEx = e ; } } ","public void open ( ) { try { Class . forName ( IGNITE_JDBC_DRIVER_NAME ) ; } catch ( ClassNotFoundException e ) { logger . error ( ""Can't find Ignite JDBC driver"" , e ) ; connEx = e ; return ; } try { logger . info ( ""connect to "" + getProperty ( IGNITE_JDBC_URL ) ) ; conn = DriverManager . getConnection ( getProperty ( IGNITE_JDBC_URL ) ) ; connEx = null ; logger . info ( ""Successfully created JDBC connection"" ) ; } catch ( Exception e ) { logger . error ( ""Can't open connection: "" , e ) ; connEx = e ; } } " 907,"public void open ( ) { try { Class . forName ( IGNITE_JDBC_DRIVER_NAME ) ; } catch ( ClassNotFoundException e ) { logger . error ( ""Can't find Ignite JDBC driver"" , e ) ; connEx = e ; return ; } try { conn = DriverManager . getConnection ( getProperty ( IGNITE_JDBC_URL ) ) ; connEx = null ; logger . info ( ""Successfully created JDBC connection"" ) ; } catch ( Exception e ) { logger . error ( ""Can't open connection: "" , e ) ; connEx = e ; } } ","public void open ( ) { try { Class . forName ( IGNITE_JDBC_DRIVER_NAME ) ; } catch ( ClassNotFoundException e ) { logger . error ( ""Can't find Ignite JDBC driver"" , e ) ; connEx = e ; return ; } try { logger . info ( ""connect to "" + getProperty ( IGNITE_JDBC_URL ) ) ; conn = DriverManager . getConnection ( getProperty ( IGNITE_JDBC_URL ) ) ; connEx = null ; logger . info ( ""Successfully created JDBC connection"" ) ; } catch ( Exception e ) { logger . error ( ""Can't open connection: "" , e ) ; connEx = e ; } } " 908,"public void open ( ) { try { Class . forName ( IGNITE_JDBC_DRIVER_NAME ) ; } catch ( ClassNotFoundException e ) { logger . error ( ""Can't find Ignite JDBC driver"" , e ) ; connEx = e ; return ; } try { logger . info ( ""connect to "" + getProperty ( IGNITE_JDBC_URL ) ) ; conn = DriverManager . getConnection ( getProperty ( IGNITE_JDBC_URL ) ) ; connEx = null ; } catch ( Exception e ) { logger . error ( ""Can't open connection: "" , e ) ; connEx = e ; } } ","public void open ( ) { try { Class . forName ( IGNITE_JDBC_DRIVER_NAME ) ; } catch ( ClassNotFoundException e ) { logger . error ( ""Can't find Ignite JDBC driver"" , e ) ; connEx = e ; return ; } try { logger . info ( ""connect to "" + getProperty ( IGNITE_JDBC_URL ) ) ; conn = DriverManager . getConnection ( getProperty ( IGNITE_JDBC_URL ) ) ; connEx = null ; logger . info ( ""Successfully created JDBC connection"" ) ; } catch ( Exception e ) { logger . error ( ""Can't open connection: "" , e ) ; connEx = e ; } } " 909,"public void open ( ) { try { Class . forName ( IGNITE_JDBC_DRIVER_NAME ) ; } catch ( ClassNotFoundException e ) { logger . error ( ""Can't find Ignite JDBC driver"" , e ) ; connEx = e ; return ; } try { logger . info ( ""connect to "" + getProperty ( IGNITE_JDBC_URL ) ) ; conn = DriverManager . getConnection ( getProperty ( IGNITE_JDBC_URL ) ) ; connEx = null ; logger . info ( ""Successfully created JDBC connection"" ) ; } catch ( Exception e ) { connEx = e ; } } ","public void open ( ) { try { Class . forName ( IGNITE_JDBC_DRIVER_NAME ) ; } catch ( ClassNotFoundException e ) { logger . error ( ""Can't find Ignite JDBC driver"" , e ) ; connEx = e ; return ; } try { logger . info ( ""connect to "" + getProperty ( IGNITE_JDBC_URL ) ) ; conn = DriverManager . getConnection ( getProperty ( IGNITE_JDBC_URL ) ) ; connEx = null ; logger . info ( ""Successfully created JDBC connection"" ) ; } catch ( Exception e ) { logger . error ( ""Can't open connection: "" , e ) ; connEx = e ; } } " 910,"public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.bundle.bucketName"" ) ; if ( bucketName != null ) { _log . info ( ""servlet context provided bucketName="" + bucketName ) ; setBucketName ( bucketName ) ; } else { _log . info ( ""servlet context missing bucketName, using "" + getBucketName ( ) ) ; } } } ","public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; _log . info ( ""servlet context provided s3.user="" + user ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.bundle.bucketName"" ) ; if ( bucketName != null ) { _log . info ( ""servlet context provided bucketName="" + bucketName ) ; setBucketName ( bucketName ) ; } else { _log . info ( ""servlet context missing bucketName, using "" + getBucketName ( ) ) ; } } } " 911,"public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; _log . info ( ""servlet context provided s3.user="" + user ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.bundle.bucketName"" ) ; if ( bucketName != null ) { setBucketName ( bucketName ) ; } else { _log . info ( ""servlet context missing bucketName, using "" + getBucketName ( ) ) ; } } } ","public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; _log . info ( ""servlet context provided s3.user="" + user ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.bundle.bucketName"" ) ; if ( bucketName != null ) { _log . info ( ""servlet context provided bucketName="" + bucketName ) ; setBucketName ( bucketName ) ; } else { _log . info ( ""servlet context missing bucketName, using "" + getBucketName ( ) ) ; } } } " 912,"public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; _log . info ( ""servlet context provided s3.user="" + user ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.bundle.bucketName"" ) ; if ( bucketName != null ) { _log . info ( ""servlet context provided bucketName="" + bucketName ) ; setBucketName ( bucketName ) ; } else { } } } ","public void setServletContext ( ServletContext servletContext ) { if ( servletContext != null ) { String user = servletContext . getInitParameter ( ""s3.user"" ) ; _log . info ( ""servlet context provided s3.user="" + user ) ; if ( user != null ) { setUser ( user ) ; } String password = servletContext . getInitParameter ( ""s3.password"" ) ; if ( password != null ) { setPassword ( password ) ; } String bucketName = servletContext . getInitParameter ( ""s3.bundle.bucketName"" ) ; if ( bucketName != null ) { _log . info ( ""servlet context provided bucketName="" + bucketName ) ; setBucketName ( bucketName ) ; } else { _log . info ( ""servlet context missing bucketName, using "" + getBucketName ( ) ) ; } } } " 913,"protected void configure ( HttpSecurity http ) throws Exception { RESTRequestParameterProcessingFilter restAuthenticationFilter = new RESTRequestParameterProcessingFilter ( ) ; restAuthenticationFilter . setAuthenticationManager ( authenticationManagerBean ( ) ) ; restAuthenticationFilter . setSecurityService ( securityService ) ; restAuthenticationFilter . setEventPublisher ( eventPublisher ) ; http = http . addFilterBefore ( restAuthenticationFilter , UsernamePasswordAuthenticationFilter . class ) ; String rememberMeKey = settingsService . getRememberMeKey ( ) ; boolean development = SettingsService . isDevelopmentMode ( ) ; if ( StringUtils . isBlank ( rememberMeKey ) && ! development ) { rememberMeKey = generateRememberMeKey ( ) ; } else if ( StringUtils . isBlank ( rememberMeKey ) && development ) { LOG . warn ( ""Using a fixed 'remember me' key because we're in development mode, this is INSECURE."" ) ; rememberMeKey = DEVELOPMENT_REMEMBER_ME_KEY ; } else { LOG . info ( ""Using a fixed 'remember me' key from system properties, this is insecure."" ) ; } http . csrf ( ) . requireCsrfProtectionMatcher ( csrfSecurityRequestMatcher ) . and ( ) . headers ( ) . frameOptions ( ) . sameOrigin ( ) . and ( ) . authorizeRequests ( ) . antMatchers ( ""/recover*"" , ""/accessDenied*"" , ""/style/**"" , ""/icons/**"" , ""/flash/**"" , ""/script/**"" , ""/sonos/**"" , ""/login"" , ""/error"" ) . permitAll ( ) . antMatchers ( ""/personalSettings*"" , ""/passwordSettings*"" , ""/playerSettings*"" , ""/shareSettings*"" , ""/passwordSettings*"" ) . hasRole ( ""SETTINGS"" ) . antMatchers ( ""/generalSettings*"" , ""/advancedSettings*"" , ""/userSettings*"" , ""/internalhelp*"" , ""/musicFolderSettings*"" , ""/databaseSettings*"" , ""/transcodeSettings*"" , ""/rest/startScan*"" ) . hasRole ( ""ADMIN"" ) . antMatchers ( ""/deletePlaylist*"" , ""/savePlaylist*"" ) . hasRole ( ""PLAYLIST"" ) . antMatchers ( ""/download*"" ) . hasRole ( ""DOWNLOAD"" ) . antMatchers ( ""/upload*"" ) . hasRole ( ""UPLOAD"" ) . antMatchers ( ""/createShare*"" ) . hasRole ( ""SHARE"" ) . antMatchers ( ""/changeCoverArt*"" , ""/editTags*"" ) . hasRole ( ""COVERART"" ) . antMatchers ( ""/setMusicFileInfo*"" ) . hasRole ( ""COMMENT"" ) . antMatchers ( ""/podcastReceiverAdmin*"" ) . hasRole ( ""PODCAST"" ) . antMatchers ( ""/**"" ) . hasRole ( ""USER"" ) . anyRequest ( ) . authenticated ( ) . and ( ) . formLogin ( ) . loginPage ( ""/login"" ) . permitAll ( ) . defaultSuccessUrl ( ""/index"" , true ) . failureUrl ( FAILURE_URL ) . usernameParameter ( ""j_username"" ) . passwordParameter ( ""j_password"" ) . and ( ) . logout ( ) . logoutRequestMatcher ( new AntPathRequestMatcher ( ""/logout"" , ""GET"" ) ) . logoutSuccessUrl ( ""/login?logout"" ) . and ( ) . rememberMe ( ) . key ( rememberMeKey ) ; } ","protected void configure ( HttpSecurity http ) throws Exception { RESTRequestParameterProcessingFilter restAuthenticationFilter = new RESTRequestParameterProcessingFilter ( ) ; restAuthenticationFilter . setAuthenticationManager ( authenticationManagerBean ( ) ) ; restAuthenticationFilter . setSecurityService ( securityService ) ; restAuthenticationFilter . setEventPublisher ( eventPublisher ) ; http = http . addFilterBefore ( restAuthenticationFilter , UsernamePasswordAuthenticationFilter . class ) ; String rememberMeKey = settingsService . getRememberMeKey ( ) ; boolean development = SettingsService . isDevelopmentMode ( ) ; if ( StringUtils . isBlank ( rememberMeKey ) && ! development ) { LOG . debug ( ""Generating a new ephemeral 'remember me' key in a secure way."" ) ; rememberMeKey = generateRememberMeKey ( ) ; } else if ( StringUtils . isBlank ( rememberMeKey ) && development ) { LOG . warn ( ""Using a fixed 'remember me' key because we're in development mode, this is INSECURE."" ) ; rememberMeKey = DEVELOPMENT_REMEMBER_ME_KEY ; } else { LOG . info ( ""Using a fixed 'remember me' key from system properties, this is insecure."" ) ; } http . csrf ( ) . requireCsrfProtectionMatcher ( csrfSecurityRequestMatcher ) . and ( ) . headers ( ) . frameOptions ( ) . sameOrigin ( ) . and ( ) . authorizeRequests ( ) . antMatchers ( ""/recover*"" , ""/accessDenied*"" , ""/style/**"" , ""/icons/**"" , ""/flash/**"" , ""/script/**"" , ""/sonos/**"" , ""/login"" , ""/error"" ) . permitAll ( ) . antMatchers ( ""/personalSettings*"" , ""/passwordSettings*"" , ""/playerSettings*"" , ""/shareSettings*"" , ""/passwordSettings*"" ) . hasRole ( ""SETTINGS"" ) . antMatchers ( ""/generalSettings*"" , ""/advancedSettings*"" , ""/userSettings*"" , ""/internalhelp*"" , ""/musicFolderSettings*"" , ""/databaseSettings*"" , ""/transcodeSettings*"" , ""/rest/startScan*"" ) . hasRole ( ""ADMIN"" ) . antMatchers ( ""/deletePlaylist*"" , ""/savePlaylist*"" ) . hasRole ( ""PLAYLIST"" ) . antMatchers ( ""/download*"" ) . hasRole ( ""DOWNLOAD"" ) . antMatchers ( ""/upload*"" ) . hasRole ( ""UPLOAD"" ) . antMatchers ( ""/createShare*"" ) . hasRole ( ""SHARE"" ) . antMatchers ( ""/changeCoverArt*"" , ""/editTags*"" ) . hasRole ( ""COVERART"" ) . antMatchers ( ""/setMusicFileInfo*"" ) . hasRole ( ""COMMENT"" ) . antMatchers ( ""/podcastReceiverAdmin*"" ) . hasRole ( ""PODCAST"" ) . antMatchers ( ""/**"" ) . hasRole ( ""USER"" ) . anyRequest ( ) . authenticated ( ) . and ( ) . formLogin ( ) . loginPage ( ""/login"" ) . permitAll ( ) . defaultSuccessUrl ( ""/index"" , true ) . failureUrl ( FAILURE_URL ) . usernameParameter ( ""j_username"" ) . passwordParameter ( ""j_password"" ) . and ( ) . logout ( ) . logoutRequestMatcher ( new AntPathRequestMatcher ( ""/logout"" , ""GET"" ) ) . logoutSuccessUrl ( ""/login?logout"" ) . and ( ) . rememberMe ( ) . key ( rememberMeKey ) ; } " 914,"protected void configure ( HttpSecurity http ) throws Exception { RESTRequestParameterProcessingFilter restAuthenticationFilter = new RESTRequestParameterProcessingFilter ( ) ; restAuthenticationFilter . setAuthenticationManager ( authenticationManagerBean ( ) ) ; restAuthenticationFilter . setSecurityService ( securityService ) ; restAuthenticationFilter . setEventPublisher ( eventPublisher ) ; http = http . addFilterBefore ( restAuthenticationFilter , UsernamePasswordAuthenticationFilter . class ) ; String rememberMeKey = settingsService . getRememberMeKey ( ) ; boolean development = SettingsService . isDevelopmentMode ( ) ; if ( StringUtils . isBlank ( rememberMeKey ) && ! development ) { LOG . debug ( ""Generating a new ephemeral 'remember me' key in a secure way."" ) ; rememberMeKey = generateRememberMeKey ( ) ; } else if ( StringUtils . isBlank ( rememberMeKey ) && development ) { rememberMeKey = DEVELOPMENT_REMEMBER_ME_KEY ; } else { LOG . info ( ""Using a fixed 'remember me' key from system properties, this is insecure."" ) ; } http . csrf ( ) . requireCsrfProtectionMatcher ( csrfSecurityRequestMatcher ) . and ( ) . headers ( ) . frameOptions ( ) . sameOrigin ( ) . and ( ) . authorizeRequests ( ) . antMatchers ( ""/recover*"" , ""/accessDenied*"" , ""/style/**"" , ""/icons/**"" , ""/flash/**"" , ""/script/**"" , ""/sonos/**"" , ""/login"" , ""/error"" ) . permitAll ( ) . antMatchers ( ""/personalSettings*"" , ""/passwordSettings*"" , ""/playerSettings*"" , ""/shareSettings*"" , ""/passwordSettings*"" ) . hasRole ( ""SETTINGS"" ) . antMatchers ( ""/generalSettings*"" , ""/advancedSettings*"" , ""/userSettings*"" , ""/internalhelp*"" , ""/musicFolderSettings*"" , ""/databaseSettings*"" , ""/transcodeSettings*"" , ""/rest/startScan*"" ) . hasRole ( ""ADMIN"" ) . antMatchers ( ""/deletePlaylist*"" , ""/savePlaylist*"" ) . hasRole ( ""PLAYLIST"" ) . antMatchers ( ""/download*"" ) . hasRole ( ""DOWNLOAD"" ) . antMatchers ( ""/upload*"" ) . hasRole ( ""UPLOAD"" ) . antMatchers ( ""/createShare*"" ) . hasRole ( ""SHARE"" ) . antMatchers ( ""/changeCoverArt*"" , ""/editTags*"" ) . hasRole ( ""COVERART"" ) . antMatchers ( ""/setMusicFileInfo*"" ) . hasRole ( ""COMMENT"" ) . antMatchers ( ""/podcastReceiverAdmin*"" ) . hasRole ( ""PODCAST"" ) . antMatchers ( ""/**"" ) . hasRole ( ""USER"" ) . anyRequest ( ) . authenticated ( ) . and ( ) . formLogin ( ) . loginPage ( ""/login"" ) . permitAll ( ) . defaultSuccessUrl ( ""/index"" , true ) . failureUrl ( FAILURE_URL ) . usernameParameter ( ""j_username"" ) . passwordParameter ( ""j_password"" ) . and ( ) . logout ( ) . logoutRequestMatcher ( new AntPathRequestMatcher ( ""/logout"" , ""GET"" ) ) . logoutSuccessUrl ( ""/login?logout"" ) . and ( ) . rememberMe ( ) . key ( rememberMeKey ) ; } ","protected void configure ( HttpSecurity http ) throws Exception { RESTRequestParameterProcessingFilter restAuthenticationFilter = new RESTRequestParameterProcessingFilter ( ) ; restAuthenticationFilter . setAuthenticationManager ( authenticationManagerBean ( ) ) ; restAuthenticationFilter . setSecurityService ( securityService ) ; restAuthenticationFilter . setEventPublisher ( eventPublisher ) ; http = http . addFilterBefore ( restAuthenticationFilter , UsernamePasswordAuthenticationFilter . class ) ; String rememberMeKey = settingsService . getRememberMeKey ( ) ; boolean development = SettingsService . isDevelopmentMode ( ) ; if ( StringUtils . isBlank ( rememberMeKey ) && ! development ) { LOG . debug ( ""Generating a new ephemeral 'remember me' key in a secure way."" ) ; rememberMeKey = generateRememberMeKey ( ) ; } else if ( StringUtils . isBlank ( rememberMeKey ) && development ) { LOG . warn ( ""Using a fixed 'remember me' key because we're in development mode, this is INSECURE."" ) ; rememberMeKey = DEVELOPMENT_REMEMBER_ME_KEY ; } else { LOG . info ( ""Using a fixed 'remember me' key from system properties, this is insecure."" ) ; } http . csrf ( ) . requireCsrfProtectionMatcher ( csrfSecurityRequestMatcher ) . and ( ) . headers ( ) . frameOptions ( ) . sameOrigin ( ) . and ( ) . authorizeRequests ( ) . antMatchers ( ""/recover*"" , ""/accessDenied*"" , ""/style/**"" , ""/icons/**"" , ""/flash/**"" , ""/script/**"" , ""/sonos/**"" , ""/login"" , ""/error"" ) . permitAll ( ) . antMatchers ( ""/personalSettings*"" , ""/passwordSettings*"" , ""/playerSettings*"" , ""/shareSettings*"" , ""/passwordSettings*"" ) . hasRole ( ""SETTINGS"" ) . antMatchers ( ""/generalSettings*"" , ""/advancedSettings*"" , ""/userSettings*"" , ""/internalhelp*"" , ""/musicFolderSettings*"" , ""/databaseSettings*"" , ""/transcodeSettings*"" , ""/rest/startScan*"" ) . hasRole ( ""ADMIN"" ) . antMatchers ( ""/deletePlaylist*"" , ""/savePlaylist*"" ) . hasRole ( ""PLAYLIST"" ) . antMatchers ( ""/download*"" ) . hasRole ( ""DOWNLOAD"" ) . antMatchers ( ""/upload*"" ) . hasRole ( ""UPLOAD"" ) . antMatchers ( ""/createShare*"" ) . hasRole ( ""SHARE"" ) . antMatchers ( ""/changeCoverArt*"" , ""/editTags*"" ) . hasRole ( ""COVERART"" ) . antMatchers ( ""/setMusicFileInfo*"" ) . hasRole ( ""COMMENT"" ) . antMatchers ( ""/podcastReceiverAdmin*"" ) . hasRole ( ""PODCAST"" ) . antMatchers ( ""/**"" ) . hasRole ( ""USER"" ) . anyRequest ( ) . authenticated ( ) . and ( ) . formLogin ( ) . loginPage ( ""/login"" ) . permitAll ( ) . defaultSuccessUrl ( ""/index"" , true ) . failureUrl ( FAILURE_URL ) . usernameParameter ( ""j_username"" ) . passwordParameter ( ""j_password"" ) . and ( ) . logout ( ) . logoutRequestMatcher ( new AntPathRequestMatcher ( ""/logout"" , ""GET"" ) ) . logoutSuccessUrl ( ""/login?logout"" ) . and ( ) . rememberMe ( ) . key ( rememberMeKey ) ; } " 915,"protected void configure ( HttpSecurity http ) throws Exception { RESTRequestParameterProcessingFilter restAuthenticationFilter = new RESTRequestParameterProcessingFilter ( ) ; restAuthenticationFilter . setAuthenticationManager ( authenticationManagerBean ( ) ) ; restAuthenticationFilter . setSecurityService ( securityService ) ; restAuthenticationFilter . setEventPublisher ( eventPublisher ) ; http = http . addFilterBefore ( restAuthenticationFilter , UsernamePasswordAuthenticationFilter . class ) ; String rememberMeKey = settingsService . getRememberMeKey ( ) ; boolean development = SettingsService . isDevelopmentMode ( ) ; if ( StringUtils . isBlank ( rememberMeKey ) && ! development ) { LOG . debug ( ""Generating a new ephemeral 'remember me' key in a secure way."" ) ; rememberMeKey = generateRememberMeKey ( ) ; } else if ( StringUtils . isBlank ( rememberMeKey ) && development ) { LOG . warn ( ""Using a fixed 'remember me' key because we're in development mode, this is INSECURE."" ) ; rememberMeKey = DEVELOPMENT_REMEMBER_ME_KEY ; } else { } http . csrf ( ) . requireCsrfProtectionMatcher ( csrfSecurityRequestMatcher ) . and ( ) . headers ( ) . frameOptions ( ) . sameOrigin ( ) . and ( ) . authorizeRequests ( ) . antMatchers ( ""/recover*"" , ""/accessDenied*"" , ""/style/**"" , ""/icons/**"" , ""/flash/**"" , ""/script/**"" , ""/sonos/**"" , ""/login"" , ""/error"" ) . permitAll ( ) . antMatchers ( ""/personalSettings*"" , ""/passwordSettings*"" , ""/playerSettings*"" , ""/shareSettings*"" , ""/passwordSettings*"" ) . hasRole ( ""SETTINGS"" ) . antMatchers ( ""/generalSettings*"" , ""/advancedSettings*"" , ""/userSettings*"" , ""/internalhelp*"" , ""/musicFolderSettings*"" , ""/databaseSettings*"" , ""/transcodeSettings*"" , ""/rest/startScan*"" ) . hasRole ( ""ADMIN"" ) . antMatchers ( ""/deletePlaylist*"" , ""/savePlaylist*"" ) . hasRole ( ""PLAYLIST"" ) . antMatchers ( ""/download*"" ) . hasRole ( ""DOWNLOAD"" ) . antMatchers ( ""/upload*"" ) . hasRole ( ""UPLOAD"" ) . antMatchers ( ""/createShare*"" ) . hasRole ( ""SHARE"" ) . antMatchers ( ""/changeCoverArt*"" , ""/editTags*"" ) . hasRole ( ""COVERART"" ) . antMatchers ( ""/setMusicFileInfo*"" ) . hasRole ( ""COMMENT"" ) . antMatchers ( ""/podcastReceiverAdmin*"" ) . hasRole ( ""PODCAST"" ) . antMatchers ( ""/**"" ) . hasRole ( ""USER"" ) . anyRequest ( ) . authenticated ( ) . and ( ) . formLogin ( ) . loginPage ( ""/login"" ) . permitAll ( ) . defaultSuccessUrl ( ""/index"" , true ) . failureUrl ( FAILURE_URL ) . usernameParameter ( ""j_username"" ) . passwordParameter ( ""j_password"" ) . and ( ) . logout ( ) . logoutRequestMatcher ( new AntPathRequestMatcher ( ""/logout"" , ""GET"" ) ) . logoutSuccessUrl ( ""/login?logout"" ) . and ( ) . rememberMe ( ) . key ( rememberMeKey ) ; } ","protected void configure ( HttpSecurity http ) throws Exception { RESTRequestParameterProcessingFilter restAuthenticationFilter = new RESTRequestParameterProcessingFilter ( ) ; restAuthenticationFilter . setAuthenticationManager ( authenticationManagerBean ( ) ) ; restAuthenticationFilter . setSecurityService ( securityService ) ; restAuthenticationFilter . setEventPublisher ( eventPublisher ) ; http = http . addFilterBefore ( restAuthenticationFilter , UsernamePasswordAuthenticationFilter . class ) ; String rememberMeKey = settingsService . getRememberMeKey ( ) ; boolean development = SettingsService . isDevelopmentMode ( ) ; if ( StringUtils . isBlank ( rememberMeKey ) && ! development ) { LOG . debug ( ""Generating a new ephemeral 'remember me' key in a secure way."" ) ; rememberMeKey = generateRememberMeKey ( ) ; } else if ( StringUtils . isBlank ( rememberMeKey ) && development ) { LOG . warn ( ""Using a fixed 'remember me' key because we're in development mode, this is INSECURE."" ) ; rememberMeKey = DEVELOPMENT_REMEMBER_ME_KEY ; } else { LOG . info ( ""Using a fixed 'remember me' key from system properties, this is insecure."" ) ; } http . csrf ( ) . requireCsrfProtectionMatcher ( csrfSecurityRequestMatcher ) . and ( ) . headers ( ) . frameOptions ( ) . sameOrigin ( ) . and ( ) . authorizeRequests ( ) . antMatchers ( ""/recover*"" , ""/accessDenied*"" , ""/style/**"" , ""/icons/**"" , ""/flash/**"" , ""/script/**"" , ""/sonos/**"" , ""/login"" , ""/error"" ) . permitAll ( ) . antMatchers ( ""/personalSettings*"" , ""/passwordSettings*"" , ""/playerSettings*"" , ""/shareSettings*"" , ""/passwordSettings*"" ) . hasRole ( ""SETTINGS"" ) . antMatchers ( ""/generalSettings*"" , ""/advancedSettings*"" , ""/userSettings*"" , ""/internalhelp*"" , ""/musicFolderSettings*"" , ""/databaseSettings*"" , ""/transcodeSettings*"" , ""/rest/startScan*"" ) . hasRole ( ""ADMIN"" ) . antMatchers ( ""/deletePlaylist*"" , ""/savePlaylist*"" ) . hasRole ( ""PLAYLIST"" ) . antMatchers ( ""/download*"" ) . hasRole ( ""DOWNLOAD"" ) . antMatchers ( ""/upload*"" ) . hasRole ( ""UPLOAD"" ) . antMatchers ( ""/createShare*"" ) . hasRole ( ""SHARE"" ) . antMatchers ( ""/changeCoverArt*"" , ""/editTags*"" ) . hasRole ( ""COVERART"" ) . antMatchers ( ""/setMusicFileInfo*"" ) . hasRole ( ""COMMENT"" ) . antMatchers ( ""/podcastReceiverAdmin*"" ) . hasRole ( ""PODCAST"" ) . antMatchers ( ""/**"" ) . hasRole ( ""USER"" ) . anyRequest ( ) . authenticated ( ) . and ( ) . formLogin ( ) . loginPage ( ""/login"" ) . permitAll ( ) . defaultSuccessUrl ( ""/index"" , true ) . failureUrl ( FAILURE_URL ) . usernameParameter ( ""j_username"" ) . passwordParameter ( ""j_password"" ) . and ( ) . logout ( ) . logoutRequestMatcher ( new AntPathRequestMatcher ( ""/logout"" , ""GET"" ) ) . logoutSuccessUrl ( ""/login?logout"" ) . and ( ) . rememberMe ( ) . key ( rememberMeKey ) ; } " 916,"private AtlasEdge updateEdge ( AtlasAttributeDef attributeDef , Object value , AtlasEdge currentEdge , final AtlasVertex entityVertex ) throws AtlasBaseException { if ( LOG . isDebugEnabled ( ) ) { } AtlasVertex currentVertex = currentEdge . getInVertex ( ) ; String currentEntityId = getIdFromVertex ( currentVertex ) ; String newEntityId = getIdFromVertex ( entityVertex ) ; AtlasEdge newEdge = currentEdge ; if ( ! currentEntityId . equals ( newEntityId ) && entityVertex != null ) { try { newEdge = graphHelper . getOrCreateEdge ( currentEdge . getOutVertex ( ) , entityVertex , currentEdge . getLabel ( ) ) ; } catch ( RepositoryException e ) { throw new AtlasBaseException ( AtlasErrorCode . INTERNAL_ERROR , e ) ; } } return newEdge ; } ","private AtlasEdge updateEdge ( AtlasAttributeDef attributeDef , Object value , AtlasEdge currentEdge , final AtlasVertex entityVertex ) throws AtlasBaseException { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Updating entity reference {} for reference attribute {}"" , attributeDef . getName ( ) ) ; } AtlasVertex currentVertex = currentEdge . getInVertex ( ) ; String currentEntityId = getIdFromVertex ( currentVertex ) ; String newEntityId = getIdFromVertex ( entityVertex ) ; AtlasEdge newEdge = currentEdge ; if ( ! currentEntityId . equals ( newEntityId ) && entityVertex != null ) { try { newEdge = graphHelper . getOrCreateEdge ( currentEdge . getOutVertex ( ) , entityVertex , currentEdge . getLabel ( ) ) ; } catch ( RepositoryException e ) { throw new AtlasBaseException ( AtlasErrorCode . INTERNAL_ERROR , e ) ; } } return newEdge ; } " 917,"@ RequestMapping ( method = RequestMethod . GET , value = ""/secure/vcpeNetwork/isIPFree"" ) public @ ResponseBody String isIPFree ( String vcpeId , String router , String ip , Model model , Locale locale ) { Boolean isFree = false ; try { isFree = vcpeNetworkBO . isIPFree ( vcpeId , router , ip ) ; } catch ( RestServiceException e ) { model . addAttribute ( ""errorMsg"" , messageSource . getMessage ( ""vcpenetwork.check.ip.message.error"" , null , locale ) ) ; } return isFree . toString ( ) ; } ","@ RequestMapping ( method = RequestMethod . GET , value = ""/secure/vcpeNetwork/isIPFree"" ) public @ ResponseBody String isIPFree ( String vcpeId , String router , String ip , Model model , Locale locale ) { LOGGER . debug ( ""Check if the IP: "" + ip + "" is free. The vcpeID: "" + vcpeId ) ; Boolean isFree = false ; try { isFree = vcpeNetworkBO . isIPFree ( vcpeId , router , ip ) ; } catch ( RestServiceException e ) { model . addAttribute ( ""errorMsg"" , messageSource . getMessage ( ""vcpenetwork.check.ip.message.error"" , null , locale ) ) ; } return isFree . toString ( ) ; } " 918,"public void stop ( ) { if ( shutdownExecutorOnStop ) { executor . shutdown ( ) ; } try { report ( ) ; } catch ( Exception e ) { } if ( shutdownExecutorOnStop ) { try { if ( ! executor . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { executor . shutdownNow ( ) ; if ( ! executor . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { LOG . warn ( ""ScheduledExecutorService did not terminate."" ) ; } } } catch ( InterruptedException ie ) { executor . shutdownNow ( ) ; Thread . currentThread ( ) . interrupt ( ) ; } } else { cancelScheduledFuture ( ) ; } } ","public void stop ( ) { if ( shutdownExecutorOnStop ) { executor . shutdown ( ) ; } try { report ( ) ; } catch ( Exception e ) { LOG . warn ( ""Final reporting of metrics failed."" , e ) ; } if ( shutdownExecutorOnStop ) { try { if ( ! executor . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { executor . shutdownNow ( ) ; if ( ! executor . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { LOG . warn ( ""ScheduledExecutorService did not terminate."" ) ; } } } catch ( InterruptedException ie ) { executor . shutdownNow ( ) ; Thread . currentThread ( ) . interrupt ( ) ; } } else { cancelScheduledFuture ( ) ; } } " 919,"public void stop ( ) { if ( shutdownExecutorOnStop ) { executor . shutdown ( ) ; } try { report ( ) ; } catch ( Exception e ) { LOG . warn ( ""Final reporting of metrics failed."" , e ) ; } if ( shutdownExecutorOnStop ) { try { if ( ! executor . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { executor . shutdownNow ( ) ; if ( ! executor . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { } } } catch ( InterruptedException ie ) { executor . shutdownNow ( ) ; Thread . currentThread ( ) . interrupt ( ) ; } } else { cancelScheduledFuture ( ) ; } } ","public void stop ( ) { if ( shutdownExecutorOnStop ) { executor . shutdown ( ) ; } try { report ( ) ; } catch ( Exception e ) { LOG . warn ( ""Final reporting of metrics failed."" , e ) ; } if ( shutdownExecutorOnStop ) { try { if ( ! executor . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { executor . shutdownNow ( ) ; if ( ! executor . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { LOG . warn ( ""ScheduledExecutorService did not terminate."" ) ; } } } catch ( InterruptedException ie ) { executor . shutdownNow ( ) ; Thread . currentThread ( ) . interrupt ( ) ; } } else { cancelScheduledFuture ( ) ; } } " 920,"@ Deprecated public String getFinancialYearId ( String estDate ) { String result = """" ; Query query = getCurrentSession ( ) . createQuery ( ""select cfinancialyear.id from CFinancialYear cfinancialyear where cfinancialyear.startingDate <= to_date('"" + estDate + ""','dd/MM/yyyy') and cfinancialyear.endingDate >= to_date('"" + estDate + ""','dd/MM/yyyy') "" ) ; ArrayList list = ( ArrayList ) query . list ( ) ; if ( list . size ( ) > 0 ) result = list . get ( 0 ) . toString ( ) ; return result ; } ","@ Deprecated public String getFinancialYearId ( String estDate ) { logger . info ( ""Obtained session"" ) ; String result = """" ; Query query = getCurrentSession ( ) . createQuery ( ""select cfinancialyear.id from CFinancialYear cfinancialyear where cfinancialyear.startingDate <= to_date('"" + estDate + ""','dd/MM/yyyy') and cfinancialyear.endingDate >= to_date('"" + estDate + ""','dd/MM/yyyy') "" ) ; ArrayList list = ( ArrayList ) query . list ( ) ; if ( list . size ( ) > 0 ) result = list . get ( 0 ) . toString ( ) ; return result ; } " 921,"public void update ( final Collection < ProvenanceEventRecord > newEvents , final long totalHits ) { boolean queryComplete = false ; writeLock . lock ( ) ; try { if ( isFinished ( ) ) { return ; } this . matchingRecords . addAll ( newEvents ) ; hitCount += totalHits ; if ( matchingRecords . size ( ) > query . getMaxResults ( ) ) { final Iterator < ProvenanceEventRecord > itr = matchingRecords . iterator ( ) ; for ( int i = 0 ; i < query . getMaxResults ( ) ; i ++ ) { itr . next ( ) ; } while ( itr . hasNext ( ) ) { itr . next ( ) ; itr . remove ( ) ; } } numCompletedSteps ++ ; updateExpiration ( ) ; if ( numCompletedSteps >= numSteps || this . matchingRecords . size ( ) >= query . getMaxResults ( ) ) { final long searchNanos = System . nanoTime ( ) - creationNanos ; queryTime = TimeUnit . MILLISECONDS . convert ( searchNanos , TimeUnit . NANOSECONDS ) ; queryComplete = true ; if ( numCompletedSteps >= numSteps ) { } else { logger . info ( ""Completed {} comprised of {} steps in {} millis. Index found {} hits. Read {} events from Event Files. "" + ""Only completed {} steps because the maximum number of results was reached."" , query , numSteps , queryTime , hitCount , matchingRecords . size ( ) , numCompletedSteps ) ; } } } finally { writeLock . unlock ( ) ; } if ( queryComplete ) { synchronized ( completionMonitor ) { completionMonitor . notifyAll ( ) ; } } } ","public void update ( final Collection < ProvenanceEventRecord > newEvents , final long totalHits ) { boolean queryComplete = false ; writeLock . lock ( ) ; try { if ( isFinished ( ) ) { return ; } this . matchingRecords . addAll ( newEvents ) ; hitCount += totalHits ; if ( matchingRecords . size ( ) > query . getMaxResults ( ) ) { final Iterator < ProvenanceEventRecord > itr = matchingRecords . iterator ( ) ; for ( int i = 0 ; i < query . getMaxResults ( ) ; i ++ ) { itr . next ( ) ; } while ( itr . hasNext ( ) ) { itr . next ( ) ; itr . remove ( ) ; } } numCompletedSteps ++ ; updateExpiration ( ) ; if ( numCompletedSteps >= numSteps || this . matchingRecords . size ( ) >= query . getMaxResults ( ) ) { final long searchNanos = System . nanoTime ( ) - creationNanos ; queryTime = TimeUnit . MILLISECONDS . convert ( searchNanos , TimeUnit . NANOSECONDS ) ; queryComplete = true ; if ( numCompletedSteps >= numSteps ) { logger . info ( ""Completed {} comprised of {} steps in {} millis. Index found {} hits. Read {} events from Event Files."" , query , numSteps , queryTime , hitCount , matchingRecords . size ( ) ) ; } else { logger . info ( ""Completed {} comprised of {} steps in {} millis. Index found {} hits. Read {} events from Event Files. "" + ""Only completed {} steps because the maximum number of results was reached."" , query , numSteps , queryTime , hitCount , matchingRecords . size ( ) , numCompletedSteps ) ; } } } finally { writeLock . unlock ( ) ; } if ( queryComplete ) { synchronized ( completionMonitor ) { completionMonitor . notifyAll ( ) ; } } } " 922,"public void update ( final Collection < ProvenanceEventRecord > newEvents , final long totalHits ) { boolean queryComplete = false ; writeLock . lock ( ) ; try { if ( isFinished ( ) ) { return ; } this . matchingRecords . addAll ( newEvents ) ; hitCount += totalHits ; if ( matchingRecords . size ( ) > query . getMaxResults ( ) ) { final Iterator < ProvenanceEventRecord > itr = matchingRecords . iterator ( ) ; for ( int i = 0 ; i < query . getMaxResults ( ) ; i ++ ) { itr . next ( ) ; } while ( itr . hasNext ( ) ) { itr . next ( ) ; itr . remove ( ) ; } } numCompletedSteps ++ ; updateExpiration ( ) ; if ( numCompletedSteps >= numSteps || this . matchingRecords . size ( ) >= query . getMaxResults ( ) ) { final long searchNanos = System . nanoTime ( ) - creationNanos ; queryTime = TimeUnit . MILLISECONDS . convert ( searchNanos , TimeUnit . NANOSECONDS ) ; queryComplete = true ; if ( numCompletedSteps >= numSteps ) { logger . info ( ""Completed {} comprised of {} steps in {} millis. Index found {} hits. Read {} events from Event Files."" , query , numSteps , queryTime , hitCount , matchingRecords . size ( ) ) ; } else { } } } finally { writeLock . unlock ( ) ; } if ( queryComplete ) { synchronized ( completionMonitor ) { completionMonitor . notifyAll ( ) ; } } } ","public void update ( final Collection < ProvenanceEventRecord > newEvents , final long totalHits ) { boolean queryComplete = false ; writeLock . lock ( ) ; try { if ( isFinished ( ) ) { return ; } this . matchingRecords . addAll ( newEvents ) ; hitCount += totalHits ; if ( matchingRecords . size ( ) > query . getMaxResults ( ) ) { final Iterator < ProvenanceEventRecord > itr = matchingRecords . iterator ( ) ; for ( int i = 0 ; i < query . getMaxResults ( ) ; i ++ ) { itr . next ( ) ; } while ( itr . hasNext ( ) ) { itr . next ( ) ; itr . remove ( ) ; } } numCompletedSteps ++ ; updateExpiration ( ) ; if ( numCompletedSteps >= numSteps || this . matchingRecords . size ( ) >= query . getMaxResults ( ) ) { final long searchNanos = System . nanoTime ( ) - creationNanos ; queryTime = TimeUnit . MILLISECONDS . convert ( searchNanos , TimeUnit . NANOSECONDS ) ; queryComplete = true ; if ( numCompletedSteps >= numSteps ) { logger . info ( ""Completed {} comprised of {} steps in {} millis. Index found {} hits. Read {} events from Event Files."" , query , numSteps , queryTime , hitCount , matchingRecords . size ( ) ) ; } else { logger . info ( ""Completed {} comprised of {} steps in {} millis. Index found {} hits. Read {} events from Event Files. "" + ""Only completed {} steps because the maximum number of results was reached."" , query , numSteps , queryTime , hitCount , matchingRecords . size ( ) , numCompletedSteps ) ; } } } finally { writeLock . unlock ( ) ; } if ( queryComplete ) { synchronized ( completionMonitor ) { completionMonitor . notifyAll ( ) ; } } } " 923,"public void onMessage ( Message < Long > message ) { if ( ! message . getMessageObject ( ) . equals ( received ) ) { failures ++ ; } if ( received % 10000 == 0 ) { } received ++ ; } ","public void onMessage ( Message < Long > message ) { if ( ! message . getMessageObject ( ) . equals ( received ) ) { failures ++ ; } if ( received % 10000 == 0 ) { logger . info ( toString ( ) + "" is at: "" + received ) ; } received ++ ; } " 924,"public void taskFailed ( TaskGroup tg ) { lock . lock ( ) ; try { this . failedTaskGroups . add ( tg ) ; if ( -- this . currentlyRunningCount == 0 ) { this . runningCondition . signalAll ( ) ; } } finally { lock . unlock ( ) ; } } ","public void taskFailed ( TaskGroup tg ) { logger . info ( ""Task failed callback for taskId: "" + tg . getTaskId ( ) ) ; lock . lock ( ) ; try { this . failedTaskGroups . add ( tg ) ; if ( -- this . currentlyRunningCount == 0 ) { this . runningCondition . signalAll ( ) ; } } finally { lock . unlock ( ) ; } } " 925,"public List < String > validatePartitioners ( String [ ] tableNames , Job job ) { ArrayList < String > validTableNames = new ArrayList < > ( ) ; for ( String tableName : tableNames ) { if ( hasPartitionerOverride ( new Text ( tableName ) ) ) { try { Partitioner < BulkIngestKey , Value > partitionerForTable = cachePartitioner ( new Text ( tableName ) ) ; initializeJob ( job , partitionerForTable ) ; validTableNames . add ( tableName ) ; } catch ( Exception e ) { lazyInitializeDefaultPartitioner ( job ) ; } } else { lazyInitializeDefaultPartitioner ( job ) ; } } return validTableNames ; } ","public List < String > validatePartitioners ( String [ ] tableNames , Job job ) { ArrayList < String > validTableNames = new ArrayList < > ( ) ; for ( String tableName : tableNames ) { if ( hasPartitionerOverride ( new Text ( tableName ) ) ) { try { Partitioner < BulkIngestKey , Value > partitionerForTable = cachePartitioner ( new Text ( tableName ) ) ; initializeJob ( job , partitionerForTable ) ; validTableNames . add ( tableName ) ; } catch ( Exception e ) { log . warn ( ""Unable to create the partitioner for "" + tableName + "" despite its configuration."" + ""Will use the default partitioner for this table."" , e ) ; lazyInitializeDefaultPartitioner ( job ) ; } } else { lazyInitializeDefaultPartitioner ( job ) ; } } return validTableNames ; } " 926,"private static AuthConfig getAuthConfigFromEC2InstanceRole ( KitLogger log ) throws IOException { try ( CloseableHttpClient client = HttpClients . custom ( ) . useSystemProperties ( ) . build ( ) ) { RequestConfig conf = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 1000 ) . setConnectTimeout ( 1000 ) . setSocketTimeout ( 1000 ) . build ( ) ; HttpGet request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials"" ) ; request . setConfig ( conf ) ; String instanceRole ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No instance role found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( InputStream is = response . getEntity ( ) . getContent ( ) ) { instanceRole = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; } } log . debug ( ""Found instance role %s, getting temporary security credentials"" , instanceRole ) ; request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials/"" + UrlEscapers . urlPathSegmentEscaper ( ) . escape ( instanceRole ) ) ; request . setConfig ( conf ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No security credential found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( Reader r = new InputStreamReader ( response . getEntity ( ) . getContent ( ) , StandardCharsets . UTF_8 ) ) { JsonObject securityCredentials = new Gson ( ) . fromJson ( r , JsonObject . class ) ; String user = securityCredentials . getAsJsonPrimitive ( ""AccessKeyId"" ) . getAsString ( ) ; String password = securityCredentials . getAsJsonPrimitive ( ""SecretAccessKey"" ) . getAsString ( ) ; String token = securityCredentials . getAsJsonPrimitive ( ""Token"" ) . getAsString ( ) ; log . debug ( ""Received temporary access key %s..."" , user . substring ( 0 , 8 ) ) ; return new AuthConfig ( user , password , ""none"" , token ) ; } } } } ","private static AuthConfig getAuthConfigFromEC2InstanceRole ( KitLogger log ) throws IOException { log . debug ( ""No user and password set for ECR, checking EC2 instance role"" ) ; try ( CloseableHttpClient client = HttpClients . custom ( ) . useSystemProperties ( ) . build ( ) ) { RequestConfig conf = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 1000 ) . setConnectTimeout ( 1000 ) . setSocketTimeout ( 1000 ) . build ( ) ; HttpGet request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials"" ) ; request . setConfig ( conf ) ; String instanceRole ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No instance role found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( InputStream is = response . getEntity ( ) . getContent ( ) ) { instanceRole = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; } } log . debug ( ""Found instance role %s, getting temporary security credentials"" , instanceRole ) ; request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials/"" + UrlEscapers . urlPathSegmentEscaper ( ) . escape ( instanceRole ) ) ; request . setConfig ( conf ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No security credential found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( Reader r = new InputStreamReader ( response . getEntity ( ) . getContent ( ) , StandardCharsets . UTF_8 ) ) { JsonObject securityCredentials = new Gson ( ) . fromJson ( r , JsonObject . class ) ; String user = securityCredentials . getAsJsonPrimitive ( ""AccessKeyId"" ) . getAsString ( ) ; String password = securityCredentials . getAsJsonPrimitive ( ""SecretAccessKey"" ) . getAsString ( ) ; String token = securityCredentials . getAsJsonPrimitive ( ""Token"" ) . getAsString ( ) ; log . debug ( ""Received temporary access key %s..."" , user . substring ( 0 , 8 ) ) ; return new AuthConfig ( user , password , ""none"" , token ) ; } } } } " 927,"private static AuthConfig getAuthConfigFromEC2InstanceRole ( KitLogger log ) throws IOException { log . debug ( ""No user and password set for ECR, checking EC2 instance role"" ) ; try ( CloseableHttpClient client = HttpClients . custom ( ) . useSystemProperties ( ) . build ( ) ) { RequestConfig conf = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 1000 ) . setConnectTimeout ( 1000 ) . setSocketTimeout ( 1000 ) . build ( ) ; HttpGet request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials"" ) ; request . setConfig ( conf ) ; String instanceRole ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { return null ; } try ( InputStream is = response . getEntity ( ) . getContent ( ) ) { instanceRole = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; } } log . debug ( ""Found instance role %s, getting temporary security credentials"" , instanceRole ) ; request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials/"" + UrlEscapers . urlPathSegmentEscaper ( ) . escape ( instanceRole ) ) ; request . setConfig ( conf ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No security credential found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( Reader r = new InputStreamReader ( response . getEntity ( ) . getContent ( ) , StandardCharsets . UTF_8 ) ) { JsonObject securityCredentials = new Gson ( ) . fromJson ( r , JsonObject . class ) ; String user = securityCredentials . getAsJsonPrimitive ( ""AccessKeyId"" ) . getAsString ( ) ; String password = securityCredentials . getAsJsonPrimitive ( ""SecretAccessKey"" ) . getAsString ( ) ; String token = securityCredentials . getAsJsonPrimitive ( ""Token"" ) . getAsString ( ) ; log . debug ( ""Received temporary access key %s..."" , user . substring ( 0 , 8 ) ) ; return new AuthConfig ( user , password , ""none"" , token ) ; } } } } ","private static AuthConfig getAuthConfigFromEC2InstanceRole ( KitLogger log ) throws IOException { log . debug ( ""No user and password set for ECR, checking EC2 instance role"" ) ; try ( CloseableHttpClient client = HttpClients . custom ( ) . useSystemProperties ( ) . build ( ) ) { RequestConfig conf = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 1000 ) . setConnectTimeout ( 1000 ) . setSocketTimeout ( 1000 ) . build ( ) ; HttpGet request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials"" ) ; request . setConfig ( conf ) ; String instanceRole ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No instance role found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( InputStream is = response . getEntity ( ) . getContent ( ) ) { instanceRole = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; } } log . debug ( ""Found instance role %s, getting temporary security credentials"" , instanceRole ) ; request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials/"" + UrlEscapers . urlPathSegmentEscaper ( ) . escape ( instanceRole ) ) ; request . setConfig ( conf ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No security credential found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( Reader r = new InputStreamReader ( response . getEntity ( ) . getContent ( ) , StandardCharsets . UTF_8 ) ) { JsonObject securityCredentials = new Gson ( ) . fromJson ( r , JsonObject . class ) ; String user = securityCredentials . getAsJsonPrimitive ( ""AccessKeyId"" ) . getAsString ( ) ; String password = securityCredentials . getAsJsonPrimitive ( ""SecretAccessKey"" ) . getAsString ( ) ; String token = securityCredentials . getAsJsonPrimitive ( ""Token"" ) . getAsString ( ) ; log . debug ( ""Received temporary access key %s..."" , user . substring ( 0 , 8 ) ) ; return new AuthConfig ( user , password , ""none"" , token ) ; } } } } " 928,"private static AuthConfig getAuthConfigFromEC2InstanceRole ( KitLogger log ) throws IOException { log . debug ( ""No user and password set for ECR, checking EC2 instance role"" ) ; try ( CloseableHttpClient client = HttpClients . custom ( ) . useSystemProperties ( ) . build ( ) ) { RequestConfig conf = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 1000 ) . setConnectTimeout ( 1000 ) . setSocketTimeout ( 1000 ) . build ( ) ; HttpGet request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials"" ) ; request . setConfig ( conf ) ; String instanceRole ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No instance role found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( InputStream is = response . getEntity ( ) . getContent ( ) ) { instanceRole = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; } } request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials/"" + UrlEscapers . urlPathSegmentEscaper ( ) . escape ( instanceRole ) ) ; request . setConfig ( conf ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No security credential found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( Reader r = new InputStreamReader ( response . getEntity ( ) . getContent ( ) , StandardCharsets . UTF_8 ) ) { JsonObject securityCredentials = new Gson ( ) . fromJson ( r , JsonObject . class ) ; String user = securityCredentials . getAsJsonPrimitive ( ""AccessKeyId"" ) . getAsString ( ) ; String password = securityCredentials . getAsJsonPrimitive ( ""SecretAccessKey"" ) . getAsString ( ) ; String token = securityCredentials . getAsJsonPrimitive ( ""Token"" ) . getAsString ( ) ; log . debug ( ""Received temporary access key %s..."" , user . substring ( 0 , 8 ) ) ; return new AuthConfig ( user , password , ""none"" , token ) ; } } } } ","private static AuthConfig getAuthConfigFromEC2InstanceRole ( KitLogger log ) throws IOException { log . debug ( ""No user and password set for ECR, checking EC2 instance role"" ) ; try ( CloseableHttpClient client = HttpClients . custom ( ) . useSystemProperties ( ) . build ( ) ) { RequestConfig conf = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 1000 ) . setConnectTimeout ( 1000 ) . setSocketTimeout ( 1000 ) . build ( ) ; HttpGet request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials"" ) ; request . setConfig ( conf ) ; String instanceRole ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No instance role found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( InputStream is = response . getEntity ( ) . getContent ( ) ) { instanceRole = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; } } log . debug ( ""Found instance role %s, getting temporary security credentials"" , instanceRole ) ; request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials/"" + UrlEscapers . urlPathSegmentEscaper ( ) . escape ( instanceRole ) ) ; request . setConfig ( conf ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No security credential found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( Reader r = new InputStreamReader ( response . getEntity ( ) . getContent ( ) , StandardCharsets . UTF_8 ) ) { JsonObject securityCredentials = new Gson ( ) . fromJson ( r , JsonObject . class ) ; String user = securityCredentials . getAsJsonPrimitive ( ""AccessKeyId"" ) . getAsString ( ) ; String password = securityCredentials . getAsJsonPrimitive ( ""SecretAccessKey"" ) . getAsString ( ) ; String token = securityCredentials . getAsJsonPrimitive ( ""Token"" ) . getAsString ( ) ; log . debug ( ""Received temporary access key %s..."" , user . substring ( 0 , 8 ) ) ; return new AuthConfig ( user , password , ""none"" , token ) ; } } } } " 929,"private static AuthConfig getAuthConfigFromEC2InstanceRole ( KitLogger log ) throws IOException { log . debug ( ""No user and password set for ECR, checking EC2 instance role"" ) ; try ( CloseableHttpClient client = HttpClients . custom ( ) . useSystemProperties ( ) . build ( ) ) { RequestConfig conf = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 1000 ) . setConnectTimeout ( 1000 ) . setSocketTimeout ( 1000 ) . build ( ) ; HttpGet request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials"" ) ; request . setConfig ( conf ) ; String instanceRole ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No instance role found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( InputStream is = response . getEntity ( ) . getContent ( ) ) { instanceRole = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; } } log . debug ( ""Found instance role %s, getting temporary security credentials"" , instanceRole ) ; request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials/"" + UrlEscapers . urlPathSegmentEscaper ( ) . escape ( instanceRole ) ) ; request . setConfig ( conf ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { return null ; } try ( Reader r = new InputStreamReader ( response . getEntity ( ) . getContent ( ) , StandardCharsets . UTF_8 ) ) { JsonObject securityCredentials = new Gson ( ) . fromJson ( r , JsonObject . class ) ; String user = securityCredentials . getAsJsonPrimitive ( ""AccessKeyId"" ) . getAsString ( ) ; String password = securityCredentials . getAsJsonPrimitive ( ""SecretAccessKey"" ) . getAsString ( ) ; String token = securityCredentials . getAsJsonPrimitive ( ""Token"" ) . getAsString ( ) ; log . debug ( ""Received temporary access key %s..."" , user . substring ( 0 , 8 ) ) ; return new AuthConfig ( user , password , ""none"" , token ) ; } } } } ","private static AuthConfig getAuthConfigFromEC2InstanceRole ( KitLogger log ) throws IOException { log . debug ( ""No user and password set for ECR, checking EC2 instance role"" ) ; try ( CloseableHttpClient client = HttpClients . custom ( ) . useSystemProperties ( ) . build ( ) ) { RequestConfig conf = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 1000 ) . setConnectTimeout ( 1000 ) . setSocketTimeout ( 1000 ) . build ( ) ; HttpGet request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials"" ) ; request . setConfig ( conf ) ; String instanceRole ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No instance role found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( InputStream is = response . getEntity ( ) . getContent ( ) ) { instanceRole = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; } } log . debug ( ""Found instance role %s, getting temporary security credentials"" , instanceRole ) ; request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials/"" + UrlEscapers . urlPathSegmentEscaper ( ) . escape ( instanceRole ) ) ; request . setConfig ( conf ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No security credential found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( Reader r = new InputStreamReader ( response . getEntity ( ) . getContent ( ) , StandardCharsets . UTF_8 ) ) { JsonObject securityCredentials = new Gson ( ) . fromJson ( r , JsonObject . class ) ; String user = securityCredentials . getAsJsonPrimitive ( ""AccessKeyId"" ) . getAsString ( ) ; String password = securityCredentials . getAsJsonPrimitive ( ""SecretAccessKey"" ) . getAsString ( ) ; String token = securityCredentials . getAsJsonPrimitive ( ""Token"" ) . getAsString ( ) ; log . debug ( ""Received temporary access key %s..."" , user . substring ( 0 , 8 ) ) ; return new AuthConfig ( user , password , ""none"" , token ) ; } } } } " 930,"private static AuthConfig getAuthConfigFromEC2InstanceRole ( KitLogger log ) throws IOException { log . debug ( ""No user and password set for ECR, checking EC2 instance role"" ) ; try ( CloseableHttpClient client = HttpClients . custom ( ) . useSystemProperties ( ) . build ( ) ) { RequestConfig conf = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 1000 ) . setConnectTimeout ( 1000 ) . setSocketTimeout ( 1000 ) . build ( ) ; HttpGet request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials"" ) ; request . setConfig ( conf ) ; String instanceRole ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No instance role found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( InputStream is = response . getEntity ( ) . getContent ( ) ) { instanceRole = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; } } log . debug ( ""Found instance role %s, getting temporary security credentials"" , instanceRole ) ; request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials/"" + UrlEscapers . urlPathSegmentEscaper ( ) . escape ( instanceRole ) ) ; request . setConfig ( conf ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No security credential found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( Reader r = new InputStreamReader ( response . getEntity ( ) . getContent ( ) , StandardCharsets . UTF_8 ) ) { JsonObject securityCredentials = new Gson ( ) . fromJson ( r , JsonObject . class ) ; String user = securityCredentials . getAsJsonPrimitive ( ""AccessKeyId"" ) . getAsString ( ) ; String password = securityCredentials . getAsJsonPrimitive ( ""SecretAccessKey"" ) . getAsString ( ) ; String token = securityCredentials . getAsJsonPrimitive ( ""Token"" ) . getAsString ( ) ; return new AuthConfig ( user , password , ""none"" , token ) ; } } } } ","private static AuthConfig getAuthConfigFromEC2InstanceRole ( KitLogger log ) throws IOException { log . debug ( ""No user and password set for ECR, checking EC2 instance role"" ) ; try ( CloseableHttpClient client = HttpClients . custom ( ) . useSystemProperties ( ) . build ( ) ) { RequestConfig conf = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 1000 ) . setConnectTimeout ( 1000 ) . setSocketTimeout ( 1000 ) . build ( ) ; HttpGet request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials"" ) ; request . setConfig ( conf ) ; String instanceRole ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No instance role found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( InputStream is = response . getEntity ( ) . getContent ( ) ) { instanceRole = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; } } log . debug ( ""Found instance role %s, getting temporary security credentials"" , instanceRole ) ; request = new HttpGet ( ""http://169.254.169.254/latest/meta-data/iam/security-credentials/"" + UrlEscapers . urlPathSegmentEscaper ( ) . escape ( instanceRole ) ) ; request . setConfig ( conf ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { if ( response . getStatusLine ( ) . getStatusCode ( ) != HttpStatus . SC_OK ) { log . debug ( ""No security credential found, return code was %d"" , response . getStatusLine ( ) . getStatusCode ( ) ) ; return null ; } try ( Reader r = new InputStreamReader ( response . getEntity ( ) . getContent ( ) , StandardCharsets . UTF_8 ) ) { JsonObject securityCredentials = new Gson ( ) . fromJson ( r , JsonObject . class ) ; String user = securityCredentials . getAsJsonPrimitive ( ""AccessKeyId"" ) . getAsString ( ) ; String password = securityCredentials . getAsJsonPrimitive ( ""SecretAccessKey"" ) . getAsString ( ) ; String token = securityCredentials . getAsJsonPrimitive ( ""Token"" ) . getAsString ( ) ; log . debug ( ""Received temporary access key %s..."" , user . substring ( 0 , 8 ) ) ; return new AuthConfig ( user , password , ""none"" , token ) ; } } } } " 931,"public static com . liferay . portal . kernel . model . EmailAddressSoap [ ] getEmailAddresses ( String className , long classPK ) throws RemoteException { try { java . util . List < com . liferay . portal . kernel . model . EmailAddress > returnValue = EmailAddressServiceUtil . getEmailAddresses ( className , classPK ) ; return com . liferay . portal . kernel . model . EmailAddressSoap . toSoapModels ( returnValue ) ; } catch ( Exception exception ) { throw new RemoteException ( exception . getMessage ( ) ) ; } } ","public static com . liferay . portal . kernel . model . EmailAddressSoap [ ] getEmailAddresses ( String className , long classPK ) throws RemoteException { try { java . util . List < com . liferay . portal . kernel . model . EmailAddress > returnValue = EmailAddressServiceUtil . getEmailAddresses ( className , classPK ) ; return com . liferay . portal . kernel . model . EmailAddressSoap . toSoapModels ( returnValue ) ; } catch ( Exception exception ) { _log . error ( exception , exception ) ; throw new RemoteException ( exception . getMessage ( ) ) ; } } " 932,"private static void convertTieLine ( UcteNetwork ucteNetwork , MergedXnode mergedXnode , UcteExporterContext context ) { Line line = mergedXnode . getExtendable ( ) ; convertXNode ( ucteNetwork , mergedXnode , context ) ; UcteElementId ucteElementId1 = context . getNamingStrategy ( ) . getUcteElementId ( mergedXnode . getLine1Name ( ) ) ; String elementName1 = line . getProperty ( ELEMENT_NAME_PROPERTY_KEY + ""_1"" , null ) ; UcteElementStatus status1 = line instanceof TieLine ? getStatusHalf ( ( TieLine ) line , Branch . Side . ONE ) : getStatus ( line , Branch . Side . ONE ) ; UcteLine ucteLine1 = new UcteLine ( ucteElementId1 , status1 , ( float ) line . getR ( ) * mergedXnode . getRdp ( ) , ( float ) line . getX ( ) * mergedXnode . getXdp ( ) , ( float ) line . getB1 ( ) , ( int ) line . getCurrentLimits1 ( ) . getPermanentLimit ( ) , elementName1 ) ; ucteNetwork . addLine ( ucteLine1 ) ; UcteElementId ucteElementId2 = context . getNamingStrategy ( ) . getUcteElementId ( mergedXnode . getLine2Name ( ) ) ; String elementName2 = line . getProperty ( ELEMENT_NAME_PROPERTY_KEY + ""_2"" , null ) ; UcteElementStatus status2 = line instanceof TieLine ? getStatusHalf ( ( TieLine ) line , Branch . Side . TWO ) : getStatus ( line , Branch . Side . TWO ) ; UcteLine ucteLine2 = new UcteLine ( ucteElementId2 , status2 , ( float ) line . getR ( ) * ( 1.0f - mergedXnode . getRdp ( ) ) , ( float ) line . getX ( ) * ( 1.0f - mergedXnode . getXdp ( ) ) , ( float ) line . getB2 ( ) , ( int ) line . getCurrentLimits2 ( ) . getPermanentLimit ( ) , elementName2 ) ; ucteNetwork . addLine ( ucteLine2 ) ; } ","private static void convertTieLine ( UcteNetwork ucteNetwork , MergedXnode mergedXnode , UcteExporterContext context ) { Line line = mergedXnode . getExtendable ( ) ; LOGGER . trace ( ""Converting TieLine {}"" , line . getId ( ) ) ; convertXNode ( ucteNetwork , mergedXnode , context ) ; UcteElementId ucteElementId1 = context . getNamingStrategy ( ) . getUcteElementId ( mergedXnode . getLine1Name ( ) ) ; String elementName1 = line . getProperty ( ELEMENT_NAME_PROPERTY_KEY + ""_1"" , null ) ; UcteElementStatus status1 = line instanceof TieLine ? getStatusHalf ( ( TieLine ) line , Branch . Side . ONE ) : getStatus ( line , Branch . Side . ONE ) ; UcteLine ucteLine1 = new UcteLine ( ucteElementId1 , status1 , ( float ) line . getR ( ) * mergedXnode . getRdp ( ) , ( float ) line . getX ( ) * mergedXnode . getXdp ( ) , ( float ) line . getB1 ( ) , ( int ) line . getCurrentLimits1 ( ) . getPermanentLimit ( ) , elementName1 ) ; ucteNetwork . addLine ( ucteLine1 ) ; UcteElementId ucteElementId2 = context . getNamingStrategy ( ) . getUcteElementId ( mergedXnode . getLine2Name ( ) ) ; String elementName2 = line . getProperty ( ELEMENT_NAME_PROPERTY_KEY + ""_2"" , null ) ; UcteElementStatus status2 = line instanceof TieLine ? getStatusHalf ( ( TieLine ) line , Branch . Side . TWO ) : getStatus ( line , Branch . Side . TWO ) ; UcteLine ucteLine2 = new UcteLine ( ucteElementId2 , status2 , ( float ) line . getR ( ) * ( 1.0f - mergedXnode . getRdp ( ) ) , ( float ) line . getX ( ) * ( 1.0f - mergedXnode . getXdp ( ) ) , ( float ) line . getB2 ( ) , ( int ) line . getCurrentLimits2 ( ) . getPermanentLimit ( ) , elementName2 ) ; ucteNetwork . addLine ( ucteLine2 ) ; } " 933,"private static void onDocumentRemoved ( CoreSession coreSession , RelationManager relationManager , QuoteServiceConfig config , DocumentModel docMessage ) throws ClientException { Resource documentRes = relationManager . getResource ( config . documentNamespace , docMessage , null ) ; if ( documentRes == null ) { return ; } Statement pattern = new StatementImpl ( null , null , documentRes ) ; List < Statement > statementList = relationManager . getStatements ( config . graphName , pattern ) ; for ( Statement stmt : statementList ) { QNameResource resource = ( QNameResource ) stmt . getSubject ( ) ; String commentId = resource . getLocalName ( ) ; DocumentModel docModel = ( DocumentModel ) relationManager . getResourceRepresentation ( config . commentNamespace , resource , null ) ; if ( docModel != null ) { try { coreSession . removeDocument ( docModel . getRef ( ) ) ; log . debug ( ""quote removal succeded for id: "" + commentId ) ; } catch ( Exception e ) { log . error ( ""quote removal failed"" , e ) ; } } else { log . warn ( ""quote/comment not found: id="" + commentId ) ; } } coreSession . save ( ) ; relationManager . remove ( config . graphName , statementList ) ; } ","private static void onDocumentRemoved ( CoreSession coreSession , RelationManager relationManager , QuoteServiceConfig config , DocumentModel docMessage ) throws ClientException { Resource documentRes = relationManager . getResource ( config . documentNamespace , docMessage , null ) ; if ( documentRes == null ) { log . error ( ""Could not adapt document model to relation resource ; "" + ""check the service relation adapters configuration"" ) ; return ; } Statement pattern = new StatementImpl ( null , null , documentRes ) ; List < Statement > statementList = relationManager . getStatements ( config . graphName , pattern ) ; for ( Statement stmt : statementList ) { QNameResource resource = ( QNameResource ) stmt . getSubject ( ) ; String commentId = resource . getLocalName ( ) ; DocumentModel docModel = ( DocumentModel ) relationManager . getResourceRepresentation ( config . commentNamespace , resource , null ) ; if ( docModel != null ) { try { coreSession . removeDocument ( docModel . getRef ( ) ) ; log . debug ( ""quote removal succeded for id: "" + commentId ) ; } catch ( Exception e ) { log . error ( ""quote removal failed"" , e ) ; } } else { log . warn ( ""quote/comment not found: id="" + commentId ) ; } } coreSession . save ( ) ; relationManager . remove ( config . graphName , statementList ) ; } " 934,"private static void onDocumentRemoved ( CoreSession coreSession , RelationManager relationManager , QuoteServiceConfig config , DocumentModel docMessage ) throws ClientException { Resource documentRes = relationManager . getResource ( config . documentNamespace , docMessage , null ) ; if ( documentRes == null ) { log . error ( ""Could not adapt document model to relation resource ; "" + ""check the service relation adapters configuration"" ) ; return ; } Statement pattern = new StatementImpl ( null , null , documentRes ) ; List < Statement > statementList = relationManager . getStatements ( config . graphName , pattern ) ; for ( Statement stmt : statementList ) { QNameResource resource = ( QNameResource ) stmt . getSubject ( ) ; String commentId = resource . getLocalName ( ) ; DocumentModel docModel = ( DocumentModel ) relationManager . getResourceRepresentation ( config . commentNamespace , resource , null ) ; if ( docModel != null ) { try { coreSession . removeDocument ( docModel . getRef ( ) ) ; } catch ( Exception e ) { log . error ( ""quote removal failed"" , e ) ; } } else { log . warn ( ""quote/comment not found: id="" + commentId ) ; } } coreSession . save ( ) ; relationManager . remove ( config . graphName , statementList ) ; } ","private static void onDocumentRemoved ( CoreSession coreSession , RelationManager relationManager , QuoteServiceConfig config , DocumentModel docMessage ) throws ClientException { Resource documentRes = relationManager . getResource ( config . documentNamespace , docMessage , null ) ; if ( documentRes == null ) { log . error ( ""Could not adapt document model to relation resource ; "" + ""check the service relation adapters configuration"" ) ; return ; } Statement pattern = new StatementImpl ( null , null , documentRes ) ; List < Statement > statementList = relationManager . getStatements ( config . graphName , pattern ) ; for ( Statement stmt : statementList ) { QNameResource resource = ( QNameResource ) stmt . getSubject ( ) ; String commentId = resource . getLocalName ( ) ; DocumentModel docModel = ( DocumentModel ) relationManager . getResourceRepresentation ( config . commentNamespace , resource , null ) ; if ( docModel != null ) { try { coreSession . removeDocument ( docModel . getRef ( ) ) ; log . debug ( ""quote removal succeded for id: "" + commentId ) ; } catch ( Exception e ) { log . error ( ""quote removal failed"" , e ) ; } } else { log . warn ( ""quote/comment not found: id="" + commentId ) ; } } coreSession . save ( ) ; relationManager . remove ( config . graphName , statementList ) ; } " 935,"private static void onDocumentRemoved ( CoreSession coreSession , RelationManager relationManager , QuoteServiceConfig config , DocumentModel docMessage ) throws ClientException { Resource documentRes = relationManager . getResource ( config . documentNamespace , docMessage , null ) ; if ( documentRes == null ) { log . error ( ""Could not adapt document model to relation resource ; "" + ""check the service relation adapters configuration"" ) ; return ; } Statement pattern = new StatementImpl ( null , null , documentRes ) ; List < Statement > statementList = relationManager . getStatements ( config . graphName , pattern ) ; for ( Statement stmt : statementList ) { QNameResource resource = ( QNameResource ) stmt . getSubject ( ) ; String commentId = resource . getLocalName ( ) ; DocumentModel docModel = ( DocumentModel ) relationManager . getResourceRepresentation ( config . commentNamespace , resource , null ) ; if ( docModel != null ) { try { coreSession . removeDocument ( docModel . getRef ( ) ) ; log . debug ( ""quote removal succeded for id: "" + commentId ) ; } catch ( Exception e ) { } } else { log . warn ( ""quote/comment not found: id="" + commentId ) ; } } coreSession . save ( ) ; relationManager . remove ( config . graphName , statementList ) ; } ","private static void onDocumentRemoved ( CoreSession coreSession , RelationManager relationManager , QuoteServiceConfig config , DocumentModel docMessage ) throws ClientException { Resource documentRes = relationManager . getResource ( config . documentNamespace , docMessage , null ) ; if ( documentRes == null ) { log . error ( ""Could not adapt document model to relation resource ; "" + ""check the service relation adapters configuration"" ) ; return ; } Statement pattern = new StatementImpl ( null , null , documentRes ) ; List < Statement > statementList = relationManager . getStatements ( config . graphName , pattern ) ; for ( Statement stmt : statementList ) { QNameResource resource = ( QNameResource ) stmt . getSubject ( ) ; String commentId = resource . getLocalName ( ) ; DocumentModel docModel = ( DocumentModel ) relationManager . getResourceRepresentation ( config . commentNamespace , resource , null ) ; if ( docModel != null ) { try { coreSession . removeDocument ( docModel . getRef ( ) ) ; log . debug ( ""quote removal succeded for id: "" + commentId ) ; } catch ( Exception e ) { log . error ( ""quote removal failed"" , e ) ; } } else { log . warn ( ""quote/comment not found: id="" + commentId ) ; } } coreSession . save ( ) ; relationManager . remove ( config . graphName , statementList ) ; } " 936,"private static void onDocumentRemoved ( CoreSession coreSession , RelationManager relationManager , QuoteServiceConfig config , DocumentModel docMessage ) throws ClientException { Resource documentRes = relationManager . getResource ( config . documentNamespace , docMessage , null ) ; if ( documentRes == null ) { log . error ( ""Could not adapt document model to relation resource ; "" + ""check the service relation adapters configuration"" ) ; return ; } Statement pattern = new StatementImpl ( null , null , documentRes ) ; List < Statement > statementList = relationManager . getStatements ( config . graphName , pattern ) ; for ( Statement stmt : statementList ) { QNameResource resource = ( QNameResource ) stmt . getSubject ( ) ; String commentId = resource . getLocalName ( ) ; DocumentModel docModel = ( DocumentModel ) relationManager . getResourceRepresentation ( config . commentNamespace , resource , null ) ; if ( docModel != null ) { try { coreSession . removeDocument ( docModel . getRef ( ) ) ; log . debug ( ""quote removal succeded for id: "" + commentId ) ; } catch ( Exception e ) { log . error ( ""quote removal failed"" , e ) ; } } else { } } coreSession . save ( ) ; relationManager . remove ( config . graphName , statementList ) ; } ","private static void onDocumentRemoved ( CoreSession coreSession , RelationManager relationManager , QuoteServiceConfig config , DocumentModel docMessage ) throws ClientException { Resource documentRes = relationManager . getResource ( config . documentNamespace , docMessage , null ) ; if ( documentRes == null ) { log . error ( ""Could not adapt document model to relation resource ; "" + ""check the service relation adapters configuration"" ) ; return ; } Statement pattern = new StatementImpl ( null , null , documentRes ) ; List < Statement > statementList = relationManager . getStatements ( config . graphName , pattern ) ; for ( Statement stmt : statementList ) { QNameResource resource = ( QNameResource ) stmt . getSubject ( ) ; String commentId = resource . getLocalName ( ) ; DocumentModel docModel = ( DocumentModel ) relationManager . getResourceRepresentation ( config . commentNamespace , resource , null ) ; if ( docModel != null ) { try { coreSession . removeDocument ( docModel . getRef ( ) ) ; log . debug ( ""quote removal succeded for id: "" + commentId ) ; } catch ( Exception e ) { log . error ( ""quote removal failed"" , e ) ; } } else { log . warn ( ""quote/comment not found: id="" + commentId ) ; } } coreSession . save ( ) ; relationManager . remove ( config . graphName , statementList ) ; } " 937,"public String setDefaultWidgets ( ) { Page page = null ; try { page = ( Page ) this . getPage ( this . getPageCode ( ) ) ; PageModel model = page . getMetadata ( ) . getModel ( ) ; Widget [ ] defaultWidgets = model . getDefaultWidget ( ) ; if ( null == defaultWidgets ) { return SUCCESS ; } Widget [ ] widgets = new Widget [ defaultWidgets . length ] ; for ( int i = 0 ; i < defaultWidgets . length ; i ++ ) { Widget defaultWidget = defaultWidgets [ i ] ; if ( null != defaultWidget ) { if ( null == defaultWidget . getType ( ) ) { logger . info ( ""Widget Type null when adding defaulWidget (of pagemodel '{}') on frame '{}' of page '{}'"" , model . getCode ( ) , i , page . getCode ( ) ) ; continue ; } widgets [ i ] = defaultWidget ; } } page . setWidgets ( widgets ) ; this . getPageManager ( ) . updatePage ( page ) ; } catch ( Throwable t ) { logger . error ( ""Error setting default widget to page {}"" , this . getPageCode ( ) , t ) ; return FAILURE ; } return SUCCESS ; } ","public String setDefaultWidgets ( ) { Page page = null ; try { page = ( Page ) this . getPage ( this . getPageCode ( ) ) ; PageModel model = page . getMetadata ( ) . getModel ( ) ; Widget [ ] defaultWidgets = model . getDefaultWidget ( ) ; if ( null == defaultWidgets ) { logger . info ( ""No default Widget found for pagemodel '{}' of page '{}'"" , model . getCode ( ) , page . getCode ( ) ) ; return SUCCESS ; } Widget [ ] widgets = new Widget [ defaultWidgets . length ] ; for ( int i = 0 ; i < defaultWidgets . length ; i ++ ) { Widget defaultWidget = defaultWidgets [ i ] ; if ( null != defaultWidget ) { if ( null == defaultWidget . getType ( ) ) { logger . info ( ""Widget Type null when adding defaulWidget (of pagemodel '{}') on frame '{}' of page '{}'"" , model . getCode ( ) , i , page . getCode ( ) ) ; continue ; } widgets [ i ] = defaultWidget ; } } page . setWidgets ( widgets ) ; this . getPageManager ( ) . updatePage ( page ) ; } catch ( Throwable t ) { logger . error ( ""Error setting default widget to page {}"" , this . getPageCode ( ) , t ) ; return FAILURE ; } return SUCCESS ; } " 938,"public String setDefaultWidgets ( ) { Page page = null ; try { page = ( Page ) this . getPage ( this . getPageCode ( ) ) ; PageModel model = page . getMetadata ( ) . getModel ( ) ; Widget [ ] defaultWidgets = model . getDefaultWidget ( ) ; if ( null == defaultWidgets ) { logger . info ( ""No default Widget found for pagemodel '{}' of page '{}'"" , model . getCode ( ) , page . getCode ( ) ) ; return SUCCESS ; } Widget [ ] widgets = new Widget [ defaultWidgets . length ] ; for ( int i = 0 ; i < defaultWidgets . length ; i ++ ) { Widget defaultWidget = defaultWidgets [ i ] ; if ( null != defaultWidget ) { if ( null == defaultWidget . getType ( ) ) { continue ; } widgets [ i ] = defaultWidget ; } } page . setWidgets ( widgets ) ; this . getPageManager ( ) . updatePage ( page ) ; } catch ( Throwable t ) { logger . error ( ""Error setting default widget to page {}"" , this . getPageCode ( ) , t ) ; return FAILURE ; } return SUCCESS ; } ","public String setDefaultWidgets ( ) { Page page = null ; try { page = ( Page ) this . getPage ( this . getPageCode ( ) ) ; PageModel model = page . getMetadata ( ) . getModel ( ) ; Widget [ ] defaultWidgets = model . getDefaultWidget ( ) ; if ( null == defaultWidgets ) { logger . info ( ""No default Widget found for pagemodel '{}' of page '{}'"" , model . getCode ( ) , page . getCode ( ) ) ; return SUCCESS ; } Widget [ ] widgets = new Widget [ defaultWidgets . length ] ; for ( int i = 0 ; i < defaultWidgets . length ; i ++ ) { Widget defaultWidget = defaultWidgets [ i ] ; if ( null != defaultWidget ) { if ( null == defaultWidget . getType ( ) ) { logger . info ( ""Widget Type null when adding defaulWidget (of pagemodel '{}') on frame '{}' of page '{}'"" , model . getCode ( ) , i , page . getCode ( ) ) ; continue ; } widgets [ i ] = defaultWidget ; } } page . setWidgets ( widgets ) ; this . getPageManager ( ) . updatePage ( page ) ; } catch ( Throwable t ) { logger . error ( ""Error setting default widget to page {}"" , this . getPageCode ( ) , t ) ; return FAILURE ; } return SUCCESS ; } " 939,"public String setDefaultWidgets ( ) { Page page = null ; try { page = ( Page ) this . getPage ( this . getPageCode ( ) ) ; PageModel model = page . getMetadata ( ) . getModel ( ) ; Widget [ ] defaultWidgets = model . getDefaultWidget ( ) ; if ( null == defaultWidgets ) { logger . info ( ""No default Widget found for pagemodel '{}' of page '{}'"" , model . getCode ( ) , page . getCode ( ) ) ; return SUCCESS ; } Widget [ ] widgets = new Widget [ defaultWidgets . length ] ; for ( int i = 0 ; i < defaultWidgets . length ; i ++ ) { Widget defaultWidget = defaultWidgets [ i ] ; if ( null != defaultWidget ) { if ( null == defaultWidget . getType ( ) ) { logger . info ( ""Widget Type null when adding defaulWidget (of pagemodel '{}') on frame '{}' of page '{}'"" , model . getCode ( ) , i , page . getCode ( ) ) ; continue ; } widgets [ i ] = defaultWidget ; } } page . setWidgets ( widgets ) ; this . getPageManager ( ) . updatePage ( page ) ; } catch ( Throwable t ) { return FAILURE ; } return SUCCESS ; } ","public String setDefaultWidgets ( ) { Page page = null ; try { page = ( Page ) this . getPage ( this . getPageCode ( ) ) ; PageModel model = page . getMetadata ( ) . getModel ( ) ; Widget [ ] defaultWidgets = model . getDefaultWidget ( ) ; if ( null == defaultWidgets ) { logger . info ( ""No default Widget found for pagemodel '{}' of page '{}'"" , model . getCode ( ) , page . getCode ( ) ) ; return SUCCESS ; } Widget [ ] widgets = new Widget [ defaultWidgets . length ] ; for ( int i = 0 ; i < defaultWidgets . length ; i ++ ) { Widget defaultWidget = defaultWidgets [ i ] ; if ( null != defaultWidget ) { if ( null == defaultWidget . getType ( ) ) { logger . info ( ""Widget Type null when adding defaulWidget (of pagemodel '{}') on frame '{}' of page '{}'"" , model . getCode ( ) , i , page . getCode ( ) ) ; continue ; } widgets [ i ] = defaultWidget ; } } page . setWidgets ( widgets ) ; this . getPageManager ( ) . updatePage ( page ) ; } catch ( Throwable t ) { logger . error ( ""Error setting default widget to page {}"" , this . getPageCode ( ) , t ) ; return FAILURE ; } return SUCCESS ; } " 940,"public FeedMessage getModel ( ) { FeedMessage cachedAlerts = _cache . getAlerts ( getAgencyIdHashKey ( ) ) ; if ( cachedAlerts != null ) { return cachedAlerts ; } else { FeedMessage . Builder feedMessage = createFeedWithDefaultHeader ( null ) ; List < String > agencyIds = new ArrayList < String > ( ) ; if ( agencyId != null ) { agencyIds . add ( agencyId ) ; } else { Map < String , List < CoordinateBounds > > agencies = _transitDataService . getAgencyIdsWithCoverageArea ( ) ; agencyIds . addAll ( agencies . keySet ( ) ) ; } for ( String agencyId : agencyIds ) { ListBean < ServiceAlertBean > serviceAlertBeans = _transitDataService . getAllServiceAlertsForAgencyId ( agencyId ) ; for ( ServiceAlertBean serviceAlert : serviceAlertBeans . getList ( ) ) { try { if ( matchesFilter ( serviceAlert ) ) { Alert . Builder alert = Alert . newBuilder ( ) ; fillAlertHeader ( alert , serviceAlert . getSummaries ( ) ) ; fillAlertDescriptions ( alert , serviceAlert . getDescriptions ( ) ) ; if ( ! alert . hasDescriptionText ( ) ) { alert . setDescriptionText ( alert . getHeaderText ( ) ) ; } fillActiveWindows ( alert , serviceAlert . getActiveWindows ( ) ) ; fillSituationAffects ( alert , serviceAlert . getAllAffects ( ) ) ; FeedEntity . Builder feedEntity = FeedEntity . newBuilder ( ) ; feedEntity . setAlert ( alert ) ; feedEntity . setId ( id ( agencyId , serviceAlert . getId ( ) ) ) ; feedMessage . addEntity ( feedEntity ) ; } } catch ( Exception e ) { _log . error ( ""Unable to process service alert"" , e ) ; } } } FeedMessage builtFeedMessage = feedMessage . build ( ) ; _cache . putAlerts ( getAgencyIdHashKey ( ) , builtFeedMessage ) ; return builtFeedMessage ; } } ","public FeedMessage getModel ( ) { FeedMessage cachedAlerts = _cache . getAlerts ( getAgencyIdHashKey ( ) ) ; if ( cachedAlerts != null ) { return cachedAlerts ; } else { FeedMessage . Builder feedMessage = createFeedWithDefaultHeader ( null ) ; List < String > agencyIds = new ArrayList < String > ( ) ; if ( agencyId != null ) { agencyIds . add ( agencyId ) ; } else { Map < String , List < CoordinateBounds > > agencies = _transitDataService . getAgencyIdsWithCoverageArea ( ) ; agencyIds . addAll ( agencies . keySet ( ) ) ; } for ( String agencyId : agencyIds ) { ListBean < ServiceAlertBean > serviceAlertBeans = _transitDataService . getAllServiceAlertsForAgencyId ( agencyId ) ; for ( ServiceAlertBean serviceAlert : serviceAlertBeans . getList ( ) ) { try { if ( matchesFilter ( serviceAlert ) ) { Alert . Builder alert = Alert . newBuilder ( ) ; fillAlertHeader ( alert , serviceAlert . getSummaries ( ) ) ; fillAlertDescriptions ( alert , serviceAlert . getDescriptions ( ) ) ; if ( ! alert . hasDescriptionText ( ) ) { _log . info ( ""copying header text of "" + alert . getHeaderText ( ) . getTranslation ( 0 ) ) ; alert . setDescriptionText ( alert . getHeaderText ( ) ) ; } fillActiveWindows ( alert , serviceAlert . getActiveWindows ( ) ) ; fillSituationAffects ( alert , serviceAlert . getAllAffects ( ) ) ; FeedEntity . Builder feedEntity = FeedEntity . newBuilder ( ) ; feedEntity . setAlert ( alert ) ; feedEntity . setId ( id ( agencyId , serviceAlert . getId ( ) ) ) ; feedMessage . addEntity ( feedEntity ) ; } } catch ( Exception e ) { _log . error ( ""Unable to process service alert"" , e ) ; } } } FeedMessage builtFeedMessage = feedMessage . build ( ) ; _cache . putAlerts ( getAgencyIdHashKey ( ) , builtFeedMessage ) ; return builtFeedMessage ; } } " 941,"public FeedMessage getModel ( ) { FeedMessage cachedAlerts = _cache . getAlerts ( getAgencyIdHashKey ( ) ) ; if ( cachedAlerts != null ) { return cachedAlerts ; } else { FeedMessage . Builder feedMessage = createFeedWithDefaultHeader ( null ) ; List < String > agencyIds = new ArrayList < String > ( ) ; if ( agencyId != null ) { agencyIds . add ( agencyId ) ; } else { Map < String , List < CoordinateBounds > > agencies = _transitDataService . getAgencyIdsWithCoverageArea ( ) ; agencyIds . addAll ( agencies . keySet ( ) ) ; } for ( String agencyId : agencyIds ) { ListBean < ServiceAlertBean > serviceAlertBeans = _transitDataService . getAllServiceAlertsForAgencyId ( agencyId ) ; for ( ServiceAlertBean serviceAlert : serviceAlertBeans . getList ( ) ) { try { if ( matchesFilter ( serviceAlert ) ) { Alert . Builder alert = Alert . newBuilder ( ) ; fillAlertHeader ( alert , serviceAlert . getSummaries ( ) ) ; fillAlertDescriptions ( alert , serviceAlert . getDescriptions ( ) ) ; if ( ! alert . hasDescriptionText ( ) ) { _log . info ( ""copying header text of "" + alert . getHeaderText ( ) . getTranslation ( 0 ) ) ; alert . setDescriptionText ( alert . getHeaderText ( ) ) ; } fillActiveWindows ( alert , serviceAlert . getActiveWindows ( ) ) ; fillSituationAffects ( alert , serviceAlert . getAllAffects ( ) ) ; FeedEntity . Builder feedEntity = FeedEntity . newBuilder ( ) ; feedEntity . setAlert ( alert ) ; feedEntity . setId ( id ( agencyId , serviceAlert . getId ( ) ) ) ; feedMessage . addEntity ( feedEntity ) ; } } catch ( Exception e ) { } } } FeedMessage builtFeedMessage = feedMessage . build ( ) ; _cache . putAlerts ( getAgencyIdHashKey ( ) , builtFeedMessage ) ; return builtFeedMessage ; } } ","public FeedMessage getModel ( ) { FeedMessage cachedAlerts = _cache . getAlerts ( getAgencyIdHashKey ( ) ) ; if ( cachedAlerts != null ) { return cachedAlerts ; } else { FeedMessage . Builder feedMessage = createFeedWithDefaultHeader ( null ) ; List < String > agencyIds = new ArrayList < String > ( ) ; if ( agencyId != null ) { agencyIds . add ( agencyId ) ; } else { Map < String , List < CoordinateBounds > > agencies = _transitDataService . getAgencyIdsWithCoverageArea ( ) ; agencyIds . addAll ( agencies . keySet ( ) ) ; } for ( String agencyId : agencyIds ) { ListBean < ServiceAlertBean > serviceAlertBeans = _transitDataService . getAllServiceAlertsForAgencyId ( agencyId ) ; for ( ServiceAlertBean serviceAlert : serviceAlertBeans . getList ( ) ) { try { if ( matchesFilter ( serviceAlert ) ) { Alert . Builder alert = Alert . newBuilder ( ) ; fillAlertHeader ( alert , serviceAlert . getSummaries ( ) ) ; fillAlertDescriptions ( alert , serviceAlert . getDescriptions ( ) ) ; if ( ! alert . hasDescriptionText ( ) ) { _log . info ( ""copying header text of "" + alert . getHeaderText ( ) . getTranslation ( 0 ) ) ; alert . setDescriptionText ( alert . getHeaderText ( ) ) ; } fillActiveWindows ( alert , serviceAlert . getActiveWindows ( ) ) ; fillSituationAffects ( alert , serviceAlert . getAllAffects ( ) ) ; FeedEntity . Builder feedEntity = FeedEntity . newBuilder ( ) ; feedEntity . setAlert ( alert ) ; feedEntity . setId ( id ( agencyId , serviceAlert . getId ( ) ) ) ; feedMessage . addEntity ( feedEntity ) ; } } catch ( Exception e ) { _log . error ( ""Unable to process service alert"" , e ) ; } } } FeedMessage builtFeedMessage = feedMessage . build ( ) ; _cache . putAlerts ( getAgencyIdHashKey ( ) , builtFeedMessage ) ; return builtFeedMessage ; } } " 942,"public static ArrayList < String > loadSystemData ( String system ) { Path datapath = Paths . get ( ""./src/main/resources/QALD6MultilingualLogs/multilingual_"" + system + "".html"" ) ; ArrayList < String > result = Lists . newArrayList ( ) ; try { String loadedData = Files . lines ( datapath ) . collect ( Collectors . joining ( ) ) ; Document doc = Jsoup . parse ( loadedData ) ; Element table = doc . select ( ""table"" ) . get ( 5 ) ; Elements tableRows = table . select ( ""tr"" ) ; for ( Element row : tableRows ) { Elements tableEntry = row . select ( ""td"" ) ; result . add ( tableEntry . get ( 3 ) . ownText ( ) ) ; } result . remove ( 0 ) ; return result ; } catch ( IOException e ) { e . printStackTrace ( ) ; return result ; } } ","public static ArrayList < String > loadSystemData ( String system ) { Path datapath = Paths . get ( ""./src/main/resources/QALD6MultilingualLogs/multilingual_"" + system + "".html"" ) ; ArrayList < String > result = Lists . newArrayList ( ) ; try { String loadedData = Files . lines ( datapath ) . collect ( Collectors . joining ( ) ) ; Document doc = Jsoup . parse ( loadedData ) ; Element table = doc . select ( ""table"" ) . get ( 5 ) ; Elements tableRows = table . select ( ""tr"" ) ; for ( Element row : tableRows ) { Elements tableEntry = row . select ( ""td"" ) ; result . add ( tableEntry . get ( 3 ) . ownText ( ) ) ; } result . remove ( 0 ) ; return result ; } catch ( IOException e ) { e . printStackTrace ( ) ; log . debug ( ""loading failed."" ) ; return result ; } } " 943,"public PollsQuestion findByPrimaryKey ( Serializable primaryKey ) throws NoSuchQuestionException { PollsQuestion pollsQuestion = fetchByPrimaryKey ( primaryKey ) ; if ( pollsQuestion == null ) { if ( _log . isDebugEnabled ( ) ) { } throw new NoSuchQuestionException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } return pollsQuestion ; } ","public PollsQuestion findByPrimaryKey ( Serializable primaryKey ) throws NoSuchQuestionException { PollsQuestion pollsQuestion = fetchByPrimaryKey ( primaryKey ) ; if ( pollsQuestion == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchQuestionException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } return pollsQuestion ; } " 944,"private boolean connect ( String address , int port ) { try { socket = TimedSocket . getSocket ( address , port , SOCKET_TIMEOUT ) ; socket . setSoTimeout ( SOCKET_TIMEOUT ) ; BufferedOutputStream buffOut = new BufferedOutputStream ( socket . getOutputStream ( ) ) ; outputStream = new DataOutputStream ( buffOut ) ; return true ; } catch ( IOException e ) { Freedomotic . logger . severe ( ""Unable to connect to host "" + address + "" on port "" + port ) ; return false ; } } ","private boolean connect ( String address , int port ) { Freedomotic . logger . info ( ""Trying to connect to ethernet relay board on address "" + address + ':' + port ) ; try { socket = TimedSocket . getSocket ( address , port , SOCKET_TIMEOUT ) ; socket . setSoTimeout ( SOCKET_TIMEOUT ) ; BufferedOutputStream buffOut = new BufferedOutputStream ( socket . getOutputStream ( ) ) ; outputStream = new DataOutputStream ( buffOut ) ; return true ; } catch ( IOException e ) { Freedomotic . logger . severe ( ""Unable to connect to host "" + address + "" on port "" + port ) ; return false ; } } " 945,"public void delete ( Table hTable , Object rowKey , String colFamily , String colName ) { try { byte [ ] rowBytes = HBaseUtils . getBytes ( rowKey ) ; Delete delete = new Delete ( rowBytes ) ; hTable . delete ( delete ) ; } catch ( IOException e ) { throw new PersistenceException ( ""Could not perform delete. Caused by: "" , e ) ; } } ","public void delete ( Table hTable , Object rowKey , String colFamily , String colName ) { try { byte [ ] rowBytes = HBaseUtils . getBytes ( rowKey ) ; Delete delete = new Delete ( rowBytes ) ; hTable . delete ( delete ) ; } catch ( IOException e ) { logger . error ( ""Error while delete on hbase for : "" + rowKey ) ; throw new PersistenceException ( ""Could not perform delete. Caused by: "" , e ) ; } } " 946,"protected MediaPackageElement retractElement ( String channelId , MediaPackage mediapackage , MediaPackageElement element ) throws DistributionException { notNull ( mediapackage , ""mediapackage"" ) ; notNull ( element , ""element"" ) ; notNull ( channelId , ""channelId"" ) ; String mediapackageId = mediapackage . getIdentifier ( ) . toString ( ) ; String elementId = element . getIdentifier ( ) ; try { final File elementFile = getDistributionFile ( channelId , mediapackage , element ) ; final File mediapackageDir = getMediaPackageDirectory ( channelId , mediapackage ) ; if ( ! elementFile . exists ( ) ) { return element ; } logger . debug ( ""Retracting element {} ({})"" , element , elementFile ) ; if ( ! FileUtils . deleteQuietly ( elementFile . getParentFile ( ) ) ) { logger . debug ( ""Unable to delete folder {}"" , elementFile . getParentFile ( ) . getAbsolutePath ( ) ) ; } if ( mediapackageDir . isDirectory ( ) && mediapackageDir . list ( ) . length == 0 ) { FileSupport . delete ( mediapackageDir ) ; } logger . debug ( ""Finished retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } catch ( Exception e ) { logger . warn ( ""Error retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId , e ) ; if ( e instanceof DistributionException ) { throw ( DistributionException ) e ; } else { throw new DistributionException ( e ) ; } } } ","protected MediaPackageElement retractElement ( String channelId , MediaPackage mediapackage , MediaPackageElement element ) throws DistributionException { notNull ( mediapackage , ""mediapackage"" ) ; notNull ( element , ""element"" ) ; notNull ( channelId , ""channelId"" ) ; String mediapackageId = mediapackage . getIdentifier ( ) . toString ( ) ; String elementId = element . getIdentifier ( ) ; try { final File elementFile = getDistributionFile ( channelId , mediapackage , element ) ; final File mediapackageDir = getMediaPackageDirectory ( channelId , mediapackage ) ; if ( ! elementFile . exists ( ) ) { logger . info ( ""Element {} from media package {} has already been removed or has never been distributed to "" + ""publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } logger . debug ( ""Retracting element {} ({})"" , element , elementFile ) ; if ( ! FileUtils . deleteQuietly ( elementFile . getParentFile ( ) ) ) { logger . debug ( ""Unable to delete folder {}"" , elementFile . getParentFile ( ) . getAbsolutePath ( ) ) ; } if ( mediapackageDir . isDirectory ( ) && mediapackageDir . list ( ) . length == 0 ) { FileSupport . delete ( mediapackageDir ) ; } logger . debug ( ""Finished retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } catch ( Exception e ) { logger . warn ( ""Error retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId , e ) ; if ( e instanceof DistributionException ) { throw ( DistributionException ) e ; } else { throw new DistributionException ( e ) ; } } } " 947,"protected MediaPackageElement retractElement ( String channelId , MediaPackage mediapackage , MediaPackageElement element ) throws DistributionException { notNull ( mediapackage , ""mediapackage"" ) ; notNull ( element , ""element"" ) ; notNull ( channelId , ""channelId"" ) ; String mediapackageId = mediapackage . getIdentifier ( ) . toString ( ) ; String elementId = element . getIdentifier ( ) ; try { final File elementFile = getDistributionFile ( channelId , mediapackage , element ) ; final File mediapackageDir = getMediaPackageDirectory ( channelId , mediapackage ) ; if ( ! elementFile . exists ( ) ) { logger . info ( ""Element {} from media package {} has already been removed or has never been distributed to "" + ""publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } if ( ! FileUtils . deleteQuietly ( elementFile . getParentFile ( ) ) ) { logger . debug ( ""Unable to delete folder {}"" , elementFile . getParentFile ( ) . getAbsolutePath ( ) ) ; } if ( mediapackageDir . isDirectory ( ) && mediapackageDir . list ( ) . length == 0 ) { FileSupport . delete ( mediapackageDir ) ; } logger . debug ( ""Finished retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } catch ( Exception e ) { logger . warn ( ""Error retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId , e ) ; if ( e instanceof DistributionException ) { throw ( DistributionException ) e ; } else { throw new DistributionException ( e ) ; } } } ","protected MediaPackageElement retractElement ( String channelId , MediaPackage mediapackage , MediaPackageElement element ) throws DistributionException { notNull ( mediapackage , ""mediapackage"" ) ; notNull ( element , ""element"" ) ; notNull ( channelId , ""channelId"" ) ; String mediapackageId = mediapackage . getIdentifier ( ) . toString ( ) ; String elementId = element . getIdentifier ( ) ; try { final File elementFile = getDistributionFile ( channelId , mediapackage , element ) ; final File mediapackageDir = getMediaPackageDirectory ( channelId , mediapackage ) ; if ( ! elementFile . exists ( ) ) { logger . info ( ""Element {} from media package {} has already been removed or has never been distributed to "" + ""publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } logger . debug ( ""Retracting element {} ({})"" , element , elementFile ) ; if ( ! FileUtils . deleteQuietly ( elementFile . getParentFile ( ) ) ) { logger . debug ( ""Unable to delete folder {}"" , elementFile . getParentFile ( ) . getAbsolutePath ( ) ) ; } if ( mediapackageDir . isDirectory ( ) && mediapackageDir . list ( ) . length == 0 ) { FileSupport . delete ( mediapackageDir ) ; } logger . debug ( ""Finished retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } catch ( Exception e ) { logger . warn ( ""Error retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId , e ) ; if ( e instanceof DistributionException ) { throw ( DistributionException ) e ; } else { throw new DistributionException ( e ) ; } } } " 948,"protected MediaPackageElement retractElement ( String channelId , MediaPackage mediapackage , MediaPackageElement element ) throws DistributionException { notNull ( mediapackage , ""mediapackage"" ) ; notNull ( element , ""element"" ) ; notNull ( channelId , ""channelId"" ) ; String mediapackageId = mediapackage . getIdentifier ( ) . toString ( ) ; String elementId = element . getIdentifier ( ) ; try { final File elementFile = getDistributionFile ( channelId , mediapackage , element ) ; final File mediapackageDir = getMediaPackageDirectory ( channelId , mediapackage ) ; if ( ! elementFile . exists ( ) ) { logger . info ( ""Element {} from media package {} has already been removed or has never been distributed to "" + ""publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } logger . debug ( ""Retracting element {} ({})"" , element , elementFile ) ; if ( ! FileUtils . deleteQuietly ( elementFile . getParentFile ( ) ) ) { } if ( mediapackageDir . isDirectory ( ) && mediapackageDir . list ( ) . length == 0 ) { FileSupport . delete ( mediapackageDir ) ; } logger . debug ( ""Finished retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } catch ( Exception e ) { logger . warn ( ""Error retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId , e ) ; if ( e instanceof DistributionException ) { throw ( DistributionException ) e ; } else { throw new DistributionException ( e ) ; } } } ","protected MediaPackageElement retractElement ( String channelId , MediaPackage mediapackage , MediaPackageElement element ) throws DistributionException { notNull ( mediapackage , ""mediapackage"" ) ; notNull ( element , ""element"" ) ; notNull ( channelId , ""channelId"" ) ; String mediapackageId = mediapackage . getIdentifier ( ) . toString ( ) ; String elementId = element . getIdentifier ( ) ; try { final File elementFile = getDistributionFile ( channelId , mediapackage , element ) ; final File mediapackageDir = getMediaPackageDirectory ( channelId , mediapackage ) ; if ( ! elementFile . exists ( ) ) { logger . info ( ""Element {} from media package {} has already been removed or has never been distributed to "" + ""publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } logger . debug ( ""Retracting element {} ({})"" , element , elementFile ) ; if ( ! FileUtils . deleteQuietly ( elementFile . getParentFile ( ) ) ) { logger . debug ( ""Unable to delete folder {}"" , elementFile . getParentFile ( ) . getAbsolutePath ( ) ) ; } if ( mediapackageDir . isDirectory ( ) && mediapackageDir . list ( ) . length == 0 ) { FileSupport . delete ( mediapackageDir ) ; } logger . debug ( ""Finished retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } catch ( Exception e ) { logger . warn ( ""Error retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId , e ) ; if ( e instanceof DistributionException ) { throw ( DistributionException ) e ; } else { throw new DistributionException ( e ) ; } } } " 949,"protected MediaPackageElement retractElement ( String channelId , MediaPackage mediapackage , MediaPackageElement element ) throws DistributionException { notNull ( mediapackage , ""mediapackage"" ) ; notNull ( element , ""element"" ) ; notNull ( channelId , ""channelId"" ) ; String mediapackageId = mediapackage . getIdentifier ( ) . toString ( ) ; String elementId = element . getIdentifier ( ) ; try { final File elementFile = getDistributionFile ( channelId , mediapackage , element ) ; final File mediapackageDir = getMediaPackageDirectory ( channelId , mediapackage ) ; if ( ! elementFile . exists ( ) ) { logger . info ( ""Element {} from media package {} has already been removed or has never been distributed to "" + ""publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } logger . debug ( ""Retracting element {} ({})"" , element , elementFile ) ; if ( ! FileUtils . deleteQuietly ( elementFile . getParentFile ( ) ) ) { logger . debug ( ""Unable to delete folder {}"" , elementFile . getParentFile ( ) . getAbsolutePath ( ) ) ; } if ( mediapackageDir . isDirectory ( ) && mediapackageDir . list ( ) . length == 0 ) { FileSupport . delete ( mediapackageDir ) ; } return element ; } catch ( Exception e ) { logger . warn ( ""Error retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId , e ) ; if ( e instanceof DistributionException ) { throw ( DistributionException ) e ; } else { throw new DistributionException ( e ) ; } } } ","protected MediaPackageElement retractElement ( String channelId , MediaPackage mediapackage , MediaPackageElement element ) throws DistributionException { notNull ( mediapackage , ""mediapackage"" ) ; notNull ( element , ""element"" ) ; notNull ( channelId , ""channelId"" ) ; String mediapackageId = mediapackage . getIdentifier ( ) . toString ( ) ; String elementId = element . getIdentifier ( ) ; try { final File elementFile = getDistributionFile ( channelId , mediapackage , element ) ; final File mediapackageDir = getMediaPackageDirectory ( channelId , mediapackage ) ; if ( ! elementFile . exists ( ) ) { logger . info ( ""Element {} from media package {} has already been removed or has never been distributed to "" + ""publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } logger . debug ( ""Retracting element {} ({})"" , element , elementFile ) ; if ( ! FileUtils . deleteQuietly ( elementFile . getParentFile ( ) ) ) { logger . debug ( ""Unable to delete folder {}"" , elementFile . getParentFile ( ) . getAbsolutePath ( ) ) ; } if ( mediapackageDir . isDirectory ( ) && mediapackageDir . list ( ) . length == 0 ) { FileSupport . delete ( mediapackageDir ) ; } logger . debug ( ""Finished retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } catch ( Exception e ) { logger . warn ( ""Error retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId , e ) ; if ( e instanceof DistributionException ) { throw ( DistributionException ) e ; } else { throw new DistributionException ( e ) ; } } } " 950,"protected MediaPackageElement retractElement ( String channelId , MediaPackage mediapackage , MediaPackageElement element ) throws DistributionException { notNull ( mediapackage , ""mediapackage"" ) ; notNull ( element , ""element"" ) ; notNull ( channelId , ""channelId"" ) ; String mediapackageId = mediapackage . getIdentifier ( ) . toString ( ) ; String elementId = element . getIdentifier ( ) ; try { final File elementFile = getDistributionFile ( channelId , mediapackage , element ) ; final File mediapackageDir = getMediaPackageDirectory ( channelId , mediapackage ) ; if ( ! elementFile . exists ( ) ) { logger . info ( ""Element {} from media package {} has already been removed or has never been distributed to "" + ""publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } logger . debug ( ""Retracting element {} ({})"" , element , elementFile ) ; if ( ! FileUtils . deleteQuietly ( elementFile . getParentFile ( ) ) ) { logger . debug ( ""Unable to delete folder {}"" , elementFile . getParentFile ( ) . getAbsolutePath ( ) ) ; } if ( mediapackageDir . isDirectory ( ) && mediapackageDir . list ( ) . length == 0 ) { FileSupport . delete ( mediapackageDir ) ; } logger . debug ( ""Finished retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } catch ( Exception e ) { if ( e instanceof DistributionException ) { throw ( DistributionException ) e ; } else { throw new DistributionException ( e ) ; } } } ","protected MediaPackageElement retractElement ( String channelId , MediaPackage mediapackage , MediaPackageElement element ) throws DistributionException { notNull ( mediapackage , ""mediapackage"" ) ; notNull ( element , ""element"" ) ; notNull ( channelId , ""channelId"" ) ; String mediapackageId = mediapackage . getIdentifier ( ) . toString ( ) ; String elementId = element . getIdentifier ( ) ; try { final File elementFile = getDistributionFile ( channelId , mediapackage , element ) ; final File mediapackageDir = getMediaPackageDirectory ( channelId , mediapackage ) ; if ( ! elementFile . exists ( ) ) { logger . info ( ""Element {} from media package {} has already been removed or has never been distributed to "" + ""publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } logger . debug ( ""Retracting element {} ({})"" , element , elementFile ) ; if ( ! FileUtils . deleteQuietly ( elementFile . getParentFile ( ) ) ) { logger . debug ( ""Unable to delete folder {}"" , elementFile . getParentFile ( ) . getAbsolutePath ( ) ) ; } if ( mediapackageDir . isDirectory ( ) && mediapackageDir . list ( ) . length == 0 ) { FileSupport . delete ( mediapackageDir ) ; } logger . debug ( ""Finished retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId ) ; return element ; } catch ( Exception e ) { logger . warn ( ""Error retracting element {} of media package {} from publication channel {}"" , elementId , mediapackageId , channelId , e ) ; if ( e instanceof DistributionException ) { throw ( DistributionException ) e ; } else { throw new DistributionException ( e ) ; } } } " 951,"public void warnIfPartitionerMismatch ( Class < ? extends IPartitioner > expectedPartitioner ) { String mismatchedPartitioner = getMismatchedPartitioner ( expectedPartitioner ) ; if ( mismatchedPartitioner != null ) { } } ","public void warnIfPartitionerMismatch ( Class < ? extends IPartitioner > expectedPartitioner ) { String mismatchedPartitioner = getMismatchedPartitioner ( expectedPartitioner ) ; if ( mismatchedPartitioner != null ) { LoggerFactory . getLogger ( CassandraKeyspace . class ) . warn ( ""Cassandra keyspace '{}' would perform better if it was configured with the {}. It currently uses the {}."" , getName ( ) , expectedPartitioner . getSimpleName ( ) , mismatchedPartitioner ) ; } } " 952,"public void fireBeforeRefreshStart ( boolean asynchronous ) { if ( myRefreshCount ++ == 0 ) { for ( final VirtualFileManagerListener listener : myVirtualFileManagerListeners ) { try { listener . beforeRefreshStart ( asynchronous ) ; } catch ( Exception e ) { } } } } ","public void fireBeforeRefreshStart ( boolean asynchronous ) { if ( myRefreshCount ++ == 0 ) { for ( final VirtualFileManagerListener listener : myVirtualFileManagerListeners ) { try { listener . beforeRefreshStart ( asynchronous ) ; } catch ( Exception e ) { LOG . error ( e ) ; } } } } " 953,"private void dispatchInternal ( UniformPair < EventBean [ ] > events ) { if ( statementResultNaturalStrategy != null ) { statementResultNaturalStrategy . execute ( events ) ; } EventBean [ ] newEventArr = events != null ? events . getFirst ( ) : null ; EventBean [ ] oldEventArr = events != null ? events . getSecond ( ) : null ; for ( UpdateListener listener : statementListenerSet . getListeners ( ) ) { try { listener . update ( newEventArr , oldEventArr , epStatement , runtime ) ; } catch ( Throwable t ) { String message = ""Unexpected exception invoking listener update method on listener class '"" + listener . getClass ( ) . getSimpleName ( ) + ""' : "" + t . getClass ( ) . getSimpleName ( ) + "" : "" + t . getMessage ( ) ; } } } ","private void dispatchInternal ( UniformPair < EventBean [ ] > events ) { if ( statementResultNaturalStrategy != null ) { statementResultNaturalStrategy . execute ( events ) ; } EventBean [ ] newEventArr = events != null ? events . getFirst ( ) : null ; EventBean [ ] oldEventArr = events != null ? events . getSecond ( ) : null ; for ( UpdateListener listener : statementListenerSet . getListeners ( ) ) { try { listener . update ( newEventArr , oldEventArr , epStatement , runtime ) ; } catch ( Throwable t ) { String message = ""Unexpected exception invoking listener update method on listener class '"" + listener . getClass ( ) . getSimpleName ( ) + ""' : "" + t . getClass ( ) . getSimpleName ( ) + "" : "" + t . getMessage ( ) ; log . error ( message , t ) ; } } } " 954,"public void handleUpdate ( LutronCommandType type , String ... parameters ) { try { if ( type == LutronCommandType . MODE && parameters . length > 1 && ModeCommand . ACTION_STEP . toString ( ) . equals ( parameters [ 0 ] ) ) { Long step = Long . valueOf ( parameters [ 1 ] ) ; if ( getThing ( ) . getStatus ( ) == ThingStatus . UNKNOWN ) { updateStatus ( ThingStatus . ONLINE ) ; startPolling ( ) ; } updateState ( CHANNEL_STEP , new DecimalType ( step . longValue ( ) ) ) ; } else { } } catch ( NumberFormatException e ) { logger . debug ( ""Encountered number format exception while handling update for greenmode {}"" , integrationId ) ; } } ","public void handleUpdate ( LutronCommandType type , String ... parameters ) { try { if ( type == LutronCommandType . MODE && parameters . length > 1 && ModeCommand . ACTION_STEP . toString ( ) . equals ( parameters [ 0 ] ) ) { Long step = Long . valueOf ( parameters [ 1 ] ) ; if ( getThing ( ) . getStatus ( ) == ThingStatus . UNKNOWN ) { updateStatus ( ThingStatus . ONLINE ) ; startPolling ( ) ; } updateState ( CHANNEL_STEP , new DecimalType ( step . longValue ( ) ) ) ; } else { logger . debug ( ""Ignoring unexpected update for id {}"" , integrationId ) ; } } catch ( NumberFormatException e ) { logger . debug ( ""Encountered number format exception while handling update for greenmode {}"" , integrationId ) ; } } " 955,"public void handleUpdate ( LutronCommandType type , String ... parameters ) { try { if ( type == LutronCommandType . MODE && parameters . length > 1 && ModeCommand . ACTION_STEP . toString ( ) . equals ( parameters [ 0 ] ) ) { Long step = Long . valueOf ( parameters [ 1 ] ) ; if ( getThing ( ) . getStatus ( ) == ThingStatus . UNKNOWN ) { updateStatus ( ThingStatus . ONLINE ) ; startPolling ( ) ; } updateState ( CHANNEL_STEP , new DecimalType ( step . longValue ( ) ) ) ; } else { logger . debug ( ""Ignoring unexpected update for id {}"" , integrationId ) ; } } catch ( NumberFormatException e ) { } } ","public void handleUpdate ( LutronCommandType type , String ... parameters ) { try { if ( type == LutronCommandType . MODE && parameters . length > 1 && ModeCommand . ACTION_STEP . toString ( ) . equals ( parameters [ 0 ] ) ) { Long step = Long . valueOf ( parameters [ 1 ] ) ; if ( getThing ( ) . getStatus ( ) == ThingStatus . UNKNOWN ) { updateStatus ( ThingStatus . ONLINE ) ; startPolling ( ) ; } updateState ( CHANNEL_STEP , new DecimalType ( step . longValue ( ) ) ) ; } else { logger . debug ( ""Ignoring unexpected update for id {}"" , integrationId ) ; } } catch ( NumberFormatException e ) { logger . debug ( ""Encountered number format exception while handling update for greenmode {}"" , integrationId ) ; } } " 956,"public static void main ( String args [ ] ) { JMeterUtils . loadJMeterProperties ( ""jmeter.properties"" ) ; String dataset = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.datasetDirectory"" , HttpSimpleTableControl . DEFAULT_DATA_DIR ) ; int port = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.port"" , HttpSimpleTableControl . DEFAULT_PORT ) ; boolean timestamp = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.addTimestamp"" , HttpSimpleTableControl . DEFAULT_TIMESTAMP ) ; Configurator . setLevel ( log . getName ( ) , Level . INFO ) ; String loglevelStr = JMeterUtils . getPropDefault ( ""loglevel"" , HttpSimpleTableControl . DEFAULT_LOG_LEVEL ) ; System . out . println ( ""loglevel="" + loglevelStr ) ; Configurator . setRootLevel ( Level . toLevel ( loglevelStr ) ) ; Configurator . setLevel ( log . getName ( ) , Level . toLevel ( loglevelStr ) ) ; bStartFromMain = true ; HttpSimpleTableServer serv = new HttpSimpleTableServer ( port , timestamp , dataset ) ; log . info ( ""------------------------------"" ) ; log . info ( ""SERVER_PORT : "" + port ) ; log . info ( ""DATASET_DIR : "" + dataset ) ; log . info ( ""TIMESTAMP : "" + timestamp ) ; log . info ( ""------------------------------"" ) ; log . info ( ""STS_VERSION : "" + STS_VERSION ) ; ServerRunner . executeInstance ( serv ) ; } ","public static void main ( String args [ ] ) { JMeterUtils . loadJMeterProperties ( ""jmeter.properties"" ) ; String dataset = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.datasetDirectory"" , HttpSimpleTableControl . DEFAULT_DATA_DIR ) ; int port = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.port"" , HttpSimpleTableControl . DEFAULT_PORT ) ; boolean timestamp = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.addTimestamp"" , HttpSimpleTableControl . DEFAULT_TIMESTAMP ) ; Configurator . setLevel ( log . getName ( ) , Level . INFO ) ; String loglevelStr = JMeterUtils . getPropDefault ( ""loglevel"" , HttpSimpleTableControl . DEFAULT_LOG_LEVEL ) ; System . out . println ( ""loglevel="" + loglevelStr ) ; Configurator . setRootLevel ( Level . toLevel ( loglevelStr ) ) ; Configurator . setLevel ( log . getName ( ) , Level . toLevel ( loglevelStr ) ) ; bStartFromMain = true ; HttpSimpleTableServer serv = new HttpSimpleTableServer ( port , timestamp , dataset ) ; log . info ( ""Creating HttpSimpleTable ..."" ) ; log . info ( ""------------------------------"" ) ; log . info ( ""SERVER_PORT : "" + port ) ; log . info ( ""DATASET_DIR : "" + dataset ) ; log . info ( ""TIMESTAMP : "" + timestamp ) ; log . info ( ""------------------------------"" ) ; log . info ( ""STS_VERSION : "" + STS_VERSION ) ; ServerRunner . executeInstance ( serv ) ; } " 957,"public static void main ( String args [ ] ) { JMeterUtils . loadJMeterProperties ( ""jmeter.properties"" ) ; String dataset = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.datasetDirectory"" , HttpSimpleTableControl . DEFAULT_DATA_DIR ) ; int port = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.port"" , HttpSimpleTableControl . DEFAULT_PORT ) ; boolean timestamp = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.addTimestamp"" , HttpSimpleTableControl . DEFAULT_TIMESTAMP ) ; Configurator . setLevel ( log . getName ( ) , Level . INFO ) ; String loglevelStr = JMeterUtils . getPropDefault ( ""loglevel"" , HttpSimpleTableControl . DEFAULT_LOG_LEVEL ) ; System . out . println ( ""loglevel="" + loglevelStr ) ; Configurator . setRootLevel ( Level . toLevel ( loglevelStr ) ) ; Configurator . setLevel ( log . getName ( ) , Level . toLevel ( loglevelStr ) ) ; bStartFromMain = true ; HttpSimpleTableServer serv = new HttpSimpleTableServer ( port , timestamp , dataset ) ; log . info ( ""Creating HttpSimpleTable ..."" ) ; log . info ( ""------------------------------"" ) ; log . info ( ""DATASET_DIR : "" + dataset ) ; log . info ( ""TIMESTAMP : "" + timestamp ) ; log . info ( ""------------------------------"" ) ; log . info ( ""STS_VERSION : "" + STS_VERSION ) ; ServerRunner . executeInstance ( serv ) ; } ","public static void main ( String args [ ] ) { JMeterUtils . loadJMeterProperties ( ""jmeter.properties"" ) ; String dataset = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.datasetDirectory"" , HttpSimpleTableControl . DEFAULT_DATA_DIR ) ; int port = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.port"" , HttpSimpleTableControl . DEFAULT_PORT ) ; boolean timestamp = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.addTimestamp"" , HttpSimpleTableControl . DEFAULT_TIMESTAMP ) ; Configurator . setLevel ( log . getName ( ) , Level . INFO ) ; String loglevelStr = JMeterUtils . getPropDefault ( ""loglevel"" , HttpSimpleTableControl . DEFAULT_LOG_LEVEL ) ; System . out . println ( ""loglevel="" + loglevelStr ) ; Configurator . setRootLevel ( Level . toLevel ( loglevelStr ) ) ; Configurator . setLevel ( log . getName ( ) , Level . toLevel ( loglevelStr ) ) ; bStartFromMain = true ; HttpSimpleTableServer serv = new HttpSimpleTableServer ( port , timestamp , dataset ) ; log . info ( ""Creating HttpSimpleTable ..."" ) ; log . info ( ""------------------------------"" ) ; log . info ( ""SERVER_PORT : "" + port ) ; log . info ( ""DATASET_DIR : "" + dataset ) ; log . info ( ""TIMESTAMP : "" + timestamp ) ; log . info ( ""------------------------------"" ) ; log . info ( ""STS_VERSION : "" + STS_VERSION ) ; ServerRunner . executeInstance ( serv ) ; } " 958,"public static void main ( String args [ ] ) { JMeterUtils . loadJMeterProperties ( ""jmeter.properties"" ) ; String dataset = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.datasetDirectory"" , HttpSimpleTableControl . DEFAULT_DATA_DIR ) ; int port = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.port"" , HttpSimpleTableControl . DEFAULT_PORT ) ; boolean timestamp = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.addTimestamp"" , HttpSimpleTableControl . DEFAULT_TIMESTAMP ) ; Configurator . setLevel ( log . getName ( ) , Level . INFO ) ; String loglevelStr = JMeterUtils . getPropDefault ( ""loglevel"" , HttpSimpleTableControl . DEFAULT_LOG_LEVEL ) ; System . out . println ( ""loglevel="" + loglevelStr ) ; Configurator . setRootLevel ( Level . toLevel ( loglevelStr ) ) ; Configurator . setLevel ( log . getName ( ) , Level . toLevel ( loglevelStr ) ) ; bStartFromMain = true ; HttpSimpleTableServer serv = new HttpSimpleTableServer ( port , timestamp , dataset ) ; log . info ( ""Creating HttpSimpleTable ..."" ) ; log . info ( ""------------------------------"" ) ; log . info ( ""SERVER_PORT : "" + port ) ; log . info ( ""TIMESTAMP : "" + timestamp ) ; log . info ( ""------------------------------"" ) ; log . info ( ""STS_VERSION : "" + STS_VERSION ) ; ServerRunner . executeInstance ( serv ) ; } ","public static void main ( String args [ ] ) { JMeterUtils . loadJMeterProperties ( ""jmeter.properties"" ) ; String dataset = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.datasetDirectory"" , HttpSimpleTableControl . DEFAULT_DATA_DIR ) ; int port = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.port"" , HttpSimpleTableControl . DEFAULT_PORT ) ; boolean timestamp = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.addTimestamp"" , HttpSimpleTableControl . DEFAULT_TIMESTAMP ) ; Configurator . setLevel ( log . getName ( ) , Level . INFO ) ; String loglevelStr = JMeterUtils . getPropDefault ( ""loglevel"" , HttpSimpleTableControl . DEFAULT_LOG_LEVEL ) ; System . out . println ( ""loglevel="" + loglevelStr ) ; Configurator . setRootLevel ( Level . toLevel ( loglevelStr ) ) ; Configurator . setLevel ( log . getName ( ) , Level . toLevel ( loglevelStr ) ) ; bStartFromMain = true ; HttpSimpleTableServer serv = new HttpSimpleTableServer ( port , timestamp , dataset ) ; log . info ( ""Creating HttpSimpleTable ..."" ) ; log . info ( ""------------------------------"" ) ; log . info ( ""SERVER_PORT : "" + port ) ; log . info ( ""DATASET_DIR : "" + dataset ) ; log . info ( ""TIMESTAMP : "" + timestamp ) ; log . info ( ""------------------------------"" ) ; log . info ( ""STS_VERSION : "" + STS_VERSION ) ; ServerRunner . executeInstance ( serv ) ; } " 959,"public static void main ( String args [ ] ) { JMeterUtils . loadJMeterProperties ( ""jmeter.properties"" ) ; String dataset = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.datasetDirectory"" , HttpSimpleTableControl . DEFAULT_DATA_DIR ) ; int port = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.port"" , HttpSimpleTableControl . DEFAULT_PORT ) ; boolean timestamp = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.addTimestamp"" , HttpSimpleTableControl . DEFAULT_TIMESTAMP ) ; Configurator . setLevel ( log . getName ( ) , Level . INFO ) ; String loglevelStr = JMeterUtils . getPropDefault ( ""loglevel"" , HttpSimpleTableControl . DEFAULT_LOG_LEVEL ) ; System . out . println ( ""loglevel="" + loglevelStr ) ; Configurator . setRootLevel ( Level . toLevel ( loglevelStr ) ) ; Configurator . setLevel ( log . getName ( ) , Level . toLevel ( loglevelStr ) ) ; bStartFromMain = true ; HttpSimpleTableServer serv = new HttpSimpleTableServer ( port , timestamp , dataset ) ; log . info ( ""Creating HttpSimpleTable ..."" ) ; log . info ( ""------------------------------"" ) ; log . info ( ""SERVER_PORT : "" + port ) ; log . info ( ""DATASET_DIR : "" + dataset ) ; log . info ( ""------------------------------"" ) ; log . info ( ""STS_VERSION : "" + STS_VERSION ) ; ServerRunner . executeInstance ( serv ) ; } ","public static void main ( String args [ ] ) { JMeterUtils . loadJMeterProperties ( ""jmeter.properties"" ) ; String dataset = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.datasetDirectory"" , HttpSimpleTableControl . DEFAULT_DATA_DIR ) ; int port = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.port"" , HttpSimpleTableControl . DEFAULT_PORT ) ; boolean timestamp = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.addTimestamp"" , HttpSimpleTableControl . DEFAULT_TIMESTAMP ) ; Configurator . setLevel ( log . getName ( ) , Level . INFO ) ; String loglevelStr = JMeterUtils . getPropDefault ( ""loglevel"" , HttpSimpleTableControl . DEFAULT_LOG_LEVEL ) ; System . out . println ( ""loglevel="" + loglevelStr ) ; Configurator . setRootLevel ( Level . toLevel ( loglevelStr ) ) ; Configurator . setLevel ( log . getName ( ) , Level . toLevel ( loglevelStr ) ) ; bStartFromMain = true ; HttpSimpleTableServer serv = new HttpSimpleTableServer ( port , timestamp , dataset ) ; log . info ( ""Creating HttpSimpleTable ..."" ) ; log . info ( ""------------------------------"" ) ; log . info ( ""SERVER_PORT : "" + port ) ; log . info ( ""DATASET_DIR : "" + dataset ) ; log . info ( ""TIMESTAMP : "" + timestamp ) ; log . info ( ""------------------------------"" ) ; log . info ( ""STS_VERSION : "" + STS_VERSION ) ; ServerRunner . executeInstance ( serv ) ; } " 960,"public static void main ( String args [ ] ) { JMeterUtils . loadJMeterProperties ( ""jmeter.properties"" ) ; String dataset = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.datasetDirectory"" , HttpSimpleTableControl . DEFAULT_DATA_DIR ) ; int port = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.port"" , HttpSimpleTableControl . DEFAULT_PORT ) ; boolean timestamp = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.addTimestamp"" , HttpSimpleTableControl . DEFAULT_TIMESTAMP ) ; Configurator . setLevel ( log . getName ( ) , Level . INFO ) ; String loglevelStr = JMeterUtils . getPropDefault ( ""loglevel"" , HttpSimpleTableControl . DEFAULT_LOG_LEVEL ) ; System . out . println ( ""loglevel="" + loglevelStr ) ; Configurator . setRootLevel ( Level . toLevel ( loglevelStr ) ) ; Configurator . setLevel ( log . getName ( ) , Level . toLevel ( loglevelStr ) ) ; bStartFromMain = true ; HttpSimpleTableServer serv = new HttpSimpleTableServer ( port , timestamp , dataset ) ; log . info ( ""Creating HttpSimpleTable ..."" ) ; log . info ( ""------------------------------"" ) ; log . info ( ""SERVER_PORT : "" + port ) ; log . info ( ""DATASET_DIR : "" + dataset ) ; log . info ( ""TIMESTAMP : "" + timestamp ) ; log . info ( ""------------------------------"" ) ; ServerRunner . executeInstance ( serv ) ; } ","public static void main ( String args [ ] ) { JMeterUtils . loadJMeterProperties ( ""jmeter.properties"" ) ; String dataset = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.datasetDirectory"" , HttpSimpleTableControl . DEFAULT_DATA_DIR ) ; int port = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.port"" , HttpSimpleTableControl . DEFAULT_PORT ) ; boolean timestamp = JMeterUtils . getPropDefault ( ""jmeterPlugin.sts.addTimestamp"" , HttpSimpleTableControl . DEFAULT_TIMESTAMP ) ; Configurator . setLevel ( log . getName ( ) , Level . INFO ) ; String loglevelStr = JMeterUtils . getPropDefault ( ""loglevel"" , HttpSimpleTableControl . DEFAULT_LOG_LEVEL ) ; System . out . println ( ""loglevel="" + loglevelStr ) ; Configurator . setRootLevel ( Level . toLevel ( loglevelStr ) ) ; Configurator . setLevel ( log . getName ( ) , Level . toLevel ( loglevelStr ) ) ; bStartFromMain = true ; HttpSimpleTableServer serv = new HttpSimpleTableServer ( port , timestamp , dataset ) ; log . info ( ""Creating HttpSimpleTable ..."" ) ; log . info ( ""------------------------------"" ) ; log . info ( ""SERVER_PORT : "" + port ) ; log . info ( ""DATASET_DIR : "" + dataset ) ; log . info ( ""TIMESTAMP : "" + timestamp ) ; log . info ( ""------------------------------"" ) ; log . info ( ""STS_VERSION : "" + STS_VERSION ) ; ServerRunner . executeInstance ( serv ) ; } " 961,"public void start ( final Map < String , String > properties ) { final String timeout = properties . getOrDefault ( StatelessKafkaConnectorUtil . DATAFLOW_TIMEOUT , StatelessKafkaConnectorUtil . DEFAULT_DATAFLOW_TIMEOUT ) ; timeoutMillis = ( long ) FormatUtils . getPreciseTimeDuration ( timeout , TimeUnit . MILLISECONDS ) ; topicName = properties . get ( StatelessNiFiSourceConnector . TOPIC_NAME ) ; topicNameAttribute = properties . get ( StatelessNiFiSourceConnector . TOPIC_NAME_ATTRIBUTE ) ; keyAttributeName = properties . get ( StatelessNiFiSourceConnector . KEY_ATTRIBUTE ) ; if ( topicName == null && topicNameAttribute == null ) { throw new ConfigException ( ""Either the topic.name or topic.name.attribute configuration must be specified"" ) ; } final String headerRegex = properties . get ( StatelessNiFiSourceConnector . HEADER_REGEX ) ; headerAttributeNamePattern = headerRegex == null ? null : Pattern . compile ( headerRegex ) ; dataflow = StatelessKafkaConnectorUtil . createDataflow ( properties ) ; dataflow . initialize ( ) ; dataflowName = properties . get ( StatelessKafkaConnectorUtil . DATAFLOW_NAME ) ; outputPortName = properties . get ( StatelessNiFiSourceConnector . OUTPUT_PORT_NAME ) ; if ( outputPortName == null ) { final Set < String > outputPorts = dataflow . getOutputPortNames ( ) ; if ( outputPorts . isEmpty ( ) ) { throw new ConfigException ( ""The dataflow specified for <"" + dataflowName + ""> does not have an Output Port at the root level. Dataflows used for a Kafka Connect Source Task "" + ""must have at least one Output Port at the root level."" ) ; } if ( outputPorts . size ( ) > 1 ) { throw new ConfigException ( ""The dataflow specified for <"" + dataflowName + ""> has multiple Output Ports at the root level ("" + outputPorts . toString ( ) + ""). The "" + StatelessNiFiSourceConnector . OUTPUT_PORT_NAME + "" property must be set to indicate which of these Ports Kafka records should be retrieved from."" ) ; } outputPortName = outputPorts . iterator ( ) . next ( ) ; } final String taskIndex = properties . get ( STATE_MAP_KEY ) ; localStatePartitionMap . put ( STATE_MAP_KEY , taskIndex ) ; final Map < String , String > localStateMap = ( Map < String , String > ) ( Map ) context . offsetStorageReader ( ) . offset ( localStatePartitionMap ) ; final Map < String , String > clusterStateMap = ( Map < String , String > ) ( Map ) context . offsetStorageReader ( ) . offset ( clusterStatePartitionMap ) ; dataflow . setComponentStates ( localStateMap , Scope . LOCAL ) ; dataflow . setComponentStates ( clusterStateMap , Scope . CLUSTER ) ; } ","public void start ( final Map < String , String > properties ) { logger . info ( ""Starting Source Task with properties {}"" , StatelessKafkaConnectorUtil . getLoggableProperties ( properties ) ) ; final String timeout = properties . getOrDefault ( StatelessKafkaConnectorUtil . DATAFLOW_TIMEOUT , StatelessKafkaConnectorUtil . DEFAULT_DATAFLOW_TIMEOUT ) ; timeoutMillis = ( long ) FormatUtils . getPreciseTimeDuration ( timeout , TimeUnit . MILLISECONDS ) ; topicName = properties . get ( StatelessNiFiSourceConnector . TOPIC_NAME ) ; topicNameAttribute = properties . get ( StatelessNiFiSourceConnector . TOPIC_NAME_ATTRIBUTE ) ; keyAttributeName = properties . get ( StatelessNiFiSourceConnector . KEY_ATTRIBUTE ) ; if ( topicName == null && topicNameAttribute == null ) { throw new ConfigException ( ""Either the topic.name or topic.name.attribute configuration must be specified"" ) ; } final String headerRegex = properties . get ( StatelessNiFiSourceConnector . HEADER_REGEX ) ; headerAttributeNamePattern = headerRegex == null ? null : Pattern . compile ( headerRegex ) ; dataflow = StatelessKafkaConnectorUtil . createDataflow ( properties ) ; dataflow . initialize ( ) ; dataflowName = properties . get ( StatelessKafkaConnectorUtil . DATAFLOW_NAME ) ; outputPortName = properties . get ( StatelessNiFiSourceConnector . OUTPUT_PORT_NAME ) ; if ( outputPortName == null ) { final Set < String > outputPorts = dataflow . getOutputPortNames ( ) ; if ( outputPorts . isEmpty ( ) ) { throw new ConfigException ( ""The dataflow specified for <"" + dataflowName + ""> does not have an Output Port at the root level. Dataflows used for a Kafka Connect Source Task "" + ""must have at least one Output Port at the root level."" ) ; } if ( outputPorts . size ( ) > 1 ) { throw new ConfigException ( ""The dataflow specified for <"" + dataflowName + ""> has multiple Output Ports at the root level ("" + outputPorts . toString ( ) + ""). The "" + StatelessNiFiSourceConnector . OUTPUT_PORT_NAME + "" property must be set to indicate which of these Ports Kafka records should be retrieved from."" ) ; } outputPortName = outputPorts . iterator ( ) . next ( ) ; } final String taskIndex = properties . get ( STATE_MAP_KEY ) ; localStatePartitionMap . put ( STATE_MAP_KEY , taskIndex ) ; final Map < String , String > localStateMap = ( Map < String , String > ) ( Map ) context . offsetStorageReader ( ) . offset ( localStatePartitionMap ) ; final Map < String , String > clusterStateMap = ( Map < String , String > ) ( Map ) context . offsetStorageReader ( ) . offset ( clusterStatePartitionMap ) ; dataflow . setComponentStates ( localStateMap , Scope . LOCAL ) ; dataflow . setComponentStates ( clusterStateMap , Scope . CLUSTER ) ; } " 962,"public List < String > getMatches ( final String query , final int rows , final int start ) { String url = composeURL ( TERM_SEARCH_QUERY_SCRIPT , TERM_SEARCH_PARAM_NAME , query , rows , start ) ; List < String > result = new ArrayList < String > ( ) ; try { Document response = readXML ( url ) ; NodeList nodes = response . getElementsByTagName ( ""IdList"" ) ; if ( nodes . getLength ( ) > 0 ) { nodes = nodes . item ( 0 ) . getChildNodes ( ) ; for ( int i = 0 ; i < nodes . getLength ( ) ; ++ i ) { Node n = nodes . item ( i ) ; if ( n . getNodeType ( ) == Node . ELEMENT_NODE && n . getNodeName ( ) . equals ( ""Id"" ) ) { result . add ( n . getTextContent ( ) ) ; } } } } catch ( Exception ex ) { } return result ; } ","public List < String > getMatches ( final String query , final int rows , final int start ) { String url = composeURL ( TERM_SEARCH_QUERY_SCRIPT , TERM_SEARCH_PARAM_NAME , query , rows , start ) ; List < String > result = new ArrayList < String > ( ) ; try { Document response = readXML ( url ) ; NodeList nodes = response . getElementsByTagName ( ""IdList"" ) ; if ( nodes . getLength ( ) > 0 ) { nodes = nodes . item ( 0 ) . getChildNodes ( ) ; for ( int i = 0 ; i < nodes . getLength ( ) ; ++ i ) { Node n = nodes . item ( i ) ; if ( n . getNodeType ( ) == Node . ELEMENT_NODE && n . getNodeName ( ) . equals ( ""Id"" ) ) { result . add ( n . getTextContent ( ) ) ; } } } } catch ( Exception ex ) { this . logger . error ( ""Error while trying to retrieve matches for "" + query + "" "" + ex . getClass ( ) . getName ( ) + "" "" + ex . getMessage ( ) , ex ) ; } return result ; } " 963,"protected void doCreateDeployment ( Exchange exchange , String operation ) throws Exception { Deployment deployment = null ; String deploymentName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_NAME , String . class ) ; String namespaceName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_NAMESPACE_NAME , String . class ) ; DeploymentSpec deSpec = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_SPEC , DeploymentSpec . class ) ; if ( ObjectHelper . isEmpty ( deploymentName ) ) { throw new IllegalArgumentException ( ""Create a specific Deployment require specify a pod name"" ) ; } if ( ObjectHelper . isEmpty ( namespaceName ) ) { LOG . error ( ""Create a specific Deployment require specify a namespace name"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a namespace name"" ) ; } if ( ObjectHelper . isEmpty ( deSpec ) ) { LOG . error ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; } Map < String , String > labels = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENTS_LABELS , Map . class ) ; Deployment deploymentCreating = new DeploymentBuilder ( ) . withNewMetadata ( ) . withName ( deploymentName ) . withLabels ( labels ) . endMetadata ( ) . withSpec ( deSpec ) . build ( ) ; deployment = getEndpoint ( ) . getKubernetesClient ( ) . apps ( ) . deployments ( ) . inNamespace ( namespaceName ) . create ( deploymentCreating ) ; MessageHelper . copyHeaders ( exchange . getIn ( ) , exchange . getOut ( ) , true ) ; exchange . getOut ( ) . setBody ( deployment ) ; } ","protected void doCreateDeployment ( Exchange exchange , String operation ) throws Exception { Deployment deployment = null ; String deploymentName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_NAME , String . class ) ; String namespaceName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_NAMESPACE_NAME , String . class ) ; DeploymentSpec deSpec = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_SPEC , DeploymentSpec . class ) ; if ( ObjectHelper . isEmpty ( deploymentName ) ) { LOG . error ( ""Create a specific Deployment require specify a Deployment name"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a pod name"" ) ; } if ( ObjectHelper . isEmpty ( namespaceName ) ) { LOG . error ( ""Create a specific Deployment require specify a namespace name"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a namespace name"" ) ; } if ( ObjectHelper . isEmpty ( deSpec ) ) { LOG . error ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; } Map < String , String > labels = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENTS_LABELS , Map . class ) ; Deployment deploymentCreating = new DeploymentBuilder ( ) . withNewMetadata ( ) . withName ( deploymentName ) . withLabels ( labels ) . endMetadata ( ) . withSpec ( deSpec ) . build ( ) ; deployment = getEndpoint ( ) . getKubernetesClient ( ) . apps ( ) . deployments ( ) . inNamespace ( namespaceName ) . create ( deploymentCreating ) ; MessageHelper . copyHeaders ( exchange . getIn ( ) , exchange . getOut ( ) , true ) ; exchange . getOut ( ) . setBody ( deployment ) ; } " 964,"protected void doCreateDeployment ( Exchange exchange , String operation ) throws Exception { Deployment deployment = null ; String deploymentName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_NAME , String . class ) ; String namespaceName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_NAMESPACE_NAME , String . class ) ; DeploymentSpec deSpec = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_SPEC , DeploymentSpec . class ) ; if ( ObjectHelper . isEmpty ( deploymentName ) ) { LOG . error ( ""Create a specific Deployment require specify a Deployment name"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a pod name"" ) ; } if ( ObjectHelper . isEmpty ( namespaceName ) ) { throw new IllegalArgumentException ( ""Create a specific Deployment require specify a namespace name"" ) ; } if ( ObjectHelper . isEmpty ( deSpec ) ) { LOG . error ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; } Map < String , String > labels = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENTS_LABELS , Map . class ) ; Deployment deploymentCreating = new DeploymentBuilder ( ) . withNewMetadata ( ) . withName ( deploymentName ) . withLabels ( labels ) . endMetadata ( ) . withSpec ( deSpec ) . build ( ) ; deployment = getEndpoint ( ) . getKubernetesClient ( ) . apps ( ) . deployments ( ) . inNamespace ( namespaceName ) . create ( deploymentCreating ) ; MessageHelper . copyHeaders ( exchange . getIn ( ) , exchange . getOut ( ) , true ) ; exchange . getOut ( ) . setBody ( deployment ) ; } ","protected void doCreateDeployment ( Exchange exchange , String operation ) throws Exception { Deployment deployment = null ; String deploymentName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_NAME , String . class ) ; String namespaceName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_NAMESPACE_NAME , String . class ) ; DeploymentSpec deSpec = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_SPEC , DeploymentSpec . class ) ; if ( ObjectHelper . isEmpty ( deploymentName ) ) { LOG . error ( ""Create a specific Deployment require specify a Deployment name"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a pod name"" ) ; } if ( ObjectHelper . isEmpty ( namespaceName ) ) { LOG . error ( ""Create a specific Deployment require specify a namespace name"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a namespace name"" ) ; } if ( ObjectHelper . isEmpty ( deSpec ) ) { LOG . error ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; } Map < String , String > labels = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENTS_LABELS , Map . class ) ; Deployment deploymentCreating = new DeploymentBuilder ( ) . withNewMetadata ( ) . withName ( deploymentName ) . withLabels ( labels ) . endMetadata ( ) . withSpec ( deSpec ) . build ( ) ; deployment = getEndpoint ( ) . getKubernetesClient ( ) . apps ( ) . deployments ( ) . inNamespace ( namespaceName ) . create ( deploymentCreating ) ; MessageHelper . copyHeaders ( exchange . getIn ( ) , exchange . getOut ( ) , true ) ; exchange . getOut ( ) . setBody ( deployment ) ; } " 965,"protected void doCreateDeployment ( Exchange exchange , String operation ) throws Exception { Deployment deployment = null ; String deploymentName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_NAME , String . class ) ; String namespaceName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_NAMESPACE_NAME , String . class ) ; DeploymentSpec deSpec = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_SPEC , DeploymentSpec . class ) ; if ( ObjectHelper . isEmpty ( deploymentName ) ) { LOG . error ( ""Create a specific Deployment require specify a Deployment name"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a pod name"" ) ; } if ( ObjectHelper . isEmpty ( namespaceName ) ) { LOG . error ( ""Create a specific Deployment require specify a namespace name"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a namespace name"" ) ; } if ( ObjectHelper . isEmpty ( deSpec ) ) { throw new IllegalArgumentException ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; } Map < String , String > labels = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENTS_LABELS , Map . class ) ; Deployment deploymentCreating = new DeploymentBuilder ( ) . withNewMetadata ( ) . withName ( deploymentName ) . withLabels ( labels ) . endMetadata ( ) . withSpec ( deSpec ) . build ( ) ; deployment = getEndpoint ( ) . getKubernetesClient ( ) . apps ( ) . deployments ( ) . inNamespace ( namespaceName ) . create ( deploymentCreating ) ; MessageHelper . copyHeaders ( exchange . getIn ( ) , exchange . getOut ( ) , true ) ; exchange . getOut ( ) . setBody ( deployment ) ; } ","protected void doCreateDeployment ( Exchange exchange , String operation ) throws Exception { Deployment deployment = null ; String deploymentName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_NAME , String . class ) ; String namespaceName = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_NAMESPACE_NAME , String . class ) ; DeploymentSpec deSpec = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENT_SPEC , DeploymentSpec . class ) ; if ( ObjectHelper . isEmpty ( deploymentName ) ) { LOG . error ( ""Create a specific Deployment require specify a Deployment name"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a pod name"" ) ; } if ( ObjectHelper . isEmpty ( namespaceName ) ) { LOG . error ( ""Create a specific Deployment require specify a namespace name"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a namespace name"" ) ; } if ( ObjectHelper . isEmpty ( deSpec ) ) { LOG . error ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; throw new IllegalArgumentException ( ""Create a specific Deployment require specify a Deployment spec bean"" ) ; } Map < String , String > labels = exchange . getIn ( ) . getHeader ( KubernetesConstants . KUBERNETES_DEPLOYMENTS_LABELS , Map . class ) ; Deployment deploymentCreating = new DeploymentBuilder ( ) . withNewMetadata ( ) . withName ( deploymentName ) . withLabels ( labels ) . endMetadata ( ) . withSpec ( deSpec ) . build ( ) ; deployment = getEndpoint ( ) . getKubernetesClient ( ) . apps ( ) . deployments ( ) . inNamespace ( namespaceName ) . create ( deploymentCreating ) ; MessageHelper . copyHeaders ( exchange . getIn ( ) , exchange . getOut ( ) , true ) ; exchange . getOut ( ) . setBody ( deployment ) ; } " 966,"@ BeforeClass public void setup ( ) throws Exception { String dataPath = rootPath + ""/src/test/resources/alldatatype.csv"" ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_WRITTEN_BY_APPNAME , ""HetuTest"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . MAX_QUERY_EXECUTION_TIME , ""0"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_SEGMENT_LOCK_FILES_PRESERVE_HOURS , ""0"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_INVISIBLE_SEGMENTS_PRESERVE_COUNT , ""1"" ) ; Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( ""hive.metastore"" , ""file"" ) ; map . put ( ""hive.allow-drop-table"" , ""true"" ) ; map . put ( ""hive.metastore.catalog.dir"" , ""file://"" + storePath + ""/hive.store"" ) ; map . put ( ""carbondata.store-location"" , ""file://"" + carbonStoreLocation ) ; map . put ( ""carbondata.minor-vacuum-seg-count"" , ""4"" ) ; map . put ( ""carbondata.major-vacuum-seg-size"" , ""1"" ) ; if ( ! FileFactory . isFileExist ( storePath + ""/carbon.store"" ) ) { FileFactory . mkdirs ( storePath + ""/carbon.store"" ) ; } hetuServer . startServer ( ""testdb"" , map ) ; hetuServer . execute ( ""drop table if exists testdb.testtable"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable2"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable3"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable4"" ) ; hetuServer . execute ( ""drop schema if exists testdb"" ) ; hetuServer . execute ( ""drop schema if exists default"" ) ; hetuServer . execute ( ""create schema testdb"" ) ; hetuServer . execute ( ""create schema default"" ) ; hetuServer . execute ( ""create table testdb.testtable(ID int, date date, country varchar, "" + ""name varchar, phonetype varchar, serialname varchar,salary double, bonus decimal(10,4), "" + ""monthlyBonus decimal(18,4), dob timestamp, shortField smallint, iscurrentemployee boolean) "" + ""with(format='CARBON') "" ) ; InsertIntoTableFromCSV ( dataPath ) ; String columnNames = ""ID,date,country,name,phonetype,serialname,salary,bonus,"" + ""monthlyBonus,dob,shortField,isCurrentEmployee"" ; logger . info ( ""CarbonStore created at location : "" + storePath ) ; } ","@ BeforeClass public void setup ( ) throws Exception { logger . info ( ""Setup begin: "" + this . getClass ( ) . getSimpleName ( ) ) ; String dataPath = rootPath + ""/src/test/resources/alldatatype.csv"" ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_WRITTEN_BY_APPNAME , ""HetuTest"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . MAX_QUERY_EXECUTION_TIME , ""0"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_SEGMENT_LOCK_FILES_PRESERVE_HOURS , ""0"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_INVISIBLE_SEGMENTS_PRESERVE_COUNT , ""1"" ) ; Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( ""hive.metastore"" , ""file"" ) ; map . put ( ""hive.allow-drop-table"" , ""true"" ) ; map . put ( ""hive.metastore.catalog.dir"" , ""file://"" + storePath + ""/hive.store"" ) ; map . put ( ""carbondata.store-location"" , ""file://"" + carbonStoreLocation ) ; map . put ( ""carbondata.minor-vacuum-seg-count"" , ""4"" ) ; map . put ( ""carbondata.major-vacuum-seg-size"" , ""1"" ) ; if ( ! FileFactory . isFileExist ( storePath + ""/carbon.store"" ) ) { FileFactory . mkdirs ( storePath + ""/carbon.store"" ) ; } hetuServer . startServer ( ""testdb"" , map ) ; hetuServer . execute ( ""drop table if exists testdb.testtable"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable2"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable3"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable4"" ) ; hetuServer . execute ( ""drop schema if exists testdb"" ) ; hetuServer . execute ( ""drop schema if exists default"" ) ; hetuServer . execute ( ""create schema testdb"" ) ; hetuServer . execute ( ""create schema default"" ) ; hetuServer . execute ( ""create table testdb.testtable(ID int, date date, country varchar, "" + ""name varchar, phonetype varchar, serialname varchar,salary double, bonus decimal(10,4), "" + ""monthlyBonus decimal(18,4), dob timestamp, shortField smallint, iscurrentemployee boolean) "" + ""with(format='CARBON') "" ) ; InsertIntoTableFromCSV ( dataPath ) ; String columnNames = ""ID,date,country,name,phonetype,serialname,salary,bonus,"" + ""monthlyBonus,dob,shortField,isCurrentEmployee"" ; logger . info ( ""CarbonStore created at location : "" + storePath ) ; } " 967,"@ BeforeClass public void setup ( ) throws Exception { logger . info ( ""Setup begin: "" + this . getClass ( ) . getSimpleName ( ) ) ; String dataPath = rootPath + ""/src/test/resources/alldatatype.csv"" ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_WRITTEN_BY_APPNAME , ""HetuTest"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . MAX_QUERY_EXECUTION_TIME , ""0"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_SEGMENT_LOCK_FILES_PRESERVE_HOURS , ""0"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_INVISIBLE_SEGMENTS_PRESERVE_COUNT , ""1"" ) ; Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( ""hive.metastore"" , ""file"" ) ; map . put ( ""hive.allow-drop-table"" , ""true"" ) ; map . put ( ""hive.metastore.catalog.dir"" , ""file://"" + storePath + ""/hive.store"" ) ; map . put ( ""carbondata.store-location"" , ""file://"" + carbonStoreLocation ) ; map . put ( ""carbondata.minor-vacuum-seg-count"" , ""4"" ) ; map . put ( ""carbondata.major-vacuum-seg-size"" , ""1"" ) ; if ( ! FileFactory . isFileExist ( storePath + ""/carbon.store"" ) ) { FileFactory . mkdirs ( storePath + ""/carbon.store"" ) ; } hetuServer . startServer ( ""testdb"" , map ) ; hetuServer . execute ( ""drop table if exists testdb.testtable"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable2"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable3"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable4"" ) ; hetuServer . execute ( ""drop schema if exists testdb"" ) ; hetuServer . execute ( ""drop schema if exists default"" ) ; hetuServer . execute ( ""create schema testdb"" ) ; hetuServer . execute ( ""create schema default"" ) ; hetuServer . execute ( ""create table testdb.testtable(ID int, date date, country varchar, "" + ""name varchar, phonetype varchar, serialname varchar,salary double, bonus decimal(10,4), "" + ""monthlyBonus decimal(18,4), dob timestamp, shortField smallint, iscurrentemployee boolean) "" + ""with(format='CARBON') "" ) ; InsertIntoTableFromCSV ( dataPath ) ; String columnNames = ""ID,date,country,name,phonetype,serialname,salary,bonus,"" + ""monthlyBonus,dob,shortField,isCurrentEmployee"" ; } ","@ BeforeClass public void setup ( ) throws Exception { logger . info ( ""Setup begin: "" + this . getClass ( ) . getSimpleName ( ) ) ; String dataPath = rootPath + ""/src/test/resources/alldatatype.csv"" ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_WRITTEN_BY_APPNAME , ""HetuTest"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . MAX_QUERY_EXECUTION_TIME , ""0"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_SEGMENT_LOCK_FILES_PRESERVE_HOURS , ""0"" ) ; CarbonProperties . getInstance ( ) . addProperty ( CarbonCommonConstants . CARBON_INVISIBLE_SEGMENTS_PRESERVE_COUNT , ""1"" ) ; Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( ""hive.metastore"" , ""file"" ) ; map . put ( ""hive.allow-drop-table"" , ""true"" ) ; map . put ( ""hive.metastore.catalog.dir"" , ""file://"" + storePath + ""/hive.store"" ) ; map . put ( ""carbondata.store-location"" , ""file://"" + carbonStoreLocation ) ; map . put ( ""carbondata.minor-vacuum-seg-count"" , ""4"" ) ; map . put ( ""carbondata.major-vacuum-seg-size"" , ""1"" ) ; if ( ! FileFactory . isFileExist ( storePath + ""/carbon.store"" ) ) { FileFactory . mkdirs ( storePath + ""/carbon.store"" ) ; } hetuServer . startServer ( ""testdb"" , map ) ; hetuServer . execute ( ""drop table if exists testdb.testtable"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable2"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable3"" ) ; hetuServer . execute ( ""drop table if exists testdb.testtable4"" ) ; hetuServer . execute ( ""drop schema if exists testdb"" ) ; hetuServer . execute ( ""drop schema if exists default"" ) ; hetuServer . execute ( ""create schema testdb"" ) ; hetuServer . execute ( ""create schema default"" ) ; hetuServer . execute ( ""create table testdb.testtable(ID int, date date, country varchar, "" + ""name varchar, phonetype varchar, serialname varchar,salary double, bonus decimal(10,4), "" + ""monthlyBonus decimal(18,4), dob timestamp, shortField smallint, iscurrentemployee boolean) "" + ""with(format='CARBON') "" ) ; InsertIntoTableFromCSV ( dataPath ) ; String columnNames = ""ID,date,country,name,phonetype,serialname,salary,bonus,"" + ""monthlyBonus,dob,shortField,isCurrentEmployee"" ; logger . info ( ""CarbonStore created at location : "" + storePath ) ; } " 968,"public static com . liferay . portal . kernel . model . User updateIncompleteUser ( HttpPrincipal httpPrincipal , long companyId , boolean autoPassword , String password1 , String password2 , boolean autoScreenName , String screenName , String emailAddress , long facebookId , String openId , java . util . Locale locale , String firstName , String middleName , String lastName , long prefixId , long suffixId , boolean male , int birthdayMonth , int birthdayDay , int birthdayYear , String jobTitle , boolean updateUserInformation , boolean sendEmail , com . liferay . portal . kernel . service . ServiceContext serviceContext ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( UserServiceUtil . class , ""updateIncompleteUser"" , _updateIncompleteUserParameterTypes60 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , companyId , autoPassword , password1 , password2 , autoScreenName , screenName , emailAddress , facebookId , openId , locale , firstName , middleName , lastName , prefixId , suffixId , male , birthdayMonth , birthdayDay , birthdayYear , jobTitle , updateUserInformation , sendEmail , serviceContext ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( com . liferay . portal . kernel . model . User ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { throw systemException ; } } ","public static com . liferay . portal . kernel . model . User updateIncompleteUser ( HttpPrincipal httpPrincipal , long companyId , boolean autoPassword , String password1 , String password2 , boolean autoScreenName , String screenName , String emailAddress , long facebookId , String openId , java . util . Locale locale , String firstName , String middleName , String lastName , long prefixId , long suffixId , boolean male , int birthdayMonth , int birthdayDay , int birthdayYear , String jobTitle , boolean updateUserInformation , boolean sendEmail , com . liferay . portal . kernel . service . ServiceContext serviceContext ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( UserServiceUtil . class , ""updateIncompleteUser"" , _updateIncompleteUserParameterTypes60 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , companyId , autoPassword , password1 , password2 , autoScreenName , screenName , emailAddress , facebookId , openId , locale , firstName , middleName , lastName , prefixId , suffixId , male , birthdayMonth , birthdayDay , birthdayYear , jobTitle , updateUserInformation , sendEmail , serviceContext ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( com . liferay . portal . kernel . model . User ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { _log . error ( systemException , systemException ) ; throw systemException ; } } " 969,"public PortablePipelineResult run ( Pipeline pipeline , JobInfo jobInfo ) throws Exception { PortablePipelineOptions pipelineOptions = PipelineOptionsTranslation . fromProto ( jobInfo . pipelineOptions ( ) ) . as ( PortablePipelineOptions . class ) ; final String jobName = jobInfo . jobName ( ) ; File outputFile = new File ( checkArgumentNotNull ( pipelineOptions . getOutputExecutablePath ( ) ) ) ; outputStream = new JarOutputStream ( new FileOutputStream ( outputFile ) , createManifest ( mainClass , jobName ) ) ; outputChannel = Channels . newChannel ( outputStream ) ; PortablePipelineJarUtils . writeDefaultJobName ( outputStream , jobName ) ; copyResourcesFromJar ( new JarFile ( mainClass . getProtectionDomain ( ) . getCodeSource ( ) . getLocation ( ) . getPath ( ) ) ) ; writeAsJson ( PipelineOptionsTranslation . toProto ( pipelineOptions ) , PortablePipelineJarUtils . getPipelineOptionsUri ( jobName ) ) ; Pipeline pipelineWithClasspathArtifacts = writeArtifacts ( pipeline , jobName ) ; writeAsJson ( pipelineWithClasspathArtifacts , PortablePipelineJarUtils . getPipelineUri ( jobName ) ) ; outputChannel . close ( ) ; LOG . info ( ""Jar {} created successfully."" , outputFile . getAbsolutePath ( ) ) ; return new JarCreatorPipelineResult ( ) ; } ","public PortablePipelineResult run ( Pipeline pipeline , JobInfo jobInfo ) throws Exception { PortablePipelineOptions pipelineOptions = PipelineOptionsTranslation . fromProto ( jobInfo . pipelineOptions ( ) ) . as ( PortablePipelineOptions . class ) ; final String jobName = jobInfo . jobName ( ) ; File outputFile = new File ( checkArgumentNotNull ( pipelineOptions . getOutputExecutablePath ( ) ) ) ; LOG . info ( ""Creating jar {} for job {}"" , outputFile . getAbsolutePath ( ) , jobName ) ; outputStream = new JarOutputStream ( new FileOutputStream ( outputFile ) , createManifest ( mainClass , jobName ) ) ; outputChannel = Channels . newChannel ( outputStream ) ; PortablePipelineJarUtils . writeDefaultJobName ( outputStream , jobName ) ; copyResourcesFromJar ( new JarFile ( mainClass . getProtectionDomain ( ) . getCodeSource ( ) . getLocation ( ) . getPath ( ) ) ) ; writeAsJson ( PipelineOptionsTranslation . toProto ( pipelineOptions ) , PortablePipelineJarUtils . getPipelineOptionsUri ( jobName ) ) ; Pipeline pipelineWithClasspathArtifacts = writeArtifacts ( pipeline , jobName ) ; writeAsJson ( pipelineWithClasspathArtifacts , PortablePipelineJarUtils . getPipelineUri ( jobName ) ) ; outputChannel . close ( ) ; LOG . info ( ""Jar {} created successfully."" , outputFile . getAbsolutePath ( ) ) ; return new JarCreatorPipelineResult ( ) ; } " 970,"public PortablePipelineResult run ( Pipeline pipeline , JobInfo jobInfo ) throws Exception { PortablePipelineOptions pipelineOptions = PipelineOptionsTranslation . fromProto ( jobInfo . pipelineOptions ( ) ) . as ( PortablePipelineOptions . class ) ; final String jobName = jobInfo . jobName ( ) ; File outputFile = new File ( checkArgumentNotNull ( pipelineOptions . getOutputExecutablePath ( ) ) ) ; LOG . info ( ""Creating jar {} for job {}"" , outputFile . getAbsolutePath ( ) , jobName ) ; outputStream = new JarOutputStream ( new FileOutputStream ( outputFile ) , createManifest ( mainClass , jobName ) ) ; outputChannel = Channels . newChannel ( outputStream ) ; PortablePipelineJarUtils . writeDefaultJobName ( outputStream , jobName ) ; copyResourcesFromJar ( new JarFile ( mainClass . getProtectionDomain ( ) . getCodeSource ( ) . getLocation ( ) . getPath ( ) ) ) ; writeAsJson ( PipelineOptionsTranslation . toProto ( pipelineOptions ) , PortablePipelineJarUtils . getPipelineOptionsUri ( jobName ) ) ; Pipeline pipelineWithClasspathArtifacts = writeArtifacts ( pipeline , jobName ) ; writeAsJson ( pipelineWithClasspathArtifacts , PortablePipelineJarUtils . getPipelineUri ( jobName ) ) ; outputChannel . close ( ) ; return new JarCreatorPipelineResult ( ) ; } ","public PortablePipelineResult run ( Pipeline pipeline , JobInfo jobInfo ) throws Exception { PortablePipelineOptions pipelineOptions = PipelineOptionsTranslation . fromProto ( jobInfo . pipelineOptions ( ) ) . as ( PortablePipelineOptions . class ) ; final String jobName = jobInfo . jobName ( ) ; File outputFile = new File ( checkArgumentNotNull ( pipelineOptions . getOutputExecutablePath ( ) ) ) ; LOG . info ( ""Creating jar {} for job {}"" , outputFile . getAbsolutePath ( ) , jobName ) ; outputStream = new JarOutputStream ( new FileOutputStream ( outputFile ) , createManifest ( mainClass , jobName ) ) ; outputChannel = Channels . newChannel ( outputStream ) ; PortablePipelineJarUtils . writeDefaultJobName ( outputStream , jobName ) ; copyResourcesFromJar ( new JarFile ( mainClass . getProtectionDomain ( ) . getCodeSource ( ) . getLocation ( ) . getPath ( ) ) ) ; writeAsJson ( PipelineOptionsTranslation . toProto ( pipelineOptions ) , PortablePipelineJarUtils . getPipelineOptionsUri ( jobName ) ) ; Pipeline pipelineWithClasspathArtifacts = writeArtifacts ( pipeline , jobName ) ; writeAsJson ( pipelineWithClasspathArtifacts , PortablePipelineJarUtils . getPipelineUri ( jobName ) ) ; outputChannel . close ( ) ; LOG . info ( ""Jar {} created successfully."" , outputFile . getAbsolutePath ( ) ) ; return new JarCreatorPipelineResult ( ) ; } " 971,"private void handleResolveOptions ( String tenantId , String triggerId , boolean checkIfAllResolved ) { if ( definitionsService == null || alertsEngine == null ) { return ; } try { Trigger trigger = definitionsService . getTrigger ( tenantId , triggerId ) ; if ( null == trigger ) { return ; } boolean setEnabled = trigger . isAutoEnable ( ) && ! trigger . isEnabled ( ) ; boolean setFiring = trigger . isAutoResolve ( ) ; if ( setFiring ) { Trigger loadedTrigger = alertsEngine . getLoadedTrigger ( trigger ) ; if ( null != loadedTrigger && Mode . FIRING == loadedTrigger . getMode ( ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Ignoring setFiring, loaded Trigger already in firing mode "" + loadedTrigger . toString ( ) ) ; } setFiring = false ; } } if ( ! ( setEnabled || setFiring ) ) { return ; } boolean allResolved = true ; if ( checkIfAllResolved ) { AlertsCriteria ac = new AlertsCriteria ( ) ; ac . setTriggerId ( triggerId ) ; ac . setStatusSet ( EnumSet . complementOf ( EnumSet . of ( Status . RESOLVED ) ) ) ; Page < Alert > unresolvedAlerts = getAlerts ( tenantId , ac , new Pager ( 0 , 1 , Order . unspecified ( ) ) ) ; allResolved = unresolvedAlerts . isEmpty ( ) ; } if ( ! allResolved ) { log . debugf ( ""Ignoring resolveOptions, not all Alerts for Trigger %s are resolved"" , trigger . toString ( ) ) ; return ; } if ( setEnabled ) { trigger . setEnabled ( true ) ; definitionsService . updateTrigger ( tenantId , trigger ) ; } else { alertsEngine . reloadTrigger ( tenantId , triggerId ) ; } } catch ( Exception e ) { log . errorDatabaseException ( e . getMessage ( ) ) ; } } ","private void handleResolveOptions ( String tenantId , String triggerId , boolean checkIfAllResolved ) { if ( definitionsService == null || alertsEngine == null ) { log . debug ( ""definitionsService or alertsEngine are not defined. Only valid for testing."" ) ; return ; } try { Trigger trigger = definitionsService . getTrigger ( tenantId , triggerId ) ; if ( null == trigger ) { return ; } boolean setEnabled = trigger . isAutoEnable ( ) && ! trigger . isEnabled ( ) ; boolean setFiring = trigger . isAutoResolve ( ) ; if ( setFiring ) { Trigger loadedTrigger = alertsEngine . getLoadedTrigger ( trigger ) ; if ( null != loadedTrigger && Mode . FIRING == loadedTrigger . getMode ( ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Ignoring setFiring, loaded Trigger already in firing mode "" + loadedTrigger . toString ( ) ) ; } setFiring = false ; } } if ( ! ( setEnabled || setFiring ) ) { return ; } boolean allResolved = true ; if ( checkIfAllResolved ) { AlertsCriteria ac = new AlertsCriteria ( ) ; ac . setTriggerId ( triggerId ) ; ac . setStatusSet ( EnumSet . complementOf ( EnumSet . of ( Status . RESOLVED ) ) ) ; Page < Alert > unresolvedAlerts = getAlerts ( tenantId , ac , new Pager ( 0 , 1 , Order . unspecified ( ) ) ) ; allResolved = unresolvedAlerts . isEmpty ( ) ; } if ( ! allResolved ) { log . debugf ( ""Ignoring resolveOptions, not all Alerts for Trigger %s are resolved"" , trigger . toString ( ) ) ; return ; } if ( setEnabled ) { trigger . setEnabled ( true ) ; definitionsService . updateTrigger ( tenantId , trigger ) ; } else { alertsEngine . reloadTrigger ( tenantId , triggerId ) ; } } catch ( Exception e ) { log . errorDatabaseException ( e . getMessage ( ) ) ; } } " 972,"private void handleResolveOptions ( String tenantId , String triggerId , boolean checkIfAllResolved ) { if ( definitionsService == null || alertsEngine == null ) { log . debug ( ""definitionsService or alertsEngine are not defined. Only valid for testing."" ) ; return ; } try { Trigger trigger = definitionsService . getTrigger ( tenantId , triggerId ) ; if ( null == trigger ) { return ; } boolean setEnabled = trigger . isAutoEnable ( ) && ! trigger . isEnabled ( ) ; boolean setFiring = trigger . isAutoResolve ( ) ; if ( setFiring ) { Trigger loadedTrigger = alertsEngine . getLoadedTrigger ( trigger ) ; if ( null != loadedTrigger && Mode . FIRING == loadedTrigger . getMode ( ) ) { if ( log . isDebugEnabled ( ) ) { } setFiring = false ; } } if ( ! ( setEnabled || setFiring ) ) { return ; } boolean allResolved = true ; if ( checkIfAllResolved ) { AlertsCriteria ac = new AlertsCriteria ( ) ; ac . setTriggerId ( triggerId ) ; ac . setStatusSet ( EnumSet . complementOf ( EnumSet . of ( Status . RESOLVED ) ) ) ; Page < Alert > unresolvedAlerts = getAlerts ( tenantId , ac , new Pager ( 0 , 1 , Order . unspecified ( ) ) ) ; allResolved = unresolvedAlerts . isEmpty ( ) ; } if ( ! allResolved ) { log . debugf ( ""Ignoring resolveOptions, not all Alerts for Trigger %s are resolved"" , trigger . toString ( ) ) ; return ; } if ( setEnabled ) { trigger . setEnabled ( true ) ; definitionsService . updateTrigger ( tenantId , trigger ) ; } else { alertsEngine . reloadTrigger ( tenantId , triggerId ) ; } } catch ( Exception e ) { log . errorDatabaseException ( e . getMessage ( ) ) ; } } ","private void handleResolveOptions ( String tenantId , String triggerId , boolean checkIfAllResolved ) { if ( definitionsService == null || alertsEngine == null ) { log . debug ( ""definitionsService or alertsEngine are not defined. Only valid for testing."" ) ; return ; } try { Trigger trigger = definitionsService . getTrigger ( tenantId , triggerId ) ; if ( null == trigger ) { return ; } boolean setEnabled = trigger . isAutoEnable ( ) && ! trigger . isEnabled ( ) ; boolean setFiring = trigger . isAutoResolve ( ) ; if ( setFiring ) { Trigger loadedTrigger = alertsEngine . getLoadedTrigger ( trigger ) ; if ( null != loadedTrigger && Mode . FIRING == loadedTrigger . getMode ( ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ""Ignoring setFiring, loaded Trigger already in firing mode "" + loadedTrigger . toString ( ) ) ; } setFiring = false ; } } if ( ! ( setEnabled || setFiring ) ) { return ; } boolean allResolved = true ; if ( checkIfAllResolved ) { AlertsCriteria ac = new AlertsCriteria ( ) ; ac . setTriggerId ( triggerId ) ; ac . setStatusSet ( EnumSet . complementOf ( EnumSet . of ( Status . RESOLVED ) ) ) ; Page < Alert > unresolvedAlerts = getAlerts ( tenantId , ac , new Pager ( 0 , 1 , Order . unspecified ( ) ) ) ; allResolved = unresolvedAlerts . isEmpty ( ) ; } if ( ! allResolved ) { log . debugf ( ""Ignoring resolveOptions, not all Alerts for Trigger %s are resolved"" , trigger . toString ( ) ) ; return ; } if ( setEnabled ) { trigger . setEnabled ( true ) ; definitionsService . updateTrigger ( tenantId , trigger ) ; } else { alertsEngine . reloadTrigger ( tenantId , triggerId ) ; } } catch ( Exception e ) { log . errorDatabaseException ( e . getMessage ( ) ) ; } } " 973,"public void onFailure ( final Throwable throwable ) { sender . tell ( new Failure ( throwable ) , getSelf ( ) ) ; } ","public void onFailure ( final Throwable throwable ) { LOG . debug ( ""{}: getSchemaSource for {} failed"" , id , sourceIdentifier , throwable ) ; sender . tell ( new Failure ( throwable ) , getSelf ( ) ) ; } " 974,"@ Watched ( prefix = ""schema"" ) public Id removeVertexLabel ( Id id ) { SchemaCallable callable = new VertexLabelRemoveCallable ( ) ; VertexLabel schema = this . getVertexLabel ( id ) ; return asyncRun ( this . graph ( ) , schema , callable ) ; } ","@ Watched ( prefix = ""schema"" ) public Id removeVertexLabel ( Id id ) { LOG . debug ( ""SchemaTransaction remove vertex label '{}'"" , id ) ; SchemaCallable callable = new VertexLabelRemoveCallable ( ) ; VertexLabel schema = this . getVertexLabel ( id ) ; return asyncRun ( this . graph ( ) , schema , callable ) ; } " 975,"public void adjustTLSExtensionContext ( SignedCertificateTimestampExtensionMessage message ) { if ( message . getExtensionLength ( ) . getValue ( ) > 65535 ) { } context . setSignedCertificateTimestamp ( message . getSignedTimestamp ( ) . getValue ( ) ) ; LOGGER . debug ( ""The context SignedCertificateTimestamp was set to "" + ArrayConverter . bytesToHexString ( message . getSignedTimestamp ( ) ) ) ; } ","public void adjustTLSExtensionContext ( SignedCertificateTimestampExtensionMessage message ) { if ( message . getExtensionLength ( ) . getValue ( ) > 65535 ) { LOGGER . warn ( ""The SingedCertificateTimestamp length shouldn't exceed 2 bytes as defined in RFC 6962. "" + ""Length was "" + message . getExtensionLength ( ) . getValue ( ) ) ; } context . setSignedCertificateTimestamp ( message . getSignedTimestamp ( ) . getValue ( ) ) ; LOGGER . debug ( ""The context SignedCertificateTimestamp was set to "" + ArrayConverter . bytesToHexString ( message . getSignedTimestamp ( ) ) ) ; } " 976,"public void adjustTLSExtensionContext ( SignedCertificateTimestampExtensionMessage message ) { if ( message . getExtensionLength ( ) . getValue ( ) > 65535 ) { LOGGER . warn ( ""The SingedCertificateTimestamp length shouldn't exceed 2 bytes as defined in RFC 6962. "" + ""Length was "" + message . getExtensionLength ( ) . getValue ( ) ) ; } context . setSignedCertificateTimestamp ( message . getSignedTimestamp ( ) . getValue ( ) ) ; } ","public void adjustTLSExtensionContext ( SignedCertificateTimestampExtensionMessage message ) { if ( message . getExtensionLength ( ) . getValue ( ) > 65535 ) { LOGGER . warn ( ""The SingedCertificateTimestamp length shouldn't exceed 2 bytes as defined in RFC 6962. "" + ""Length was "" + message . getExtensionLength ( ) . getValue ( ) ) ; } context . setSignedCertificateTimestamp ( message . getSignedTimestamp ( ) . getValue ( ) ) ; LOGGER . debug ( ""The context SignedCertificateTimestamp was set to "" + ArrayConverter . bytesToHexString ( message . getSignedTimestamp ( ) ) ) ; } " 977,"public Image getDefaultUserMalePortrait ( ) { if ( _defaultUserMalePortrait != null ) { return _defaultUserMalePortrait ; } ClassLoader classLoader = ImageToolImpl . class . getClassLoader ( ) ; try { InputStream inputStream = classLoader . getResourceAsStream ( PropsUtil . get ( PropsKeys . IMAGE_DEFAULT_USER_MALE_PORTRAIT ) ) ; if ( inputStream == null ) { } _defaultUserMalePortrait = getImage ( inputStream ) ; } catch ( Exception exception ) { _log . error ( ""Unable to configure the default user male portrait: "" + exception . getMessage ( ) ) ; } return _defaultUserMalePortrait ; } ","public Image getDefaultUserMalePortrait ( ) { if ( _defaultUserMalePortrait != null ) { return _defaultUserMalePortrait ; } ClassLoader classLoader = ImageToolImpl . class . getClassLoader ( ) ; try { InputStream inputStream = classLoader . getResourceAsStream ( PropsUtil . get ( PropsKeys . IMAGE_DEFAULT_USER_MALE_PORTRAIT ) ) ; if ( inputStream == null ) { _log . error ( ""Default user male portrait is not available"" ) ; } _defaultUserMalePortrait = getImage ( inputStream ) ; } catch ( Exception exception ) { _log . error ( ""Unable to configure the default user male portrait: "" + exception . getMessage ( ) ) ; } return _defaultUserMalePortrait ; } " 978,"public Image getDefaultUserMalePortrait ( ) { if ( _defaultUserMalePortrait != null ) { return _defaultUserMalePortrait ; } ClassLoader classLoader = ImageToolImpl . class . getClassLoader ( ) ; try { InputStream inputStream = classLoader . getResourceAsStream ( PropsUtil . get ( PropsKeys . IMAGE_DEFAULT_USER_MALE_PORTRAIT ) ) ; if ( inputStream == null ) { _log . error ( ""Default user male portrait is not available"" ) ; } _defaultUserMalePortrait = getImage ( inputStream ) ; } catch ( Exception exception ) { } return _defaultUserMalePortrait ; } ","public Image getDefaultUserMalePortrait ( ) { if ( _defaultUserMalePortrait != null ) { return _defaultUserMalePortrait ; } ClassLoader classLoader = ImageToolImpl . class . getClassLoader ( ) ; try { InputStream inputStream = classLoader . getResourceAsStream ( PropsUtil . get ( PropsKeys . IMAGE_DEFAULT_USER_MALE_PORTRAIT ) ) ; if ( inputStream == null ) { _log . error ( ""Default user male portrait is not available"" ) ; } _defaultUserMalePortrait = getImage ( inputStream ) ; } catch ( Exception exception ) { _log . error ( ""Unable to configure the default user male portrait: "" + exception . getMessage ( ) ) ; } return _defaultUserMalePortrait ; } " 979,"public Note get ( String noteId , AuthenticationInfo subject ) throws IOException { if ( StringUtils . isBlank ( noteId ) || ! isSubjectValid ( subject ) ) { return EMPTY_NOTE ; } String token = getUserToken ( subject . getUser ( ) ) ; String response = restApiClient . get ( token , noteId ) ; Note note = Note . fromJson ( response ) ; if ( note == null ) { return EMPTY_NOTE ; } return note ; } ","public Note get ( String noteId , AuthenticationInfo subject ) throws IOException { if ( StringUtils . isBlank ( noteId ) || ! isSubjectValid ( subject ) ) { return EMPTY_NOTE ; } String token = getUserToken ( subject . getUser ( ) ) ; String response = restApiClient . get ( token , noteId ) ; Note note = Note . fromJson ( response ) ; if ( note == null ) { return EMPTY_NOTE ; } LOG . info ( ""ZeppelinHub REST API get note {} "" , noteId ) ; return note ; } " 980,"private Trace createTrace ( final Object target , final Object [ ] args ) { final Method methodInvoked = ( Method ) args [ 2 ] ; final StringBuilder methodNameBuilder = new StringBuilder ( ) ; if ( methodInvoked != null ) { try { final Class < ? > declaringClass = methodInvoked . getDeclaringClass ( ) ; if ( declaringClass != null ) { methodNameBuilder . append ( declaringClass . getCanonicalName ( ) ) ; methodNameBuilder . append ( '.' ) ; } methodNameBuilder . append ( methodInvoked . getName ( ) ) ; } catch ( final Exception exception ) { } } final Trace trace = traceContext . newTraceObject ( ) ; final Connection connection = RemotingContext . getConnection ( ) ; final String remoteAddress = JbossUtility . fetchRemoteAddress ( connection ) ; if ( trace . canSampled ( ) ) { final SpanRecorder recorder = trace . getSpanRecorder ( ) ; recordRootSpan ( recorder , methodNameBuilder . toString ( ) , remoteAddress ) ; if ( isDebug ) { logger . debug ( ""Trace sampling is true, Recording trace. methodInvoked:{}, remoteAddress:{}"" , methodNameBuilder . toString ( ) , remoteAddress ) ; } } else { if ( isDebug ) { logger . debug ( ""Trace sampling is false, Skip recording trace. methodInvoked:{}, remoteAddress:{}"" , methodNameBuilder . toString ( ) , remoteAddress ) ; } } return trace ; } ","private Trace createTrace ( final Object target , final Object [ ] args ) { final Method methodInvoked = ( Method ) args [ 2 ] ; final StringBuilder methodNameBuilder = new StringBuilder ( ) ; if ( methodInvoked != null ) { try { final Class < ? > declaringClass = methodInvoked . getDeclaringClass ( ) ; if ( declaringClass != null ) { methodNameBuilder . append ( declaringClass . getCanonicalName ( ) ) ; methodNameBuilder . append ( '.' ) ; } methodNameBuilder . append ( methodInvoked . getName ( ) ) ; } catch ( final Exception exception ) { logger . error ( ""An error occurred while fetching method details"" , exception ) ; } } final Trace trace = traceContext . newTraceObject ( ) ; final Connection connection = RemotingContext . getConnection ( ) ; final String remoteAddress = JbossUtility . fetchRemoteAddress ( connection ) ; if ( trace . canSampled ( ) ) { final SpanRecorder recorder = trace . getSpanRecorder ( ) ; recordRootSpan ( recorder , methodNameBuilder . toString ( ) , remoteAddress ) ; if ( isDebug ) { logger . debug ( ""Trace sampling is true, Recording trace. methodInvoked:{}, remoteAddress:{}"" , methodNameBuilder . toString ( ) , remoteAddress ) ; } } else { if ( isDebug ) { logger . debug ( ""Trace sampling is false, Skip recording trace. methodInvoked:{}, remoteAddress:{}"" , methodNameBuilder . toString ( ) , remoteAddress ) ; } } return trace ; } " 981,"private Trace createTrace ( final Object target , final Object [ ] args ) { final Method methodInvoked = ( Method ) args [ 2 ] ; final StringBuilder methodNameBuilder = new StringBuilder ( ) ; if ( methodInvoked != null ) { try { final Class < ? > declaringClass = methodInvoked . getDeclaringClass ( ) ; if ( declaringClass != null ) { methodNameBuilder . append ( declaringClass . getCanonicalName ( ) ) ; methodNameBuilder . append ( '.' ) ; } methodNameBuilder . append ( methodInvoked . getName ( ) ) ; } catch ( final Exception exception ) { logger . error ( ""An error occurred while fetching method details"" , exception ) ; } } final Trace trace = traceContext . newTraceObject ( ) ; final Connection connection = RemotingContext . getConnection ( ) ; final String remoteAddress = JbossUtility . fetchRemoteAddress ( connection ) ; if ( trace . canSampled ( ) ) { final SpanRecorder recorder = trace . getSpanRecorder ( ) ; recordRootSpan ( recorder , methodNameBuilder . toString ( ) , remoteAddress ) ; if ( isDebug ) { } } else { if ( isDebug ) { logger . debug ( ""Trace sampling is false, Skip recording trace. methodInvoked:{}, remoteAddress:{}"" , methodNameBuilder . toString ( ) , remoteAddress ) ; } } return trace ; } ","private Trace createTrace ( final Object target , final Object [ ] args ) { final Method methodInvoked = ( Method ) args [ 2 ] ; final StringBuilder methodNameBuilder = new StringBuilder ( ) ; if ( methodInvoked != null ) { try { final Class < ? > declaringClass = methodInvoked . getDeclaringClass ( ) ; if ( declaringClass != null ) { methodNameBuilder . append ( declaringClass . getCanonicalName ( ) ) ; methodNameBuilder . append ( '.' ) ; } methodNameBuilder . append ( methodInvoked . getName ( ) ) ; } catch ( final Exception exception ) { logger . error ( ""An error occurred while fetching method details"" , exception ) ; } } final Trace trace = traceContext . newTraceObject ( ) ; final Connection connection = RemotingContext . getConnection ( ) ; final String remoteAddress = JbossUtility . fetchRemoteAddress ( connection ) ; if ( trace . canSampled ( ) ) { final SpanRecorder recorder = trace . getSpanRecorder ( ) ; recordRootSpan ( recorder , methodNameBuilder . toString ( ) , remoteAddress ) ; if ( isDebug ) { logger . debug ( ""Trace sampling is true, Recording trace. methodInvoked:{}, remoteAddress:{}"" , methodNameBuilder . toString ( ) , remoteAddress ) ; } } else { if ( isDebug ) { logger . debug ( ""Trace sampling is false, Skip recording trace. methodInvoked:{}, remoteAddress:{}"" , methodNameBuilder . toString ( ) , remoteAddress ) ; } } return trace ; } " 982,"private Trace createTrace ( final Object target , final Object [ ] args ) { final Method methodInvoked = ( Method ) args [ 2 ] ; final StringBuilder methodNameBuilder = new StringBuilder ( ) ; if ( methodInvoked != null ) { try { final Class < ? > declaringClass = methodInvoked . getDeclaringClass ( ) ; if ( declaringClass != null ) { methodNameBuilder . append ( declaringClass . getCanonicalName ( ) ) ; methodNameBuilder . append ( '.' ) ; } methodNameBuilder . append ( methodInvoked . getName ( ) ) ; } catch ( final Exception exception ) { logger . error ( ""An error occurred while fetching method details"" , exception ) ; } } final Trace trace = traceContext . newTraceObject ( ) ; final Connection connection = RemotingContext . getConnection ( ) ; final String remoteAddress = JbossUtility . fetchRemoteAddress ( connection ) ; if ( trace . canSampled ( ) ) { final SpanRecorder recorder = trace . getSpanRecorder ( ) ; recordRootSpan ( recorder , methodNameBuilder . toString ( ) , remoteAddress ) ; if ( isDebug ) { logger . debug ( ""Trace sampling is true, Recording trace. methodInvoked:{}, remoteAddress:{}"" , methodNameBuilder . toString ( ) , remoteAddress ) ; } } else { if ( isDebug ) { } } return trace ; } ","private Trace createTrace ( final Object target , final Object [ ] args ) { final Method methodInvoked = ( Method ) args [ 2 ] ; final StringBuilder methodNameBuilder = new StringBuilder ( ) ; if ( methodInvoked != null ) { try { final Class < ? > declaringClass = methodInvoked . getDeclaringClass ( ) ; if ( declaringClass != null ) { methodNameBuilder . append ( declaringClass . getCanonicalName ( ) ) ; methodNameBuilder . append ( '.' ) ; } methodNameBuilder . append ( methodInvoked . getName ( ) ) ; } catch ( final Exception exception ) { logger . error ( ""An error occurred while fetching method details"" , exception ) ; } } final Trace trace = traceContext . newTraceObject ( ) ; final Connection connection = RemotingContext . getConnection ( ) ; final String remoteAddress = JbossUtility . fetchRemoteAddress ( connection ) ; if ( trace . canSampled ( ) ) { final SpanRecorder recorder = trace . getSpanRecorder ( ) ; recordRootSpan ( recorder , methodNameBuilder . toString ( ) , remoteAddress ) ; if ( isDebug ) { logger . debug ( ""Trace sampling is true, Recording trace. methodInvoked:{}, remoteAddress:{}"" , methodNameBuilder . toString ( ) , remoteAddress ) ; } } else { if ( isDebug ) { logger . debug ( ""Trace sampling is false, Skip recording trace. methodInvoked:{}, remoteAddress:{}"" , methodNameBuilder . toString ( ) , remoteAddress ) ; } } return trace ; } " 983,"@ PreAuthorize ( ""hasRole('"" + IdRepoEntitlement . KEYMASTER + ""')"" ) @ Transactional ( readOnly = true ) public void exportInternalStorageContent ( final OutputStream os ) { try { exporter . export ( AuthContextUtils . getDomain ( ) , os , uwfAdapter . getPrefix ( ) , gwfAdapter . getPrefix ( ) , awfAdapter . getPrefix ( ) ) ; } catch ( Exception e ) { LOG . error ( ""While exporting internal storage content"" , e ) ; } } ","@ PreAuthorize ( ""hasRole('"" + IdRepoEntitlement . KEYMASTER + ""')"" ) @ Transactional ( readOnly = true ) public void exportInternalStorageContent ( final OutputStream os ) { try { exporter . export ( AuthContextUtils . getDomain ( ) , os , uwfAdapter . getPrefix ( ) , gwfAdapter . getPrefix ( ) , awfAdapter . getPrefix ( ) ) ; LOG . debug ( ""Internal storage content successfully exported"" ) ; } catch ( Exception e ) { LOG . error ( ""While exporting internal storage content"" , e ) ; } } " 984,"@ PreAuthorize ( ""hasRole('"" + IdRepoEntitlement . KEYMASTER + ""')"" ) @ Transactional ( readOnly = true ) public void exportInternalStorageContent ( final OutputStream os ) { try { exporter . export ( AuthContextUtils . getDomain ( ) , os , uwfAdapter . getPrefix ( ) , gwfAdapter . getPrefix ( ) , awfAdapter . getPrefix ( ) ) ; LOG . debug ( ""Internal storage content successfully exported"" ) ; } catch ( Exception e ) { } } ","@ PreAuthorize ( ""hasRole('"" + IdRepoEntitlement . KEYMASTER + ""')"" ) @ Transactional ( readOnly = true ) public void exportInternalStorageContent ( final OutputStream os ) { try { exporter . export ( AuthContextUtils . getDomain ( ) , os , uwfAdapter . getPrefix ( ) , gwfAdapter . getPrefix ( ) , awfAdapter . getPrefix ( ) ) ; LOG . debug ( ""Internal storage content successfully exported"" ) ; } catch ( Exception e ) { LOG . error ( ""While exporting internal storage content"" , e ) ; } } " 985,"public void close ( ) { super . close ( ) ; ServerSocketChannel serverChannel = _acceptChannel ; _acceptChannel = null ; if ( serverChannel != null ) { removeBean ( serverChannel ) ; if ( serverChannel . isOpen ( ) ) { try { serverChannel . close ( ) ; } catch ( IOException e ) { } } } _localPort = - 2 ; } ","public void close ( ) { super . close ( ) ; ServerSocketChannel serverChannel = _acceptChannel ; _acceptChannel = null ; if ( serverChannel != null ) { removeBean ( serverChannel ) ; if ( serverChannel . isOpen ( ) ) { try { serverChannel . close ( ) ; } catch ( IOException e ) { LOG . warn ( ""Unable to close {}"" , serverChannel , e ) ; } } } _localPort = - 2 ; } " 986,"private void createVertexCompositeIndexWithSystemProperty ( AtlasGraphManagement management , Class propertyClass , AtlasPropertyKey propertyKey , final String systemPropertyKey , AtlasCardinality cardinality , boolean isUnique ) { if ( LOG . isDebugEnabled ( ) ) { } AtlasPropertyKey typePropertyKey = management . getPropertyKey ( systemPropertyKey ) ; if ( typePropertyKey == null ) { typePropertyKey = management . makePropertyKey ( systemPropertyKey , String . class , cardinality ) ; } final String indexName = propertyKey . getName ( ) + systemPropertyKey ; AtlasGraphIndex existingIndex = management . getGraphIndex ( indexName ) ; if ( existingIndex == null ) { List < AtlasPropertyKey > keys = new ArrayList < > ( 2 ) ; keys . add ( typePropertyKey ) ; keys . add ( propertyKey ) ; management . createVertexCompositeIndex ( indexName , isUnique , keys ) ; LOG . info ( ""Created composite index for property {} of type {} and {}"" , propertyKey . getName ( ) , propertyClass . getName ( ) , systemPropertyKey ) ; } } ","private void createVertexCompositeIndexWithSystemProperty ( AtlasGraphManagement management , Class propertyClass , AtlasPropertyKey propertyKey , final String systemPropertyKey , AtlasCardinality cardinality , boolean isUnique ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Creating composite index for property {} of type {} and {}"" , propertyKey . getName ( ) , propertyClass . getName ( ) , systemPropertyKey ) ; } AtlasPropertyKey typePropertyKey = management . getPropertyKey ( systemPropertyKey ) ; if ( typePropertyKey == null ) { typePropertyKey = management . makePropertyKey ( systemPropertyKey , String . class , cardinality ) ; } final String indexName = propertyKey . getName ( ) + systemPropertyKey ; AtlasGraphIndex existingIndex = management . getGraphIndex ( indexName ) ; if ( existingIndex == null ) { List < AtlasPropertyKey > keys = new ArrayList < > ( 2 ) ; keys . add ( typePropertyKey ) ; keys . add ( propertyKey ) ; management . createVertexCompositeIndex ( indexName , isUnique , keys ) ; LOG . info ( ""Created composite index for property {} of type {} and {}"" , propertyKey . getName ( ) , propertyClass . getName ( ) , systemPropertyKey ) ; } } " 987,"private void createVertexCompositeIndexWithSystemProperty ( AtlasGraphManagement management , Class propertyClass , AtlasPropertyKey propertyKey , final String systemPropertyKey , AtlasCardinality cardinality , boolean isUnique ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Creating composite index for property {} of type {} and {}"" , propertyKey . getName ( ) , propertyClass . getName ( ) , systemPropertyKey ) ; } AtlasPropertyKey typePropertyKey = management . getPropertyKey ( systemPropertyKey ) ; if ( typePropertyKey == null ) { typePropertyKey = management . makePropertyKey ( systemPropertyKey , String . class , cardinality ) ; } final String indexName = propertyKey . getName ( ) + systemPropertyKey ; AtlasGraphIndex existingIndex = management . getGraphIndex ( indexName ) ; if ( existingIndex == null ) { List < AtlasPropertyKey > keys = new ArrayList < > ( 2 ) ; keys . add ( typePropertyKey ) ; keys . add ( propertyKey ) ; management . createVertexCompositeIndex ( indexName , isUnique , keys ) ; } } ","private void createVertexCompositeIndexWithSystemProperty ( AtlasGraphManagement management , Class propertyClass , AtlasPropertyKey propertyKey , final String systemPropertyKey , AtlasCardinality cardinality , boolean isUnique ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( ""Creating composite index for property {} of type {} and {}"" , propertyKey . getName ( ) , propertyClass . getName ( ) , systemPropertyKey ) ; } AtlasPropertyKey typePropertyKey = management . getPropertyKey ( systemPropertyKey ) ; if ( typePropertyKey == null ) { typePropertyKey = management . makePropertyKey ( systemPropertyKey , String . class , cardinality ) ; } final String indexName = propertyKey . getName ( ) + systemPropertyKey ; AtlasGraphIndex existingIndex = management . getGraphIndex ( indexName ) ; if ( existingIndex == null ) { List < AtlasPropertyKey > keys = new ArrayList < > ( 2 ) ; keys . add ( typePropertyKey ) ; keys . add ( propertyKey ) ; management . createVertexCompositeIndex ( indexName , isUnique , keys ) ; LOG . info ( ""Created composite index for property {} of type {} and {}"" , propertyKey . getName ( ) , propertyClass . getName ( ) , systemPropertyKey ) ; } } " 988,"private static Option < String > getMetadataValue ( HoodieTableMetaClient metaClient , String extraMetadataKey , HoodieInstant instant ) { try { HoodieCommitMetadata commitMetadata = HoodieCommitMetadata . fromBytes ( metaClient . getCommitsTimeline ( ) . getInstantDetails ( instant ) . get ( ) , HoodieCommitMetadata . class ) ; return Option . ofNullable ( commitMetadata . getExtraMetadata ( ) . get ( extraMetadataKey ) ) ; } catch ( IOException e ) { throw new HoodieIOException ( ""Unable to parse instant metadata "" + instant , e ) ; } } ","private static Option < String > getMetadataValue ( HoodieTableMetaClient metaClient , String extraMetadataKey , HoodieInstant instant ) { try { LOG . info ( ""reading checkpoint info for:"" + instant + "" key: "" + extraMetadataKey ) ; HoodieCommitMetadata commitMetadata = HoodieCommitMetadata . fromBytes ( metaClient . getCommitsTimeline ( ) . getInstantDetails ( instant ) . get ( ) , HoodieCommitMetadata . class ) ; return Option . ofNullable ( commitMetadata . getExtraMetadata ( ) . get ( extraMetadataKey ) ) ; } catch ( IOException e ) { throw new HoodieIOException ( ""Unable to parse instant metadata "" + instant , e ) ; } } " 989,"public void close ( ) throws IOException { disruptor . halt ( ) ; disruptor . shutdown ( ) ; LOG . info ( ""\tPersistence Processor Disruptor shutdown"" ) ; disruptorExec . shutdownNow ( ) ; try { disruptorExec . awaitTermination ( 3 , SECONDS ) ; LOG . info ( ""\tPersistence Processor Disruptor executor shutdown"" ) ; } catch ( InterruptedException e ) { LOG . error ( ""Interrupted whilst finishing Persistence Processor Disruptor executor"" ) ; Thread . currentThread ( ) . interrupt ( ) ; } LOG . info ( ""Persistence Processor terminated"" ) ; } ","public void close ( ) throws IOException { LOG . info ( ""Terminating Persistence Processor..."" ) ; disruptor . halt ( ) ; disruptor . shutdown ( ) ; LOG . info ( ""\tPersistence Processor Disruptor shutdown"" ) ; disruptorExec . shutdownNow ( ) ; try { disruptorExec . awaitTermination ( 3 , SECONDS ) ; LOG . info ( ""\tPersistence Processor Disruptor executor shutdown"" ) ; } catch ( InterruptedException e ) { LOG . error ( ""Interrupted whilst finishing Persistence Processor Disruptor executor"" ) ; Thread . currentThread ( ) . interrupt ( ) ; } LOG . info ( ""Persistence Processor terminated"" ) ; } " 990,"public void close ( ) throws IOException { LOG . info ( ""Terminating Persistence Processor..."" ) ; disruptor . halt ( ) ; disruptor . shutdown ( ) ; disruptorExec . shutdownNow ( ) ; try { disruptorExec . awaitTermination ( 3 , SECONDS ) ; LOG . info ( ""\tPersistence Processor Disruptor executor shutdown"" ) ; } catch ( InterruptedException e ) { LOG . error ( ""Interrupted whilst finishing Persistence Processor Disruptor executor"" ) ; Thread . currentThread ( ) . interrupt ( ) ; } LOG . info ( ""Persistence Processor terminated"" ) ; } ","public void close ( ) throws IOException { LOG . info ( ""Terminating Persistence Processor..."" ) ; disruptor . halt ( ) ; disruptor . shutdown ( ) ; LOG . info ( ""\tPersistence Processor Disruptor shutdown"" ) ; disruptorExec . shutdownNow ( ) ; try { disruptorExec . awaitTermination ( 3 , SECONDS ) ; LOG . info ( ""\tPersistence Processor Disruptor executor shutdown"" ) ; } catch ( InterruptedException e ) { LOG . error ( ""Interrupted whilst finishing Persistence Processor Disruptor executor"" ) ; Thread . currentThread ( ) . interrupt ( ) ; } LOG . info ( ""Persistence Processor terminated"" ) ; } " 991,"public void close ( ) throws IOException { LOG . info ( ""Terminating Persistence Processor..."" ) ; disruptor . halt ( ) ; disruptor . shutdown ( ) ; LOG . info ( ""\tPersistence Processor Disruptor shutdown"" ) ; disruptorExec . shutdownNow ( ) ; try { disruptorExec . awaitTermination ( 3 , SECONDS ) ; } catch ( InterruptedException e ) { LOG . error ( ""Interrupted whilst finishing Persistence Processor Disruptor executor"" ) ; Thread . currentThread ( ) . interrupt ( ) ; } LOG . info ( ""Persistence Processor terminated"" ) ; } ","public void close ( ) throws IOException { LOG . info ( ""Terminating Persistence Processor..."" ) ; disruptor . halt ( ) ; disruptor . shutdown ( ) ; LOG . info ( ""\tPersistence Processor Disruptor shutdown"" ) ; disruptorExec . shutdownNow ( ) ; try { disruptorExec . awaitTermination ( 3 , SECONDS ) ; LOG . info ( ""\tPersistence Processor Disruptor executor shutdown"" ) ; } catch ( InterruptedException e ) { LOG . error ( ""Interrupted whilst finishing Persistence Processor Disruptor executor"" ) ; Thread . currentThread ( ) . interrupt ( ) ; } LOG . info ( ""Persistence Processor terminated"" ) ; } " 992,"public void close ( ) throws IOException { LOG . info ( ""Terminating Persistence Processor..."" ) ; disruptor . halt ( ) ; disruptor . shutdown ( ) ; LOG . info ( ""\tPersistence Processor Disruptor shutdown"" ) ; disruptorExec . shutdownNow ( ) ; try { disruptorExec . awaitTermination ( 3 , SECONDS ) ; LOG . info ( ""\tPersistence Processor Disruptor executor shutdown"" ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } LOG . info ( ""Persistence Processor terminated"" ) ; } ","public void close ( ) throws IOException { LOG . info ( ""Terminating Persistence Processor..."" ) ; disruptor . halt ( ) ; disruptor . shutdown ( ) ; LOG . info ( ""\tPersistence Processor Disruptor shutdown"" ) ; disruptorExec . shutdownNow ( ) ; try { disruptorExec . awaitTermination ( 3 , SECONDS ) ; LOG . info ( ""\tPersistence Processor Disruptor executor shutdown"" ) ; } catch ( InterruptedException e ) { LOG . error ( ""Interrupted whilst finishing Persistence Processor Disruptor executor"" ) ; Thread . currentThread ( ) . interrupt ( ) ; } LOG . info ( ""Persistence Processor terminated"" ) ; } " 993,"public void close ( ) throws IOException { LOG . info ( ""Terminating Persistence Processor..."" ) ; disruptor . halt ( ) ; disruptor . shutdown ( ) ; LOG . info ( ""\tPersistence Processor Disruptor shutdown"" ) ; disruptorExec . shutdownNow ( ) ; try { disruptorExec . awaitTermination ( 3 , SECONDS ) ; LOG . info ( ""\tPersistence Processor Disruptor executor shutdown"" ) ; } catch ( InterruptedException e ) { LOG . error ( ""Interrupted whilst finishing Persistence Processor Disruptor executor"" ) ; Thread . currentThread ( ) . interrupt ( ) ; } } ","public void close ( ) throws IOException { LOG . info ( ""Terminating Persistence Processor..."" ) ; disruptor . halt ( ) ; disruptor . shutdown ( ) ; LOG . info ( ""\tPersistence Processor Disruptor shutdown"" ) ; disruptorExec . shutdownNow ( ) ; try { disruptorExec . awaitTermination ( 3 , SECONDS ) ; LOG . info ( ""\tPersistence Processor Disruptor executor shutdown"" ) ; } catch ( InterruptedException e ) { LOG . error ( ""Interrupted whilst finishing Persistence Processor Disruptor executor"" ) ; Thread . currentThread ( ) . interrupt ( ) ; } LOG . info ( ""Persistence Processor terminated"" ) ; } " 994,"protected synchronized void update ( final Map < String , Object > properties ) { logger . debug ( ""Updating GPIO Driver... Done"" ) ; } ","protected synchronized void update ( final Map < String , Object > properties ) { logger . debug ( ""Updating GPIO Driver..."" ) ; logger . debug ( ""Updating GPIO Driver... Done"" ) ; } " 995,"protected synchronized void update ( final Map < String , Object > properties ) { logger . debug ( ""Updating GPIO Driver..."" ) ; } ","protected synchronized void update ( final Map < String , Object > properties ) { logger . debug ( ""Updating GPIO Driver..."" ) ; logger . debug ( ""Updating GPIO Driver... Done"" ) ; } " 996,"private void deleteUserConfigRecord ( String username , Connection conn ) { PreparedStatement stat = null ; try { stat = conn . prepareStatement ( DELETE_CONFIG ) ; stat . setString ( 1 , username ) ; stat . executeUpdate ( ) ; } catch ( Throwable t ) { throw new RuntimeException ( ""Error deleting user config record by id "" + username , t ) ; } finally { this . closeDaoResources ( null , stat ) ; } } ","private void deleteUserConfigRecord ( String username , Connection conn ) { PreparedStatement stat = null ; try { stat = conn . prepareStatement ( DELETE_CONFIG ) ; stat . setString ( 1 , username ) ; stat . executeUpdate ( ) ; } catch ( Throwable t ) { _logger . error ( ""Error deleting user config record by id {}"" , username , t ) ; throw new RuntimeException ( ""Error deleting user config record by id "" + username , t ) ; } finally { this . closeDaoResources ( null , stat ) ; } } " 997,"public static com . liferay . portal . kernel . model . EmailAddress getEmailAddress ( HttpPrincipal httpPrincipal , long emailAddressId ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( EmailAddressServiceUtil . class , ""getEmailAddress"" , _getEmailAddressParameterTypes3 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , emailAddressId ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( com . liferay . portal . kernel . model . EmailAddress ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { throw systemException ; } } ","public static com . liferay . portal . kernel . model . EmailAddress getEmailAddress ( HttpPrincipal httpPrincipal , long emailAddressId ) throws com . liferay . portal . kernel . exception . PortalException { try { MethodKey methodKey = new MethodKey ( EmailAddressServiceUtil . class , ""getEmailAddress"" , _getEmailAddressParameterTypes3 ) ; MethodHandler methodHandler = new MethodHandler ( methodKey , emailAddressId ) ; Object returnObj = null ; try { returnObj = TunnelUtil . invoke ( httpPrincipal , methodHandler ) ; } catch ( Exception exception ) { if ( exception instanceof com . liferay . portal . kernel . exception . PortalException ) { throw ( com . liferay . portal . kernel . exception . PortalException ) exception ; } throw new com . liferay . portal . kernel . exception . SystemException ( exception ) ; } return ( com . liferay . portal . kernel . model . EmailAddress ) returnObj ; } catch ( com . liferay . portal . kernel . exception . SystemException systemException ) { _log . error ( systemException , systemException ) ; throw systemException ; } } " 998,"public ArrayList < ServiceInfo > getServices ( Properties properties ) throws ApiException { ArrayList < ServiceInfo > services = new ArrayList < ServiceInfo > ( ) ; try { String defaultLangCode = this . getLangManager ( ) . getDefaultLang ( ) . getCode ( ) ; String langCode = properties . getProperty ( SystemConstants . API_LANG_CODE_PARAMETER ) ; String tagParamValue = properties . getProperty ( ""tag"" ) ; langCode = ( null != langCode && null != this . getLangManager ( ) . getLang ( langCode ) ) ? langCode : defaultLangCode ; Map < String , ApiService > masterServices = this . getApiCatalogManager ( ) . getServices ( tagParamValue ) ; Iterator < ApiService > iter = masterServices . values ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { ApiService service = ( ApiService ) iter . next ( ) ; if ( service . isActive ( ) && ! service . isHidden ( ) && this . checkServiceAuthorization ( service , properties , false ) ) { ServiceInfo smallService = this . createServiceInfo ( service , langCode , defaultLangCode ) ; services . add ( smallService ) ; } } BeanComparator comparator = new BeanComparator ( ""description"" ) ; Collections . sort ( services , comparator ) ; } catch ( Throwable t ) { throw new ApiException ( IApiErrorCodes . SERVER_ERROR , ""Internal error"" ) ; } return services ; } ","public ArrayList < ServiceInfo > getServices ( Properties properties ) throws ApiException { ArrayList < ServiceInfo > services = new ArrayList < ServiceInfo > ( ) ; try { String defaultLangCode = this . getLangManager ( ) . getDefaultLang ( ) . getCode ( ) ; String langCode = properties . getProperty ( SystemConstants . API_LANG_CODE_PARAMETER ) ; String tagParamValue = properties . getProperty ( ""tag"" ) ; langCode = ( null != langCode && null != this . getLangManager ( ) . getLang ( langCode ) ) ? langCode : defaultLangCode ; Map < String , ApiService > masterServices = this . getApiCatalogManager ( ) . getServices ( tagParamValue ) ; Iterator < ApiService > iter = masterServices . values ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { ApiService service = ( ApiService ) iter . next ( ) ; if ( service . isActive ( ) && ! service . isHidden ( ) && this . checkServiceAuthorization ( service , properties , false ) ) { ServiceInfo smallService = this . createServiceInfo ( service , langCode , defaultLangCode ) ; services . add ( smallService ) ; } } BeanComparator comparator = new BeanComparator ( ""description"" ) ; Collections . sort ( services , comparator ) ; } catch ( Throwable t ) { _logger . error ( ""Error extracting services"" , t ) ; throw new ApiException ( IApiErrorCodes . SERVER_ERROR , ""Internal error"" ) ; } return services ; } " 999,"private String insertConfirmationToken ( String state , int confirmationValidity ) throws EngineException { Date createDate = new Date ( ) ; Calendar cl = Calendar . getInstance ( ) ; cl . setTime ( createDate ) ; cl . add ( Calendar . MINUTE , confirmationValidity ) ; Date expires = cl . getTime ( ) ; String token = UUID . randomUUID ( ) . toString ( ) ; try { tokensMan . addToken ( CONFIRMATION_TOKEN_TYPE , token , state . getBytes ( StandardCharsets . UTF_8 ) , createDate , expires ) ; } catch ( Exception e ) { throw e ; } return token ; } ","private String insertConfirmationToken ( String state , int confirmationValidity ) throws EngineException { Date createDate = new Date ( ) ; Calendar cl = Calendar . getInstance ( ) ; cl . setTime ( createDate ) ; cl . add ( Calendar . MINUTE , confirmationValidity ) ; Date expires = cl . getTime ( ) ; String token = UUID . randomUUID ( ) . toString ( ) ; try { tokensMan . addToken ( CONFIRMATION_TOKEN_TYPE , token , state . getBytes ( StandardCharsets . UTF_8 ) , createDate , expires ) ; } catch ( Exception e ) { log . error ( ""Cannot add token to db"" , e ) ; throw e ; } return token ; } "