idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
10,000 | private Type evalMainType ( final Collection < Type > _baseTypes ) throws EFapsException { final Type ret ; if ( _baseTypes . size ( ) == 1 ) { ret = _baseTypes . iterator ( ) . next ( ) ; } else { final List < List < Type > > typeLists = new ArrayList <> ( ) ; for ( final Type type : _baseTypes ) { final List < Type >... | Gets the main type . | 291 | 6 |
10,001 | public Collection < Select > getAllSelects ( ) { final List < Select > ret = new ArrayList <> ( this . selects ) ; ret . addAll ( this . instSelects . values ( ) ) ; return Collections . unmodifiableCollection ( ret ) ; } | Gets the all data selects . | 58 | 7 |
10,002 | protected void unassignFromUserObjectInDb ( final Type _unassignType , final JAASSystem _jaasSystem , final AbstractUserObject _object ) throws EFapsException { Connection con = null ; try { con = Context . getConnection ( ) ; Statement stmt = null ; final StringBuilder cmd = new StringBuilder ( ) ; try { cmd . append ... | Unassign this user object from the given user object for given JAAS system . | 462 | 17 |
10,003 | protected void setStatusInDB ( final boolean _status ) throws EFapsException { Connection con = null ; try { con = Context . getConnection ( ) ; PreparedStatement stmt = null ; final StringBuilder cmd = new StringBuilder ( ) ; try { cmd . append ( " update T_USERABSTRACT set STATUS=? where ID=" ) . append ( getId ( ) )... | Method to set the status of a UserObject in the eFaps Database . | 443 | 16 |
10,004 | private void readFromDB4Access ( ) throws CacheReloadException { Statement stmt = null ; try { stmt = Context . getThreadContext ( ) . getConnectionResource ( ) . createStatement ( ) ; final ResultSet resultset = stmt . executeQuery ( "select " + "T_UIACCESS.USERABSTRACT " + "from T_UIACCESS " + "where T_UIACCESS.UIABS... | The instance method reads the access for this user interface object . | 342 | 12 |
10,005 | public String getPath ( ) { final StringBuilder path = new StringBuilder ( ) ; if ( getPrevious ( ) != null ) { path . append ( getPrevious ( ) . getPath ( ) ) ; } return path . toString ( ) ; } | Gets the path . | 53 | 5 |
10,006 | private Map < String , IEsjpSelect > getEsjpSelect ( final List < Instance > _instances ) throws Exception { final Map < String , IEsjpSelect > ret = new HashMap <> ( ) ; if ( ! _instances . isEmpty ( ) ) { for ( final Entry < String , AbstractSelect > entry : getAlias2Selects ( ) . entrySet ( ) ) { if ( entry . getVal... | Gets the esjp select . | 258 | 7 |
10,007 | private MultiPrintQuery getMultiPrint ( ) throws EFapsException { final MultiPrintQuery ret ; if ( getInstances ( ) . isEmpty ( ) ) { ret = new MultiPrintQuery ( QueryBldrUtil . getInstances ( this ) ) ; } else { final List < Instance > instances = new ArrayList <> ( ) ; for ( final String oid : getInstances ( ) ) { in... | Gets the multi print . | 119 | 6 |
10,008 | private void addUoM ( final UoM _uom ) { this . uoMs . add ( _uom ) ; if ( _uom . getId ( ) == this . baseUoMId ) { this . baseUoM = _uom ; } } | Method to add an UoM to this dimension . | 62 | 11 |
10,009 | public static UoM getUoM ( final Long _uoMId ) { final Cache < Long , UoM > cache = InfinispanCache . get ( ) . < Long , UoM > getCache ( Dimension . IDCACHE4UOM ) ; if ( ! cache . containsKey ( _uoMId ) ) { try { Dimension . getUoMFromDB ( Dimension . SQL_SELECT_UOM4ID , _uoMId ) ; } catch ( final CacheReloadException... | Static Method to get an UoM for an id . | 155 | 12 |
10,010 | public String getResumptionToken ( ) { String resumptionToken = null ; try { if ( data != null && data . has ( resumptionTokenParam ) ) { resumptionToken = data . getString ( resumptionTokenParam ) ; } } catch ( JSONException e ) { //This is already handled by the enclosing "has" checks } return resumptionToken ; } | Returns the resumption token if it exists | 79 | 8 |
10,011 | public List < JSONObject > getResourceData ( ) { List < JSONObject > resources = new ArrayList < JSONObject > ( ) ; try { if ( data != null && data . has ( documentsParam ) ) { List < JSONObject > results = getDocuments ( ) ; for ( JSONObject json : results ) { if ( json . has ( documentParam ) ) { JSONObject result = ... | Returns resource data from obtain or harvest request | 204 | 8 |
10,012 | public List < JSONObject > getDocuments ( ) { List < JSONObject > documents = new ArrayList < JSONObject > ( ) ; try { if ( data != null && data . has ( documentsParam ) ) { JSONArray jsonDocuments = data . getJSONArray ( documentsParam ) ; for ( int i = 0 ; i < jsonDocuments . length ( ) ; i ++ ) { JSONObject document... | Returns documents from obtain request | 129 | 5 |
10,013 | public List < JSONObject > getRecords ( ) { List < JSONObject > records = new ArrayList < JSONObject > ( ) ; try { if ( data != null && data . has ( getRecordParam ) ) { JSONObject jsonGetRecord = data . getJSONObject ( getRecordParam ) ; if ( jsonGetRecord . has ( recordParam ) ) { JSONArray jsonRecords = jsonGetRecor... | Returns records from harvest request | 167 | 5 |
10,014 | public BigDecimal roundBigDecimal ( final BigDecimal number ) { int mscale = getMathScale ( ) ; if ( mscale >= 0 ) { return number . setScale ( mscale , getMathContext ( ) . getRoundingMode ( ) ) ; } else { return number ; } } | Ensure a big decimal is rounded by this arithmetic scale and rounding mode . | 65 | 15 |
10,015 | protected boolean isFloatingPointType ( Object left , Object right ) { return left instanceof Float || left instanceof Double || right instanceof Float || right instanceof Double ; } | Test if either left or right are either a Float or Double . | 37 | 13 |
10,016 | protected boolean isNumberable ( final Object o ) { return o instanceof Integer || o instanceof Long || o instanceof Byte || o instanceof Short || o instanceof Character ; } | Is Object a whole number . | 38 | 6 |
10,017 | protected Number narrowBigDecimal ( Object lhs , Object rhs , BigDecimal bigd ) { if ( isNumberable ( lhs ) || isNumberable ( rhs ) ) { try { long l = bigd . longValueExact ( ) ; // coerce to int when possible (int being so often used in method parms) if ( l <= Integer . MAX_VALUE && l >= Integer . MIN_VALUE ) { return... | Given a BigDecimal attempt to narrow it to an Integer or Long if it fits if one of the arguments is a numberable . | 142 | 27 |
10,018 | protected boolean narrowArguments ( Object [ ] args ) { boolean narrowed = false ; for ( int a = 0 ; a < args . length ; ++ a ) { Object arg = args [ a ] ; if ( arg instanceof Number ) { Object narg = narrow ( ( Number ) arg ) ; if ( narg != arg ) { narrowed = true ; } args [ a ] = narg ; } } return narrowed ; } | Replace all numbers in an arguments array with the smallest type that will fit . | 89 | 16 |
10,019 | public Object divide ( Object left , Object right ) { if ( left == null && right == null ) { return 0 ; } // if either are floating point (double or float) use double if ( isFloatingPointNumber ( left ) || isFloatingPointNumber ( right ) ) { double l = toDouble ( left ) ; double r = toDouble ( right ) ; if ( r == 0.0 )... | Divide the left value by the right . | 295 | 9 |
10,020 | public Object multiply ( Object left , Object right ) { if ( left == null && right == null ) { return 0 ; } // if either are floating point (double or float) use double if ( isFloatingPointNumber ( left ) || isFloatingPointNumber ( right ) ) { double l = toDouble ( left ) ; double r = toDouble ( right ) ; return new Do... | Multiply the left value by the right . | 224 | 10 |
10,021 | public boolean matches ( Object left , Object right ) { if ( left == null && right == null ) { // if both are null L == R return true ; } if ( left == null || right == null ) { // we know both aren't null, therefore L != R return false ; } final String arg = left . toString ( ) ; if ( right instanceof java . util . reg... | Test if left regexp matches right . | 128 | 8 |
10,022 | public Object bitwiseOr ( Object left , Object right ) { long l = toLong ( left ) ; long r = toLong ( right ) ; return Long . valueOf ( l | r ) ; } | Performs a bitwise or . | 43 | 7 |
10,023 | public Object bitwiseComplement ( Object val ) { long l = toLong ( val ) ; return Long . valueOf ( ~ l ) ; } | Performs a bitwise complement . | 31 | 7 |
10,024 | public boolean lessThan ( Object left , Object right ) { if ( ( left == right ) || ( left == null ) || ( right == null ) ) { return false ; } else { return compare ( left , right , "<" ) < 0 ; } } | Test if left < right . | 55 | 6 |
10,025 | public boolean greaterThan ( Object left , Object right ) { if ( ( left == right ) || left == null || right == null ) { return false ; } else { return compare ( left , right , ">" ) > 0 ; } } | Test if left > right . | 51 | 6 |
10,026 | public boolean lessThanOrEqual ( Object left , Object right ) { if ( left == right ) { return true ; } else if ( left == null || right == null ) { return false ; } else { return compare ( left , right , "<=" ) <= 0 ; } } | Test if left < = right . | 60 | 7 |
10,027 | public boolean greaterThanOrEqual ( Object left , Object right ) { if ( left == right ) { return true ; } else if ( left == null || right == null ) { return false ; } else { return compare ( left , right , ">=" ) >= 0 ; } } | Test if left > = right . | 61 | 7 |
10,028 | public int toInteger ( Object val ) { if ( val == null ) { return 0 ; } else if ( val instanceof Double ) { if ( ! Double . isNaN ( ( ( Double ) val ) . doubleValue ( ) ) ) { return 0 ; } else { return ( ( Double ) val ) . intValue ( ) ; } } else if ( val instanceof Number ) { return ( ( Number ) val ) . intValue ( ) ;... | Coerce to a int . | 217 | 7 |
10,029 | public BigInteger toBigInteger ( Object val ) { if ( val == null ) { return BigInteger . ZERO ; } else if ( val instanceof BigInteger ) { return ( BigInteger ) val ; } else if ( val instanceof Double ) { if ( ! Double . isNaN ( ( ( Double ) val ) . doubleValue ( ) ) ) { return new BigInteger ( val . toString ( ) ) ; } ... | Get a BigInteger from the object passed . Null and empty string maps to zero . | 246 | 17 |
10,030 | public BigDecimal toBigDecimal ( Object val ) { if ( val instanceof BigDecimal ) { return roundBigDecimal ( ( BigDecimal ) val ) ; } else if ( val == null ) { return BigDecimal . ZERO ; } else if ( val instanceof String ) { String string = ( ( String ) val ) . trim ( ) ; if ( "" . equals ( string ) ) { return BigDecima... | Get a BigDecimal from the object passed . Null and empty string maps to zero . | 297 | 18 |
10,031 | public double toDouble ( Object val ) { if ( val == null ) { return 0 ; } else if ( val instanceof Double ) { return ( ( Double ) val ) . doubleValue ( ) ; } else if ( val instanceof Number ) { // The below construct is used rather than ((Number)val).doubleValue() to ensure // equality between comparing new Double( 6.4... | Coerce to a double . | 274 | 7 |
10,032 | public Collection < ? > toCollection ( Object val ) { if ( val == null ) { return Collections . emptyList ( ) ; } else if ( val instanceof Collection < ? > ) { return ( Collection < ? > ) val ; } else if ( val . getClass ( ) . isArray ( ) ) { return newArrayList ( ( Object [ ] ) val ) ; } else if ( val instanceof Map <... | Coerce to a collection | 125 | 6 |
10,033 | protected boolean narrowAccept ( Class < ? > narrow , Class < ? > source ) { return narrow == null || narrow . equals ( source ) ; } | Whether we consider the narrow class as a potential candidate for narrowing the source . | 31 | 15 |
10,034 | protected Number narrowNumber ( Number original , Class < ? > narrow ) { if ( original == null ) { return original ; } Number result = original ; if ( original instanceof BigDecimal ) { BigDecimal bigd = ( BigDecimal ) original ; // if it's bigger than a double it can't be narrowed if ( bigd . compareTo ( BIGD_DOUBLE_M... | Given a Number return back the value attempting to narrow it to a target class . | 541 | 16 |
10,035 | public static AttributeSet get ( final String _typeName , final String _name ) throws CacheReloadException { return ( AttributeSet ) Type . get ( AttributeSet . evaluateName ( _typeName , _name ) ) ; } | Method to get the type from the cache . | 51 | 9 |
10,036 | public static AttributeSet find ( final String _typeName , final String _name ) throws CacheReloadException { AttributeSet ret = ( AttributeSet ) Type . get ( AttributeSet . evaluateName ( _typeName , _name ) ) ; if ( ret == null ) { if ( Type . get ( _typeName ) . getParentType ( ) != null ) { ret = AttributeSet . fin... | Method to get the type from the cache . Searches if not found in the type hierarchy . | 119 | 19 |
10,037 | private Set < Classification > getClassification ( final List < Long > _classIds ) throws CacheReloadException { final Set < Classification > noadd = new HashSet <> ( ) ; final Set < Classification > add = new HashSet <> ( ) ; if ( _classIds != null ) { for ( final Long id : _classIds ) { Classification clazz = ( Class... | Method to get only the leaf of the classification tree . | 178 | 11 |
10,038 | protected boolean executeOneCompleteStmt ( final String _complStmt , final List < Instance > _instances ) throws EFapsException { final boolean ret = false ; ConnectionResource con = null ; try { con = Context . getThreadContext ( ) . getConnectionResource ( ) ; final Statement stmt = con . createStatement ( ) ; final ... | Method to execute one statement against the eFaps - DataBase . | 320 | 14 |
10,039 | public static void writeSourceToFile ( Class < ? > koanClass , String newSource ) { Path currentRelativePath = Paths . get ( "" ) ; String workingDirectory = currentRelativePath . toAbsolutePath ( ) . toString ( ) ; String packagePath = koanClass . getPackage ( ) . getName ( ) ; packagePath = packagePath . replace ( PA... | Write source to file . | 220 | 5 |
10,040 | protected Person createPerson ( final LoginContext _login ) throws EFapsException { Person person = null ; for ( final JAASSystem system : JAASSystem . getAllJAASSystems ( ) ) { final Set < ? > users = _login . getSubject ( ) . getPrincipals ( system . getPersonJAASPrincipleClass ( ) ) ; for ( final Object persObj : us... | The person represented in the JAAS login context is created and associated to eFaps . If the person is defined in more than one JAAS system the person is also associated to the other JAAS systems . | 364 | 42 |
10,041 | protected void updatePerson ( final LoginContext _login , final Person _person ) throws EFapsException { for ( final JAASSystem system : JAASSystem . getAllJAASSystems ( ) ) { final Set < ? > users = _login . getSubject ( ) . getPrincipals ( system . getPersonJAASPrincipleClass ( ) ) ; for ( final Object persObj : user... | The person information inside eFaps is update with information from JAAS login context . | 349 | 17 |
10,042 | protected void updateRoles ( final LoginContext _login , final Person _person ) throws EFapsException { for ( final JAASSystem system : JAASSystem . getAllJAASSystems ( ) ) { if ( system . getRoleJAASPrincipleClass ( ) != null ) { final Set < ? > rolesJaas = _login . getSubject ( ) . getPrincipals ( system . getRoleJAA... | The roles of the given person are updated with the information from the JAAS login context . | 332 | 18 |
10,043 | protected void updateGroups ( final LoginContext _login , final Person _person ) throws EFapsException { for ( final JAASSystem system : JAASSystem . getAllJAASSystems ( ) ) { if ( system . getGroupJAASPrincipleClass ( ) != null ) { final Set < ? > groupsJaas = _login . getSubject ( ) . getPrincipals ( system . getGrou... | The groups of the given person are updated with the information from the JAAS login context . | 332 | 18 |
10,044 | public Attachment updateWithUploadDetails ( UploadContentResponse response ) { this . id = response . getId ( ) ; this . url = response . getUrl ( ) ; this . size = response . getSize ( ) ; this . type = response . getType ( ) ; return this ; } | For internal use . Update attachment details with upload APIs response . | 62 | 12 |
10,045 | @ Override protected void initTableInfoUniqueKeys ( final Connection _con , final String _sql , final Map < String , TableInformation > _cache4Name ) throws SQLException { final String sqlStmt = new StringBuilder ( ) . append ( "select t.tablename as TABLE_NAME, c.CONSTRAINTNAME as INDEX_NAME, g.DESCRIPTOR as COLUMN_NA... | Fetches all unique keys for this table . Instead of using the JDBC meta data functionality a SQL statement on system tables are used because the JDBC meta data functionality returns for unique keys internal names and not the real names . Also if a unique key includes also columns with null values this unique keys are n... | 242 | 64 |
10,046 | private void backup ( final FileObject _backup , final int _number ) throws FileSystemException { if ( _number < this . numberBackup ) { final FileObject backFile = this . manager . resolveFile ( this . manager . getBaseFile ( ) , this . storeFileName + VFSStoreResource . EXTENSION_BACKUP + _number ) ; if ( backFile . ... | Method that deletes the oldest backup and moves the others one up . | 124 | 14 |
10,047 | @ Override public Xid [ ] recover ( final int _flag ) { if ( VFSStoreResource . LOG . isDebugEnabled ( ) ) { VFSStoreResource . LOG . debug ( "recover (flag = " + _flag + ")" ) ; } return null ; } | Obtains a list of prepared transaction branches from a resource manager . | 61 | 13 |
10,048 | Observable < ChatResult > sendMessageWithAttachments ( @ NonNull final String conversationId , @ NonNull final MessageToSend message , @ Nullable final List < Attachment > attachments ) { final MessageProcessor messageProcessor = attCon . createMessageProcessor ( message , attachments , conversationId , getProfileId ( ... | Save and send message with attachments . | 395 | 7 |
10,049 | public Observable < ChatResult > handleParticipantsAdded ( final String conversationId ) { return persistenceController . getConversation ( conversationId ) . flatMap ( conversation -> { if ( conversation == null ) { return handleNoLocalConversation ( conversationId ) ; } else { return Observable . fromCallable ( ( ) -... | Handle participant added to a conversation Foundation SDK event . | 85 | 10 |
10,050 | private Observable < ChatResult > handleMessageError ( MessageProcessor mp , Throwable t ) { return persistenceController . updateStoreForSentError ( mp . getConversationId ( ) , mp . getTempId ( ) , mp . getSender ( ) ) . map ( success -> new ChatResult ( false , new ChatResult . Error ( 0 , t ) ) ) ; } | Handle failure when sent message . | 82 | 6 |
10,051 | Observable < RxComapiClient > checkState ( ) { final RxComapiClient client = clientReference . get ( ) ; if ( client == null ) { return Observable . error ( new ComapiException ( "No client instance available in controller." ) ) ; } else { return Observable . fromCallable ( ( ) -> client ) ; } } | Checks if controller state is correct . | 76 | 8 |
10,052 | Observable < ChatResult > handleNoLocalConversation ( String conversationId ) { return checkState ( ) . flatMap ( client -> client . service ( ) . messaging ( ) . getConversation ( conversationId ) . flatMap ( result -> { if ( result . isSuccessful ( ) && result . getResult ( ) != null ) { return persistenceController ... | When SDK detects missing conversation it makes query in services and saves in the saves locally . | 188 | 17 |
10,053 | Observable < ComapiResult < Void > > markDelivered ( String conversationId , Set < String > ids ) { final List < MessageStatusUpdate > updates = new ArrayList <> ( ) ; updates . add ( MessageStatusUpdate . builder ( ) . setMessagesIds ( ids ) . setStatus ( MessageStatus . delivered ) . setTimestamp ( DateHelper . getCu... | Mark messages in a conversations as delivered . | 244 | 8 |
10,054 | String getProfileId ( ) { final RxComapiClient client = clientReference . get ( ) ; return client != null ? client . getSession ( ) . getProfileId ( ) : null ; } | Gets profile id from Foundation for the active user . | 42 | 11 |
10,055 | Observable < ChatResult > synchroniseStore ( ) { if ( isSynchronising . getAndSet ( true ) ) { log . i ( "Synchronisation in progress." ) ; return Observable . fromCallable ( ( ) -> new ChatResult ( true , null ) ) ; } log . i ( "Synchronising store." ) ; return synchroniseConversations ( ) . onErrorReturn ( t -> new C... | Check state for all conversations and update from services . | 202 | 10 |
10,056 | Observable < ChatResult > handleConversationCreated ( ComapiResult < ConversationDetails > result ) { if ( result . isSuccessful ( ) ) { return persistenceController . upsertConversation ( ChatConversation . builder ( ) . populate ( result . getResult ( ) , result . getETag ( ) ) . build ( ) ) . map ( success -> adapte... | Handles conversation create service response . | 116 | 7 |
10,057 | Observable < ChatResult > handleConversationDeleted ( String conversationId , ComapiResult < Void > result ) { if ( result . getCode ( ) != ETAG_NOT_VALID ) { return persistenceController . deleteConversation ( conversationId ) . map ( success -> adapter . adaptResult ( result , success ) ) ; } else { return checkState... | Handles conversation delete service response . | 292 | 7 |
10,058 | Observable < ChatResult > handleConversationUpdated ( ConversationUpdate request , ComapiResult < ConversationDetails > result ) { if ( result . isSuccessful ( ) ) { return persistenceController . upsertConversation ( ChatConversation . builder ( ) . populate ( result . getResult ( ) , result . getETag ( ) ) . build ( ... | Handles conversation update service response . | 361 | 7 |
10,059 | Observable < ChatResult > handleMessageStatusToUpdate ( String conversationId , List < MessageStatusUpdate > msgStatusList , ComapiResult < Void > result ) { if ( result . isSuccessful ( ) && msgStatusList != null && ! msgStatusList . isEmpty ( ) ) { return persistenceController . upsertMessageStatuses ( conversationId... | Handles message status update service response . | 127 | 8 |
10,060 | private Observable < Boolean > upsertTempMessage ( ChatMessage message ) { return persistenceController . updateStoreWithNewMessage ( message , noConversationListener ) . doOnError ( t -> log . e ( "Error saving temp message " + t . getLocalizedMessage ( ) ) ) . onErrorReturn ( t -> false ) ; } | Insert temporary message to the store for the ui to be responsive . | 73 | 14 |
10,061 | Observable < ChatResult > updateStoreWithSentMsg ( MessageProcessor mp , ComapiResult < MessageSentResponse > response ) { if ( response . isSuccessful ( ) ) { return persistenceController . updateStoreWithNewMessage ( mp . createFinalMessage ( response . getResult ( ) ) , noConversationListener ) . map ( success -> ad... | Handles message send service response . Will delete temporary message object . Same message but with correct message id will be inserted instead . | 111 | 25 |
10,062 | private Observable < ChatResult > synchroniseConversations ( ) { return checkState ( ) . flatMap ( client -> client . service ( ) . messaging ( ) . getConversations ( false ) . flatMap ( result -> persistenceController . loadAllConversations ( ) . map ( chatConversationBases -> compare ( result . isSuccessful ( ) , res... | Updates all conversation states . | 145 | 6 |
10,063 | ConversationComparison compare ( boolean successful , List < Conversation > remote , List < ChatConversationBase > local ) { return new ConversationComparison ( successful , makeMapFromDownloadedConversations ( remote ) , makeMapFromSavedConversations ( local ) ) ; } | Compares remote and local conversation lists . | 61 | 8 |
10,064 | Observable < ChatResult > synchroniseConversation ( String conversationId ) { return checkState ( ) . flatMap ( client -> client . service ( ) . messaging ( ) . queryMessages ( conversationId , null , 1 ) . map ( result -> { if ( result . isSuccessful ( ) && result . getResult ( ) != null ) { return ( long ) result . g... | Updates single conversation state . | 182 | 6 |
10,065 | private Observable < ConversationComparison > lookForMissingEvents ( final RxComapiClient client , ConversationComparison conversationComparison ) { if ( ! conversationComparison . isSuccessful || conversationComparison . conversationsToUpdate . isEmpty ( ) ) { return Observable . fromCallable ( ( ) -> conversationComp... | Checks services for missing events in stored conversations . | 133 | 10 |
10,066 | private Observable < ConversationComparison > updateLocalConversationList ( final ConversationComparison conversationComparison ) { return Observable . zip ( persistenceController . deleteConversations ( conversationComparison . conversationsToDelete ) , persistenceController . upsertConversations ( conversationCompari... | Update list of local conversations . | 127 | 6 |
10,067 | private Observable < Boolean > synchroniseEvents ( final RxComapiClient client , @ NonNull final List < ChatConversation > conversationsToUpdate , @ NonNull final List < Boolean > successes ) { final List < ChatConversation > limited = limitNumberOfConversations ( conversationsToUpdate ) ; if ( limited . isEmpty ( ) ) ... | Synchronise missing events for the list of locally stored conversations . | 276 | 13 |
10,068 | private Observable < ComapiResult < ConversationEventsResponse > > queryEventsRecursively ( final RxComapiClient client , final String conversationId , final long lastEventId , final int count , final List < Boolean > successes ) { return client . service ( ) . messaging ( ) . queryConversationEvents ( conversationId ,... | Synchronise missing events for particular conversation . | 199 | 9 |
10,069 | private Observable < ComapiResult < ConversationEventsResponse > > processEventsQueryResponse ( ComapiResult < ConversationEventsResponse > result , final List < Boolean > successes ) { ConversationEventsResponse response = result . getResult ( ) ; successes . add ( result . isSuccessful ( ) ) ; if ( response != null &... | Process the event query response . Calls appropraiate persistance controller methods for received events . | 339 | 19 |
10,070 | private List < ChatConversation > limitNumberOfConversations ( List < ChatConversation > conversations ) { List < ChatConversation > noEmptyConversations = new ArrayList <> ( ) ; for ( ChatConversation c : conversations ) { if ( c . getLastRemoteEventId ( ) != null && c . getLastRemoteEventId ( ) >= 0 ) { noEmptyConver... | Limits number of conversations to check and synchronise . Emty conversations wont be synchronised . The synchronisation will take place for twenty conversations updated most recently . | 287 | 32 |
10,071 | public Observable < Boolean > handleMessage ( final ChatMessage message ) { String sender = message . getSentBy ( ) ; Observable < Boolean > replaceMessages = persistenceController . updateStoreWithNewMessage ( message , noConversationListener ) ; if ( ! TextUtils . isEmpty ( sender ) && ! sender . equals ( getProfileI... | Handle incomming message . Replace temporary message with received one and mark as delivered . | 164 | 17 |
10,072 | public void analyzeEndStop ( ) { DFA < T > dfa = constructDFA ( new Scope < DFAState < T > > ( "analyzeEndStop" ) ) ; for ( DFAState < T > s : dfa ) { if ( s . isAccepting ( ) ) { if ( s . isEndStop ( ) ) { for ( NFAState < T > n : s . getNfaSet ( ) ) { if ( n . isAccepting ( ) ) { n . setEndStop ( true ) ; } } } } } } | Marks all nfa states that can be accepting to end stop . | 122 | 14 |
10,073 | public DFA < T > constructDFA ( Scope < DFAState < T > > scope ) { return new DFA <> ( first . constructDFA ( scope ) , scope . count ( ) ) ; } | Constructs a dfa from using first nfa state as starting state . | 46 | 15 |
10,074 | public void concat ( NFA < T > nfa ) { last . addEpsilon ( nfa . getFirst ( ) ) ; last = nfa . last ; } | Concatenates this to nfa by making epsilon move from this last to nfa first . | 38 | 22 |
10,075 | public static Application getApplicationFromSource ( final File _versionFile , final List < String > _classpathElements , final File _eFapsDir , final File _outputDir , final List < String > _includes , final List < String > _excludes , final Map < String , String > _file2typeMapping ) throws InstallationException { fi... | Returns the application definition read from a source directory . | 477 | 10 |
10,076 | public static Application getApplicationFromClassPath ( final String _application , final List < String > _classpath ) throws InstallationException { return Application . getApplicationsFromClassPath ( _application , _classpath ) . get ( _application ) ; } | Method to get the applications from the class path . | 51 | 10 |
10,077 | public static Map < String , Application > getApplicationsFromClassPath ( final String _application , final List < String > _classpath ) throws InstallationException { final Map < String , Application > appls = new HashMap <> ( ) ; try { final ClassLoader parent = Application . class . getClassLoader ( ) ; final List <... | Method to get all applications from the class path . | 332 | 10 |
10,078 | public void updateLastVersion ( final String _userName , final String _password , final Set < Profile > _profiles ) throws Exception { // reload cache (if possible) reloadCache ( ) ; // load installed versions Context . begin ( ) ; EFapsClassLoader . getOfflineInstance ( getClass ( ) . getClassLoader ( ) ) ; final Map ... | Updates the last installed version . | 264 | 7 |
10,079 | protected void reloadCache ( ) throws InstallationException { try { LOG . info ( "Reloading Cache" ) ; Context . begin ( ) ; if ( RunLevel . isInitialisable ( ) ) { RunLevel . init ( "shell" ) ; RunLevel . execute ( ) ; } Context . commit ( ) ; } catch ( final EFapsException e ) { throw new InstallationException ( "Rel... | Reloads the eFaps cache . | 93 | 9 |
10,080 | @ Override public String getString ( long start , int length ) { if ( length == 0 ) { return "" ; } if ( array != null ) { int ps = ( int ) ( start % size ) ; int es = ( int ) ( ( start + length ) % size ) ; if ( ps < es ) { return new String ( array , ps , length ) ; } else { StringBuilder sb = new StringBuilder ( ) ;... | Returns string from buffer | 186 | 4 |
10,081 | static Map < String , Set < String > > groupNameToSet ( GravityNameValue [ ] nameValues ) { Map < String , Set < String > > result = new HashMap <> ( ) ; for ( GravityNameValue nameValue : nameValues ) { if ( nameValue . name == null || nameValue . value == null ) continue ; if ( ! result . containsKey ( nameValue . na... | Transform grouped into a map of name to a linked set of values | 134 | 13 |
10,082 | protected void setFileInfo ( final String _filename , final long _fileLength ) throws EFapsException { if ( ! _filename . equals ( this . fileName ) || _fileLength != this . fileLength ) { ConnectionResource res = null ; try { res = Context . getThreadContext ( ) . getConnectionResource ( ) ; final AbstractDatabase < ?... | Set the info for the file in this store reosurce . | 510 | 14 |
10,083 | private void getGeneralID ( final String _complStmt ) throws EFapsException { ConnectionResource con = null ; try { con = Context . getThreadContext ( ) . getConnectionResource ( ) ; final Statement stmt = con . createStatement ( ) ; final ResultSet rs = stmt . executeQuery ( _complStmt . toString ( ) ) ; while ( rs . ... | Get the generalID etc . from the eFasp DataBase . | 256 | 14 |
10,084 | protected Compress getCompress ( ) { final Compress compress ; if ( this . store . getResourceProperties ( ) . containsKey ( Store . PROPERTY_COMPRESS ) ) { compress = Compress . valueOf ( this . store . getResourceProperties ( ) . get ( Store . PROPERTY_COMPRESS ) . toUpperCase ( ) ) ; } else { compress = Compress . N... | Is this Store resource compressed . | 96 | 6 |
10,085 | public static void registerUpdate ( final Instance _instance ) throws EFapsException { // check if SystemConfiguration exists, necessary during install if ( EFapsSystemConfiguration . get ( ) != null && EFapsSystemConfiguration . get ( ) . getAttributeValueAsBoolean ( KernelSettings . INDEXACTIVATE ) ) { if ( _instance... | Register update . | 168 | 3 |
10,086 | public static void initialize ( ) throws CacheReloadException { Context . getDbType ( ) . initialize ( AbstractDataModelObject . class ) ; AttributeType . initialize ( AbstractDataModelObject . class ) ; SQLTable . initialize ( AbstractDataModelObject . class ) ; Type . initialize ( AbstractDataModelObject . class ) ; ... | Initialize the cache of all data model objects . | 107 | 10 |
10,087 | public static String nullifyBadInput ( String input ) { if ( input != null ) { if ( input . matches ( emptyRegex ) ) { return null ; } return input . trim ( ) ; } return null ; } | Returns a valid string or null if empty | 47 | 8 |
10,088 | public static String [ ] nullifyBadInput ( String [ ] input ) { if ( input != null ) { if ( input . length > 0 ) { return input ; } } return null ; } | Returns a valid string array or null if empty | 41 | 9 |
10,089 | public static String [ ] removeDuplicates ( String [ ] input ) { if ( input != null ) { if ( input . length > 0 ) { Set < String > inputSet = new HashSet < String > ( Arrays . asList ( input ) ) ; if ( inputSet . size ( ) > 0 ) { return inputSet . toArray ( new String [ inputSet . size ( ) ] ) ; } } } return null ; } | Returns a valid string array without dulicates or null if empty | 94 | 13 |
10,090 | public String getString ( final String _key ) { String ret = null ; if ( this . attributes . containsKey ( _key ) ) { ret = this . attributes . get ( _key ) . getValue ( ) ; } return ret ; } | Returns the value for a key as a String . | 52 | 10 |
10,091 | public void set ( final String _key , final String _value , final UserAttributesDefinition _definition ) throws EFapsException { if ( _key == null || _value == null ) { throw new EFapsException ( this . getClass ( ) , "set" , _key , _value , _definition ) ; } else { final UserAttribute userattribute = this . attributes... | Sets a key - value pair into the attribute set of an user . The method will search for the key and if the key already exists it will update the user attribute in this set . If the key does not exist a new user attribute will be added to this set . | 172 | 55 |
10,092 | @ Override public Object get ( final Attribute _attribute , final Object _object ) throws EFapsException { Object ret = null ; if ( _object != null && _attribute . getAttributeType ( ) . getDbAttrType ( ) instanceof IFormattableType ) { final IFormattableType attrType = ( IFormattableType ) _attribute . getAttributeTyp... | Method to format a given object . | 196 | 7 |
10,093 | public static CachedMultiPrintQuery get4Request ( final List < Instance > _instances ) throws EFapsException { return new CachedMultiPrintQuery ( _instances , Context . getThreadContext ( ) . getRequestId ( ) ) . setLifespan ( 5 ) . setLifespanUnit ( TimeUnit . MINUTES ) ; } | Get a CachedMultiPrintQuery that will only cache during a request . | 78 | 15 |
10,094 | public Insert set ( final CIAttribute _attr , final Object _value ) throws EFapsException { return super . set ( _attr . name , Converter . convert ( _value ) ) ; } | Sets a value for an CIAttribute . | 42 | 10 |
10,095 | public void set ( double x , double y , double z ) { this . MODE = POINTS_3D ; this . x = x ; this . y = y ; this . z = z ; } | Sets x y z - coordinate . | 45 | 8 |
10,096 | protected void addType ( final Long _typeId ) { if ( ! this . types . contains ( _typeId ) ) { this . types . add ( _typeId ) ; setDirty ( ) ; } } | The instance method adds a new type to the type list . | 46 | 12 |
10,097 | private void loadResourceProperties ( final long _id ) throws EFapsException { this . resourceProperties . clear ( ) ; final QueryBuilder queryBldr = new QueryBuilder ( CIAdminCommon . Property ) ; queryBldr . addWhereAttrEqValue ( CIAdminCommon . Property . Abstract , _id ) ; final MultiPrintQuery multi = queryBldr . ... | Method to get the properties for the resource . | 172 | 9 |
10,098 | public Resource getResource ( final Instance _instance ) throws EFapsException { Resource ret = null ; try { Store . LOG . debug ( "Getting resource for: {} with properties: {}" , this . resource , this . resourceProperties ) ; ret = ( Resource ) Class . forName ( this . resource ) . newInstance ( ) ; ret . initialize ... | Method to get a instance of the resource . | 198 | 9 |
10,099 | public BufferedImage copyImage ( BufferedImage image ) { BufferedImage newImage = new BufferedImage ( image . getWidth ( ) , image . getHeight ( ) , image . getType ( ) ) ; Graphics2D g2d = newImage . createGraphics ( ) ; g2d . drawImage ( image , 0 , 0 , null ) ; g2d . dispose ( ) ; return newImage ; } | Copies a Image object using BuffedImage . | 90 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.