idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
8,300 | private synchronized LinkedHashSet < IMessageCallback > getCallbacks ( String channel , boolean autoCreate , boolean clone ) { LinkedHashSet < IMessageCallback > result = callbacks . get ( channel ) ; if ( result == null && autoCreate ) { callbacks . put ( channel , result = new LinkedHashSet <> ( ) ) ; } return result == null ? null : clone ? new LinkedHashSet <> ( result ) : result ; } | Return the callbacks associated with the specified channel . | 99 | 10 |
8,301 | @ Override public void onMessage ( String channel , Message message ) { if ( MessageUtil . isMessageExcluded ( message , RecipientType . CONSUMER , nodeId ) ) { return ; } if ( updateDelivered ( message ) ) { LinkedHashSet < IMessageCallback > callbacks = getCallbacks ( channel , false , true ) ; if ( callbacks != null ) { dispatchMessages ( channel , message , callbacks ) ; } } } | Callback entry point for all registered consumers . | 100 | 8 |
8,302 | private boolean updateDelivered ( Message message ) { if ( consumers . size ( ) <= 1 ) { return true ; } String pubid = ( String ) message . getMetadata ( "cwf.pub.event" ) ; return deliveredMessageCache . putIfAbsent ( pubid , "" ) == null ; } | Updates the delivered message cache . This avoids delivering the same message transported by different messaging frameworks . If we have only one consumer registered we don t need to worry about this . | 68 | 35 |
8,303 | protected void dispatchMessages ( String channel , Message message , Set < IMessageCallback > callbacks ) { for ( IMessageCallback callback : callbacks ) { try { callback . onMessage ( channel , message ) ; } catch ( Exception e ) { } } } | Dispatch message to callback . Override to address special threading considerations . | 55 | 14 |
8,304 | private void updateStyle ( ) { CaptionStyle cs = captionStyle == null ? CaptionStyle . HIDDEN : captionStyle ; String background = null ; switch ( cs ) { case FRAME : break ; case TITLE : break ; case LEFT : background = getGradValue ( color1 , color2 ) ; break ; case RIGHT : background = getGradValue ( color2 , color1 ) ; break ; case CENTER : background = getGradValue ( color1 , color2 , color1 ) ; break ; } panel . addClass ( "sharedForms-captioned sharedForms-captioned-caption-" + cs . name ( ) . toLowerCase ( ) ) ; String css = "##{id}-titlebar " ; if ( cs == CaptionStyle . HIDDEN ) { css += "{display:none}" ; } else { css += "{background: " + background + "}" ; } panel . setCss ( css ) ; } | Update styles by current caption style setting . | 209 | 8 |
8,305 | static List < TaskGroupInformation > getPath ( TaskGroupFactoryMakerService imf , TaskSystemInformation def , String locale ) throws TaskSystemException { Set < TaskGroupInformation > specs = imf . list ( locale ) ; Map < String , List < TaskGroupInformation > > byInput = byInput ( specs ) ; return getPathSpecifications ( def . getInputType ( ) . getIdentifier ( ) , def . getOutputType ( ) . getIdentifier ( ) , byInput ) ; } | Finds a path for the given specifications | 106 | 8 |
8,306 | public void addToolbarComponent ( BaseComponent component , String action ) { BaseComponent ref = toolbar . getFirstChild ( ) ; if ( component instanceof Toolbar ) { BaseComponent child ; while ( ( child = component . getFirstChild ( ) ) != null ) { toolbar . addChild ( child , ref ) ; } } else { toolbar . addChild ( component , ref ) ; ActionUtil . addAction ( component , action ) ; } } | Adds a component to the toolbar . | 95 | 7 |
8,307 | protected String extractAttribute ( String name , String line ) { int i = line . indexOf ( name + "=\"" ) ; i = i == - 1 ? i : i + name . length ( ) + 2 ; int j = i == - 1 ? - 1 : line . indexOf ( "\"" , i ) ; return j == - 1 ? null : line . substring ( i , j ) ; } | Extracts the value of the named attribute . | 88 | 10 |
8,308 | protected void write ( OutputStream outputStream , String data , boolean terminate , int level ) { try { if ( data != null ) { if ( level > 0 ) { outputStream . write ( StringUtils . repeat ( " " , level ) . getBytes ( CS_UTF8 ) ) ; } outputStream . write ( data . getBytes ( CS_UTF8 ) ) ; if ( terminate ) { outputStream . write ( "\n" . getBytes ( ) ) ; } } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } | Write data to the output stream with the specified formatting . | 120 | 11 |
8,309 | public synchronized void closeAll ( ) { for ( Window window : windows ) { try { window . removeEventListener ( "close" , this ) ; window . destroy ( ) ; } catch ( Throwable e ) { } } windows . clear ( ) ; resetPosition ( ) ; } | Close all open popups . | 59 | 6 |
8,310 | @ SuppressWarnings ( "deprecation" ) @ Override public void eventCallback ( String eventName , Object eventData ) { try { PopupData popupData = null ; if ( eventData instanceof PopupData ) { popupData = ( PopupData ) eventData ; } else { popupData = new PopupData ( eventData . toString ( ) ) ; } if ( popupData . isEmpty ( ) ) { return ; } Page currentPage = ExecutionContext . getPage ( ) ; Window window = getPopupWindow ( ) ; window . setTitle ( popupData . getTitle ( ) ) ; window . setParent ( currentPage ) ; String pos = getPosition ( ) ; window . addStyle ( "left" , pos ) ; window . addStyle ( "top" , pos ) ; window . addEventListener ( "close" , this ) ; Label label = window . findByName ( "messagetext" , Label . class ) ; label . setLabel ( popupData . getMessage ( ) ) ; window . setMode ( Mode . POPUP ) ; } catch ( Exception e ) { } } | Popup event handler - display popup dialog upon receipt . | 242 | 11 |
8,311 | private synchronized Window getPopupWindow ( ) throws Exception { if ( popupDefinition == null ) { popupDefinition = PageParser . getInstance ( ) . parse ( RESOURCE_PREFIX + "popupWindow.fsp" ) ; } Window window = ( Window ) popupDefinition . materialize ( null ) ; windows . add ( window ) ; return window ; } | Return a popup window instance . | 77 | 6 |
8,312 | @ SuppressWarnings ( "unchecked" ) @ Override public Object postProcessAfterInitialization ( Object bean , String beanName ) throws BeansException { if ( clazz . isInstance ( bean ) ) { register ( ( V ) bean ) ; } return bean ; } | If the managed bean is of the desired type add it to the registry . | 59 | 15 |
8,313 | @ SuppressWarnings ( "unchecked" ) @ Override public void postProcessBeforeDestruction ( Object bean , String beanName ) throws BeansException { if ( clazz . isInstance ( bean ) ) { unregister ( ( V ) bean ) ; } } | If the managed bean is of the desired type remove it from the registry . | 57 | 15 |
8,314 | public void loadChoices ( Iterable < String > choices ) { clear ( ) ; if ( choices != null ) { for ( String choice : choices ) { addChoice ( choice , false ) ; } } checkSelection ( true ) ; } | Load choices from a list . | 51 | 6 |
8,315 | public Dateitem addChoice ( DateRange range , boolean isCustom ) { Dateitem item ; if ( isCustom ) { item = findMatchingItem ( range ) ; if ( item != null ) { return item ; } } item = new Dateitem ( ) ; item . setLabel ( range . getLabel ( ) ) ; item . setData ( range ) ; addChild ( item , isCustom ? null : customItem ) ; if ( range . isDefault ( ) ) { setSelectedItem ( item ) ; } return item ; } | Adds a date range to the choice list . | 113 | 9 |
8,316 | public Dateitem findMatchingItem ( DateRange range ) { for ( BaseComponent item : getChildren ( ) ) { if ( range . equals ( item . getData ( ) ) ) { return ( Dateitem ) item ; } } return null ; } | Searches for a comboitem that has a date range equivalent to the specified range . | 53 | 18 |
8,317 | public Dateitem findMatchingItem ( String label ) { for ( BaseComponent child : getChildren ( ) ) { Dateitem item = ( Dateitem ) child ; if ( label . equalsIgnoreCase ( item . getLabel ( ) ) ) { return item ; } } return null ; } | Searches for a comboitem that has a label that matches the specified value . The search is case insensitive . | 61 | 23 |
8,318 | private void checkSelection ( boolean suppressEvent ) { Dateitem selectedItem = getSelectedItem ( ) ; if ( selectedItem == null ) { selectedItem = lastSelectedItem ; setSelectedItem ( selectedItem ) ; } else if ( selectedItem != customItem && lastSelectedItem != selectedItem ) { lastSelectedItem = selectedItem ; if ( ! suppressEvent ) { EventUtil . send ( new Event ( ON_SELECT_RANGE , this ) ) ; } } updateSelection ( ) ; } | Check the current selection . If nothing is selected display a prompt message in gray text . Also remembers the last selection made . | 111 | 24 |
8,319 | private void updateSelection ( ) { Dateitem selectedItem = getSelectedItem ( ) ; if ( selectedItem == null ) { addStyle ( "color" , "gray" ) ; } else { addStyle ( "color" , "inherit" ) ; } setFocus ( false ) ; } | Updates the visual appearance of the current selection . | 65 | 10 |
8,320 | @ EventHandler ( "change" ) private void onChange ( ChangeEvent event ) { // When the custom range item is selected, triggers the display of the date range dialog. if ( event . getRelatedTarget ( ) == customItem ) { event . stopPropagation ( ) ; DateRangeDialog . show ( ( range ) - > { setSelectedItem ( range == null ? lastSelectedItem : addChoice ( range , true ) ) ; checkSelection ( false ) ; } ) ; } | Change event handler . | 105 | 4 |
8,321 | private String getAttribute ( BeanDefinition beanDefinition , String attributeName ) { String value = null ; while ( beanDefinition != null ) { value = ( String ) beanDefinition . getAttribute ( attributeName ) ; if ( value != null ) { break ; } beanDefinition = beanDefinition . getOriginatingBeanDefinition ( ) ; } return value ; } | Searches this bean definition and all originating bean definitions until it finds the requested attribute . | 73 | 18 |
8,322 | public static String getValue ( String propertyName , String instanceName ) { return getPropertyService ( ) . getValue ( propertyName , instanceName ) ; } | Returns a property value as a string . | 33 | 8 |
8,323 | public static List < String > getValues ( String propertyName , String instanceName ) { return getPropertyService ( ) . getValues ( propertyName , instanceName ) ; } | Returns a property value as a string list . | 36 | 9 |
8,324 | public static void saveValue ( String propertyName , String instanceName , boolean asGlobal , String value ) { getPropertyService ( ) . saveValue ( propertyName , instanceName , asGlobal , value ) ; } | Saves a string value to the underlying property store . | 44 | 11 |
8,325 | public static void saveValues ( String propertyName , String instanceName , boolean asGlobal , List < String > value ) { getPropertyService ( ) . saveValues ( propertyName , instanceName , asGlobal , value ) ; } | Saves a value list to the underlying property store . | 47 | 11 |
8,326 | public static List < String > getInstances ( String propertyName , boolean asGlobal ) { return getPropertyService ( ) . getInstances ( propertyName , asGlobal ) ; } | Returns a list of all instance id s associated with the specified property name . | 38 | 15 |
8,327 | private void sendRequest ( String methodName , Object ... params ) { sendRequest ( new InvocationRequest ( methodName , params ) , true ) ; } | Send a request to the remote viewer to request execution of the specified method . | 32 | 15 |
8,328 | private void sendRequest ( InvocationRequest helpRequest , boolean startRemoteViewer ) { this . helpRequest = helpRequest ; if ( helpRequest != null ) { if ( remoteViewerActive ( ) ) { remoteQueue . sendRequest ( helpRequest ) ; this . helpRequest = null ; } else if ( startRemoteViewer ) { startRemoteViewer ( ) ; } else { this . helpRequest = null ; } } } | Sends a request to the remote viewer . | 91 | 9 |
8,329 | public void setRemoteQueue ( InvocationRequestQueue remoteQueue ) { this . remoteQueue = remoteQueue ; InvocationRequest deferredRequest = helpRequest ; sendRequest ( loadRequest , false ) ; sendRequest ( deferredRequest , false ) ; } | Sets the remote queue associated with the proxy . | 50 | 10 |
8,330 | public static Class < ? extends IHelpSet > register ( Class < ? extends IHelpSet > clazz , String formats ) { for ( String type : formats . split ( "\\," ) ) { instance . map . put ( type , clazz ) ; } return clazz ; } | Register an implementation for one or more help formats . | 60 | 10 |
8,331 | public static IHelpSet create ( HelpModule module ) { try { Class < ? extends IHelpSet > clazz = instance . map . get ( module . getFormat ( ) ) ; if ( clazz == null ) { throw new Exception ( "Unsupported help format: " + module . getFormat ( ) ) ; } Constructor < ? extends IHelpSet > ctor = clazz . getConstructor ( HelpModule . class ) ; return ctor . newInstance ( module ) ; } catch ( Exception e ) { log . error ( "Error creating help set for " + module . getUrl ( ) , e ) ; throw MiscUtil . toUnchecked ( e ) ; } } | Creates a help set . | 146 | 6 |
8,332 | public BaseRedisQueue < ID , DATA > setRedisHashName ( String redisHashName ) { _redisHashName = redisHashName ; this . redisHashName = _redisHashName . getBytes ( QueueUtils . UTF8 ) ; return this ; } | Name of the Redis hash to store queue messages . | 63 | 11 |
8,333 | public BaseRedisQueue < ID , DATA > setRedisListName ( String redisListName ) { _redisListName = redisListName ; this . redisListName = _redisListName . getBytes ( QueueUtils . UTF8 ) ; return this ; } | Name of the Redis list to store queue message ids . | 63 | 13 |
8,334 | public BaseRedisQueue < ID , DATA > setRedisSortedSetName ( String redisSortedSetName ) { _redisSortedSetName = redisSortedSetName ; this . redisSortedSetName = _redisSortedSetName . getBytes ( QueueUtils . UTF8 ) ; return this ; } | Name of the Redis sorted - set to store ephemeral message ids . | 75 | 17 |
8,335 | public void addEntry ( String placeholder , String ... params ) { ConfigEntry entry = entries . get ( placeholder ) ; String line = entry . template ; for ( int i = 0 ; i < params . length ; i ++ ) { line = line . replace ( "{" + i + "}" , StringUtils . defaultString ( params [ i ] ) ) ; } entry . buffer . add ( line ) ; } | Adds an entry to the config file . | 87 | 8 |
8,336 | protected void createFile ( File stagingDirectory ) throws MojoExecutionException { File targetDirectory = newSubdirectory ( stagingDirectory , "META-INF" ) ; File newEntry = new File ( targetDirectory , filename ) ; try ( FileOutputStream out = new FileOutputStream ( newEntry ) ; PrintStream ps = new PrintStream ( out ) ; ) { Iterator < ConfigEntry > iter = entries . values ( ) . iterator ( ) ; ConfigEntry entry = null ; for ( int i = 0 ; i < buffer . size ( ) ; i ++ ) { if ( entry == null && iter . hasNext ( ) ) { entry = iter . next ( ) ; } if ( entry != null && entry . placeholder == i ) { for ( String line : entry . buffer ) { ps . println ( line ) ; } entry = null ; continue ; } ps . println ( buffer . get ( i ) ) ; } } catch ( Exception e ) { throw new MojoExecutionException ( "Unexpected error while creating configuration file." , e ) ; } } | Create the xml configuration descriptor . | 225 | 6 |
8,337 | private File newSubdirectory ( File parentDirectory , String path ) { File dir = new File ( parentDirectory , path ) ; if ( ! dir . exists ( ) ) { dir . mkdirs ( ) ; } return dir ; } | Creates a new subdirectory under the specified parent directory . | 49 | 12 |
8,338 | @ Override public void destroy ( ) { shell . unregisterPlugin ( this ) ; executeAction ( PluginAction . UNLOAD , false ) ; CommandUtil . dissociateAll ( container ) ; if ( pluginEventListeners1 != null ) { pluginEventListeners1 . clear ( ) ; pluginEventListeners1 = null ; } if ( pluginEventListeners2 != null ) { executeAction ( PluginAction . UNSUBSCRIBE , false ) ; pluginEventListeners2 . clear ( ) ; pluginEventListeners2 = null ; } if ( registeredProperties != null ) { registeredProperties . clear ( ) ; registeredProperties = null ; } if ( registeredBeans != null ) { registeredBeans . clear ( ) ; registeredBeans = null ; } if ( registeredComponents != null ) { for ( BaseComponent component : registeredComponents ) { component . destroy ( ) ; } registeredComponents . clear ( ) ; registeredComponents = null ; } super . destroy ( ) ; } | Release contained resources . | 214 | 4 |
8,339 | @ Override public Object getPropertyValue ( PropertyInfo propInfo ) throws Exception { Object obj = registeredProperties == null ? null : registeredProperties . get ( propInfo . getId ( ) ) ; if ( obj instanceof PropertyProxy ) { Object value = ( ( PropertyProxy ) obj ) . getValue ( ) ; return value instanceof String ? propInfo . getPropertyType ( ) . getSerializer ( ) . deserialize ( ( String ) value ) : value ; } else { return obj == null ? null : propInfo . getPropertyValue ( obj , obj == this ) ; } } | Returns the value for a registered property . | 127 | 8 |
8,340 | @ Override public void setPropertyValue ( PropertyInfo propInfo , Object value ) throws Exception { String propId = propInfo . getId ( ) ; Object obj = registeredProperties == null ? null : registeredProperties . get ( propId ) ; if ( obj == null ) { obj = new PropertyProxy ( propInfo , value ) ; registerProperties ( obj , propId ) ; } else if ( obj instanceof PropertyProxy ) { ( ( PropertyProxy ) obj ) . setValue ( value ) ; } else { propInfo . setPropertyValue ( obj , value , obj == this ) ; } } | Sets a value for a registered property . | 128 | 9 |
8,341 | @ Override protected void updateVisibility ( boolean visible , boolean activated ) { super . updateVisibility ( visible , activated ) ; if ( registeredComponents != null ) { for ( BaseUIComponent component : registeredComponents ) { if ( ! visible ) { component . setAttribute ( Constants . ATTR_VISIBLE , component . isVisible ( ) ) ; component . setVisible ( false ) ; } else { component . setVisible ( ( Boolean ) component . getAttribute ( Constants . ATTR_VISIBLE ) ) ; } } } if ( visible ) { checkBusy ( ) ; } } | Sets the visibility of the contained resource and any registered components . | 132 | 13 |
8,342 | @ Override public void setDefinition ( PluginDefinition definition ) { super . setDefinition ( definition ) ; if ( definition != null ) { container . addClass ( "cwf-plugin-" + definition . getId ( ) ) ; shell . registerPlugin ( this ) ; } } | Sets the plugin definition the container will use to instantiate the plugin . If there is a status bean associated with the plugin it is registered with the container at this time . If there are style sheet resources associated with the plugin they will be added to the container at this time . | 59 | 56 |
8,343 | public void setBusy ( String message ) { busyMessage = message = StrUtil . formatMessage ( message ) ; if ( busyDisabled ) { busyPending = true ; } else if ( message != null ) { disableActions ( true ) ; ClientUtil . busy ( container , message ) ; busyPending = ! isVisible ( ) ; } else { disableActions ( false ) ; ClientUtil . busy ( container , null ) ; busyPending = false ; } } | If message is not null disables the plugin and displays the busy message . If message is null removes any previous message and returns the plugin to its previous state . | 105 | 32 |
8,344 | private void executeAction ( PluginAction action , boolean async , Object data ) { if ( hasListeners ( ) || action == PluginAction . LOAD ) { PluginEvent event = new PluginEvent ( this , action , data ) ; if ( async ) { EventUtil . post ( event ) ; } else { onAction ( event ) ; } } } | Notify all plugin callbacks of the specified action . | 74 | 11 |
8,345 | @ EventHandler ( "action" ) private void onAction ( PluginEvent event ) { PluginException exception = null ; PluginAction action = event . getAction ( ) ; boolean debug = log . isDebugEnabled ( ) ; if ( pluginEventListeners1 != null ) { for ( IPluginEvent listener : new ArrayList <> ( pluginEventListeners1 ) ) { try { if ( debug ) { log . debug ( "Invoking IPluginEvent.on" + WordUtils . capitalizeFully ( action . name ( ) ) + " for listener " + listener ) ; } switch ( action ) { case LOAD : listener . onLoad ( this ) ; continue ; case UNLOAD : listener . onUnload ( ) ; continue ; case ACTIVATE : listener . onActivate ( ) ; continue ; case INACTIVATE : listener . onInactivate ( ) ; continue ; } } catch ( Throwable e ) { exception = createChainedException ( action . name ( ) , e , exception ) ; } } } if ( pluginEventListeners2 != null ) { for ( IPluginEventListener listener : new ArrayList <> ( pluginEventListeners2 ) ) { try { if ( debug ) { log . debug ( "Delivering " + action . name ( ) + " event to IPluginEventListener listener " + listener ) ; } listener . onPluginEvent ( event ) ; } catch ( Throwable e ) { exception = createChainedException ( action . name ( ) , e , exception ) ; } } } if ( action == PluginAction . LOAD ) { doAfterLoad ( ) ; } if ( exception != null ) { throw exception ; } } | Notify listeners of plugin events . | 354 | 7 |
8,346 | @ EventHandler ( "command" ) private void onCommand ( CommandEvent event ) { if ( isEnabled ( ) ) { for ( BaseComponent child : container . getChildren ( ) ) { EventUtil . send ( event , child ) ; if ( event . isStopped ( ) ) { break ; } } } } | Forward command events to first level children of the container . | 67 | 11 |
8,347 | private PluginException createChainedException ( String action , Throwable newException , PluginException previousException ) { String msg = action + " event generated an error." ; log . error ( msg , newException ) ; PluginException wrapper = new PluginException ( msg , previousException == null ? newException : previousException , null ) ; wrapper . setStackTrace ( newException . getStackTrace ( ) ) ; return wrapper ; } | Creates a chained exception . | 90 | 6 |
8,348 | public void load ( ) { PluginDefinition definition = getDefinition ( ) ; if ( ! initialized && definition != null ) { BaseComponent top ; try { initialized = true ; top = container . getFirstChild ( ) ; if ( top == null ) { top = PageUtil . createPage ( definition . getUrl ( ) , container ) . get ( 0 ) ; } } catch ( Throwable e ) { container . destroyChildren ( ) ; throw createChainedException ( "Initialize" , e , null ) ; } if ( pluginControllers != null ) { for ( Object controller : pluginControllers ) { top . wireController ( controller ) ; } } findListeners ( container ) ; executeAction ( PluginAction . LOAD , true ) ; } } | Initializes a plugin if not already done . This loads the plugin s principal cwf page attaches any event listeners and sends a load event to subscribers . | 159 | 31 |
8,349 | public void addToolbarComponent ( BaseComponent component ) { if ( tbarContainer == null ) { tbarContainer = new ToolbarContainer ( ) ; shell . addToolbarComponent ( tbarContainer ) ; registerComponent ( tbarContainer ) ; } tbarContainer . addChild ( component ) ; } | Adds the specified component to the toolbar container . The component is registered to this container and will visible only when the container is active . | 64 | 26 |
8,350 | public void registerId ( String id , BaseComponent component ) { if ( ! StringUtils . isEmpty ( id ) && ! container . hasAttribute ( id ) ) { container . setAttribute ( id , component ) ; } } | Allows auto - wire to work even if component is not a child of the container . | 48 | 17 |
8,351 | public void registerListener ( IPluginEvent listener ) { if ( pluginEventListeners1 == null ) { pluginEventListeners1 = new ArrayList <> ( ) ; } if ( ! pluginEventListeners1 . contains ( listener ) ) { pluginEventListeners1 . add ( listener ) ; } } | Registers a listener for the IPluginEvent callback event . If the listener has already been registered the request is ignored . | 65 | 24 |
8,352 | public void registerListener ( IPluginEventListener listener ) { if ( pluginEventListeners2 == null ) { pluginEventListeners2 = new ArrayList <> ( ) ; } if ( ! pluginEventListeners2 . contains ( listener ) ) { pluginEventListeners2 . add ( listener ) ; listener . onPluginEvent ( new PluginEvent ( this , PluginAction . SUBSCRIBE ) ) ; } } | Registers a listener for the IPluginEventListener callback event . If the listener has already been registered the request is ignored . | 89 | 25 |
8,353 | public void unregisterListener ( IPluginEventListener listener ) { if ( pluginEventListeners2 != null && pluginEventListeners2 . contains ( listener ) ) { pluginEventListeners2 . remove ( listener ) ; listener . onPluginEvent ( new PluginEvent ( this , PluginAction . UNSUBSCRIBE ) ) ; } } | Unregisters a listener for the IPluginEvent callback event . | 72 | 13 |
8,354 | public boolean tryRegisterListener ( Object object , boolean register ) { boolean success = false ; if ( object instanceof IPluginEvent ) { if ( register ) { registerListener ( ( IPluginEvent ) object ) ; } else { unregisterListener ( ( IPluginEvent ) object ) ; } success = true ; } if ( object instanceof IPluginEventListener ) { if ( register ) { registerListener ( ( IPluginEventListener ) object ) ; } else { unregisterListener ( ( IPluginEventListener ) object ) ; } success = true ; } return success ; } | Attempts to register or unregister an object as an event listener . | 119 | 13 |
8,355 | public void tryRegisterController ( Object object ) { if ( object instanceof IPluginController ) { if ( pluginControllers == null ) { pluginControllers = new ArrayList <> ( ) ; } pluginControllers . add ( ( IPluginController ) object ) ; } } | Registers an object as a controller if it implements the IPluginController interface . | 58 | 16 |
8,356 | public void registerProperties ( Object instance , String ... propertyNames ) { for ( String propertyName : propertyNames ) { registerProperty ( instance , propertyName , true ) ; } } | Registers one or more named properties to the container . Using this a plugin can expose properties for serialization and deserialization . | 38 | 26 |
8,357 | public void registerProperty ( Object instance , String propertyName , boolean override ) { if ( registeredProperties == null ) { registeredProperties = new HashMap <> ( ) ; } if ( instance == null ) { registeredProperties . remove ( propertyName ) ; } else { Object oldInstance = registeredProperties . get ( propertyName ) ; PropertyProxy proxy = oldInstance instanceof PropertyProxy ? ( PropertyProxy ) oldInstance : null ; if ( ! override && oldInstance != null && proxy == null ) { return ; } registeredProperties . put ( propertyName , instance ) ; // If previous registrant was a property proxy, transfer its value to new registrant. if ( proxy != null ) { try { proxy . getPropertyInfo ( ) . setPropertyValue ( instance , proxy . getValue ( ) ) ; } catch ( Exception e ) { throw createChainedException ( "Register Property" , e , null ) ; } } } } | Registers a named property to the container . Using this a plugin can expose a property for serialization and deserialization . | 198 | 25 |
8,358 | public void registerBean ( String beanId , boolean isRequired ) { if ( beanId == null || beanId . isEmpty ( ) ) { return ; } Object bean = SpringUtil . getBean ( beanId ) ; if ( bean == null && isRequired ) { throw new PluginException ( "Required bean resouce not found: " + beanId ) ; } Object oldBean = getAssociatedBean ( beanId ) ; if ( bean == oldBean ) { return ; } if ( registeredBeans == null ) { registeredBeans = new HashMap <> ( ) ; } tryRegisterListener ( oldBean , false ) ; if ( bean == null ) { registeredBeans . remove ( beanId ) ; } else { registeredBeans . put ( beanId , bean ) ; tryRegisterListener ( bean , true ) ; tryRegisterController ( bean ) ; } } | Registers a helper bean with this container . | 189 | 9 |
8,359 | @ Override public void setPropertyValue ( PropertyInfo propInfo , Object value ) { setPropertyValue ( propInfo . getId ( ) , value ) ; } | Overridden to set property value in proxy s property cache . | 34 | 12 |
8,360 | public ElementBase realize ( ElementBase parent ) { if ( ! deleted && real == null ) { real = getDefinition ( ) . createElement ( parent , null , false ) ; } else if ( deleted && real != null ) { real . remove ( true ) ; real = null ; } return real ; } | Realizes the creation or destruction of the proxied object . In other words if this is a deletion operation and the proxied object exists the proxied object is removed from its parent . If this is not a deletion and the proxied object does not exist a new object is instantiated as a child to the specified parent . | 64 | 65 |
8,361 | private void syncProperties ( boolean fromReal ) { PluginDefinition def = getDefinition ( ) ; for ( PropertyInfo propInfo : def . getProperties ( ) ) { if ( fromReal ) { syncProperty ( propInfo , real , this ) ; } else { syncProperty ( propInfo , this , real ) ; } } } | Synchronizes property values between the proxy and its object . | 70 | 12 |
8,362 | @ Override public String execute ( @ SuppressWarnings ( "rawtypes" ) Map parameters , String body , RenderContext renderContext ) throws MacroException { try { return body ; } catch ( Exception e ) { return getErrorView ( "greenpepper.info.macroid" , e . getMessage ( ) ) ; } } | Confluence 2 and 3 | 72 | 5 |
8,363 | @ Override public String execute ( Map < String , String > parameters , String body , ConversionContext context ) throws MacroExecutionException { try { String xhtmlRendered = gpUtil . getWikiStyleRenderer ( ) . convertWikiToXHtml ( context . getPageContext ( ) , body ) ; LOGGER . trace ( "rendering : \n - source \n {} \n - output \n {}" , body , xhtmlRendered ) ; return xhtmlRendered ; } catch ( Exception e ) { return getErrorView ( "greenpepper.info.macroid" , e . getMessage ( ) ) ; } } | Confluence 4 + | 139 | 4 |
8,364 | private void saveLastFetchedId ( byte [ ] lastFetchedId ) { if ( lastFetchedId != null ) { rocksDbWrapper . put ( cfNameMetadata , writeOptions , keyLastFetchedId , lastFetchedId ) ; } } | Saves last - fetched - id . | 61 | 9 |
8,365 | public static HelpViewBase createView ( HelpViewer viewer , HelpViewType viewType ) { Class < ? extends HelpViewBase > viewClass = viewType == null ? null : getViewClass ( viewType ) ; if ( viewClass == null ) { return null ; } try { return viewClass . getConstructor ( HelpViewer . class , HelpViewType . class ) . newInstance ( viewer , viewType ) ; } catch ( Exception e ) { throw MiscUtil . toUnchecked ( e ) ; } } | Creates a new tab for the specified view type . | 111 | 11 |
8,366 | private static Class < ? extends HelpViewBase > getViewClass ( HelpViewType viewType ) { switch ( viewType ) { case TOC : return HelpViewContents . class ; case KEYWORD : return HelpViewIndex . class ; case INDEX : return HelpViewIndex . class ; case SEARCH : return HelpViewSearch . class ; case HISTORY : return HelpViewHistory . class ; case GLOSSARY : return HelpViewIndex . class ; default : return null ; } } | Returns the help view class that services the specified view type . For unsupported view types returns null . | 102 | 19 |
8,367 | private static int computeCapacity ( final int expectedSize ) { if ( expectedSize == 0 ) { return 1 ; } final int capacity = ( int ) InternalFastMath . ceil ( expectedSize / LOAD_FACTOR ) ; final int powerOfTwo = Integer . highestOneBit ( capacity ) ; if ( powerOfTwo == capacity ) { return capacity ; } return nextPowerOfTwo ( capacity ) ; } | Compute the capacity needed for a given size . | 88 | 10 |
8,368 | public boolean contains ( final long key ) { final int hash = hashOf ( key ) ; int index = hash & mask ; if ( contains ( key , index ) ) { return true ; } if ( states [ index ] == FREE ) { return false ; } int j = index ; for ( int perturb = perturb ( hash ) ; states [ index ] != FREE ; perturb >>= PERTURB_SHIFT ) { j = probe ( perturb , j ) ; index = j & mask ; if ( contains ( key , index ) ) { return true ; } } return false ; } | Check if a value is associated with a key . | 126 | 10 |
8,369 | private static int findInsertionIndex ( final long [ ] keys , final byte [ ] states , final long key , final int mask ) { final int hash = hashOf ( key ) ; int index = hash & mask ; if ( states [ index ] == FREE ) { return index ; } else if ( states [ index ] == FULL && keys [ index ] == key ) { return changeIndexSign ( index ) ; } int perturb = perturb ( hash ) ; int j = index ; if ( states [ index ] == FULL ) { while ( true ) { j = probe ( perturb , j ) ; index = j & mask ; perturb >>= PERTURB_SHIFT ; if ( states [ index ] != FULL || keys [ index ] == key ) { break ; } } } if ( states [ index ] == FREE ) { return index ; } else if ( states [ index ] == FULL ) { // due to the loop exit condition, // if (states[index] == FULL) then keys[index] == key return changeIndexSign ( index ) ; } final int firstRemoved = index ; while ( true ) { j = probe ( perturb , j ) ; index = j & mask ; if ( states [ index ] == FREE ) { return firstRemoved ; } else if ( states [ index ] == FULL && keys [ index ] == key ) { return changeIndexSign ( index ) ; } perturb >>= PERTURB_SHIFT ; } } | Find the index at which a key should be inserted | 310 | 10 |
8,370 | public void clear ( ) { final int capacity = keys . length ; Arrays . fill ( keys , 0 ) ; Arrays . fill ( values , 0 ) ; Arrays . fill ( states , FREE ) ; size = 0 ; mask = capacity - 1 ; count = 0 ; } | Removes all entries from the hash map . | 59 | 9 |
8,371 | private static void swap ( long [ ] values , int [ ] index , int i , int j ) { if ( i != j ) { swap ( values , i , j ) ; swap ( index , i , j ) ; numSwaps ++ ; } } | Swaps the elements at positions i and j in both the values and index array which must be the same length . | 54 | 23 |
8,372 | public static IntTuple getArgmax ( float [ ] [ ] array , float delta ) { float maxValue = Float . NEGATIVE_INFINITY ; int maxX = - 1 ; int maxY = - 1 ; float numMax = 1 ; for ( int x = 0 ; x < array . length ; x ++ ) { for ( int y = 0 ; y < array [ x ] . length ; y ++ ) { float diff = Primitives . compare ( array [ x ] [ y ] , maxValue , delta ) ; if ( diff == 0 && Prng . nextFloat ( ) < 1.0 / numMax ) { maxValue = array [ x ] [ y ] ; maxX = x ; maxY = y ; numMax ++ ; } else if ( diff > 0 ) { maxValue = array [ x ] [ y ] ; maxX = x ; maxY = y ; numMax = 1 ; } } } return new IntTuple ( maxX , maxY ) ; } | Gets the argmax breaking ties randomly . | 212 | 9 |
8,373 | public static int count ( float [ ] array , float val ) { int count = 0 ; for ( int i = 0 ; i < array . length ; i ++ ) { if ( array [ i ] == val ) { count ++ ; } } return count ; } | Gets the number of times a given value occurs in an array . | 55 | 14 |
8,374 | public static Collection < OrderedPair > sampleOrderedPairs ( int minI , int maxI , int minJ , int maxJ , double prop ) { int numI = maxI - minI ; int numJ = maxJ - minJ ; // Count the max number possible: long maxPairs = numI * numJ ; Collection < OrderedPair > samples ; if ( maxPairs < 400000000 || prop > 0.1 ) { samples = new ArrayList < OrderedPair > ( ) ; for ( int i = minI ; i < maxI ; i ++ ) { for ( int j = minJ ; j < maxJ ; j ++ ) { if ( prop >= 1.0 || Prng . nextDouble ( ) < prop ) { samples . add ( new OrderedPair ( i , j ) ) ; } } } } else { samples = new HashSet < OrderedPair > ( ) ; double numSamples = maxPairs * prop ; while ( samples . size ( ) < numSamples ) { int i = Prng . nextInt ( numI ) + minI ; int j = Prng . nextInt ( numJ ) + minJ ; samples . add ( new OrderedPair ( i , j ) ) ; } } return samples ; } | Sample with replacement ordered pairs of integers . | 279 | 8 |
8,375 | public static Collection < UnorderedPair > sampleUnorderedPairs ( int minI , int maxI , int minJ , int maxJ , double prop ) { int numI = maxI - minI ; int numJ = maxJ - minJ ; // Count the max number possible: long maxPairs = PairSampler . countUnorderedPairs ( minI , maxI , minJ , maxJ ) ; Collection < UnorderedPair > samples ; if ( maxPairs < 400000000 || prop > 0.1 ) { samples = new ArrayList < UnorderedPair > ( ) ; int min = Math . min ( minI , minJ ) ; int max = Math . max ( maxI , maxJ ) ; for ( int i = min ; i < max ; i ++ ) { for ( int j = i ; j < max ; j ++ ) { if ( ( minI <= i && i < maxI && minJ <= j && j < maxJ ) || ( minJ <= i && i < maxJ && minI <= j && j < maxI ) ) { if ( prop >= 1.0 || Prng . nextDouble ( ) < prop ) { samples . add ( new UnorderedPair ( i , j ) ) ; } } } } } else { samples = new HashSet < UnorderedPair > ( ) ; double numSamples = maxPairs * prop ; while ( samples . size ( ) < numSamples ) { int i = Prng . nextInt ( numI ) + minI ; int j = Prng . nextInt ( numJ ) + minJ ; if ( i <= j ) { // We must reject samples for which j < i, or else we would // be making pairs with i==j half as likely. samples . add ( new UnorderedPair ( i , j ) ) ; } } } return samples ; } | Sample with replacement unordered pairs of integers . | 403 | 9 |
8,376 | public void setActive ( boolean active ) { refreshListener . setActive ( active ) ; addListener . setActive ( active ) ; removeListener . setActive ( active ) ; eventManager . fireRemoteEvent ( active ? addListener . eventName : removeListener . eventName , self ) ; if ( active ) { refresh ( ) ; } } | Sets the active state . | 71 | 6 |
8,377 | public void init ( ) { if ( manifests == null ) { manifests = new ArrayList <> ( ) ; try { primaryManifest = addToList ( applicationContext . getResource ( MANIFEST_PATH ) ) ; Resource [ ] resources = applicationContext . getResources ( "classpath*:/" + MANIFEST_PATH ) ; for ( Resource resource : resources ) { Manifest manifest = addToList ( resource ) ; if ( primaryManifest == null ) { primaryManifest = manifest ; } } } catch ( Exception e ) { log . error ( "Error enumerating manifests." , e ) ; } } } | Initialize the manifest list if not already done . This is done by iterating over the class path to locate all manifest files . | 131 | 26 |
8,378 | public Manifest findByPath ( String path ) { for ( Manifest manifest : this ) { String mpath = ( ( ManifestEx ) manifest ) . path ; if ( path . startsWith ( mpath ) ) { return manifest ; } } return null ; } | Returns a manifest based on the input path . | 53 | 9 |
8,379 | private Manifest addToList ( Resource resource ) { try { if ( resource != null && resource . exists ( ) ) { Manifest manifest = new ManifestEx ( resource ) ; manifests . add ( manifest ) ; return manifest ; } } catch ( Exception e ) { log . debug ( "Exception occurred reading manifest: " + resource ) ; } return null ; } | Adds the manifest referenced by the specified resource to the list . | 73 | 12 |
8,380 | protected void putToQueue ( IQueueMessage < ID , DATA > msg ) throws QueueException . QueueIsFull { if ( ! queue . offer ( msg ) ) { throw new QueueException . QueueIsFull ( getBoundary ( ) ) ; } } | Puts a message to the queue buffer . | 57 | 9 |
8,381 | protected String getType ( String script ) { int i = script . indexOf ( ' ' ) ; return i < 0 ? "" : script . substring ( 0 , i ) ; } | Extracts the action type prefix . | 39 | 8 |
8,382 | @ Override public void setApplicationContext ( ApplicationContext applicationContext ) throws BeansException { propertyProvider = new PropertyProvider ( applicationContext ) ; conversionService = DefaultConversionService . getSharedInstance ( ) ; wireParams ( this ) ; afterInitialized ( ) ; } | Inject all annotated class members . | 57 | 8 |
8,383 | void initConfigs ( String propertiesAbsoluteClassPath ) { this . propertiesAbsoluteClassPath = propertiesAbsoluteClassPath ; this . propertiesFilePath = ResourceUtil . getAbsolutePath ( propertiesAbsoluteClassPath ) ; loadConfigs ( ) ; } | Init properties file path . Will reload configs every time . | 56 | 12 |
8,384 | protected void loadConfigs ( ) { configs = new Properties ( ) ; // If run as a jar, find in file system classpath first, if not found, then get resource in jar. if ( ClassPathUtil . testRunMainInJar ( ) ) { String [ ] classPathsInFileSystem = ClassPathUtil . getAllClassPathNotInJar ( ) ; String workDir = System . getProperty ( "user.dir" ) ; String mainJarRelativePath = ClassPathUtil . getClassPathsInSystemProperty ( ) [ 0 ] ; File mainJar = new File ( workDir , mainJarRelativePath ) ; File mainJarDir = mainJar . getParentFile ( ) ; for ( String classPath : classPathsInFileSystem ) { File classPathFile = new File ( classPath ) ; File configFile ; if ( classPathFile . isAbsolute ( ) ) { configFile = new File ( classPathFile , propertiesAbsoluteClassPath ) ; } else { configFile = new File ( new File ( mainJarDir , classPath ) , propertiesAbsoluteClassPath ) ; } if ( configFile . exists ( ) && configFile . isFile ( ) ) { InputStream is = null ; try { is = new FileInputStream ( configFile ) ; loadConfigsFromStream ( is ) ; } catch ( FileNotFoundException e ) { LOGGER . warn ( "Load config file " + configFile . getPath ( ) + " error!" , e ) ; } return ; } } } if ( propertiesFilePath == null ) { if ( propertiesAbsoluteClassPath == null ) { return ; } InputStream is = OneProperties . class . getResourceAsStream ( propertiesAbsoluteClassPath ) ; loadConfigsFromStream ( is ) ; } else { configs = PropertiesIO . load ( propertiesFilePath ) ; } } | Load properties . Will refresh configs every time . | 402 | 10 |
8,385 | protected void modifyConfig ( IConfigKey key , String value ) throws IOException { if ( propertiesFilePath == null ) { LOGGER . warn ( "Config " + propertiesAbsoluteClassPath + " is not a file, maybe just a resource in library." ) ; } if ( configs == null ) { loadConfigs ( ) ; } configs . setProperty ( key . getKeyString ( ) , value ) ; PropertiesIO . store ( propertiesFilePath , configs ) ; } | Modify one config and write new config into properties file . | 103 | 12 |
8,386 | protected boolean insertToCollection ( IQueueMessage < ID , DATA > msg ) { getCollection ( ) . insertOne ( toDocument ( msg ) ) ; return true ; } | Insert a new message to collection . | 36 | 7 |
8,387 | public T get ( final int key ) { final int hash = hashOf ( key ) ; int index = hash & mask ; if ( containsKey ( key , index ) ) { return ( T ) values [ index ] ; } if ( states [ index ] == FREE ) { return missingEntries ; } int j = index ; for ( int perturb = perturb ( hash ) ; states [ index ] != FREE ; perturb >>= PERTURB_SHIFT ) { j = probe ( perturb , j ) ; index = j & mask ; if ( containsKey ( key , index ) ) { return ( T ) values [ index ] ; } } return missingEntries ; } | Get the stored value associated with the given key | 144 | 9 |
8,388 | private T doRemove ( int index ) { keys [ index ] = 0 ; states [ index ] = REMOVED ; final Object previous = values [ index ] ; values [ index ] = missingEntries ; -- size ; ++ count ; return ( T ) previous ; } | Remove an element at specified index . | 56 | 7 |
8,389 | protected byte [ ] serialize ( IQueueMessage < ID , DATA > queueMsg ) { return queueMsg != null ? SerializationUtils . toByteArray ( queueMsg ) : null ; } | Serialize a queue message to bytes . | 41 | 8 |
8,390 | private RRBudget10Document getRRBudget10 ( ) { deleteAutoGenNarratives ( ) ; RRBudget10Document rrBudgetDocument = RRBudget10Document . Factory . newInstance ( ) ; RRBudget10 rrBudget = RRBudget10 . Factory . newInstance ( ) ; rrBudget . setFormVersion ( FormVersion . v1_1 . getVersion ( ) ) ; if ( pdDoc . getDevelopmentProposal ( ) . getApplicantOrganization ( ) != null ) { rrBudget . setDUNSID ( pdDoc . getDevelopmentProposal ( ) . getApplicantOrganization ( ) . getOrganization ( ) . getDunsNumber ( ) ) ; rrBudget . setOrganizationName ( pdDoc . getDevelopmentProposal ( ) . getApplicantOrganization ( ) . getOrganization ( ) . getOrganizationName ( ) ) ; } rrBudget . setBudgetType ( BudgetTypeDataType . PROJECT ) ; List < BudgetPeriodDto > budgetperiodList ; BudgetSummaryDto budgetSummary = null ; try { validateBudgetForForm ( pdDoc ) ; budgetperiodList = s2sBudgetCalculatorService . getBudgetPeriods ( pdDoc ) ; budgetSummary = s2sBudgetCalculatorService . getBudgetInfo ( pdDoc , budgetperiodList ) ; } catch ( S2SException e ) { LOG . error ( e . getMessage ( ) , e ) ; return rrBudgetDocument ; } rrBudget . setBudgetSummary ( getBudgetSummary ( budgetSummary ) ) ; for ( BudgetPeriodDto budgetPeriodData : budgetperiodList ) { setBudgetYearDataType ( rrBudget , budgetPeriodData ) ; } AttachedFileDataType attachedFileDataType = AttachedFileDataType . Factory . newInstance ( ) ; for ( NarrativeContract narrative : pdDoc . getDevelopmentProposal ( ) . getNarratives ( ) ) { if ( narrative . getNarrativeType ( ) . getCode ( ) != null && Integer . parseInt ( narrative . getNarrativeType ( ) . getCode ( ) ) == 132 ) { attachedFileDataType = getAttachedFileType ( narrative ) ; if ( attachedFileDataType != null ) { break ; } } } rrBudget . setBudgetJustificationAttachment ( attachedFileDataType ) ; rrBudgetDocument . setRRBudget10 ( rrBudget ) ; return rrBudgetDocument ; } | This method returns RRBudget10Document object based on proposal development document which contains the informations such as DUNSID OrganizationName BudgetType BudgetYear and BudgetSummary . | 559 | 35 |
8,391 | private IndirectCosts getIndirectCosts ( BudgetPeriodDto periodInfo ) { IndirectCosts indirectCosts = null ; if ( periodInfo != null && periodInfo . getIndirectCosts ( ) != null && periodInfo . getIndirectCosts ( ) . getIndirectCostDetails ( ) != null ) { List < IndirectCosts . IndirectCost > indirectCostList = new ArrayList <> ( ) ; int IndirectCostCount = 0 ; for ( IndirectCostDetailsDto indirectCostDetails : periodInfo . getIndirectCosts ( ) . getIndirectCostDetails ( ) ) { IndirectCosts . IndirectCost indirectCost = IndirectCosts . IndirectCost . Factory . newInstance ( ) ; if ( indirectCostDetails . getBase ( ) != null ) { indirectCost . setBase ( indirectCostDetails . getBase ( ) . bigDecimalValue ( ) ) ; } indirectCost . setCostType ( indirectCostDetails . getCostType ( ) ) ; if ( indirectCostDetails . getFunds ( ) != null ) { indirectCost . setFundRequested ( indirectCostDetails . getFunds ( ) . bigDecimalValue ( ) ) ; } if ( indirectCostDetails . getRate ( ) != null ) { indirectCost . setRate ( indirectCostDetails . getRate ( ) . bigDecimalValue ( ) ) ; } indirectCostList . add ( indirectCost ) ; IndirectCostCount ++ ; if ( IndirectCostCount == ARRAY_LIMIT_IN_SCHEMA ) { LOG . warn ( "Stopping iteration over indirect cost details because array limit in schema is only 4" ) ; break ; } } if ( IndirectCostCount > 0 ) { indirectCosts = IndirectCosts . Factory . newInstance ( ) ; IndirectCosts . IndirectCost indirectCostArray [ ] = new IndirectCosts . IndirectCost [ 0 ] ; indirectCosts . setIndirectCostArray ( indirectCostList . toArray ( indirectCostArray ) ) ; if ( periodInfo . getIndirectCosts ( ) . getTotalIndirectCosts ( ) != null ) { indirectCosts . setTotalIndirectCosts ( periodInfo . getIndirectCosts ( ) . getTotalIndirectCosts ( ) . bigDecimalValue ( ) ) ; } } } return indirectCosts ; } | This method returns IndirectCosts details such as Base CostType FundRequested Rate and TotalIndirectCosts in BudgetYearDataType based on BudgetPeriodInfo for the RRBudget10 . | 511 | 41 |
8,392 | private void setOthersForOtherDirectCosts ( OtherDirectCosts otherDirectCosts , BudgetPeriodDto periodInfo ) { if ( periodInfo != null && periodInfo . getOtherDirectCosts ( ) != null ) { for ( OtherDirectCostInfoDto otherDirectCostInfo : periodInfo . getOtherDirectCosts ( ) ) { gov . grants . apply . forms . rrBudget10V11 . BudgetYearDataType . OtherDirectCosts . Other other = otherDirectCosts . addNewOther ( ) ; if ( otherDirectCostInfo . getOtherCosts ( ) != null && otherDirectCostInfo . getOtherCosts ( ) . size ( ) > 0 ) { other . setCost ( new BigDecimal ( otherDirectCostInfo . getOtherCosts ( ) . get ( 0 ) . get ( CostConstants . KEY_COST ) ) ) ; } other . setDescription ( OTHERCOST_DESCRIPTION ) ; } } } | This method is to set Other type description and total cost OtherDirectCosts details in BudgetYearDataType based on BudgetPeriodInfo for the RRBudget10 . | 208 | 34 |
8,393 | private PostDocAssociates getPostDocAssociates ( OtherPersonnelDto otherPersonnel ) { PostDocAssociates postDocAssociates = PostDocAssociates . Factory . newInstance ( ) ; if ( otherPersonnel != null ) { postDocAssociates . setNumberOfPersonnel ( otherPersonnel . getNumberPersonnel ( ) ) ; postDocAssociates . setProjectRole ( otherPersonnel . getRole ( ) ) ; CompensationDto sectBCompType = otherPersonnel . getCompensation ( ) ; postDocAssociates . setRequestedSalary ( sectBCompType . getRequestedSalary ( ) . bigDecimalValue ( ) ) ; postDocAssociates . setFringeBenefits ( sectBCompType . getFringe ( ) . bigDecimalValue ( ) ) ; postDocAssociates . setAcademicMonths ( sectBCompType . getAcademicMonths ( ) . bigDecimalValue ( ) ) ; postDocAssociates . setCalendarMonths ( sectBCompType . getCalendarMonths ( ) . bigDecimalValue ( ) ) ; postDocAssociates . setFundsRequested ( sectBCompType . getFundsRequested ( ) . bigDecimalValue ( ) ) ; postDocAssociates . setSummerMonths ( sectBCompType . getSummerMonths ( ) . bigDecimalValue ( ) ) ; } return postDocAssociates ; } | This method gets the PostDocAssociates details ProjectRole NumberOfPersonnel Compensation based on OtherPersonnelInfo for the RRBudget10 if it is a PostDocAssociates type . | 321 | 40 |
8,394 | private GraduateStudents getGraduateStudents ( OtherPersonnelDto otherPersonnel ) { GraduateStudents graduate = GraduateStudents . Factory . newInstance ( ) ; if ( otherPersonnel != null ) { graduate . setNumberOfPersonnel ( otherPersonnel . getNumberPersonnel ( ) ) ; graduate . setProjectRole ( otherPersonnel . getRole ( ) ) ; CompensationDto sectBCompType = otherPersonnel . getCompensation ( ) ; graduate . setRequestedSalary ( sectBCompType . getRequestedSalary ( ) . bigDecimalValue ( ) ) ; graduate . setFringeBenefits ( sectBCompType . getFringe ( ) . bigDecimalValue ( ) ) ; graduate . setAcademicMonths ( sectBCompType . getAcademicMonths ( ) . bigDecimalValue ( ) ) ; graduate . setCalendarMonths ( sectBCompType . getCalendarMonths ( ) . bigDecimalValue ( ) ) ; graduate . setFundsRequested ( sectBCompType . getFundsRequested ( ) . bigDecimalValue ( ) ) ; graduate . setSummerMonths ( sectBCompType . getSummerMonths ( ) . bigDecimalValue ( ) ) ; } return graduate ; } | This method gets the GraduateStudents details ProjectRole NumberOfPersonnel Compensation based on OtherPersonnelInfo for the RRBudget10 if it is a GraduateStudents type . | 270 | 34 |
8,395 | private UndergraduateStudents getUndergraduateStudents ( OtherPersonnelDto otherPersonnel ) { UndergraduateStudents undergraduate = UndergraduateStudents . Factory . newInstance ( ) ; if ( otherPersonnel != null ) { undergraduate . setNumberOfPersonnel ( otherPersonnel . getNumberPersonnel ( ) ) ; undergraduate . setProjectRole ( otherPersonnel . getRole ( ) ) ; CompensationDto sectBCompType = otherPersonnel . getCompensation ( ) ; undergraduate . setRequestedSalary ( sectBCompType . getRequestedSalary ( ) . bigDecimalValue ( ) ) ; undergraduate . setFringeBenefits ( sectBCompType . getFringe ( ) . bigDecimalValue ( ) ) ; undergraduate . setAcademicMonths ( sectBCompType . getAcademicMonths ( ) . bigDecimalValue ( ) ) ; undergraduate . setCalendarMonths ( sectBCompType . getCalendarMonths ( ) . bigDecimalValue ( ) ) ; undergraduate . setFundsRequested ( sectBCompType . getFundsRequested ( ) . bigDecimalValue ( ) ) ; undergraduate . setSummerMonths ( sectBCompType . getSummerMonths ( ) . bigDecimalValue ( ) ) ; } return undergraduate ; } | This method is to get the UndergraduateStudents details ProjectRole NumberOfPersonnel Compensation based on OtherPersonnelInfo for the RRBudget10 if it is a UndergraduateStudents type . | 273 | 38 |
8,396 | private SecretarialClerical getSecretarialClerical ( OtherPersonnelDto otherPersonnel ) { SecretarialClerical secretarialClerical = SecretarialClerical . Factory . newInstance ( ) ; if ( otherPersonnel != null ) { secretarialClerical . setNumberOfPersonnel ( otherPersonnel . getNumberPersonnel ( ) ) ; secretarialClerical . setProjectRole ( otherPersonnel . getRole ( ) ) ; CompensationDto sectBCompType = otherPersonnel . getCompensation ( ) ; secretarialClerical . setRequestedSalary ( sectBCompType . getRequestedSalary ( ) . bigDecimalValue ( ) ) ; secretarialClerical . setFringeBenefits ( sectBCompType . getFringe ( ) . bigDecimalValue ( ) ) ; secretarialClerical . setAcademicMonths ( sectBCompType . getAcademicMonths ( ) . bigDecimalValue ( ) ) ; secretarialClerical . setCalendarMonths ( sectBCompType . getCalendarMonths ( ) . bigDecimalValue ( ) ) ; secretarialClerical . setFundsRequested ( sectBCompType . getFundsRequested ( ) . bigDecimalValue ( ) ) ; secretarialClerical . setSummerMonths ( sectBCompType . getSummerMonths ( ) . bigDecimalValue ( ) ) ; } return secretarialClerical ; } | This method is to get the SecretarialClerical details ProjectRole NumberOfPersonnel Compensation based on OtherPersonnelInfo for the RRBudget10 if it is a SecretarialClerical type . | 321 | 42 |
8,397 | private List < File > listFiles ( File file , List < File > files ) { File [ ] children = file . listFiles ( ) ; if ( children != null ) { for ( File child : children ) { files . add ( child ) ; listFiles ( child , files ) ; } } return files ; } | Recurse over entire directory subtree adding entries to the file list . | 66 | 14 |
8,398 | public static void associateCommand ( String commandName , BaseUIComponent component , IAction action ) { getCommand ( commandName , true ) . bind ( component , action ) ; } | Associates a UI component with a command and action . | 39 | 12 |
8,399 | public static void dissociateCommand ( String commandName , BaseUIComponent component ) { Command command = getCommand ( commandName , false ) ; if ( command != null ) { command . unbind ( component ) ; } } | Dissociate a UI component with a command . | 48 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.