idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
8,500 | private static InputStream getResourceAsStream ( String path ) throws IOException { if ( StringUtils . isEmpty ( path ) ) { return null ; } // first try to load as file File file = new File ( path ) ; if ( file . exists ( ) && file . isFile ( ) ) { return new FileInputStream ( file ) ; } // if not a file fallback to cl... | Tries to load the given resource as file or if no file exists as classpath resource . | 101 | 19 |
8,501 | private static String getFilenameInfo ( String path ) { if ( StringUtils . isEmpty ( path ) ) { return null ; } try { return new File ( path ) . getCanonicalPath ( ) ; } catch ( IOException ex ) { return new File ( path ) . getAbsolutePath ( ) ; } } | Generate filename info for given path for error messages . | 69 | 11 |
8,502 | public static boolean isSslKeyManagerEnabled ( HttpClientConfig config ) { return StringUtils . isNotEmpty ( config . getSslContextType ( ) ) && StringUtils . isNotEmpty ( config . getKeyManagerType ( ) ) && StringUtils . isNotEmpty ( config . getKeyStoreType ( ) ) && StringUtils . isNotEmpty ( config . getKeyStorePath... | Checks whether a SSL key store is configured . | 92 | 10 |
8,503 | public static boolean isSslTrustStoreEnbaled ( HttpClientConfig config ) { return StringUtils . isNotEmpty ( config . getSslContextType ( ) ) && StringUtils . isNotEmpty ( config . getTrustManagerType ( ) ) && StringUtils . isNotEmpty ( config . getTrustStoreType ( ) ) && StringUtils . isNotEmpty ( config . getTrustSto... | Checks whether a SSL trust store is configured . | 94 | 10 |
8,504 | public static SSLContext createDefaultSSlContext ( ) throws SSLInitializationException { try { final SSLContext sslcontext = SSLContext . getInstance ( SSL_CONTEXT_TYPE_DEFAULT ) ; sslcontext . init ( null , null , null ) ; return sslcontext ; } catch ( NoSuchAlgorithmException ex ) { throw new SSLInitializationExcepti... | Creates default SSL context . | 117 | 6 |
8,505 | private static void swap ( byte [ ] array , int i , int j ) { if ( i != j ) { byte valAtI = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = valAtI ; numSwaps ++ ; } } | Swaps the elements at positions i and j . | 60 | 10 |
8,506 | public String getUrl ( String mockupType ) { return mockupType == null ? null : mockupTypes . getProperty ( mockupType ) ; } | Returns the url given the mockup type . | 33 | 9 |
8,507 | @ Override public Iterator < String > iterator ( ) { List < String > list = new ArrayList <> ( mockupTypes . stringPropertyNames ( ) ) ; Collections . sort ( list , String . CASE_INSENSITIVE_ORDER ) ; return list . iterator ( ) ; } | Returns an alphabetically sorted iterator of recognized mockup framework types . | 63 | 13 |
8,508 | public int lookupIndex ( short value ) { for ( int i = 0 ; i < elements . length ; i ++ ) { if ( elements [ i ] == value ) { return i ; } } return - 1 ; } | Gets the index of the first element in this list with the specified value or - 1 if it is not present . | 46 | 24 |
8,509 | public static short [ ] ensureCapacity ( short [ ] elements , int size ) { if ( size > elements . length ) { short [ ] tmp = new short [ size * 2 ] ; System . arraycopy ( elements , 0 , tmp , 0 , elements . length ) ; elements = tmp ; } return elements ; } | Ensure that the array has space to contain the specified number of elements . | 67 | 15 |
8,510 | private PluginDefinition pluginById ( String id ) { PluginDefinition def = pluginRegistry . get ( id ) ; if ( def == null ) { throw new PluginException ( EXC_UNKNOWN_PLUGIN , null , null , id ) ; } return def ; } | Lookup a plugin definition by its id . Raises a runtime exception if the plugin is not found . | 57 | 21 |
8,511 | public ElementMenuItem registerMenu ( String path , String action ) { ElementMenuItem menu = getElement ( path , getDesktop ( ) . getMenubar ( ) , ElementMenuItem . class ) ; menu . setAction ( action ) ; return menu ; } | Register a menu . | 55 | 4 |
8,512 | public void registerLayout ( String path , String resource ) throws Exception { Layout layout = LayoutParser . parseResource ( resource ) ; ElementUI parent = parentFromPath ( path ) ; if ( parent != null ) { layout . materialize ( parent ) ; } } | Registers a layout at the specified path . | 54 | 9 |
8,513 | private ElementUI parentFromPath ( String path ) throws Exception { if ( TOOLBAR_PATH . equalsIgnoreCase ( path ) ) { return getDesktop ( ) . getToolbar ( ) ; } String [ ] pieces = path . split ( delim , 2 ) ; ElementTabPane tabPane = pieces . length == 0 ? null : findTabPane ( pieces [ 0 ] ) ; ElementUI parent = piece... | Returns the parent UI element based on the provided path . | 129 | 11 |
8,514 | private ElementTabPane findTabPane ( String name ) throws Exception { ElementTabView tabView = getTabView ( ) ; ElementTabPane tabPane = null ; while ( ( tabPane = tabView . getChild ( ElementTabPane . class , tabPane ) ) != null ) { if ( name . equalsIgnoreCase ( tabPane . getLabel ( ) ) ) { return tabPane ; } } tabPa... | Locate the tab with the corresponding label or create one if not found . | 133 | 15 |
8,515 | private String getDefaultPluginId ( ) { if ( defaultPluginId == null ) { try { defaultPluginId = PropertyUtil . getValue ( "CAREWEB.INITIAL.SECTION" , null ) ; if ( defaultPluginId == null ) { defaultPluginId = "" ; } } catch ( Exception e ) { defaultPluginId = "" ; } } return defaultPluginId ; } | Returns the default plugin id as a user preference . | 84 | 10 |
8,516 | public void setResources ( Resource [ ] resources ) throws IOException { clear ( ) ; for ( Resource resource : resources ) { addResource ( resource ) ; } } | Initializes the properties from a multiple resources . | 34 | 9 |
8,517 | @ Override public void afterInitialized ( BaseComponent comp ) { super . afterInitialized ( comp ) ; createLabel ( "default" ) ; getEventManager ( ) . subscribe ( EventUtil . STATUS_EVENT , this ) ; } | Creates the default pane . | 51 | 6 |
8,518 | private Label getLabel ( String pane ) { Label lbl = root . findByName ( pane , Label . class ) ; return lbl == null ? createLabel ( pane ) : lbl ; } | Returns the label associated with the named pane or creates a new one if necessary . | 42 | 16 |
8,519 | private Label createLabel ( String label ) { Pane pane = new Pane ( ) ; root . addChild ( pane ) ; Label lbl = new Label ( ) ; lbl . setName ( label ) ; pane . addChild ( lbl ) ; adjustPanes ( ) ; return lbl ; } | Create a new status pane and associated label . | 65 | 9 |
8,520 | public synchronized int addSubscriber ( String eventName , IGenericEvent < T > subscriber ) { List < IGenericEvent < T >> subscribers = getSubscribers ( eventName , true ) ; subscribers . add ( subscriber ) ; return subscribers . size ( ) ; } | Adds a subscriber to the specified event . | 57 | 8 |
8,521 | public synchronized int removeSubscriber ( String eventName , IGenericEvent < T > subscriber ) { List < IGenericEvent < T >> subscribers = getSubscribers ( eventName , false ) ; if ( subscribers != null ) { subscribers . remove ( subscriber ) ; if ( subscribers . isEmpty ( ) ) { subscriptions . remove ( eventName ) ; }... | Removes a subscriber from the specified event . | 88 | 9 |
8,522 | public boolean hasSubscribers ( String eventName , boolean exact ) { while ( ! StringUtils . isEmpty ( eventName ) ) { if ( hasSubscribers ( eventName ) ) { return true ; } else if ( exact ) { return false ; } else { eventName = stripLevel ( eventName ) ; } } return false ; } | Returns true If the event has subscribers . | 74 | 8 |
8,523 | public synchronized Iterable < IGenericEvent < T > > getSubscribers ( String eventName ) { List < IGenericEvent < T >> subscribers = getSubscribers ( eventName , false ) ; return subscribers == null ? null : new ArrayList <> ( subscribers ) ; } | Returns a thread - safe iterable for the subscriber list . | 60 | 12 |
8,524 | public void invokeCallbacks ( String eventName , T eventData ) { String name = eventName ; while ( ! StringUtils . isEmpty ( name ) ) { Iterable < IGenericEvent < T >> subscribers = getSubscribers ( name ) ; if ( subscribers != null ) { for ( IGenericEvent < T > subscriber : subscribers ) { try { if ( log . isDebugEnab... | Invokes callbacks on all subscribers of this and parent events . | 169 | 13 |
8,525 | private List < IGenericEvent < T > > getSubscribers ( String eventName , boolean canCreate ) { List < IGenericEvent < T >> subscribers = subscriptions . get ( eventName ) ; if ( subscribers == null && canCreate ) { subscribers = new LinkedList <> ( ) ; subscriptions . put ( eventName , subscribers ) ; } return subscrib... | Gets the list of subscribers associated with an event . | 78 | 11 |
8,526 | private String stripLevel ( String eventName ) { int i = eventName . lastIndexOf ( ' ' ) ; return i > 1 ? eventName . substring ( 0 , i ) : "" ; } | Strips the lowest hierarchical level from the event type . | 43 | 12 |
8,527 | public void start ( ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Executing ThreadEx [target=" + target . getClass ( ) . getName ( ) + "]" ) ; } ThreadUtil . startThread ( this . thread ) ; } | Starts the background thread . | 60 | 6 |
8,528 | protected void done ( ) { try { page . getEventQueue ( ) . queue ( event ) ; } catch ( Exception e ) { log . error ( e ) ; } } | Invoked by the background thread when it has completed the target operation even if aborted . This schedules a notification on the desktop s event thread where the requester is notified of the completion . | 37 | 37 |
8,529 | public void setAttribute ( String name , Object value ) { synchronized ( attribute ) { attribute . put ( name , value ) ; } } | Sets the named attribute to the specified value . | 28 | 10 |
8,530 | public void revertImplementation ( Page page ) { Integer previousImplementedVersion = getPreviousImplementedVersion ( page ) ; if ( previousImplementedVersion != null ) { saveImplementedVersion ( page , previousImplementedVersion ) ; savePreviousImplementedVersion ( page , null ) ; } } | Sets the implemented version to the previous implemented version . | 67 | 11 |
8,531 | public Integer getPreviousImplementedVersion ( Page page ) { ContentEntityObject entityObject = getContentEntityManager ( ) . getById ( page . getId ( ) ) ; String value = getContentPropertyManager ( ) . getStringProperty ( entityObject , PREVIOUS_IMPLEMENTED_VERSION ) ; return value == null ? null : Integer . valueOf ... | Retrieves the previous implemented version of the specification . | 82 | 11 |
8,532 | public void savePreviousImplementedVersion ( Page page , Integer version ) { String value = version != null ? String . valueOf ( version ) : null ; ContentEntityObject entityObject = getContentEntityManager ( ) . getById ( page . getId ( ) ) ; getContentPropertyManager ( ) . setStringProperty ( entityObject , PREVIOUS_... | Saves the sprecified version as the Previous implemented version | 86 | 12 |
8,533 | public boolean canBeImplemented ( Page page ) { Integer implementedVersion = getImplementedVersion ( page ) ; return implementedVersion == null || page . getVersion ( ) != implementedVersion ; } | Verifies if the specification can be Implemented . | 42 | 11 |
8,534 | public Integer getImplementedVersion ( Page page ) { ContentEntityObject entityObject = getContentEntityManager ( ) . getById ( page . getId ( ) ) ; String value = getContentPropertyManager ( ) . getStringProperty ( entityObject , IMPLEMENTED_VERSION ) ; return value == null ? null : Integer . valueOf ( value ) ; } | Retrieves the implemented version of the specification . | 77 | 10 |
8,535 | public void saveImplementedVersion ( Page page , Integer version ) { Integer previousImplementedVersion = getImplementedVersion ( page ) ; if ( previousImplementedVersion != null && version != null && previousImplementedVersion == version ) return ; if ( previousImplementedVersion != null ) savePreviousImplementedVersi... | Saves the sprecified version as the Iimplemented version | 147 | 14 |
8,536 | public boolean isImplementationDue ( Page page ) { int version = page . getVersion ( ) ; Integer implementedVersion = getImplementedVersion ( page ) ; if ( implementedVersion != null ) version = page . getVersion ( ) == implementedVersion ? implementedVersion : implementedVersion + 1 ; Date date = getPageManager ( ) . ... | Verifies if the Specification has stayed to long in the WORKING state . | 129 | 16 |
8,537 | public boolean getExecuteChildren ( Page page ) { ContentEntityObject entityObject = getContentEntityManager ( ) . getById ( page . getId ( ) ) ; String value = getContentPropertyManager ( ) . getStringProperty ( entityObject , EXECUTE_CHILDREN ) ; return value == null ? false : Boolean . valueOf ( value ) ; } | Retrieves from the page propeties the Execute childs boolean . If none registered false is returned . | 78 | 22 |
8,538 | public static Document toDocument ( BaseComponent root , String ... excludedProperties ) { try { CWF2XML instance = new CWF2XML ( excludedProperties ) ; instance . toXML ( root , instance . doc ) ; return instance . doc ; } catch ( ParserConfigurationException e ) { return null ; } } | Returns an XML document that mirrors the CWF component tree starting at the specified root . | 71 | 17 |
8,539 | public static String toXML ( BaseComponent root , String ... excludedProperties ) { return XMLUtil . toString ( toDocument ( root , excludedProperties ) ) ; } | Returns an XML - formatted string that mirrors the CWF component tree starting at the specified root . | 38 | 19 |
8,540 | private void toXML ( BaseComponent root , Node parent ) { TreeMap < String , String > properties = new TreeMap <> ( String . CASE_INSENSITIVE_ORDER ) ; Class < ? > clazz = root . getClass ( ) ; ComponentDefinition def = root . getDefinition ( ) ; String cmpname = def . getTag ( ) ; if ( def . getComponentClass ( ) != c... | Adds the root component to the XML document at the current level along with all bean properties that return String or primitive types . Then recurses over all of the root component s children . | 470 | 36 |
8,541 | private boolean isExcluded ( String name , String cmpname , String value ) { return exclude . contains ( excludeKey ( name , null , value ) ) || exclude . contains ( excludeKey ( name , cmpname , value ) ) ; } | Returns true if the property is to be excluded . | 52 | 10 |
8,542 | private String excludeKey ( String name , String cmpname , String value ) { StringBuilder sb = new StringBuilder ( cmpname == null ? "" : cmpname + "." ) ; sb . append ( name ) . append ( value == null ? "" : "=" + value ) ; return sb . toString ( ) ; } | Returns the exclusion lookup key for the property . | 74 | 9 |
8,543 | protected void putToRingBuffer ( IQueueMessage < ID , DATA > msg ) throws QueueException . QueueIsFull { if ( msg == null ) { throw new NullPointerException ( "Supplied queue message is null!" ) ; } LOCK_PUT . lock ( ) ; try { if ( ! ringBuffer . tryPublishEvent ( ( event , _seq ) -> { event . set ( msg ) ; knownPublis... | Put a message to the ring buffer . | 147 | 8 |
8,544 | protected IQueueMessage < ID , DATA > takeFromRingBuffer ( ) { LOCK_TAKE . lock ( ) ; try { long l = consumedSeq . get ( ) + 1 ; if ( l <= knownPublishedSeq ) { try { Event < ID , DATA > eventHolder = ringBuffer . get ( l ) ; try { return eventHolder . get ( ) ; } finally { eventHolder . set ( null ) ; } } finally { co... | Takes a message from the ring buffer . | 145 | 9 |
8,545 | protected void setHumanSubjectInvolvedAndVertebrateAnimalUsed ( OtherResearchTrainingPlan researchTrainingPlan ) { researchTrainingPlan . setHumanSubjectsInvolved ( YesNoDataType . N_NO ) ; researchTrainingPlan . setVertebrateAnimalsUsed ( YesNoDataType . N_NO ) ; for ( ProposalSpecialReviewContract propSpecialReview :... | This method is used to set HumanSubjectInvoved and VertebrateAnimalUsed XMLObject Data . | 182 | 20 |
8,546 | public List < Pair < A , B > > getEntries ( ) { List < Pair < A , B > > l = new ArrayList <> ( size ( ) ) ; for ( Map . Entry < A , B > x : map1 . entrySet ( ) ) l . ( new Pair <> ( x . getKey ( ) , x . getValue ( ) ) ) ; return l ; } | Returns a new List with all the entries in this bimap | 86 | 13 |
8,547 | public static void show ( DialogControl < ? > control ) { DialogResponse < ? > response = control . getLastResponse ( ) ; if ( response != null ) { control . callback ( response ) ; return ; } Window root = null ; try { Map < String , Object > args = Collections . singletonMap ( "control" , control ) ; root = ( Window ... | Display the prompt dialog . | 182 | 5 |
8,548 | public static SecurityContext getSecurityContext ( ) { Session session = ExecutionContext . getSession ( ) ; @ SuppressWarnings ( "resource" ) WebSocketSession ws = session == null ? null : session . getSocket ( ) ; return ws == null ? null : ( SecurityContext ) ws . getAttributes ( ) . get ( HttpSessionSecurityContext... | Returns the security context from the execution context . | 95 | 9 |
8,549 | @ Override public void logout ( boolean force , String target , String message ) { log . trace ( "Logging Out" ) ; IContextManager contextManager = ContextManager . getInstance ( ) ; if ( contextManager == null ) { logout ( target , message ) ; } else { contextManager . reset ( force , ( response ) - > { if ( force || ... | Logout out the current page instance . | 100 | 8 |
8,550 | protected Boolean hasPersonnelBudget ( KeyPersonDto keyPerson , int period ) { List < ? extends BudgetLineItemContract > budgetLineItemList = new ArrayList <> ( ) ; ProposalDevelopmentBudgetExtContract budget = s2SCommonBudgetService . getBudget ( pdDoc . getDevelopmentProposal ( ) ) ; budgetLineItemList = budget . get... | This method check whether the key person has a personnel budget | 238 | 11 |
8,551 | public static < T > List < DialogResponse < T > > toResponseList ( T [ ] responses , T [ ] exclusions , T dflt ) { List < DialogResponse < T >> list = new ArrayList <> ( ) ; boolean forceDefault = dflt == null && responses . length == 1 ; for ( T response : responses ) { DialogResponse < T > rsp = new DialogResponse <>... | Returns list of response objects created from a string of vertical bar delimited captions . | 142 | 17 |
8,552 | private boolean isResponseType ( String text , String label ) { return label . equals ( text ) || StrUtil . formatMessage ( label ) . equals ( text ) ; } | Returns true if the text corresponds to a specific response type . | 37 | 12 |
8,553 | public double get ( long i ) { if ( i < 0 || i >= idxAfterLast ) { return missingEntries ; } return elements [ SafeCast . safeLongToInt ( i ) ] ; } | Gets the i th entry in the vector . | 44 | 10 |
8,554 | public String getName ( ) { return getName ( hasGivenNames ( ) ? Collections . singletonList ( givenNames . get ( 0 ) ) : Collections . < String > emptyList ( ) ) ; } | Will return a standard Firstname Lastname representation of the person with middle names omitted . | 44 | 17 |
8,555 | @ Override public Resource [ ] getResources ( String pattern ) { Resource [ ] resources = cache . get ( pattern ) ; return resources == null ? internalGet ( pattern ) : resources ; } | Returns an array of resources corresponding to the specified pattern . If the pattern has not yet been cached the resources will be enumerated by the application context and stored in the cache . | 40 | 35 |
8,556 | private synchronized Resource [ ] internalGet ( String pattern ) { Resource [ ] resources = cache . get ( pattern ) ; if ( resources != null ) { return resources ; } try { resources = resolver . getResources ( pattern ) ; } catch ( IOException e ) { throw MiscUtil . toUnchecked ( e ) ; } if ( resources == null ) { reso... | Use application context to enumerate resources . This call is thread safe . | 113 | 14 |
8,557 | private void setQuestionnaireAnswers ( CoverSheet coverSheet , ProjectNarrative projectNarrative ) { List < ? extends AnswerContract > answers = getPropDevQuestionAnswerService ( ) . getQuestionnaireAnswers ( pdDoc . getDevelopmentProposal ( ) . getProposalNumber ( ) , getNamespace ( ) , getFormName ( ) ) ; for ( Answe... | Setting the Coversheet and ProjectNarrative details according the Questionnaire Answers . | 882 | 16 |
8,558 | @ JsonProperty private Map < String , Object > getMetadata ( ) { if ( metadata == null ) { metadata = new HashMap <> ( ) ; } return metadata ; } | Returns the metadata map creating it if not already so . | 39 | 11 |
8,559 | public void setMetadata ( String key , Object value ) { if ( value != null ) { getMetadata ( ) . put ( key , value ) ; } } | Sets a metadata value . | 35 | 6 |
8,560 | @ Override public List < ProposalPersonContract > getNKeyPersons ( List < ? extends ProposalPersonContract > proposalPersons , int n ) { ProposalPersonContract proposalPerson , previousProposalPerson ; int size = proposalPersons . size ( ) ; for ( int i = size - 1 ; i > 0 ; i -- ) { proposalPerson = proposalPersons . g... | This method limits the number of key persons to n returns list of key persons . | 334 | 16 |
8,561 | @ Override public ProposalPersonContract getPrincipalInvestigator ( ProposalDevelopmentDocumentContract pdDoc ) { ProposalPersonContract proposalPerson = null ; if ( pdDoc != null ) { for ( ProposalPersonContract person : pdDoc . getDevelopmentProposal ( ) . getProposalPersons ( ) ) { if ( person . isPrincipalInvestiga... | This method is to get PrincipalInvestigator from person list | 96 | 11 |
8,562 | @ Override public List < ProposalPersonContract > getCoInvestigators ( ProposalDevelopmentDocumentContract pdDoc ) { List < ProposalPersonContract > investigators = new ArrayList <> ( ) ; if ( pdDoc != null ) { for ( ProposalPersonContract person : pdDoc . getDevelopmentProposal ( ) . getProposalPersons ( ) ) { //multi... | Finds all the Investigators associated with the provided pdDoc . | 129 | 13 |
8,563 | @ Override public List < ProposalPersonContract > getKeyPersons ( ProposalDevelopmentDocumentContract pdDoc ) { List < ProposalPersonContract > keyPersons = new ArrayList <> ( ) ; if ( pdDoc != null ) { for ( ProposalPersonContract person : pdDoc . getDevelopmentProposal ( ) . getProposalPersons ( ) ) { if ( person . i... | Finds all the key Person associated with the provided pdDoc . | 111 | 14 |
8,564 | public static Window show ( String dialog , Map < String , Object > args , boolean closable , boolean sizable , boolean show , IEventListener closeListener ) { Window parent = new Window ( ) ; // Temporary parent in case materialize fails, so can cleanup. Page currentPage = ExecutionContext . getPage ( ) ; parent . set... | Can be used to popup any page definition as a modal dialog . | 302 | 14 |
8,565 | private String loadfromFromFile ( String queryName ) throws IllegalStateException { try ( final InputStream is = getClass ( ) . getResourceAsStream ( scriptsFolder + queryName + ".sql" ) ; ) { String sql = StringUtils . join ( IOUtils . readLines ( is , StandardCharsets . UTF_8 ) , IOUtils . LINE_SEPARATOR ) ; // Look ... | Loads the query from the informed path and adds to cache | 223 | 12 |
8,566 | synchronized void open ( ) throws IOException { if ( opened ) { return ; } opened = true ; CompletableFuture < Void > future = new CompletableFuture <> ( ) ; OnRegistration onRegistration = new OnRegistration ( future ) ; try { registrationId = face . registerPrefix ( prefix , this , ( OnRegisterFailed ) onRegistration... | Open the publisher registering prefixes and announcing group entry . If the publisher is already open this method immediately returns | 167 | 21 |
8,567 | private boolean initPropertyService ( ) { if ( propertyService == null && appContext . containsBean ( "propertyService" ) ) { propertyService = appContext . getBean ( "propertyService" , IPropertyService . class ) ; } return propertyService != null ; } | Initializes the property service . | 59 | 6 |
8,568 | public static < T > Stream < T > of ( Iterable < T > iterable ) { checkNotNull ( iterable ) ; return new StreamImpl < T > ( iterable ) ; } | Creates a stream from an iterable . | 41 | 9 |
8,569 | @ SafeVarargs public static < T > Stream < T > of ( T ... items ) { checkNotNull ( items ) ; return new StreamImpl < T > ( Arrays . asList ( items ) ) ; } | Creates a stream from items . | 46 | 7 |
8,570 | public static Layout parseResource ( String resource ) { int i = resource . indexOf ( ":" ) ; if ( i > 0 ) { String loaderId = resource . substring ( 0 , i ) ; ILayoutLoader layoutLoader = LayoutLoaderRegistry . getInstance ( ) . get ( loaderId ) ; if ( layoutLoader != null ) { String name = resource . substring ( i + ... | Loads a layout from the specified resource using a registered layout loader or failing that using the default loadFromUrl method . | 164 | 24 |
8,571 | public static Layout parseText ( String xml ) { try { return parseDocument ( XMLUtil . parseXMLFromString ( xml ) ) ; } catch ( Exception e ) { throw MiscUtil . toUnchecked ( e ) ; } } | Parse the layout from XML content . | 51 | 8 |
8,572 | public static Layout parseStream ( InputStream stream ) { try ( InputStream is = stream ) { return parseDocument ( XMLUtil . parseXMLFromStream ( is ) ) ; } catch ( Exception e ) { throw MiscUtil . toUnchecked ( e ) ; } } | Parse layout from an input stream . | 59 | 8 |
8,573 | public static Layout parseDocument ( Document document ) { return new Layout ( instance . parseChildren ( document , null , Tag . LAYOUT ) ) ; } | Parse the layout from an XML document . | 32 | 9 |
8,574 | private LayoutElement parseElement ( Element node , LayoutElement parent ) { LayoutElement layoutElement = newLayoutElement ( node , parent , null ) ; parseChildren ( node , layoutElement , Tag . ELEMENT , Tag . TRIGGER ) ; return layoutElement ; } | Parse a layout element node . | 55 | 7 |
8,575 | private String getRequiredAttribute ( Element node , String name ) { String value = node . getAttribute ( name ) ; if ( value . isEmpty ( ) ) { throw new IllegalArgumentException ( "Missing " + name + " attribute on node: " + node . getTagName ( ) ) ; } return value ; } | Returns the value of the named attribute from a DOM node throwing an exception if not found . | 68 | 18 |
8,576 | private void parseTrigger ( Element node , LayoutElement parent ) { LayoutTrigger trigger = new LayoutTrigger ( ) ; parent . getTriggers ( ) . add ( trigger ) ; parseChildren ( node , trigger , Tag . CONDITION , Tag . ACTION ) ; } | Parse a trigger node . | 56 | 6 |
8,577 | private void parseCondition ( Element node , LayoutTrigger parent ) { new LayoutTriggerCondition ( parent , getDefinition ( null , node ) ) ; } | Parse a trigger condition node . | 30 | 7 |
8,578 | private void parseAction ( Element node , LayoutTrigger parent ) { new LayoutTriggerAction ( parent , getDefinition ( null , node ) ) ; } | Parse a trigger action node . | 30 | 7 |
8,579 | private Tag getTag ( Element node , Tag ... tags ) { String name = node . getTagName ( ) ; String error = null ; try { Tag tag = Tag . valueOf ( name . toUpperCase ( ) ) ; int i = ArrayUtils . indexOf ( tags , tag ) ; if ( i < 0 ) { error = "Tag '%s' is not valid at this location" ; } else { if ( ! tag . allowMultiple ... | Return and validate the tag type throwing an exception if the tag is unknown or among the allowable types . | 158 | 20 |
8,580 | private LayoutRoot parseUI ( ElementBase root ) { LayoutRoot ele = new LayoutRoot ( ) ; if ( root instanceof ElementDesktop ) { copyAttributes ( root , ele ) ; } parseChildren ( root , ele ) ; return ele ; } | Parse the layout from the UI element tree . | 51 | 10 |
8,581 | private void copyAttributes ( ElementBase src , LayoutElement dest ) { for ( PropertyInfo propInfo : src . getDefinition ( ) . getProperties ( ) ) { Object value = propInfo . isSerializable ( ) ? propInfo . getPropertyValue ( src ) : null ; String val = value == null ? null : propInfo . getPropertyType ( ) . getSeriali... | Copy attributes from a UI element to layout element . | 133 | 10 |
8,582 | public static String readContent ( File file ) throws IOException { Reader input = null ; try { input = new FileReader ( file ) ; return readContent ( input ) ; } finally { closeQuietly ( input ) ; } } | Returns the content of a file as a String . | 49 | 10 |
8,583 | public static void log ( Marker marker , PerformanceMetrics metrics ) { if ( log . isDebugEnabled ( ) ) { log . debug ( marker , getEndMetrics ( metrics ) ) ; } } | Log line of measured performance of single operation specifying by performance metrics parameter . | 43 | 14 |
8,584 | public void update ( ) { boolean shouldShow = shouldShow ( ) ; if ( visible != shouldShow ) { visible = shouldShow ; BaseUIComponent target = element . getMaskTarget ( ) ; if ( visible ) { Menupopup contextMenu = ElementUI . getDesignContextMenu ( target ) ; String displayName = element . getDisplayName ( ) ; target . ... | Show or hide the design mode mask . | 103 | 8 |
8,585 | @ Override protected URL toURL ( String filename ) { try { return new File ( filename ) . toURI ( ) . toURL ( ) ; } catch ( MalformedURLException e ) { throw new IllegalArgumentException ( e ) ; } } | Returns a file URL pointing to the given file | 55 | 9 |
8,586 | public float putAndGet ( final int key , final float value ) { int index = findInsertionIndex ( key ) ; float previous = missingEntries ; boolean newMapping = true ; if ( index < 0 ) { index = changeIndexSign ( index ) ; previous = values [ index ] ; newMapping = false ; } keys [ index ] = key ; states [ index ] = FULL... | Put a value associated with a key in the map . | 125 | 11 |
8,587 | private void growTable ( ) { final int oldLength = states . length ; final int [ ] oldKeys = keys ; final float [ ] oldValues = values ; final byte [ ] oldStates = states ; final int newLength = RESIZE_MULTIPLIER * oldLength ; final int [ ] newKeys = new int [ newLength ] ; final float [ ] newValues = new float [ newLe... | Grow the tables . | 221 | 5 |
8,588 | public static < T > T newObject ( Class < T > clazz ) { return getFactory ( clazz ) . newObject ( clazz ) ; } | Creates a new instance of an object of this domain . | 33 | 12 |
8,589 | public static < T > T fetchObject ( Class < T > clazz , String id ) { return getFactory ( clazz ) . fetchObject ( clazz , id ) ; } | Fetches an object identified by its unique id from the underlying data store . | 38 | 16 |
8,590 | public static < T > List < T > fetchObjects ( Class < T > clazz , String [ ] ids ) { return getFactory ( clazz ) . fetchObjects ( clazz , ids ) ; } | Fetches multiple domain objects as specified by an array of identifier values . | 47 | 15 |
8,591 | @ SuppressWarnings ( "unchecked" ) public static < T > IDomainFactory < T > getFactory ( Class < T > clazz ) { for ( IDomainFactory < ? > factory : instance ) { String alias = factory . getAlias ( clazz ) ; if ( alias != null ) { return ( IDomainFactory < T > ) factory ; } } throw new IllegalArgumentException ( "Domain... | Returns a domain factory for the specified class . | 109 | 9 |
8,592 | public static int compare ( float a , float b , float delta ) { if ( equals ( a , b , delta ) ) { return 0 ; } return Float . compare ( a , b ) ; } | Compares two float values up to some delta . | 42 | 10 |
8,593 | public static short countCommon ( short [ ] indices1 , short [ ] indices2 ) { short numCommonIndices = 0 ; int i = 0 ; int j = 0 ; while ( i < indices1 . length && j < indices2 . length ) { if ( indices1 [ i ] < indices2 [ j ] ) { i ++ ; } else if ( indices2 [ j ] < indices1 [ i ] ) { j ++ ; } else { numCommonIndices +... | Counts the number of indices that appear in both arrays . | 162 | 12 |
8,594 | public boolean isSponsorInHierarchy ( DevelopmentProposalContract sponsorable , String sponsorHierarchy , String level1 ) { return sponsorHierarchyService . isSponsorInHierarchy ( sponsorable . getSponsor ( ) . getSponsorCode ( ) , sponsorHierarchy , 1 , level1 ) ; } | This method tests whether a document s sponsor is in a given sponsor hierarchy . | 71 | 15 |
8,595 | public Map < String , String > getSubmissionType ( ProposalDevelopmentDocumentContract pdDoc ) { Map < String , String > submissionInfo = new HashMap <> ( ) ; S2sOpportunityContract opportunity = pdDoc . getDevelopmentProposal ( ) . getS2sOpportunity ( ) ; if ( opportunity != null ) { if ( opportunity . getS2sSubmissio... | This method creates and returns Map of submission details like submission type description and Revision code | 282 | 16 |
8,596 | private RRBudgetDocument getRRBudget ( ) { deleteAutoGenNarratives ( ) ; RRBudgetDocument rrBudgetDocument = RRBudgetDocument . Factory . newInstance ( ) ; RRBudget rrBudget = RRBudget . Factory . newInstance ( ) ; rrBudget . setFormVersion ( FormVersion . v1_1 . getVersion ( ) ) ; if ( pdDoc . getDevelopmentProposal (... | This method returns RRBudgetDocument object based on proposal development document which contains the informations such as DUNSID OrganizationName BudgetType BudgetYear and BudgetSummary . | 791 | 34 |
8,597 | private BudgetYear1DataType getBudgetYear1DataType ( BudgetPeriodDto periodInfo ) { BudgetYear1DataType budgetYear = BudgetYear1DataType . Factory . newInstance ( ) ; if ( periodInfo != null ) { budgetYear . setBudgetPeriodStartDate ( s2SDateTimeService . convertDateToCalendar ( periodInfo . getStartDate ( ) ) ) ; budg... | This method gets BudgetYear1DataType details like BudgetPeriodStartDate BudgetPeriodEndDate BudgetPeriod KeyPersons OtherPersonnel TotalCompensation Equipment ParticipantTraineeSupportCosts Travel OtherDirectCosts DirectCosts IndirectCosts CognizantFederalAgency TotalCosts | 497 | 60 |
8,598 | private CumulativeEquipments getCumulativeEquipments ( BudgetSummaryDto budgetSummaryData ) { CumulativeEquipments cumulativeEquipments = CumulativeEquipments . Factory . newInstance ( ) ; if ( budgetSummaryData != null && budgetSummaryData . getCumEquipmentFunds ( ) != null ) { cumulativeEquipments . setCumulativeTota... | This method gets CumulativeEquipments information CumulativeTotalFundsRequestedEquipment based on BudgetSummaryInfo for the form RRBudget . | 118 | 30 |
8,599 | private CumulativeOtherDirect getCumulativeOtherDirect ( BudgetSummaryDto budgetSummaryData ) { CumulativeOtherDirect cumulativeOtherDirect = CumulativeOtherDirect . Factory . newInstance ( ) ; cumulativeOtherDirect . setCumulativeTotalFundsRequestedOtherDirectCosts ( BigDecimal . ZERO ) ; if ( budgetSummaryData != nul... | This method gets CumulativeOtherDirectCost details CumulativeMaterialAndSupplies CumulativePublicationCosts CumulativeConsultantServices CumulativeADPComputerServices CumulativeSubawardConsortiumContractualCosts CumulativeEquipmentFacilityRentalFees CumulativeAlterationsAndRenovations and CumulativeOther1DirectCost bas... | 578 | 81 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.