idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
11,900 | @ SuppressWarnings ( { "unchecked" } ) public static Component findByComponentType ( String id , String containerId , String componentType , int index , boolean required ) { java . awt . Container container = null ; if ( isBlank ( containerId ) ) { container = ( java . awt . Container ) currentWindow ( ) . getComponent... | Finds the first component with the given component type and stores it under the given id . The component can later be used on other commands using the locator id = ID_ASSIGNED . This method searches both VISIBLE and INVISIBLE components . |
11,901 | public void addlistener ( final ChangeListener listener ) { synchronized ( LISTENER_LOCK ) { if ( listeners . contains ( listener ) ) { LOGGER . warn ( "Skip listener registration. listener[" + listener + "] is already registered!" ) ; return ; } listeners . add ( listener ) ; } } | Registers the given listener to get informed about changes . |
11,902 | boolean hasNext ( ) throws DataSourceReadException { if ( ! hasNextComputed ) { boolean stayInLoop ; do { stayInLoop = false ; if ( i == 0 ) { this . currentMin = null ; for ( DataStreamingEvent < E > elt : this . currentElt ) { currentMin = min ( elt ) ; } } if ( currentMin == null ) { this . hasNext = false ; } else ... | We loop through the iterators passed into the constructor and return whether the the next item in at least one iterator is for the right keyId . |
11,903 | public OkVolley init ( Context context ) { this . mContext = context ; InstanceRequestQueue = newRequestQueue ( context ) ; mUserAgent = generateUserAgent ( context ) ; mRequestHeaders = new HashMap < > ( ) ; mRequestHeaders . put ( OkRequest . HEADER_USER_AGENT , mUserAgent ) ; mRequestHeaders . put ( OkRequest . HEAD... | init method please call this method in Application |
11,904 | public static String generateUserAgent ( Context context ) { StringBuilder ua = new StringBuilder ( "api-client/" ) ; ua . append ( VERSION ) ; String packageName = context . getApplicationContext ( ) . getPackageName ( ) ; ua . append ( " " ) ; ua . append ( packageName ) ; PackageInfo pi = null ; try { pi = context .... | build the default User - Agent |
11,905 | public static RequestQueue getRequestQueue ( Context context ) { if ( InstanceRequestQueue == null ) { InstanceRequestQueue = newRequestQueue ( context ) ; } return InstanceRequestQueue ; } | getRquest queue static |
11,906 | public void visit ( LowLevelAbstractionDefinition lowLevelAbstractionDefinition ) throws NoSuchAlgorithmException , AlgorithmSourceReadException { String algorithmId = lowLevelAbstractionDefinition . getAlgorithmId ( ) ; Algorithm algorithm = this . algorithmSource . readAlgorithm ( algorithmId ) ; if ( algorithm == nu... | Throws an exception if no algorithm was found for the given low level abstraction definition . |
11,907 | public void objectRetracted ( ObjectRetractedEvent ore ) { String name = ore . getPropagationContext ( ) . getRuleOrigin ( ) . getName ( ) ; if ( name . equals ( "DELETE_PROPOSITION" ) ) { Proposition prop = ( Proposition ) ore . getOldObject ( ) ; LOGGER . log ( Level . FINEST , "Deleted proposition {0}" , prop ) ; pr... | Listens for retracted propositions that were retracted as a result of another proposition coming from a data source backend with a non - null delete date . Adds them to a list that will be passed to the query results handler along with propositions that remain in working memory . |
11,908 | static boolean getConsistent ( DirectedGraph g ) { Object [ ] vertexOrdering = new Object [ g . size ( ) ] ; int voa = 0 ; for ( Iterator < ? > itr = g . iterator ( ) ; itr . hasNext ( ) ; voa ++ ) { vertexOrdering [ voa ] = itr . next ( ) ; } int vol = vertexOrdering . length ; Weight [ ] [ ] updatedEdges = new Weight... | Returns whether a directed graph is consistent . |
11,909 | public static TrustManager [ ] initializeTrustManagers ( File _trustStoreFile , String _trustStorePassword ) throws IOException { if ( _trustStoreFile == null ) { return null ; } String storeType = getStoreTypeByFileName ( _trustStoreFile ) ; boolean derEncoded = storeType == STORETYPE_DER_ENCODED ; if ( derEncoded ) {... | Initialization of trustStoreManager used to provide access to the configured trustStore . |
11,910 | public static KeyManager [ ] initializeKeyManagers ( File _keyStoreFile , String _keyStorePassword , String _keyPassword ) throws IOException { if ( _keyStoreFile == null ) { return null ; } String keyStorePwd = StringUtil . defaultIfBlank ( _keyStorePassword , System . getProperty ( "javax.net.ssl.keyStorePassword" ) ... | Initialization of keyStoreManager used to provide access to the configured keyStore . |
11,911 | protected Object findObjectSymbol ( String name , ExecutionContext context ) { CommandSymbol s = context . findSymbol ( name ) ; if ( s == null ) throw new CommandExecutionException ( "Symbol cannot be null" ) ; if ( ! ( s instanceof VarCommand ) ) throw new CommandExecutionException ( "Symbol must be a variable" ) ; V... | Finds a symbol which should wrap a Java object . |
11,912 | protected PlacementConfig verifyAndUpdatePlacement ( final String alias , final PlacementConfig placementConfig ) throws CouldNotPerformException , EntryModification { try { if ( alias == null || alias . isEmpty ( ) ) { throw new NotAvailableException ( "label" ) ; } if ( placementConfig == null ) { throw new NotAvaila... | Methods verifies and updates the transformation frame id for the given placement configuration . If the given placement configuration is up to date this the method returns null . |
11,913 | public void setProperties ( Map < String , Value > properties ) { if ( properties != null ) { this . properties = new HashMap < > ( properties ) ; } else { this . properties = null ; } } | Overrides the properties for copies made with this visitor . |
11,914 | public void setReferences ( Map < String , List < UniqueId > > references ) { if ( references != null ) { this . references = new HashMap < > ( references ) ; } else { this . references = null ; } } | Overrides the references for copies made with this visitor . |
11,915 | public List < T > filter ( final List < T > list ) throws CouldNotPerformException { beforeFilter ( ) ; return ListFilter . super . filter ( list ) ; } | Filter object from the list for which the verification fails . |
11,916 | public void log ( int level , String msg , String extra ) { if ( logLevel >= level ) { messageListener . debug ( msg + extra ) ; } } | Log some debug output . |
11,917 | private byte [ ] enhancement ( ClassLoader classLoader , byte [ ] classfileBuffer ) { ClassReader cr = new ClassReader ( classfileBuffer ) ; CLAwareClassWriter cw = new CLAwareClassWriter ( FLAGS , classLoader ) ; TypeQueryClassAdapter ca = new TypeQueryClassAdapter ( cw , enhanceContext ) ; try { cr . accept ( ca , Cl... | Perform enhancement . |
11,918 | public static boolean contains ( final Label label , final String labelString ) { final String withoutWhite = StringProcessor . removeWhiteSpaces ( labelString ) ; for ( final Label . MapFieldEntry entry : label . getEntryList ( ) ) { for ( final String value : entry . getValueList ( ) ) { if ( StringProcessor . remove... | Test if a label contains a label string . This test iterates over all languages and all label strings for the language and check if one equals the label string . The test is done ignoring the case of the label string and ignoring white spaces . |
11,919 | public static boolean isEmpty ( final Label label ) { for ( Label . MapFieldEntry entry : label . getEntryList ( ) ) { for ( String value : entry . getValueList ( ) ) { if ( ! value . isEmpty ( ) ) { return false ; } } } return true ; } | Test if the label is empty . This means that every label list for every languageCode is empty or that it only contains empty string . |
11,920 | public static Label . Builder addLabel ( final Label . Builder labelBuilder , final String languageCode , final String label ) { for ( int i = 0 ; i < labelBuilder . getEntryCount ( ) ; i ++ ) { if ( labelBuilder . getEntry ( i ) . getKey ( ) . equals ( languageCode ) ) { for ( String value : labelBuilder . getEntryBui... | Add a label to a labelBuilder by languageCode . If the label is already contained for the language code nothing will be done . If the languageCode already exists and the label is not contained it will be added to the end of the label list by this language code . If no entry for the languageCode exists a new entry will ... |
11,921 | public static String getFirstLabel ( final LabelOrBuilder label ) throws NotAvailableException { for ( Label . MapFieldEntry entry : label . getEntryList ( ) ) { for ( String value : entry . getValueList ( ) ) { return value ; } } throw new NotAvailableException ( "Label" ) ; } | Get the first label found in the label type . This is independent of the language of the label . |
11,922 | public static List < String > getLabelListByLanguage ( final String languageCode , final LabelOrBuilder label ) throws NotAvailableException { for ( Label . MapFieldEntry entry : label . getEntryList ( ) ) { if ( entry . getKey ( ) . equalsIgnoreCase ( languageCode ) ) { return entry . getValueList ( ) ; } } throw new ... | Get a list of all labels for a languageCode in a label type . This is done by iterating over all entries in the label type and checking if the key matches the languageCode . If it matches the value list is returned . Thus the returned list can be empty depending on the label . |
11,923 | public static Label . Builder replace ( final Label . Builder label , final String oldLabel , final String newLabel ) { for ( final MapFieldEntry . Builder entryBuilder : label . getEntryBuilderList ( ) ) { final List < String > valueList = new ArrayList < > ( entryBuilder . getValueList ( ) ) ; entryBuilder . clearVal... | Replace all instances of a label string in a label builder . The check for the label string which should be replaced is done ignoring the case . |
11,924 | public static Label . Builder format ( final Label . Builder label ) { for ( final MapFieldEntry . Builder entryBuilder : label . getEntryBuilderList ( ) ) { final List < String > valueList = new ArrayList < > ( entryBuilder . getValueList ( ) ) ; entryBuilder . clearValue ( ) ; for ( String value : valueList ) { entry... | Format the given label by removing duplicated white spaces underscores and camel cases in all entries . |
11,925 | public static String format ( String label ) { if ( label . isEmpty ( ) ) { return label ; } if ( Character . isDigit ( label . charAt ( label . length ( ) - 1 ) ) ) { for ( int i = label . length ( ) ; i > 0 ; i -- ) { if ( ! Character . isDigit ( label . charAt ( i - 1 ) ) ) { if ( ! Character . isLowerCase ( label .... | Format the given label by removing duplicated white spaces underscores and camel cases . |
11,926 | void addIterator ( final DataStreamingEventIterator < E > iterator ) { checkLocked ( ) ; if ( iterator == null ) { throw new NullPointerException ( "Iterator must not be null" ) ; } iteratorChain . add ( iterator ) ; } | Add an Iterator to the end of the chain |
11,927 | protected void updateCurrentIterator ( ) throws DataSourceReadException { if ( currentIterator == null ) { if ( iteratorChain . isEmpty ( ) ) { currentIterator = new EmptyDataStreamingEventIterator ( ) ; } else { currentIterator = iteratorChain . remove ( ) ; } lastUsedIterator = currentIterator ; } while ( currentIter... | Updates the current iterator field to ensure that the current Iterator is not exhausted |
11,928 | public DataStreamingEvent < E > next ( ) throws DataSourceReadException { lockChain ( ) ; updateCurrentIterator ( ) ; lastUsedIterator = currentIterator ; return currentIterator . next ( ) ; } | Returns the next Object of the current Iterator |
11,929 | public void declaration ( Writer out , char quotationMark ) throws IllegalArgumentException , NullPointerException , IOException { if ( quotationMark == '"' ) { out . write ( _declarationDoubleQuotes ) ; } else if ( quotationMark == '\'' ) { out . write ( _declarationSingleQuotes ) ; } } | Writes an XML declaration with double quotes . |
11,930 | public void whitespace ( Writer out , String s ) throws NullPointerException , InvalidXMLException , IOException { char [ ] ch = s . toCharArray ( ) ; int length = ch . length ; whitespace ( out , ch , 0 , length ) ; } | Writes the specified whitespace string . |
11,931 | public void whitespace ( Writer out , char [ ] ch , int start , int length ) throws NullPointerException , IndexOutOfBoundsException , InvalidXMLException , IOException { XMLChecker . checkS ( ch , start , length ) ; out . write ( ch , start , length ) ; } | Writes whitespace from the specified character array . |
11,932 | public void attribute ( Writer out , String name , String value , char quotationMark , boolean escapeAmpersands ) throws NullPointerException , IOException { char [ ] ch = value . toCharArray ( ) ; int length = ch . length ; int start = 0 ; int end = start + length ; int lastEscaped = 0 ; boolean useQuote ; if ( quotat... | Writes an attribute assignment . |
11,933 | public boolean setRelation ( TemporalExtendedPropositionDefinition lhsDef , TemporalExtendedPropositionDefinition rhsDef , Relation relation ) { if ( lhsDef == null || rhsDef == null || relation == null ) { return false ; } if ( ! defs . contains ( lhsDef ) || ! defs . contains ( rhsDef ) ) { return false ; } List < Te... | Sets the relation between the two temporal extended proposition definitions . |
11,934 | public boolean removeRelation ( TemporalExtendedPropositionDefinition lhsRule , TemporalExtendedPropositionDefinition rhsRule ) { List < TemporalExtendedPropositionDefinition > key = Arrays . asList ( lhsRule , rhsRule ) ; if ( defPairsMap . remove ( key ) != null ) { return true ; } else { return false ; } } | Removes a relation between two temporal extended proposition definitions . |
11,935 | public boolean add ( ExtendedPropositionDefinition def ) { if ( def != null && this . defs . add ( def ) ) { this . defsAsListOutdated = true ; recalculateChildren ( ) ; return true ; } else { return false ; } } | Adds an extended proposition definition . |
11,936 | public Relation getRelation ( TemporalExtendedPropositionDefinition lhsDef , TemporalExtendedPropositionDefinition rhsDef ) { return this . defPairsMap . get ( Arrays . asList ( lhsDef , rhsDef ) ) ; } | Gets the relation between two temporal extended proposition definitions . |
11,937 | public boolean removeAllRelations ( TemporalExtendedPropositionDefinition def ) { for ( Iterator < List < TemporalExtendedPropositionDefinition > > itr = this . defPairsMap . keySet ( ) . iterator ( ) ; itr . hasNext ( ) ; ) { List < TemporalExtendedPropositionDefinition > pair = itr . next ( ) ; if ( pair . get ( 0 ) ... | Removes all relations involving a temporal extended proposition definition . |
11,938 | public boolean remove ( ExtendedPropositionDefinition def ) { if ( def instanceof TemporalExtendedPropositionDefinition ) { if ( removeAllRelations ( ( TemporalExtendedPropositionDefinition ) def ) ) { return true ; } else { return false ; } } boolean result = defs . remove ( def ) ; if ( result ) { recalculateChildren... | Removes an extended proposition definition and all relations involving it . |
11,939 | public void readWriteElement ( String tagName ) throws WLFormatException { try { while ( xmlEventReader . hasNext ( ) ) { XMLEvent event = xmlEventReader . nextEvent ( ) ; switch ( event . getEventType ( ) ) { case XMLStreamConstants . END_ELEMENT : add ( event ) ; if ( event . asEndElement ( ) . getName ( ) . getLocal... | postcondition read pointer is just after the end of the tag with the local name tagName |
11,940 | public void readWriteUpToStartElement ( String startTag ) throws XMLStreamException { boolean startTagIsNext = false ; while ( xmlEventReader . hasNext ( ) && ! startTagIsNext ) { XMLEvent peekedEvent = xmlEventReader . peek ( ) ; switch ( peekedEvent . getEventType ( ) ) { case XMLStreamConstants . START_ELEMENT : Str... | postcondition read pointer is just before the start of the tag with the local name startTag |
11,941 | public void init ( final Class < ? extends State > stateClass ) throws InitializationException { try { currentState = getState ( stateClass ) ; change . firePropertyChange ( STATE_CHANGE , null , currentState . getClass ( ) ) ; } catch ( NotAvailableException ex ) { throw new InitializationException ( this , ex ) ; } } | Defines the initial state of the state machine . |
11,942 | public synchronized void run ( ) { LOGGER . info ( "run " + currentState . getClass ( ) . getSimpleName ( ) + "..." ) ; if ( currentState == null ) { throw new IllegalStateException ( "No initial state defined." ) ; } while ( currentState != null ) { LOGGER . debug ( "execute " + currentState ) ; final Class < ? extend... | Method starts the state machine . Because this class is implementing the runnable interface its not recommended to call this method manually . Start the state machine via the global executor service . |
11,943 | private State getState ( final Class < ? extends State > stateClass ) throws NotAvailableException { if ( ! stateMap . containsKey ( stateClass ) ) { try { final State state ; try { state = stateClass . getConstructor ( ) . newInstance ( ) ; } catch ( IllegalAccessException | IllegalArgumentException | InstantiationExc... | Method loads the state referred by the state class . |
11,944 | public ValueComparator compare ( Value d2 ) { if ( d2 == null ) { return ValueComparator . NOT_EQUAL_TO ; } switch ( d2 . getType ( ) ) { case NUMBERVALUE : NumberValue otherVal = ( NumberValue ) d2 ; int valComp = val . compareTo ( otherVal ) ; switch ( this . comp ) { case EQUAL_TO : return valComp > 0 ? ValueCompara... | Compares this value and another numerically or checks this value for membership in a value list . |
11,945 | public void clear ( ) { vertices . clear ( ) ; vertexModCount ++ ; Arrays . matrixFill ( edges , null ) ; edgeCount = 0 ; edgesArr = null ; edgeModCount ++ ; freeList . clear ( ) ; for ( int row = capacity - 1 ; row >= 0 ; row -- ) { freeList . add ( row ) ; } } | Remove all vertices and edges . |
11,946 | public void add ( Object vertex ) { if ( vertex == null || vertices . containsKey ( vertex ) ) { return ; } checkGraphSize ( ) ; vertices . put ( vertex , new VertexMetadata ( freeList . removeFirst ( ) ) ) ; vertexModCount ++ ; } | Adds a vertex . |
11,947 | public Object remove ( Object vertex ) { VertexMetadata vm = ( VertexMetadata ) vertices . get ( vertex ) ; if ( vm == null ) { return null ; } vertices . remove ( vertex ) ; vertexModCount ++ ; int index = vm . index ; for ( int row = 0 ; row < capacity ; row ++ ) { edges [ row ] [ index ] = null ; edges [ index ] [ r... | Remove a vertex and all edges between the vertex and other vertices . |
11,948 | public static boolean isEmpty ( final MultiLanguageText multiLanguageText ) { for ( MultiLanguageText . MapFieldEntry entry : multiLanguageText . getEntryList ( ) ) { if ( ! entry . getValue ( ) . isEmpty ( ) ) { return false ; } } return true ; } | Test if the multiLanguageText is empty . This means that every multiLanguageText list for every languageCode is empty or that it only contains empty string . |
11,949 | public static MultiLanguageText . Builder addMultiLanguageText ( final MultiLanguageText . Builder multiLanguageTextBuilder , final String languageCode , final String multiLanguageText ) { for ( int i = 0 ; i < multiLanguageTextBuilder . getEntryCount ( ) ; i ++ ) { if ( multiLanguageTextBuilder . getEntry ( i ) . getK... | Add a multiLanguageText to a multiLanguageTextBuilder by languageCode . If the multiLanguageText is already contained for the language code nothing will be done . If the languageCode already exists and the multiLanguageText is not contained it will be added to the end of the multiLanguageText list by this language code... |
11,950 | public static String getFirstMultiLanguageText ( final MultiLanguageTextOrBuilder multiLanguageText ) throws NotAvailableException { for ( MultiLanguageText . MapFieldEntry entry : multiLanguageText . getEntryList ( ) ) { return entry . getValue ( ) ; } throw new NotAvailableException ( "MultiLanguageText" ) ; } | Get the first multiLanguageText found in the multiLanguageText type . This is independent of the language of the multiLanguageText . |
11,951 | public static String getMultiLanguageTextByLanguage ( final String languageCode , final MultiLanguageTextOrBuilder multiLanguageText ) throws NotAvailableException { for ( MultiLanguageText . MapFieldEntry entry : multiLanguageText . getEntryList ( ) ) { if ( entry . getKey ( ) . equalsIgnoreCase ( languageCode ) ) { r... | Get the multiLanguageText for a languageCode in a multiLanguageText type . This is done by checking if the key matches the languageCode . If it matches the value list is returned . Thus the returned list can be empty depending on the multiLanguageText . |
11,952 | public static MultiLanguageText . Builder format ( final MultiLanguageText . Builder multiLanguageText ) { for ( final MapFieldEntry . Builder entryBuilder : multiLanguageText . getEntryBuilderList ( ) ) { final String value = entryBuilder . getValue ( ) ; entryBuilder . clearValue ( ) ; entryBuilder . setValue ( forma... | Format the given multiLanguageText by removing duplicated white spaces underscores and camel cases in all entries . |
11,953 | public static String format ( String multiLanguageText ) { if ( multiLanguageText . isEmpty ( ) ) { return multiLanguageText ; } if ( Character . isDigit ( multiLanguageText . charAt ( multiLanguageText . length ( ) - 1 ) ) ) { for ( int i = multiLanguageText . length ( ) ; i > 0 ; i -- ) { if ( ! Character . isDigit (... | Format the given multiLanguageText by removing duplicated white spaces underscores and camel cases . |
11,954 | public void setSubContexts ( String [ ] subContextOf ) { if ( subContextOf == null ) { this . subContexts = StringUtils . EMPTY_STRING_ARRAY ; } else { ProtempaUtil . checkArrayForNullElement ( subContextOf , "subContextOf" ) ; ProtempaUtil . checkArrayForDuplicates ( subContextOf , "subContextOf" ) ; this . subContext... | Sets the ids of other context definitions that together with this one have a specific meaning when their intervals intersect . |
11,955 | String decrypt ( String str ) throws DecryptException { if ( str == null ) { return null ; } try { initCiphers ( ) ; byte [ ] ciphertext = Base64 . decodeBase64 ( str ) ; byte [ ] cleartext = this . decryptCipher . doFinal ( ciphertext ) ; return new String ( cleartext ) ; } catch ( NoSuchAlgorithmException | NoSuchPad... | Decrypts the provided hex string . This method converts a hex string to a byte array and passes the array to a decryption cipher . If an exception is thrown this instance may no longer be usable . |
11,956 | public Interval getInstance ( Long start , Granularity startGran , Long finish , Granularity finishGran ) { List < Object > key = Arrays . asList ( new Object [ ] { start , startGran , finish , finishGran } ) ; Interval result ; synchronized ( cache ) { result = cache . get ( key ) ; if ( result == null ) { if ( start ... | Returns at interval specified by the given start and finish and granularities . |
11,957 | static boolean find ( Map < List < TemporalExtendedPropositionDefinition > , Relation > epdToRelation , List < List < TemporalExtendedPropositionDefinition > > epdPairs , Map < TemporalExtendedPropositionDefinition , TemporalProposition > potentialInstance ) { for ( List < TemporalExtendedPropositionDefinition > tepd :... | Determines if a list of abstract parameters satisfies a complex abstraction definition . |
11,958 | public void setRoles ( List < RoleEntity > inRoles ) { if ( inRoles == null ) { this . roles = new ArrayList < > ( ) ; } else { this . roles = new ArrayList < > ( inRoles ) ; } this . roles = inRoles ; } | Set the roles assigned to the current user . |
11,959 | private void publish2Subscribers ( String topic , AbstractMessage . QOSType qos , ByteBuffer origMessage , boolean retain , Integer messageID ) { Log . trace ( "publish2Subscribers republishing to existing subscribers that matches the topic {}" , topic ) ; if ( Log . DEBUG ) { Log . trace ( "content <{}>" , DebugUtils ... | Flood the subscribers with the message to notify . MessageID is optional and should only used for QoS 1 and 2 |
11,960 | void processPubRel ( String clientID , int messageID ) { Log . trace ( "PUB --PUBREL , clientID , messageID ) ; String publishKey = String . format ( "%s%d" , clientID , messageID ) ; PublishEvent evt = m_storageService . retrieveQoS2Message ( publishKey ) ; final String topic = evt . getTopic ( ) ; final AbstractMessa... | Second phase of a publish QoS2 protocol sent by publisher to the broker . Search the stored message and publish to all interested subscribers . |
11,961 | void processUnsubscribe ( ServerChannel session , String clientID , List < String > topics , int messageID ) { Log . trace ( "processUnsubscribe invoked, removing subscription on topics {}, for clientID <{}>" , topics , clientID ) ; for ( String topic : topics ) { subscriptions . removeSubscription ( topic , clientID )... | Remove the clientID from topic subscription if not previously subscribed doesn t reply any error |
11,962 | public List < InetAddress > getSystemDNSServers ( ) { List < InetAddress > dnsServers = new ArrayList < InetAddress > ( ) ; ResolverConfig resolverConfig = new ResolverConfig ( ) ; try { for ( String dnsHostIp : resolverConfig . servers ( ) ) { if ( dnsHostIp . equals ( "" ) ) continue ; dnsServers . add ( InetAddress ... | Get System DNS Servers |
11,963 | public final static void main ( String [ ] args ) throws IOException { Writer writer = new OutputStreamWriter ( System . out , "utf-8" ) ; XMLOutputter outputter = new XMLOutputter ( writer , "iso-8859-1" ) ; writeXML ( outputter ) ; System . out . println ( ) ; System . out . println ( ) ; outputter . reset ( writer ,... | Main function . |
11,964 | protected void fireBackendUpdated ( E e ) { for ( int i = 0 , n = this . listenerList . size ( ) ; i < n ; i ++ ) { this . listenerList . get ( i ) . backendUpdated ( e ) ; } } | Notifies all registered listeners when the backend has been updated . |
11,965 | protected void fireUnrecoverableError ( UnrecoverableBackendErrorEvent e ) { for ( int i = 0 , n = this . listenerList . size ( ) ; i < n ; i ++ ) { this . listenerList . get ( i ) . unrecoverableErrorOccurred ( e ) ; } } | Notifies all registered listeners when an unrecoverable error has occurred in a backend . |
11,966 | public final void register ( ) { synchronized ( lock ) { if ( serviceRegistration == null ) { BundleClassResolver resolver = new BundleClassResolver ( ) ; serviceRegistration = bundleContext . registerService ( SERVICE_NAMES , resolver , serviceProperties ) ; } } } | Register class resolver . |
11,967 | @ SuppressWarnings ( "unchecked" ) protected Project initProject ( ) { Collection errors = new ArrayList ( ) ; String projectFilePathOrURI = getProjectIdentifier ( ) ; return new Project ( projectFilePathOrURI , errors ) ; } | Opens the project specified by the file path or URI given in the constructor . |
11,968 | public static void printAllStackTraces ( final String filter , final Logger logger , final LogLevel logLevel ) { for ( Map . Entry < Thread , StackTraceElement [ ] > entry : Thread . getAllStackTraces ( ) . entrySet ( ) ) { if ( filter == null || entry . getKey ( ) . getName ( ) . contains ( filter ) ) { StackTracePrin... | Method prints the stack traces of all running java threads via the given logger . |
11,969 | public void initialize ( BackendInstanceSpec config ) throws BackendInitializationException { super . initialize ( config ) ; if ( this . mappingsFactory == null ) { setMappingsFactory ( null ) ; } this . relationalDatabaseSpecBuilder = createRelationalDatabaseSpecBuilder ( ) ; } | Collects the database connection information specified in this backend s configuration and uses it to try and get a SQL generator with which to generate database queries . |
11,970 | public GranularityFactory getGranularityFactory ( ) throws DataSourceReadException { initializeIfNeeded ( ) ; GranularityFactory result = null ; DataSourceBackend b = null ; for ( DataSourceBackend backend : getBackends ( ) ) { result = backend . getGranularityFactory ( ) ; b = backend ; break ; } assert result != null... | Returns an object for accessing the granularity of returned data from the schema adaptor for this data source . |
11,971 | public UnitFactory getUnitFactory ( ) throws DataSourceReadException { initializeIfNeeded ( ) ; UnitFactory result = null ; DataSourceBackend b = null ; for ( DataSourceBackend backend : getBackends ( ) ) { result = backend . getUnitFactory ( ) ; b = backend ; break ; } assert result != null : "no unit factory returned... | Returns the length units of returned data from this data source . |
11,972 | boolean getMatches ( Proposition proposition , Collection < String > propIds ) throws KnowledgeSourceReadException { if ( proposition == null ) { return false ; } else { String pId = proposition . getId ( ) ; if ( this . propositionId != null && ! propIds . contains ( pId ) ) { return false ; } for ( PropertyConstraint... | Returns whether a proposition has the same id and value and consistent duration as specified by this extended parameter definition . |
11,973 | public Response transform ( ClassLoader loader , String className , Class < ? > classBeingRedefined , ProtectionDomain protectionDomain , byte [ ] origBytes ) throws IllegalClassFormatException { byte [ ] transformed = first . transform ( loader , className , classBeingRedefined , protectionDomain , origBytes ) ; boole... | Perform the combined enhancement . |
11,974 | public boolean cancel ( boolean mayInterruptIfRunning ) { boolean success = true ; for ( Future < FUTURE_TYPE > future : futureList ) { success &= future . cancel ( true ) ; } return success ; } | Cancels all internal futures . |
11,975 | public boolean isCancelled ( ) { boolean canceled = false ; for ( Future < FUTURE_TYPE > future : futureList ) { if ( ! future . isDone ( ) ) { return false ; } canceled |= future . isCancelled ( ) ; } return canceled ; } | Method returns true if at least one subfutures was canceled . In case there are still processing futures remaining than false is returned in any case . False is returned as well when all futures are done but none was canceled . |
11,976 | public boolean isDone ( ) { for ( Future < FUTURE_TYPE > future : futureList ) { if ( ! future . isDone ( ) ) { return false ; } } return true ; } | Method checks if the subfutures are done . |
11,977 | public static Coordinate [ ] deepCopyCoordinates ( Coordinate [ ] coordinatesOriginal ) { if ( coordinatesOriginal != null ) { Coordinate [ ] copy = new Coordinate [ coordinatesOriginal . length ] ; for ( int i = 0 ; i < coordinatesOriginal . length ; i ++ ) { copy [ i ] = deepCopyCoordinate ( coordinatesOriginal [ i ]... | Copy values of array of coordinates to new array . |
11,978 | public ServiceException setException ( Throwable innerException ) { ByteArrayOutputStream messageOutputStream = new ByteArrayOutputStream ( ) ; innerException . printStackTrace ( new PrintStream ( messageOutputStream ) ) ; String exceptionMessage = messageOutputStream . toString ( ) ; this . fault . setException ( exce... | Sets the exception which caused this service exception . It s important to set this exception to understand and reproduce the error! |
11,979 | private Object specializeInstance ( ClassDescriptor specializedClass , Object t ) { try ( Logger l = new Logger ( "specializeInstance(" + specializedClass . getSpecializedClass ( ) . getSimpleName ( ) + " , " + t + ")" ) ) { if ( ! specializedClass . isSpecialized ( ) ) { l . log ( "value unchanged" ) ; return t ; } l ... | creates a specialized copy of the given instance |
11,980 | public List < RemoteRepository > getRemoteRepositories ( SettingsDecrypter decrypter , ExtensionList < RemoteRepositoryDecorator > decorators ) { List < RemoteRepository > repositories = new ArrayList < RemoteRepository > ( ) ; MavenDependencyResolverSettings resolverSettings = new MavenDependencyResolverSettings ( ) ;... | List of remote repositories to resolve artifacts from . |
11,981 | public FoxHttpClientBuilder activteGZipResponseInterceptor ( int weight ) throws FoxHttpException { foxHttpClient . register ( FoxHttpInterceptorType . RESPONSE , new GZipResponseInterceptor ( weight ) ) ; return this ; } | Automatic gzip response parser . |
11,982 | public FoxHttpClientBuilder addFoxHttpAuthorization ( FoxHttpAuthorizationScope foxHttpAuthorizationScope , FoxHttpAuthorization foxHttpAuthorization ) { foxHttpClient . getFoxHttpAuthorizationStrategy ( ) . addAuthorization ( foxHttpAuthorizationScope , foxHttpAuthorization ) ; return this ; } | Add a Authorization to the AuthorizationStrategy |
11,983 | static void forceWritingEnumValue ( VerboseXmlEncoder encoder , Object object ) { Field valueToExpressionField = null ; Field refsField = null ; try { Class < ? > encoderClass = encoder . getClass ( ) . getSuperclass ( ) ; valueToExpressionField = encoderClass . getDeclaredField ( "valueToExpression" ) ; valueToExpress... | Use a nasty reflection hack to make sure that the given object is always written explicitly without using idref in the given VerboseXmlEncoder |
11,984 | private int readSBits ( int numBits ) throws IOException { long uBits = readUBits ( numBits ) ; if ( ( uBits & ( 1L << ( numBits - 1 ) ) ) != 0 ) { uBits |= - 1L << numBits ; } return ( int ) uBits ; } | Read a signed integer value from input . |
11,985 | ConstructorParamExpressionBuilder param ( ) { return new ConstructorParamExpressionBuilder ( new ExpressionHandler < ConstructorCallBuilder > ( ) { public ConstructorCallBuilder handleExpression ( Expression e ) { return new ConstructorCallBuilder ( factory , expressionHandler , parameters . append ( e ) ) ; } } ) ; } | pass a parameter to the constructor |
11,986 | public static < B extends ProcessBuilder > QueueBuilder < B > newQueueBuilder ( Class < B > process_builder_class ) { return new QueueBuilder < B > ( ROOT_QUEUE , process_builder_class ) ; } | Retrieve a new QueueBuilder using the ROOT_QUEUE as a parent . |
11,987 | static < B extends ProcessBuilder > QueueBuilder < B > newQueueBuilder ( Queue parent_queue , Class < B > process_builder_class ) { return new QueueBuilder < B > ( parent_queue , process_builder_class ) ; } | Retrieve a new QueueBuilder using the specified queue as a parent . |
11,988 | public List < T > handle ( List < QueryParameters > outputList ) throws MjdbcException { return this . outputProcessor . toBeanList ( outputList , this . type ) ; } | Converts query output into list of beans |
11,989 | @ SuppressWarnings ( "unchecked" ) public Constraint getConstraint ( String ... typeInfo ) { if ( typeInfo == null || typeInfo . length < 1 ) { return getConstraints ( ) . iterator ( ) . next ( ) ; } else if ( typeInfo . length == 1 ) { Constraint c = getConstraint ( new String [ 0 ] ) ; DataType < ? > attr = c . getTy... | Overrides the default method to allow conditional checking . Only for non - longtext strings do we allow for a list of choices . |
11,990 | private MjdbcSQLException translateSQLStatePrefix ( String reason , String SQLState , int vendorCode , SQLException cause ) { MjdbcSQLException result = null ; String sqlState = getSqlState ( cause ) ; String sqlStatePrefix = null ; if ( sqlState != null && sqlState . length ( ) >= 2 ) { sqlStatePrefix = sqlState . sub... | Checks SQL state and tries to convert it into Spring SQL Exception . This implementation is vendor free . |
11,991 | private String getSqlState ( SQLException ex ) { String result = ex . getSQLState ( ) ; SQLException nestedEx = null ; if ( result == null ) { nestedEx = ex . getNextException ( ) ; if ( nestedEx != null ) { result = nestedEx . getSQLState ( ) ; } } return result ; } | Reads SQLException hierarchy and returns SQL state . |
11,992 | private String getErrorCode ( SQLException ex ) { String result = null ; SQLException nestedEx = null ; if ( ex . getErrorCode ( ) != 0 ) { result = Integer . toString ( ex . getErrorCode ( ) ) ; } if ( result == null ) { nestedEx = ex . getNextException ( ) ; if ( nestedEx != null ) { result = Integer . toString ( nes... | Reads SQLException hierarchy and returns error code |
11,993 | public static void setVariableWithSingleQuotationMarks ( final String variablename , final Object object , final Map < String , Object > variables ) { if ( object != null ) { variables . put ( variablename , "'" + object + "'" ) ; } else { variables . put ( variablename , "null" ) ; } } | Sets the variable with singe quotation marks . |
11,994 | public SimpleHTMLTag addSubTag ( SimpleHTMLTag tag ) { if ( tag == this ) { throw new IllegalArgumentException ( "The tag cannot be its own parent" ) ; } if ( subTags == null ) { subTags = new ArrayList < > ( ) ; } subTags . add ( tag ) ; return this ; } | Adds a subtag to this tag . If the tag has a text content any subtag will be ignored . |
11,995 | public SimpleHTMLTag setProperty ( String key , String value ) { key = UniformUtils . checkPropertyNameAndLowerCase ( key ) ; if ( properties == null ) { properties = new HashMap < > ( ) ; } properties . put ( key , value ) ; return this ; } | Sets a property of the tag by key . |
11,996 | public SimpleHTMLTag removeProperty ( String key ) { key = UniformUtils . checkPropertyNameAndLowerCase ( key ) ; if ( properties != null ) { properties . remove ( key ) ; } return this ; } | Removes a property of the tag by key . |
11,997 | public SimpleHTMLTag setProperties ( Map < String , String > properties ) { if ( properties == null || properties . isEmpty ( ) ) { this . properties = null ; } else { this . properties = new HashMap < > ( ) ; for ( Entry < String , String > entry : properties . entrySet ( ) ) { String key = entry . getKey ( ) ; key = ... | Replaces all properties of the tag with a map of properties indexed by key . |
11,998 | public String getProperty ( String key ) { key = UniformUtils . checkPropertyNameAndLowerCase ( key ) ; if ( properties == null ) { return null ; } return properties . get ( key ) ; } | Returns a property of this tag by key if present . |
11,999 | public static ImageInfo read ( InputStream in ) throws IOException { ImageInfo imageInfo = new ImageInfo ( ) ; imageInfo . setInput ( in ) ; if ( ! imageInfo . check ( ) ) { throw new IOException ( "ImageInfo.check() failed; data stream is " + "broken or does not contain data in a supported image format" ) ; } return i... | Reads image info from a stream . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.