idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
11,500 | public void configurationChanged ( ) { HashSet < Param > changedParams = new HashSet ( ) ; for ( Param param : parameters ) { if ( ! param . isStatic ( ) ) { Object oldValue = param . getValue ( ) ; readAndValidateParameter ( param ) ; if ( ! ConfigUtil . equalValues ( oldValue , param . getValue ( ) ) ) { changedParam... | notified on reload configuration event |
11,501 | private Throwable loadLib ( String _lib ) { try { System . load ( _lib ) ; return null ; } catch ( Throwable _ex ) { return _ex ; } } | Tries to load a library from the given path . Will catches exceptions and return them to the caller . Will return null if no exception has been thrown . |
11,502 | private File extractToTemp ( InputStream _fileToExtract , String _tmpName , String _fileSuffix ) throws IOException { if ( _fileToExtract == null ) { throw new IOException ( "Null stream" ) ; } File tempFile = File . createTempFile ( _tmpName , _fileSuffix ) ; tempFile . deleteOnExit ( ) ; if ( ! tempFile . exists ( ) ... | Extract the file behind InputStream _fileToExtract to the tmp - folder . |
11,503 | public void mouseReleased ( MouseEvent e ) { if ( ! hasFocus ) { return ; } boolean repaint = tabRowPainter . mouseReleased ( e ) ; if ( ! repaint ) { repaint = toolbarPainter . mouseReleased ( e ) ; } } | the event was consumed - DO NOT PAINT |
11,504 | private boolean isProxied ( HttpServletRequest httpServletRequest ) { if ( Proxy . isProxyClass ( httpServletRequest . getClass ( ) ) ) { InvocationHandler handler = Proxy . getInvocationHandler ( httpServletRequest ) ; return handler instanceof ServletRequestInvocationHandler ; } return false ; } | Check if this request is already proxied by pax wicket |
11,505 | public boolean hasRelation ( Interval interval1 , Interval interval2 ) { if ( interval1 == null || interval2 == null ) { return false ; } Long minStart1 = interval1 . getMinimumStart ( ) ; Long maxStart1 = interval1 . getMaximumStart ( ) ; Long minFinish1 = interval1 . getMinimumFinish ( ) ; Long maxFinish1 = interval1... | Determines whether the given intervals have this relation . |
11,506 | public byte [ ] transform ( String className , File file ) throws IOException , IllegalClassFormatException { try { return transform ( className , new FileInputStream ( file ) ) ; } catch ( FileNotFoundException e ) { throw new RuntimeException ( e ) ; } } | Transform a file . |
11,507 | public byte [ ] transform ( String className , InputStream is ) throws IOException , IllegalClassFormatException { try { byte [ ] classBytes = readBytes ( is ) ; return transformer . transform ( classLoader , className , null , null , classBytes ) ; } finally { if ( is != null ) { is . close ( ) ; } } } | Transform a input stream . |
11,508 | public static void writeBytes ( byte [ ] bytes , OutputStream os ) throws IOException { BufferedOutputStream bos = new BufferedOutputStream ( os ) ; ByteArrayInputStream bis = new ByteArrayInputStream ( bytes ) ; byte [ ] buf = new byte [ 1028 ] ; int len ; while ( ( len = bis . read ( buf , 0 , buf . length ) ) > - 1 ... | Helper method to write bytes to a OutputStream . |
11,509 | public void init ( final String scope ) throws InitializationException , InterruptedException { try { init ( ScopeProcessor . generateScope ( scope ) ) ; } catch ( CouldNotPerformException | NullPointerException ex ) { throw new InitializationException ( this , ex ) ; } } | Initialize the remote on a scope . |
11,510 | public void unlock ( final Object maintainer ) throws CouldNotPerformException { synchronized ( maintainerLock ) { if ( this . maintainer != null && this . maintainer != maintainer ) { throw new CouldNotPerformException ( "Could not unlock remote because it is locked by another instance!" ) ; } this . maintainer = null... | Method unlocks this instance . |
11,511 | public void addHandler ( final Handler handler , final boolean wait ) throws InterruptedException , CouldNotPerformException { try { listener . addHandler ( handler , wait ) ; } catch ( CouldNotPerformException ex ) { throw new CouldNotPerformException ( "Could not register Handler!" , ex ) ; } } | Method adds an handler to the internal rsb listener . |
11,512 | public void deactivate ( final Object maintainer ) throws InterruptedException , CouldNotPerformException , VerificationFailedException { if ( this . maintainer . equals ( maintainer ) ) { synchronized ( maintainerLock ) { unlock ( maintainer ) ; deactivate ( ) ; lock ( maintainer ) ; } } else { throw new VerificationF... | Atomic deactivate which makes sure that the maintainer stays the same . |
11,513 | private Future < M > sync ( ) { logger . debug ( "Synchronization of Remote[" + this + "] triggered..." ) ; try { validateInitialization ( ) ; try { SyncTaskCallable syncCallable = new SyncTaskCallable ( ) ; final Future < M > currentSyncTask = GlobalCachedExecutorService . submit ( syncCallable ) ; syncCallable . setR... | Method forces a server - remote data sync and returns the new acquired data . Can be useful for initial data sync or data sync after reconnection . |
11,514 | public void shutdown ( ) { try { verifyMaintainability ( ) ; } catch ( VerificationFailedException ex ) { throw new RuntimeException ( "Can not shutdown " + this + "!" , ex ) ; } this . shutdownInitiated = true ; try { dataObservable . shutdown ( ) ; } finally { try { deactivate ( ) ; } catch ( CouldNotPerformException... | This method deactivates the remote and cleans all resources . |
11,515 | private void notifyPrioritizedObservers ( final M data ) throws CouldNotPerformException { try { internalPrioritizedDataObservable . notifyObservers ( data ) ; } catch ( CouldNotPerformException ex ) { throw ex ; } finally { long newTransactionId = ( Long ) getDataField ( TransactionIdProvider . TRANSACTION_ID_FIELD_NA... | Notify all observers registered on the prioritized observable and retrieve the new transaction id . The transaction id is updated here to guarantee that the prioritized observables have been notified before transaction sync futures return . |
11,516 | public void waitForConnectionState ( final ConnectionState . State connectionState , long timeout ) throws InterruptedException , TimeoutException , CouldNotPerformException { synchronized ( connectionMonitor ) { boolean delayDetected = false ; while ( ! Thread . currentThread ( ) . isInterrupted ( ) ) { if ( this . co... | Method blocks until the remote reaches the desired connection state . In case the timeout is expired an TimeoutException will be thrown . |
11,517 | public void waitForConnectionState ( final ConnectionState . State connectionState ) throws InterruptedException , CouldNotPerformException { try { waitForConnectionState ( connectionState , 0 ) ; } catch ( TimeoutException ex ) { assert false ; } } | Method blocks until the remote reaches the desired connection state . |
11,518 | private void applyDataUpdate ( final M data ) { this . data = data ; CompletableFutureLite < M > currentSyncFuture = null ; Future < M > currentSyncTask = null ; synchronized ( syncMonitor ) { if ( syncFuture != null ) { currentSyncFuture = syncFuture ; currentSyncTask = syncTask ; syncFuture = null ; syncTask = null ;... | Method is used to internally update the data object . |
11,519 | public boolean isInValueSet ( Value value ) { if ( value == null ) { throw new IllegalArgumentException ( "value cannot be null" ) ; } boolean result = true ; if ( ! this . valuesKeySet . isEmpty ( ) ) { result = this . valuesKeySet . contains ( value ) ; } else if ( this . lowerBound != null || this . upperBound != nu... | Returns whether the specified value is in the value set . |
11,520 | public String displayName ( Value value ) { if ( value == null ) { throw new IllegalArgumentException ( "value cannot be null" ) ; } ValueSetElement vse = this . values . get ( value ) ; if ( vse != null ) { return vse . getDisplayName ( ) ; } else { return "" ; } } | Returns a display name for the specified value if one is defined . |
11,521 | public String abbrevDisplayName ( Value value ) { if ( value == null ) { throw new IllegalArgumentException ( "value cannot be null" ) ; } ValueSetElement vse = this . values . get ( value ) ; if ( vse != null ) { return vse . getAbbrevDisplayName ( ) ; } else { return "" ; } } | Returns an abbreviated display name for the specified value if one is defined . |
11,522 | public static boolean isAnyNull ( Object ... _objects ) { if ( _objects == null ) { return true ; } for ( Object obj : _objects ) { if ( obj == null ) { return true ; } } return false ; } | Checks if any of the passed in objects is null . |
11,523 | public static String isAnyFileMissing ( File ... _files ) { if ( _files == null ) { return "null" ; } for ( File obj : _files ) { if ( obj != null && ! obj . exists ( ) ) { return obj . toString ( ) ; } else if ( obj == null ) { return null ; } } return null ; } | Checks if any of the passed in files are non - existing . |
11,524 | public static boolean equalsOne ( Object _obj , Object ... _arrObj ) { if ( _obj == null || _arrObj == null ) { return false ; } for ( Object o : _arrObj ) { if ( o != null && _obj . equals ( o ) ) { return true ; } } return false ; } | Returns true if the specified object equals at least one of the specified other objects . |
11,525 | public static boolean mapContainsKeys ( Map < ? , ? > _map , Object ... _keys ) { if ( _map == null ) { return false ; } else if ( _keys == null ) { return true ; } for ( Object key : _keys ) { if ( key != null && ! _map . containsKey ( key ) ) { return false ; } } return true ; } | Checks whether a map contains all of the specified keys . |
11,526 | public static boolean startsWithAny ( String _str , String ... _startStrings ) { if ( _str == null || _startStrings == null || _startStrings . length == 0 ) { return false ; } for ( String start : _startStrings ) { if ( _str . startsWith ( start ) ) { return true ; } } return false ; } | Checks if given String starts with any of the other given parameters . |
11,527 | public void setInverseIsA ( String ... inverseIsA ) { ProtempaUtil . checkArrayForNullElement ( inverseIsA , "inverseIsA" ) ; ProtempaUtil . checkArrayForDuplicates ( inverseIsA , "inverseIsA" ) ; this . inverseIsA = inverseIsA . clone ( ) ; recalculateChildren ( ) ; } | Sets the children of this proposition definition . |
11,528 | public void reset ( ) { setDisplayName ( null ) ; setAbbreviatedDisplayName ( null ) ; setDescription ( null ) ; setInverseIsA ( ArrayUtils . EMPTY_STRING_ARRAY ) ; setTermIds ( ArrayUtils . EMPTY_STRING_ARRAY ) ; setPropertyDefinitions ( new PropertyDefinition [ ] { } ) ; setReferenceDefinitions ( new ReferenceDefinit... | Resets this proposition definition to default values . |
11,529 | Set < ElementKind > getKinds ( Element element ) { final ImmutableSet . Builder < ElementKind > kinds = ImmutableSet . builder ( ) ; if ( element . getKind ( ) == ElementKind . INTERFACE ) { kinds . add ( ElementKind . METHOD ) ; } if ( element . getKind ( ) == ElementKind . CLASS ) { kinds . add ( ElementKind . FIELD ... | Get the set of supported element kinds that make up the total set of fields for this type . |
11,530 | public String generateClause ( ) { StringBuilder wherePart = new StringBuilder ( ) ; wherePart . append ( referenceIndices . generateColumnReference ( columnSpec ) ) ; if ( not ) { wherePart . append ( " NOT" ) ; } wherePart . append ( " IN (" ) ; for ( int k = 0 ; k < elements . length ; k ++ ) { Object val = elements... | Oracle doesn t allow more than 1000 elements in an IN clause so if we want more than 1000 we create multiple IN clauses chained together by OR . |
11,531 | public Filter [ ] filterChainToArray ( ) { int length = chainLength ( ) ; Filter [ ] array = new Filter [ length ] ; Filter thisFilter = this ; for ( int i = 0 ; i < length ; i ++ ) { array [ i ] = thisFilter ; thisFilter = thisFilter . getAnd ( ) ; } return array ; } | Return an array that contains all of the filters in the chain . |
11,532 | public void handleQueryResult ( String key , List < Proposition > propositions , Map < Proposition , Set < Proposition > > forwardDerivations , Map < Proposition , Set < Proposition > > backwardDerivations , Map < UniqueId , Proposition > references ) throws QueryResultsHandlerProcessingException { Set < Proposition > ... | Writes a keys worth of data in tab delimited format optionally sorted . |
11,533 | public boolean addPrimitiveParameterId ( String paramId ) { boolean result = this . paramIds . add ( paramId ) ; if ( result ) { recalculateChildren ( ) ; } return result ; } | Adds a primitive parameter from which this abstraction is inferred . |
11,534 | public boolean removePrimitiveParameterId ( String paramId ) { boolean result = this . paramIds . remove ( paramId ) ; if ( result ) { recalculateChildren ( ) ; } return result ; } | Removes a primitive parameter from which this abstraction is inferred . |
11,535 | public Algorithm readAlgorithm ( String id ) throws AlgorithmSourceReadException { Algorithm result = null ; if ( id != null ) { if ( algorithms != null ) { result = algorithms . getAlgorithm ( id ) ; } if ( result == null ) { initializeIfNeeded ( ) ; for ( AlgorithmSourceBackend backend : getBackends ( ) ) { result = ... | Read an algorithm with the given id . |
11,536 | public Set < Algorithm > readAlgorithms ( ) throws AlgorithmSourceReadException { initializeIfNeeded ( ) ; if ( algorithms != null ) { if ( ! readAlgorithmsCalled && getBackends ( ) != null ) { for ( AlgorithmSourceBackend backend : getBackends ( ) ) { backend . readAlgorithms ( algorithms ) ; } readAlgorithmsCalled = ... | Reads all algorithms in this algorithm source . |
11,537 | public static HierarchicalConfiguration getHierarchicalConfiguration ( final Configuration configuration ) { if ( configuration instanceof CompositeConfiguration ) { final CompositeConfiguration compositeConfig = ( CompositeConfiguration ) configuration ; for ( int i = 0 ; i < compositeConfig . getNumberOfConfiguration... | returns the hierarchical part of a configuration |
11,538 | public static Configuration createCompositeConfiguration ( final Class < ? > clazz , final Configuration configuration ) { final CompositeConfiguration compositeConfiguration = new CompositeConfiguration ( ) ; final Configuration defaultConfiguration = ConfigurationFactory . getDefaultConfiguration ( ) ; if ( configura... | create a composite configuration that wraps the configuration sent by the user . this util will also load the defaultConfig . properties file loaded relative to the given clazz parameter |
11,539 | private static String getInnerMapKey ( final String key ) { final int index = key . indexOf ( "." ) ; return key . substring ( index + 1 ) ; } | create inner key map by taking what ever is after the first dot . |
11,540 | private static String stripKey ( final String key ) { int index = key . indexOf ( "." ) ; if ( index > 0 ) { return key . substring ( 0 , index ) ; } return null ; } | strip the original key by taking every thing from the start of the original key to the first dot . |
11,541 | public static boolean isHexadecimal ( String value ) { if ( value == null || value . length ( ) == 0 ) { return false ; } if ( ! HEX_REGEX_PATTERN . matcher ( value ) . matches ( ) ) { return false ; } return true ; } | return if the given string is a valid hexadecimal string |
11,542 | public boolean evaluateCondition ( ExecutionContext context ) { Value v = condition . getValue ( context ) ; return ! ( v instanceof NilValue || ( v instanceof BooleanValue && ! ( ( BooleanValue ) v ) . get ( ) ) ) ; } | Evaluates the elsif condition . |
11,543 | void grab ( KnowledgeHelper kh ) { assert kh != null : "kh cannot be null" ; assert this . kh == null : "The previous user of this copier forgot to call release!" ; if ( this . kh != null ) { LOGGER . log ( Level . WARNING , "The previous user of this copier forgot to call release. This causes a memory leak!" ) ; } thi... | Grabs this copier for use by a Drools consequence . |
11,544 | static String [ ] parsePackages ( String packages ) { if ( packages == null || packages . trim ( ) . length ( ) == 0 ) { return new String [ 0 ] ; } String [ ] commaSplit = packages . split ( "," ) ; String [ ] processPackages = new String [ commaSplit . length ] ; for ( int i = 0 ; i < commaSplit . length ; i ++ ) { p... | Split using delimiter and convert to slash notation . |
11,545 | static DetectQueryBean convert ( Collection < String > packages ) { String [ ] asArray = packages . toArray ( new String [ packages . size ( ) ] ) ; for ( int i = 0 ; i < asArray . length ; i ++ ) { asArray [ i ] = convert ( asArray [ i ] ) ; } return new DetectQueryBean ( asArray ) ; } | Convert the dot notation entity bean packages to slash notation . |
11,546 | private static String convert ( String pkg ) { pkg = pkg . trim ( ) ; if ( pkg . endsWith ( "*" ) ) { pkg = pkg . substring ( 0 , pkg . length ( ) - 1 ) ; } if ( pkg . endsWith ( ".query" ) ) { pkg = pkg . substring ( 0 , pkg . length ( ) - 6 ) ; } pkg = pkg . replace ( '.' , '/' ) ; return pkg . endsWith ( "/" ) ? pkg... | Concert package to slash notation taking into account trailing wildcard . |
11,547 | protected CloseableLockProvider getManageLock ( ) { return new CloseableLockProvider ( ) { public CloseableReadLockWrapper getCloseableReadLock ( final Object consumer ) { return getManageReadLock ( consumer ) ; } public CloseableWriteLockWrapper getCloseableWriteLock ( final Object consumer ) { return getManageWriteLo... | This method generates a closable lock provider . Be informed that the controller and all its services are directly locked and internal builder operations are queued . Therefore please release the locks after usage otherwise the overall processing pipeline is delayed . |
11,548 | public void notifyChange ( ) throws CouldNotPerformException , InterruptedException { logger . debug ( "Notify data change of " + this ) ; M newData ; manageLock . lockWrite ( this ) ; try { try { validateInitialization ( ) ; } catch ( final NotInitializedException ex ) { if ( destroyed ) { return ; } throw ex ; } newD... | Synchronize all registered remote instances about a data change . |
11,549 | public Boolean isReady ( ) { try { validateInitialization ( ) ; validateActivation ( ) ; validateMiddleware ( ) ; return true ; } catch ( InvalidStateException e ) { return false ; } } | Method returns true if this instance was initialized activated and is successfully connected to the middleware . |
11,550 | synchronized boolean removeRelation ( Interval i1 , Interval i2 ) { if ( i1 == i2 || ! containsInterval ( i1 ) || ! containsInterval ( i2 ) ) { return false ; } Object i1Start = i1 . getStart ( ) ; Object i1Finish = i1 . getFinish ( ) ; Object i2Start = i2 . getStart ( ) ; Object i2Finish = i2 . getFinish ( ) ; directe... | Remove the distance relation between two intervals if such a relation exists . |
11,551 | synchronized boolean removeInterval ( Interval i ) { calcMinDuration = null ; calcMaxDuration = null ; calcMinFinish = null ; calcMaxFinish = null ; calcMinStart = null ; calcMaxStart = null ; shortestDistancesFromTimeZeroSource = null ; shortestDistancesFromTimeZeroDestination = null ; if ( directedGraph . remove ( i ... | Remove an interval from this graph . |
11,552 | private boolean containsInterval ( Interval i ) { if ( i != null ) { return directedGraph . contains ( i . getStart ( ) ) && directedGraph . contains ( i . getFinish ( ) ) ; } else { return false ; } } | Determine if an interval is contained in this graph . |
11,553 | synchronized boolean addInterval ( Interval i ) { if ( i == null || containsInterval ( i ) || ! intervals . add ( i ) ) { return false ; } Object iStart = i . getStart ( ) ; Object iFinish = i . getFinish ( ) ; directedGraph . add ( iStart ) ; directedGraph . add ( iFinish ) ; Weight mindur = i . getSpecifiedMinimumLen... | Add an interval to this graph . |
11,554 | synchronized Weight getMinimumStart ( ) { if ( calcMinStart == null ) { Weight result = WeightFactory . NEG_INFINITY ; if ( shortestDistancesFromTimeZeroDestination == null ) { shortestDistancesFromTimeZeroDestination = BellmanFord . calcShortestDistances ( timeZero , directedGraph , BellmanFord . Mode . DESTINATION ) ... | Calculates and returns the minimum path from time zero to the start of an interval . |
11,555 | synchronized Weight getMaximumStart ( ) { if ( calcMaxStart == null ) { Weight result = WeightFactory . POS_INFINITY ; if ( shortestDistancesFromTimeZeroSource == null ) { shortestDistancesFromTimeZeroSource = BellmanFord . calcShortestDistances ( timeZero , directedGraph , BellmanFord . Mode . SOURCE ) ; if ( shortest... | Calculates and returns the maximum path from time zero to the start of an interval . |
11,556 | synchronized Weight getMinimumFinish ( ) { if ( calcMinFinish == null ) { Weight result = WeightFactory . POS_INFINITY ; if ( shortestDistancesFromTimeZeroDestination == null ) { shortestDistancesFromTimeZeroDestination = BellmanFord . calcShortestDistances ( timeZero , directedGraph , BellmanFord . Mode . DESTINATION ... | Calculates and returns the minimum path from time zero to the finish of an interval . |
11,557 | synchronized Weight getMaximumFinish ( ) { if ( calcMaxFinish == null ) { Weight result = WeightFactory . NEG_INFINITY ; if ( shortestDistancesFromTimeZeroSource == null ) { shortestDistancesFromTimeZeroSource = BellmanFord . calcShortestDistances ( timeZero , directedGraph , BellmanFord . Mode . SOURCE ) ; if ( shorte... | Calculates and returns the maximum path from time zero to the finish of an interval . |
11,558 | synchronized Weight getMaximumDuration ( ) { if ( calcMaxDuration == null ) { Weight max = WeightFactory . ZERO ; for ( int i = 0 , n = intervals . size ( ) ; i < n ; i ++ ) { Object start = intervals . get ( i ) . getStart ( ) ; Map < ? , Weight > d = BellmanFord . calcShortestDistances ( start , directedGraph , Bellm... | Calculates and returns the maximum time distance from the start of an interval to the finish of an interval . |
11,559 | synchronized Weight getMinimumDuration ( ) { if ( calcMinDuration == null ) { Weight min = WeightFactory . POS_INFINITY ; for ( int i = 0 , n = intervals . size ( ) ; i < n ; i ++ ) { Object finish = intervals . get ( i ) . getFinish ( ) ; Map < ? , Weight > d = BellmanFord . calcShortestDistances ( finish , directedGr... | Calculates and returns the minimum time distance from the start of an interval to the finish of an interval . |
11,560 | public void send ( StDatapoint datapoint ) { StDatapointValidator . validate ( datapoint ) ; sender . send ( Collections . singletonList ( datapoint ) ) ; } | Send datapoint . |
11,561 | public void send ( List < StDatapoint > datapoints ) { for ( StDatapoint metric : datapoints ) { StDatapointValidator . validate ( metric ) ; } sender . send ( datapoints ) ; } | Send datapoints list . |
11,562 | public final void addSourceListener ( SourceListener < S > listener ) { if ( listener != null ) { this . listenerList . add ( listener ) ; } } | Adds a listener that gets called whenever something changes . |
11,563 | protected void fireSourceUpdated ( S e ) { for ( int i = 0 , n = this . listenerList . size ( ) ; i < n ; i ++ ) { this . listenerList . get ( i ) . sourceUpdated ( e ) ; } } | Notifies registered listeners that the source has been updated . |
11,564 | private static void removeNonApplicableFilters ( Collection < EntitySpec > entitySpecs , Set < Filter > filtersCopy , EntitySpec entitySpec ) { Set < EntitySpec > entitySpecsSet = new HashSet < > ( ) ; Set < String > filterPropIds = new HashSet < > ( ) ; String [ ] entitySpecPropIds = entitySpec . getPropositionIds ( )... | Remove filters that are not directly applicable to the given entity spec and are not applicable to other entity specs that refer to it . |
11,565 | static boolean needsPropIdInClause ( Set < String > queryPropIds , String [ ] entitySpecPropIds ) { Set < String > entitySpecPropIdsSet = Arrays . asSet ( entitySpecPropIds ) ; List < String > filteredPropIds = new ArrayList < > ( entitySpecPropIds . length ) ; for ( String propId : queryPropIds ) { if ( entitySpecProp... | Returns whether an IN clause containing the proposition ids of interest should be added to the WHERE clause . |
11,566 | private String getVersion ( final Class launcherClass , final String groupId , final String artifactId ) throws NotAvailableException { String version = null ; try { Properties p = new Properties ( ) ; InputStream is = getClass ( ) . getResourceAsStream ( "/META-INF/maven/" + groupId + "/" + artifactId + "/pom.properti... | Method tries to detect the application Version . |
11,567 | public void init ( String strDateParam , Date dateTarget , String strLanguage ) { if ( strDateParam != null ) dateParam = strDateParam ; initComponents ( ) ; this . setName ( "JCalendarPopup" ) ; nowDate = new Date ( ) ; if ( dateTarget == null ) dateTarget = nowDate ; selectedDate = dateTarget ; if ( strLanguage != nu... | Creates new form CalendarPopup . |
11,568 | private void nextMonthActionPerformed ( ActionEvent evt ) { calendar . setTime ( targetPanelDate ) ; calendar . add ( Calendar . MONTH , 1 ) ; calendar . set ( Calendar . HOUR_OF_DAY , 12 ) ; calendar . set ( Calendar . MINUTE , 0 ) ; calendar . set ( Calendar . SECOND , 0 ) ; calendar . set ( Calendar . MILLISECOND , ... | User pressed the next month button change the calendar . |
11,569 | private void nextYearActionPerformed ( ActionEvent evt ) { calendar . setTime ( targetPanelDate ) ; calendar . add ( Calendar . YEAR , 1 ) ; calendar . set ( Calendar . HOUR_OF_DAY , 12 ) ; calendar . set ( Calendar . MINUTE , 0 ) ; calendar . set ( Calendar . SECOND , 0 ) ; calendar . set ( Calendar . MILLISECOND , 0 ... | User pressed the next year button change the calendar . |
11,570 | public Date getFirstDateInCalendar ( Date dateTarget ) { int iFirstDayOfWeek = calendar . getFirstDayOfWeek ( ) ; calendar . setTime ( dateTarget ) ; int iTargetDayOfWeek = calendar . get ( Calendar . DAY_OF_WEEK ) ; int iOffset = - Math . abs ( iTargetDayOfWeek - iFirstDayOfWeek ) ; calendar . add ( Calendar . DATE , ... | Given the first date of the calendar get the first date of that week . |
11,571 | public void mouseEntered ( MouseEvent evt ) { JLabel button = ( JLabel ) evt . getSource ( ) ; oldBorder = button . getBorder ( ) ; button . setBorder ( ROLLOVER_BORDER ) ; } | Invoked when the mouse enters a component . |
11,572 | public void mouseExited ( MouseEvent evt ) { JLabel button = ( JLabel ) evt . getSource ( ) ; button . setBorder ( oldBorder ) ; } | Invoked when the mouse exits a component . |
11,573 | private JPopupMenu getJPopupMenu ( ) { Container parent = this . getParent ( ) ; while ( parent != null ) { if ( parent instanceof JPopupMenu ) return ( JPopupMenu ) parent ; parent = parent . getParent ( ) ; } return null ; } | Get the parent popup menu . |
11,574 | public void setText ( final String text ) { this . text . setText ( text ) ; this . text . setFont ( Font . font ( this . text . getFont ( ) . getFamily ( ) , FontWeight . BOLD , size / 2 ) ) ; stack . requestLayout ( ) ; } | Method sets the text displayed next to the logo . |
11,575 | public void setSvgIcon ( final SVGIcon svgIcon ) { if ( this . svgIcon != null ) { stack . getChildren ( ) . remove ( this . svgIcon ) ; } this . svgIcon = svgIcon ; this . svgIcon . setSize ( size ) ; stack . getChildren ( ) . add ( this . svgIcon ) ; stack . requestLayout ( ) ; } | Method sets the icon to display . |
11,576 | public void setSize ( final double size ) { this . size = size ; stack . setPrefSize ( size , size ) ; text . setFont ( Font . font ( text . getFont ( ) . getFamily ( ) , FontWeight . BOLD , size / 2 ) ) ; svgIcon . setSize ( size ) ; stack . requestLayout ( ) ; } | Method can be used to set the size of this component . |
11,577 | public static < T extends TemporalProposition > List < T > getView ( List < T > params , Long minValid , Long maxValid ) { if ( params != null ) { if ( minValid == null && maxValid == null ) { return params ; } else { int min = minValid != null ? binarySearchMinStart ( params , minValid . longValue ( ) ) : 0 ; int max ... | Filters a list of temporal propositions by time . |
11,578 | public static < T extends Proposition > Map < String , List < T > > createPropositionMap ( List < T > propositions ) { Map < String , List < T > > result = new HashMap < > ( ) ; if ( propositions != null ) { for ( T prop : propositions ) { String propId = prop . getId ( ) ; List < T > ts = null ; if ( result . contains... | Divides a list of propositions up by id . |
11,579 | public Builder removeTimestamps ( final Builder builder ) { final Descriptors . Descriptor descriptorForType = builder . getDescriptorForType ( ) ; for ( final Descriptors . FieldDescriptor field : descriptorForType . getFields ( ) ) { if ( ! field . isRepeated ( ) && field . getType ( ) == Descriptors . FieldDescripto... | Recursively clear timestamp messages from a builder . For efficiency repeated fields are ignored . |
11,580 | public static < M extends MessageOrBuilder > M updateTimestampWithCurrentTime ( final M messageOrBuilder ) throws CouldNotPerformException { return updateTimestamp ( System . currentTimeMillis ( ) , messageOrBuilder ) ; } | Method updates the timestamp field of the given message with the current time . |
11,581 | public static < M extends MessageOrBuilder > M updateTimestamp ( final long milliseconds , final M messageOrBuilder ) throws CouldNotPerformException { return updateTimestamp ( milliseconds , messageOrBuilder , TimeUnit . MILLISECONDS ) ; } | Method updates the timestamp field of the given message with the given timestamp . |
11,582 | public static < M extends MessageOrBuilder > M updateTimestamp ( final long time , final M messageOrBuilder , final TimeUnit timeUnit ) throws CouldNotPerformException { long milliseconds = TimeUnit . MILLISECONDS . convert ( time , timeUnit ) ; try { if ( messageOrBuilder == null ) { throw new NotAvailableException ( ... | Method updates the timestamp field of the given message with the given time in the given timeUnit . |
11,583 | public static < M extends MessageOrBuilder > M updateTimestamp ( final long timestamp , final M messageOrBuilder , final TimeUnit timeUnit , final Logger logger ) { try { return updateTimestamp ( timestamp , messageOrBuilder , timeUnit ) ; } catch ( CouldNotPerformException ex ) { ExceptionPrinter . printHistory ( ex ,... | Method updates the timestamp field of the given message with the given timestamp . In case of an error the original message is returned . |
11,584 | public static < M extends MessageOrBuilder > M updateTimestampWithCurrentTime ( final M messageOrBuilder , final Logger logger ) { try { return updateTimestampWithCurrentTime ( messageOrBuilder ) ; } catch ( CouldNotPerformException ex ) { ExceptionPrinter . printHistory ( ex , logger ) ; return messageOrBuilder ; } } | Method updates the timestamp field of the given message with the current time . In case of an error the original message is returned . |
11,585 | public static boolean hasTimestamp ( final MessageOrBuilder messageOrBuilder ) { try { final FieldDescriptor fieldDescriptor = ProtoBufFieldProcessor . getFieldDescriptor ( messageOrBuilder , TIMESTAMP_FIELD_NAME ) ; return messageOrBuilder . hasField ( fieldDescriptor ) ; } catch ( NotAvailableException ex ) { return ... | Method return true if the given message contains a timestamp field . |
11,586 | protected final void setApplicationName ( String applicationName ) throws IllegalArgumentException { validateNotEmpty ( applicationName , "applicationName" ) ; synchronized ( this ) { properties . put ( APPLICATION_NAME , applicationName ) ; } } | Sets the application name . |
11,587 | protected final void setPageName ( String pageName ) throws IllegalArgumentException { validateNotEmpty ( pageName , "pageName" ) ; synchronized ( this ) { properties . put ( PAGE_NAME , pageName ) ; } } | Set the page name . |
11,588 | public BitcoinURI resolve ( String label , String currency , boolean validateTLSA ) throws WalletNameLookupException { String resolved ; label = label . toLowerCase ( ) ; currency = currency . toLowerCase ( ) ; if ( label . isEmpty ( ) ) { throw new WalletNameLookupException ( "Wallet Name Label Must Non-Empty" ) ; } t... | Resolve a Wallet Name |
11,589 | public BitcoinURI processWalletNameUrl ( URL url , boolean verifyTLSA ) throws WalletNameLookupException { HttpsURLConnection conn = null ; InputStream ins ; InputStreamReader isr ; BufferedReader in = null ; Certificate possibleRootCert = null ; if ( verifyTLSA ) { try { if ( ! this . tlsaValidator . validateTLSA ( ur... | Resolve a Wallet Name URL Endpoint |
11,590 | public static Component scan ( Component root , ScannerMatcher matcher ) { if ( matcher . matches ( root ) ) return root ; if ( ! ( root instanceof Container ) ) return null ; Container container = ( Container ) root ; for ( Component component : container . getComponents ( ) ) { Component found = scan ( component , ma... | Scans a component tree searching for the one which is matched by the given matcher . In case of multiple matches the firs one found is returned . |
11,591 | protected boolean isDependingOnConsistentRegistries ( ) { dependingRegistryMapLock . readLock ( ) . lock ( ) ; try { return dependingRegistryMap . keySet ( ) . stream ( ) . noneMatch ( ( registry ) -> ( ! registry . isConsistent ( ) ) ) ; } finally { dependingRegistryMapLock . readLock ( ) . unlock ( ) ; } } | If this registry depends on other registries this method can be used to tell this registry if all depending registries are consistent . |
11,592 | public void removeDependency ( final Registry registry ) throws CouldNotPerformException { if ( registry == null ) { throw new NotAvailableException ( "registry" ) ; } registryLock . writeLock ( ) . lock ( ) ; try { dependingRegistryMapLock . writeLock ( ) . lock ( ) ; try { if ( ! dependingRegistryMap . containsKey ( ... | This method allows the removal of a registered registry dependency . |
11,593 | public void removeAllDependencies ( ) { registryLock . writeLock ( ) . lock ( ) ; try { dependingRegistryMapLock . writeLock ( ) . lock ( ) ; try { List < Registry > dependingRegistryList = new ArrayList < > ( dependingRegistryMap . keySet ( ) ) ; Collections . reverse ( dependingRegistryList ) ; dependingRegistryList ... | Removal of all registered registry dependencies in the reversed order in which they where added . |
11,594 | protected final boolean notifyObservers ( ) { try { if ( registryLock . isWriteLockedByCurrentThread ( ) ) { logger . debug ( "Notification of registry[" + this + "] change skipped because of running write operations!" ) ; notificationSkipped = true ; return false ; } if ( super . notifyObservers ( entryMap ) ) { try {... | Method triggers a new registry changed notification on all observers . The notification will be skipped in case the registry is busy . But a final notification is always guaranteed . |
11,595 | public List < String > getMatchingPropIds ( String searchKey ) throws KnowledgeSourceReadException { LOGGER . log ( Level . INFO , "Searching knowledge source For search string {0}" , searchKey ) ; Set < String > searchResults = getSearchResultsFromBackend ( searchKey ) ; return new ArrayList < > ( searchResults ) ; } | Gets the proposition Definitions from each backend that match the searchKey |
11,596 | private AgentManifestReader readManifests ( ClassLoader classLoader , String path ) throws IOException { Enumeration < URL > resources = classLoader . getResources ( path ) ; while ( resources . hasMoreElements ( ) ) { URL url = resources . nextElement ( ) ; try { addResource ( url . openStream ( ) ) ; } catch ( IOExce... | Read all the specific manifest files and return the set of packages containing type query beans . |
11,597 | private void add ( String packages ) { if ( packages != null ) { String [ ] split = packages . split ( ",|;| " ) ; for ( int i = 0 ; i < split . length ; i ++ ) { String pkg = split [ i ] . trim ( ) ; if ( ! pkg . isEmpty ( ) ) { packageSet . add ( pkg ) ; } } } } | Collect each individual package splitting by delimiters . |
11,598 | public void setAsText ( final String text ) { if ( BeanUtils . isNull ( text ) ) { setValue ( null ) ; return ; } try { Object newValue = Long . valueOf ( text ) ; setValue ( newValue ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( "Failed to parse long." , e ) ; } } | Map the argument text into and Integer using Integer . valueOf . |
11,599 | public void init ( IPersistentSubscriptionStore storageService ) { Log . debug ( "init invoked" ) ; m_storageService = storageService ; if ( Log . DEBUG ) { Log . debug ( "Reloading all stored subscriptions...subscription tree before {}" , dumpTree ( ) ) ; } for ( Subscription subscription : m_storageService . retrieve... | Initialize basic store structures like the FS storage to maintain client s topics subscriptions |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.