idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
14,600 | @ SuppressWarnings ( "unchecked" ) public BridgeFactory getBridgeFactory ( Class < ? > farType ) { if ( ! farToNearType . containsKey ( farType ) ) { throw new IllegalStateException ( "Far type not registered: " + ( farType == null ? "null" : farType . getSimpleName ( ) ) ) ; } return farTypeToFactory . get ( farType )... | Returns the bridge factory that corresponds to the given far type |
14,601 | public void init ( ServletConfig servletConfig ) throws ServletException { super . init ( servletConfig ) ; ServletTask . initServlet ( this , BasicServlet . SERVLET_TYPE . XML ) ; Enumeration < ? > paramNames = this . getInitParameterNames ( ) ; while ( paramNames . hasMoreElements ( ) ) { String strProperty = ( Strin... | Initialize the servlet . |
14,602 | public String convertIndexToString ( int index ) { String tempString = null ; if ( index == 0 ) tempString = NO ; else if ( index == 1 ) tempString = YES ; return tempString ; } | Convert this index to a string . This method return N for 0 and Y for 1 . |
14,603 | public String getSQLType ( boolean bIncludeLength , Map < String , Object > properties ) { String strType = ( String ) properties . get ( DBSQLTypes . BOOLEAN ) ; if ( strType == null ) strType = DBSQLTypes . BYTE ; return strType ; } | Get the SQL type of this field . Typically BOOLEAN or BYTE . |
14,604 | public double getValue ( ) { Boolean bField = ( Boolean ) this . getData ( ) ; if ( bField == null ) return 0 ; boolean bValue = bField . booleanValue ( ) ; if ( bValue == false ) return 0 ; else return 1 ; } | Get the Value of this field as a double . For a boolean return 0 for false 1 for true . |
14,605 | public int setValue ( double value , boolean bDisplayOption , int iMoveMode ) { Boolean bField = Boolean . FALSE ; if ( value != 0 ) bField = Boolean . TRUE ; int errorCode = this . setData ( bField , bDisplayOption , iMoveMode ) ; return errorCode ; } | Set the Value of this field as a double . For a boolean 0 for false 1 for true . |
14,606 | public void setToLimit ( int iAreaDesc ) { Boolean bFlag = Boolean . TRUE ; if ( iAreaDesc == DBConstants . END_SELECT_KEY ) bFlag = Boolean . FALSE ; this . doSetData ( bFlag , DBConstants . DONT_DISPLAY , DBConstants . SCREEN_MOVE ) ; } | Set to the min or max . false is highest for boolean fields . |
14,607 | public BaseMessageFilter addRemoteMessageFilter ( BaseMessageFilter messageFilter , RemoteSession remoteSession ) throws RemoteException { BaseTransport transport = this . createProxyTransport ( ADD_REMOTE_MESSAGE_FILTER ) ; transport . addParam ( FILTER , messageFilter ) ; String strSessionPathID = null ; if ( remoteS... | Add a message filter to this remote receive queue . |
14,608 | public boolean removeRemoteMessageFilter ( BaseMessageFilter messageFilter , boolean bFreeFilter ) throws RemoteException { BaseTransport transport = this . createProxyTransport ( REMOVE_REMOTE_MESSAGE_FILTER ) ; transport . addParam ( FILTER , messageFilter ) ; transport . addParam ( FREE , bFreeFilter ) ; Object strR... | Remove this remote message filter . |
14,609 | public Record getRecord ( ) { ContactField field = ( ContactField ) m_field ; if ( field . getContactTypeField ( ) != null ) { String strContactTypeID = field . getContactTypeField ( ) . toString ( ) ; if ( field . PROFILE_CONTACT_TYPE_ID . equals ( strContactTypeID ) ) return field . m_recProfile ; } return m_record ;... | GetRecord Method . |
14,610 | private void doBefore ( ) throws Throwable { this . repository = this . createRepository ( ) ; doStateTransition ( State . CREATED ) ; this . initialize ( ) ; doStateTransition ( State . INITIALIZED ) ; } | Creates and initializes the repository . At first the repository is created transitioning the state to CREATED . Afterwards the repository is initialized and transitioned to INITIALIZED . |
14,611 | public Session login ( final String userId , final String password ) throws RepositoryException { assertStateAfterOrEqual ( State . CREATED ) ; return this . repository . login ( new SimpleCredentials ( userId , password . toCharArray ( ) ) ) ; } | Logs into the repository with the given credentials . The created session is not managed and be logged out after use by the caller . |
14,612 | public void clearACL ( String path , String ... principalNames ) throws RepositoryException { final Session session = this . getAdminSession ( ) ; final AccessControlManager acm = session . getAccessControlManager ( ) ; final AccessControlList acl = this . getAccessControlList ( session , path ) ; final String [ ] prin... | Removes all ACLs on the node specified by the path . |
14,613 | private void removeAccessControlEntry ( final AccessControlList acList , final AccessControlEntry acEntry , final String principalName ) throws RepositoryException { if ( ANY_WILDCARD . equals ( principalName ) || acEntry . getPrincipal ( ) . getName ( ) . equals ( principalName ) ) { acList . removeAccessControlEntry ... | Removes the specified access control entry if the given principal name matches the principal associated with the entry . |
14,614 | protected final void checkMaxSize ( final Dimension screenSize , final Dimension frameSize ) { if ( frameSize . height > screenSize . height ) { frameSize . height = screenSize . height ; } if ( frameSize . width > screenSize . width ) { frameSize . width = screenSize . width ; } } | Adjusts the width and height of the fraem if it s greater than the screen . |
14,615 | public void add ( double x , double y ) { if ( count >= xarr . length ) { grow ( ) ; } xarr [ count ] = x ; yarr [ count ++ ] = y ; minX = Math . min ( minX , x ) ; minY = Math . min ( minY , y ) ; maxX = Math . max ( maxX , x ) ; maxY = Math . max ( maxY , y ) ; } | Adds sample and grows if necessary . |
14,616 | private static int compareTo ( Deque < String > first , Deque < String > second ) { if ( 0 == first . size ( ) && 0 == second . size ( ) ) { return 0 ; } if ( 0 == first . size ( ) ) { return 1 ; } if ( 0 == second . size ( ) ) { return - 1 ; } int headsComparation = ( Integer . valueOf ( first . remove ( ) ) ) . compa... | Compares two string ordered lists containing numbers . |
14,617 | public void setControlValue ( Object objValue ) { if ( objValue instanceof String ) { if ( ( ( String ) objValue ) . equalsIgnoreCase ( Constants . TRUE ) ) objValue = Boolean . TRUE ; else if ( ( ( String ) objValue ) . equalsIgnoreCase ( Constants . FALSE ) ) objValue = Boolean . FALSE ; } super . setControlValue ( o... | Set the value of this control . |
14,618 | public String getIDPath ( ) { String strIDPath = this . getID ( ) ; if ( this . getParentProxy ( ) != null ) { String strParentPath = this . getParentProxy ( ) . getIDPath ( ) ; if ( strParentPath != null ) strIDPath = strParentPath + PATH_SEPARATOR + strIDPath ; } return strIDPath ; } | Get the object s lookup ID . |
14,619 | public BaseTransport createProxyTransport ( String strCommand ) { BaseTransport transport = null ; if ( m_parentProxy != null ) transport = m_parentProxy . createProxyTransport ( strCommand ) ; transport . setProperty ( TARGET , this . getIDPath ( ) ) ; return transport ; } | Create the proxy transport . |
14,620 | public void addChildProxy ( BaseProxy childProxy ) { String strID = childProxy . getID ( ) ; m_hmChildList . put ( strID , childProxy ) ; } | Add this child to the child list . |
14,621 | public DoubleBinaryOperator determinant ( ) { int sign = 1 ; SumBuilder sum = DoubleBinaryOperators . sumBuilder ( ) ; PermutationMatrix pm = PermutationMatrix . getInstance ( rows ) ; int perms = pm . rows ; for ( int p = 0 ; p < perms ; p ++ ) { MultiplyBuilder mul = DoubleBinaryOperators . multiplyBuilder ( ) ; for ... | Composes determinant by using permutations |
14,622 | public Component getTreeCellRendererComponent ( JTree tree , Object value , boolean selected , boolean expanded , boolean leaf , int row , boolean hasFocus ) { String stringValue = tree . convertValueToText ( value , selected , expanded , leaf , row , hasFocus ) ; this . setText ( stringValue ) ; NodeData userObject = ... | This is messaged from JTree whenever it needs to get the size of the component or it wants to draw it . This attempts to set the font based on value which will be a TreeNode . |
14,623 | public void addMainKeyBehavior ( ) { Record record = this . getMainRecord ( ) ; if ( record == null ) return ; int keyCount = record . getKeyAreaCount ( ) ; for ( int keyNumber = DBConstants . MAIN_KEY_AREA ; keyNumber < keyCount + DBConstants . MAIN_KEY_AREA ; keyNumber ++ ) { KeyArea keyAreaInfo = record . getKeyArea... | Add the read - main - key listener . |
14,624 | public void addScreenMenus ( ) { AppletScreen appletScreen = this . getAppletScreen ( ) ; if ( appletScreen != null ) { ScreenField menuBar = appletScreen . getSField ( 0 ) ; if ( ( menuBar == null ) || ( ! ( menuBar instanceof SMenuBar ) ) ) { if ( menuBar instanceof SBaseMenuBar ) menuBar . free ( ) ; new SMenuBar ( ... | Add the menus that belong with this screen . |
14,625 | public boolean onMove ( int nIDMoveCommand ) { boolean flag = super . onMove ( nIDMoveCommand ) ; this . selectField ( null , DBConstants . SELECT_FIRST_FIELD ) ; return flag ; } | Move Record Command . |
14,626 | @ SuppressWarnings ( "unchecked" ) public static < T > T that ( Object key , Supplier < T > what ) { if ( CACHE . get ( key ) != null ) { try { return ( T ) CACHE . get ( key ) ; } catch ( ClassCastException e ) { System . out . print ( "E/Cache: Can't use cached object: wrong type" ) ; } } T value = what . get ( ) ; C... | Registers creator of item and returns item from cache or creator |
14,627 | public static < T > T that ( Object key , T what ) { CACHE . put ( key , what ) ; return what ; } | Puts item to cache |
14,628 | @ SuppressWarnings ( "unchecked" ) public static < T > T get ( Object key ) { try { return ( T ) CACHE . get ( key ) ; } catch ( ClassCastException e ) { System . out . print ( "E/Cache: Can't use cached object: wrong type" ) ; } return null ; } | Returns cached item |
14,629 | @ SuppressWarnings ( "unchecked" ) public static < T > T poll ( Object key ) { try { return ( T ) CACHE . remove ( key ) ; } catch ( ClassCastException e ) { System . out . print ( "E/Cache: Can't use cached object: wrong type" ) ; } return null ; } | Returns cached item and removes it from cache |
14,630 | public void addOtherSFields ( ) { super . addOtherSFields ( ) ; UserInfo recUserInfo = ( UserInfo ) this . getRecord ( UserInfo . USER_INFO_FILE ) ; BaseField field = new StringField ( recUserInfo , "Sub-Domain" , 10 , null , null ) ; field . setVirtual ( true ) ; recUserInfo . addPropertiesFieldBehavior ( field , Menu... | AddOtherSFields Method . |
14,631 | public void setCacheMinutes ( int iMinutes ) { if ( iMinutes == - 1 ) iMinutes = DEFAULT_CACHED_MINUTES ; cacheMinutes = iMinutes ; if ( iMinutes == 0 ) { if ( timerCache != null ) { timerCache . cancel ( ) ; timerCache = null ; this . stopCache ( ) ; } } else { if ( timerCache != null ) { timerCache . cancel ( ) ; } t... | This will set this database to start caching records until they haven t been used for iMinutes minutes . |
14,632 | private synchronized void startCache ( ) { for ( PDatabase pDatabase : m_htDBList . values ( ) ) { for ( PTable pTable : pDatabase . getTableList ( ) . values ( ) ) { this . addTableToCache ( pTable ) ; } } } | This will set this database to start caching records by bumping the use count of all the open tables . |
14,633 | private synchronized void checkCache ( ) { Object [ ] pTables = m_setTableCacheList . toArray ( ) ; for ( Object objTable : pTables ) { PTable pTable = ( PTable ) objTable ; if ( pTable . addPTableOwner ( null ) == 1 ) { long lTimeLastUsed = pTable . getLastUsed ( ) ; long lTimeCurrent = System . currentTimeMillis ( ) ... | Check all the cached tables and flush the old ones . |
14,634 | public void invokeHandler ( OutputStream outputStream ) throws IOException { @ SuppressWarnings ( "unchecked" ) T t = OutputStream . class . equals ( this . streamClass ) ? ( T ) outputStream : Classes . newInstance ( streamClass , outputStream ) ; handle ( t ) ; t . flush ( ) ; t . close ( ) ; } | Helper method used to invoke concrete output stream handler method . Please note that given output stream is closed after handler invocation just before this method return . |
14,635 | public JMenuBar setupStandardMenu ( ActionListener targetAction , boolean bAddHelpMenu ) { Application application = BaseApplet . getSharedInstance ( ) . getApplication ( ) ; ResourceBundle oldResources = application . getResourceBundle ( ) ; application . getResources ( null , true ) ; this . setupActions ( targetActi... | Setup the standard menu items . |
14,636 | public JMenu addHelpMenu ( JMenuBar menuBar ) { Application application = BaseApplet . getSharedInstance ( ) . getApplication ( ) ; ResourceBundle oldResources = application . getResourceBundle ( ) ; application . getResources ( null , true ) ; char [ ] rgchItemShortcuts = new char [ 20 ] ; JMenu menu = this . addMenu ... | Add a standard help menu to this menu bar |
14,637 | public boolean isTablet ( Context context ) { boolean xlarge = ( ( context . getResources ( ) . getConfiguration ( ) . screenLayout & Configuration . SCREENLAYOUT_SIZE_MASK ) == 4 ) ; boolean large = ( ( context . getResources ( ) . getConfiguration ( ) . screenLayout & Configuration . SCREENLAYOUT_SIZE_MASK ) == Confi... | This method is use to determine if the current Android device is a tablet or phone . |
14,638 | public Message receiveMessage ( ) { DualMessageQueue baseMessageQueue = ( DualMessageQueue ) this . getMessageQueue ( ) ; if ( baseMessageQueue == null ) return null ; return baseMessageQueue . getMessageStack ( ) . receiveMessage ( ) ; } | Process the receive message call . Do NOT receive from the remote server ... DO receive from the local queue . The worker thread handle remote receives and adds them to the local queue . |
14,639 | public static boolean isAnnotationPresent ( Class < ? > target , Class < ? extends Annotation > annotation ) { Class < ? > clazz = target ; if ( clazz . isAnnotationPresent ( annotation ) ) { return true ; } while ( ( clazz = clazz . getSuperclass ( ) ) != null ) { if ( clazz . isAnnotationPresent ( annotation ) ) { re... | Returns true if the supplied annotation is present on the target class or any of its super classes . |
14,640 | public static boolean isAnyAnnotationPresent ( Class < ? > target , Class < ? extends Annotation > ... annotations ) { for ( Class < ? extends Annotation > annotationClass : annotations ) { if ( isAnnotationPresent ( target , annotationClass ) ) { return true ; } } return false ; } | Returns true if any of the supplied annotations is present on the target class or any of its super classes . |
14,641 | public static int getAnnotatedParameterIndex ( Method method , Class < ? extends Annotation > annotationClass ) { Annotation [ ] [ ] annotationsForParameters = method . getParameterAnnotations ( ) ; for ( int i = 0 ; i < annotationsForParameters . length ; i ++ ) { Annotation [ ] parameterAnnotations = annotationsForPa... | Returns index of the first parameter with matching annotationClass - 1 if no parameter found with the supplied annotation . |
14,642 | private static boolean hasAnnotation ( Annotation [ ] parameterAnnotations , Class < ? extends Annotation > annotationClass ) { for ( Annotation annotation : parameterAnnotations ) { if ( annotation . annotationType ( ) . equals ( annotationClass ) ) { return true ; } } return false ; } | Returns true if any annotation in parameterAnnotations matches annotationClass . |
14,643 | public String build ( ) { final StringBuilder description = new StringBuilder ( ) ; description . append ( IssueDescriptionUtils . getOccurrencesTableHeader ( ) ) . append ( '\n' ) ; for ( final ErrorOccurrence error : occurrences ) { description . append ( IssueDescriptionUtils . getOccurrencesTableLine ( error ) ) ; ... | Builds the description . |
14,644 | public void setOccurrences ( final List < ErrorOccurrence > pOccurrences ) { occurrences . clear ( ) ; for ( final ErrorOccurrence error : pOccurrences ) { addOccurrence ( error ) ; } } | Sets the list of occurrences for this bug . |
14,645 | public static < D > String toJsonString ( D dataObject ) { try { return jsonMapper . writeValueAsString ( dataObject ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnNull ( log , e , "toJsonString" , dataObject ) ; } } | To json string string . |
14,646 | public static List < Map < String , Object > > toMapList ( String jsonMapListString ) { return withJsonString ( jsonMapListString , LIST_MAP_TYPE_REFERENCE ) ; } | To map list list . |
14,647 | public static < T > T withRestOrClasspathOrFilePath ( String resourceRestUrlOrClasspathOrFilePath , TypeReference < T > typeReference ) { return withJsonString ( JMRestfulResource . getStringWithRestOrClasspathOrFilePath ( resourceRestUrlOrClasspathOrFilePath ) , typeReference ) ; } | With rest or classpath or file path t . |
14,648 | public static < T > T withRestOrFilePathOrClasspath ( String resourceRestOrFilePathOrClasspath , TypeReference < T > typeReference ) { return withJsonString ( JMRestfulResource . getStringWithRestOrFilePathOrClasspath ( resourceRestOrFilePathOrClasspath ) , typeReference ) ; } | With rest or file path or classpath t . |
14,649 | public static < T > T withClasspathOrFilePath ( String resourceClasspathOrFilePath , TypeReference < T > typeReference ) { return withJsonString ( JMResources . getStringWithClasspathOrFilePath ( resourceClasspathOrFilePath ) , typeReference ) ; } | With classpath or file path t . |
14,650 | public static < T > T withFilePathOrClasspath ( String resourceFilePathOrClasspath , TypeReference < T > typeReference ) { return withJsonString ( JMResources . getStringWithFilePathOrClasspath ( resourceFilePathOrClasspath ) , typeReference ) ; } | With file path or classpath t . |
14,651 | public static < T > Map < String , Object > transformToMap ( T object ) { return transform ( object , MAP_TYPE_REFERENCE ) ; } | Transform to map map . |
14,652 | public static String toPrettyJsonString ( Object object ) { try { return jsonMapper . writerWithDefaultPrettyPrinter ( ) . writeValueAsString ( object ) ; } catch ( JsonProcessingException e ) { return JMExceptionManager . handleExceptionAndReturnNull ( log , e , "toPrettyJsonString" , object ) ; } } | To pretty json string string . |
14,653 | public static void modifyFile ( Path inFilePath , Path outFilePath , FileChangable modifier ) throws IOException { try ( BufferedReader bufferedReader = new BufferedReader ( new FileReader ( inFilePath . toFile ( ) ) ) ; Writer writer = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( outFilePath . ... | Modifies the input file line by line and writes the modification in the new output file |
14,654 | public int getRawRecordData ( Rec record ) { int iErrorCode = super . getRawRecordData ( record ) ; this . getRawFieldData ( record . getField ( UserInfo . USER_NAME ) ) ; this . getRawFieldData ( record . getField ( UserInfo . PASSWORD ) ) ; return iErrorCode ; } | Move the map values to the correct record fields . If this method is used is must be overidden to move the correct fields . |
14,655 | private static Folder getOrCreateFolder ( final Folder parentFolder , final String folderName ) throws IOException { Folder childFolder = null ; ItemIterable < CmisObject > children = parentFolder . getChildren ( ) ; if ( children . iterator ( ) . hasNext ( ) ) { for ( CmisObject cmisObject : children ) { if ( cmisObje... | look for a child folder of the parent folder if not found create it and return it . |
14,656 | private static String utf8inputStream2String ( final InputStream inputStream ) throws IOException { StringBuilder stringBuilder = new StringBuilder ( ) ; try ( BufferedReader bufferedReader = new BufferedReader ( new InputStreamReader ( inputStream , StandardCharsets . UTF_8 ) ) ) { String line = null ; while ( ( line ... | convert InputStream to String |
14,657 | public ImageIcon getHeaderIcon ( ) { return org . jbundle . thin . base . screen . BaseApplet . getSharedInstance ( ) . loadImageIcon ( "tour/buttons/Meal.gif" , "Meal" ) ; } | Get the icon for a meal . |
14,658 | public boolean existsAnyBroker ( ) { boolean result = false ; synchronized ( this . brokerDetails ) { Iterator < PerBrokerInfo > iter = this . brokerDetails . values ( ) . iterator ( ) ; while ( ( ! result ) && ( iter . hasNext ( ) ) ) { result = iter . next ( ) . exists ; } } return result ; } | Determine if this destination currently is known to exist on any broker registered for the destination . |
14,659 | public boolean existsOnBroker ( String brokerId ) { boolean result = false ; PerBrokerInfo info ; synchronized ( this . brokerDetails ) { info = this . brokerDetails . get ( brokerId ) ; } if ( ( info != null ) && ( info . exists ) ) { result = true ; } return result ; } | Determine whether this destination exists on the broker with the given ID . |
14,660 | public char getDefaultJava ( String strBrowser , String strOS ) { char chJavaLaunch = 'A' ; if ( "safari" . equalsIgnoreCase ( strBrowser ) ) chJavaLaunch = 'W' ; return chJavaLaunch ; } | Get best way to launch java |
14,661 | public ScreenModel checkSecurity ( ScreenModel screen , ScreenModel parentScreen ) { int iErrorCode = DBConstants . NORMAL_RETURN ; if ( screen != null ) iErrorCode = ( ( BaseScreen ) screen ) . checkSecurity ( ) ; if ( iErrorCode == Constants . READ_ACCESS ) { ( ( BaseScreen ) screen ) . setEditing ( false ) ; ( ( Bas... | Make sure I am allowed access to this screen . |
14,662 | public void changeParameters ( ) { String string = null ; String strPreferences = this . getProperty ( DBParams . PREFERENCES ) ; boolean bSetDefault = true ; if ( ( strPreferences == null ) || ( strPreferences . length ( ) == 0 ) ) bSetDefault = false ; Application application = ( BaseApplication ) this . getTask ( ) ... | Change the session parameters . |
14,663 | public void setValidators ( final Iterable < Validator < ? > > validators ) { this . validators . clear ( ) ; for ( final Validator < ? > validator : validators ) { this . validators . put ( validator . getSupportedClass ( ) , validator ) ; } } | Set the validators used by the service . This will clear any existing validators . This method is thread safe . |
14,664 | public ScreenParent makeScreen ( ScreenLoc itsLocation , ComponentParent parentScreen , int iDocMode , Map < String , Object > properties ) { ScreenParent screen = null ; if ( ( iDocMode & ScreenConstants . MAINT_MODE ) == ScreenConstants . MAINT_MODE ) screen = Record . makeNewScreen ( SCREEN_IN_SCREEN_CLASS , itsLoca... | Make a default screen . |
14,665 | public static int getFlattenedItemsCount ( final Object ... items ) { return stream ( items ) . map ( item -> item . getClass ( ) . isArray ( ) ? getFlattenedItemsCount ( ( Object [ ] ) item ) : 1 ) . reduce ( 0 , Integer :: sum ) ; } | Returns the total number of non array items held in the specified array recursively descending in every array item . |
14,666 | public static byte [ ] absorbInputStream ( InputStream input ) throws IOException { ByteArrayOutputStream output = null ; try { output = new ByteArrayOutputStream ( ) ; absorbInputStream ( input , output ) ; return output . toByteArray ( ) ; } finally { output . close ( ) ; } } | Reads all bytes from an input stream . |
14,667 | public static < T > T precondition ( T reference , Predicate < T > predicate , Class < ? extends RuntimeException > ex , String msg ) throws RuntimeException { if ( predicate . test ( reference ) ) { return reference ; } final Constructor < ? extends RuntimeException > constructor ; try { constructor = ex . getConstruc... | Test a Predicate against a reference value and if it fails throw a runtime exception with a message . |
14,668 | public static < T > T checkNotNull ( final T reference , final String errorMessage ) { return precondition ( reference , Predicates . < T > notNull ( ) , IllegalArgumentException . class , errorMessage ) ; } | Check that a reference is not null throwing a IllegalArgumentException if it is . |
14,669 | public static String checkNonEmptyString ( final String reference , final String errorMessage ) { return precondition ( reference , Predicates . notEmptyString ( ) , IllegalArgumentException . class , errorMessage ) ; } | Check that a String is not empty after removing whitespace . |
14,670 | public static Class isAssignableTo ( final Class < ? > reference , final Class < ? > toValue , final String message ) { return precondition ( reference , new Predicate < Class > ( ) { public boolean test ( Class testValue ) { return toValue . isAssignableFrom ( testValue ) ; } } , ClassCastException . class , message )... | Check that one class is assignable to another . |
14,671 | public void convertAndWriteXML ( String xml , String path ) { ClassProject classProject = ( ClassProject ) this . getMainRecord ( ) ; Record recProgramControl = this . getRecord ( ProgramControl . PROGRAM_CONTROL_FILE ) ; Model model = ( Model ) this . unmarshalMessage ( xml ) ; String name = model . getName ( ) ; Code... | ConvertAndWriteXML Method . |
14,672 | public String replaceParams ( String xml , CodeType codeType ) { ClassProject classProject = ( ClassProject ) this . getMainRecord ( ) ; Map < String , String > ht = new HashMap < String , String > ( ) ; ht . put ( START + "project" + END , classProject . getField ( ClassProject . NAME ) . toString ( ) ) ; ht . put ( S... | ReplaceParams Method . |
14,673 | public String transferStream ( InputStream in , int size ) { StringBuilder sb = new StringBuilder ( ) ; try { byte [ ] cbuf = new byte [ 1000 ] ; int iLen = Math . max ( size , cbuf . length ) ; while ( ( iLen = in . read ( cbuf , 0 , iLen ) ) > 0 ) { for ( int i = 0 ; i < iLen ; i ++ ) { sb . append ( Character . toCh... | TransferStream Method . |
14,674 | public String marshalObject ( Object message ) { try { IBindingFactory jc = BindingDirectory . getFactory ( Model . class ) ; IMarshallingContext marshaller = jc . createMarshallingContext ( ) ; ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; marshaller . setIndent ( 2 ) ; marshaller . marshalDocument ( mes... | Marshal this object to an XML string |
14,675 | public Object unmarshalMessage ( String xml ) { try { IBindingFactory jc = BindingDirectory . getFactory ( Model . class ) ; IUnmarshallingContext unmarshaller = jc . createUnmarshallingContext ( ) ; Reader inStream = new StringReader ( xml ) ; Object message = unmarshaller . unmarshalDocument ( inStream , BINDING_NAME... | Unmarshal this xml Message to an object . |
14,676 | public Map < String , Object > getHiddenParams ( ) { Map < String , Object > mapParams = super . getHiddenParams ( ) ; if ( this . getTask ( ) instanceof ServletTask ) mapParams = ( ( ServletTask ) this . getTask ( ) ) . getRequestProperties ( ( ( ServletTask ) this . getTask ( ) ) . getServletRequest ( ) , false ) ; m... | Get this screen s hidden params . |
14,677 | public static Header decode ( String header ) { JsonObject json ; try { json = Json . createReader ( new ByteArrayInputStream ( Base64 . getUrlDecoder ( ) . decode ( header ) ) ) . readObject ( ) ; } catch ( JsonException e ) { throw new DecodeException ( "Failed convert to JsonObject" , e ) ; } catch ( IllegalArgument... | Decode the base64 - string to Header . |
14,678 | public static CipherRegistry registerCiphers ( String [ ] ... ciphers ) { for ( String [ ] cipher : ciphers ) { instance . register ( cipher ) ; } return instance ; } | Register multiple ciphers . |
14,679 | public static CipherRegistry registerCiphers ( InputStream source ) { try { if ( source == null ) { throw new IllegalArgumentException ( "Cipher source not found." ) ; } List < String > lines = IOUtils . readLines ( source ) ; int start = - 1 ; int index = 0 ; boolean error = false ; while ( index < lines . size ( ) ) ... | Register one or more ciphers from an input stream . |
14,680 | public String [ ] get ( String key ) { String [ ] cipher = super . get ( key ) ; if ( cipher == null ) { throw new IllegalArgumentException ( "Cipher is unknown." ) ; } return cipher ; } | Override to return default cipher if input is null or throw an exception if the cipher key is not recognized . |
14,681 | public static String buildSubscript ( Iterable < Object > subscripts ) { StringBuilder sb = new StringBuilder ( ) ; for ( Object subscript : subscripts ) { String value = toString ( subscript ) ; if ( value . isEmpty ( ) ) { throw new RuntimeException ( "Null subscript not allowed." ) ; } if ( sb . length ( ) > 0 ) { s... | Converts a list of objects to a string of M subscripts . |
14,682 | public void merge ( final TagRequirements other ) { if ( other != null ) { matchAllOf . addAll ( other . matchAllOf ) ; matchOneOf . addAll ( other . matchOneOf ) ; } } | This method will merge the tag information stored in another TagRequirements object with the tag information stored in this object . |
14,683 | private static boolean isSecure ( String protocol ) throws BugError { if ( HTTP . equalsIgnoreCase ( protocol ) ) { return false ; } else if ( HTTPS . equalsIgnoreCase ( protocol ) ) { return true ; } else { throw new BugError ( "Unsupported protocol |%s| for HTTP transaction." , protocol ) ; } } | Predicate to test if given protocol is secure . |
14,684 | public void writeClass ( String strClassName , CodeType codeType ) { if ( ! this . readThisClass ( strClassName ) ) return ; this . writeHeading ( strClassName , this . getPackage ( codeType ) , codeType ) ; this . writeIncludes ( codeType ) ; if ( m_MethodNameList . size ( ) != 0 ) m_MethodNameList . removeAllElements... | Create the Class for this field . |
14,685 | public boolean readThisClass ( String strClassName ) { try { Record recClassInfo = this . getMainRecord ( ) ; recClassInfo . getField ( ClassInfo . CLASS_NAME ) . setString ( strClassName ) ; recClassInfo . setKeyArea ( ClassInfo . CLASS_NAME_KEY ) ; return recClassInfo . seek ( "=" ) ; } catch ( DBException ex ) { ex ... | Read the class with this name . |
14,686 | public void writeClassInterface ( ) { Record recClassInfo = this . getMainRecord ( ) ; String strClassName = recClassInfo . getField ( ClassInfo . CLASS_NAME ) . getString ( ) ; String strBaseClass = recClassInfo . getField ( ClassInfo . BASE_CLASS_NAME ) . getString ( ) ; String strClassDesc = recClassInfo . getField ... | Start the interface . |
14,687 | public void writeEndCode ( boolean bJavaFile ) { m_StreamOut . setTabs ( - 1 ) ; if ( bJavaFile ) m_StreamOut . writeit ( "\n}" ) ; m_StreamOut . writeit ( "\n" ) ; m_StreamOut . free ( ) ; m_StreamOut = null ; m_IncludeNameList . free ( ) ; m_IncludeNameList = null ; } | Write the end of class code . |
14,688 | public boolean readThisMethod ( String strMethodName ) { Record recClassInfo = this . getMainRecord ( ) ; LogicFile recLogicFile = ( LogicFile ) this . getRecord ( LogicFile . LOGIC_FILE_FILE ) ; try { String strClassName = recClassInfo . getField ( ClassInfo . CLASS_NAME ) . getString ( ) ; recLogicFile . getField ( L... | Read this method . |
14,689 | public void writeDefaultMethodCode ( String strMethodName , String strMethodReturns , String strMethodInterface , String strClassName ) { String strBaseClass , strMethodVariables = DBConstants . BLANK ; Record recClassInfo = this . getMainRecord ( ) ; LogicFile recLogicFile = ( LogicFile ) this . getRecord ( LogicFile ... | No code supplied write default code . |
14,690 | public void writeClassMethods ( CodeType codeType ) { LogicFile recLogicFile = ( LogicFile ) this . getRecord ( LogicFile . LOGIC_FILE_FILE ) ; try { Set < String > methodsIncluded = new HashSet < String > ( ) ; Set < String > methodInterfaces = new HashSet < String > ( ) ; recLogicFile . close ( ) ; while ( recLogicFi... | Write the methods for this class . |
14,691 | public boolean writeTextField ( BaseField textField , String strBaseClass , String strMethodName , String strMethodInterface , String strClassName ) { if ( textField . getString ( ) . length ( ) == 0 ) return false ; String beforeMethodCode ; beforeMethodCode = textField . getString ( ) ; int inher = beforeMethodCode .... | Write this text field out - line by line . |
14,692 | public String fixSQLName ( String strName ) { int index = 0 ; while ( index != - 1 ) { index = strName . indexOf ( ' ' ) ; if ( index != - 1 ) strName = strName . substring ( 0 , index ) + strName . substring ( index + 1 , strName . length ( ) ) ; } return strName ; } | Take out the spaces in the name . |
14,693 | String convertDescToJavaDoc ( String strDesc ) { for ( int i = 0 ; i < strDesc . length ( ) - 1 ; i ++ ) { if ( strDesc . charAt ( i ) == '\n' ) strDesc = strDesc . substring ( 0 , i + 1 ) + " * " + strDesc . substring ( i + 1 ) ; } strDesc = " * " + strDesc ; if ( ! strDesc . endsWith ( "." ) ) strDesc += '.' ; return... | Convert the description to a javadoc compatible description . |
14,694 | public Object getControlValue ( ) { int iIndex = this . getSelectedIndex ( ) ; try { FieldTable table = m_record . getTable ( ) ; if ( m_strIndexValue != null ) if ( iIndex != 0 ) if ( table . get ( iIndex - 1 ) != null ) { FieldInfo field = m_record . getField ( m_strIndexValue ) ; if ( field == null ) field = m_recor... | Get this component s value as an object that FieldInfo can use . |
14,695 | public int valueToIndex ( Object value ) { if ( value != null ) if ( ! ( value instanceof String ) ) value = value . toString ( ) ; if ( ( m_record != null ) && ( m_strIndexValue != null ) ) { try { FieldTable table = m_record . getTable ( ) ; for ( int iIndex = 0 ; ; iIndex ++ ) { if ( table . get ( iIndex ) == null )... | Convert this value to a selection index . |
14,696 | public String callRPC ( String name , boolean async , int timeout , RPCParameters params ) { ensureConnection ( ) ; String version = "" ; String context = connectionParams . getAppid ( ) ; if ( name . contains ( ":" ) ) { String pcs [ ] = StrUtil . split ( name , ":" , 3 , true ) ; name = pcs [ 0 ] ; version = pcs [ 1 ... | Performs a remote procedure call . |
14,697 | private RPCParameters packageParams ( Object ... params ) { if ( params == null ) { return null ; } if ( params . length == 1 && params [ 0 ] instanceof RPCParameters ) { return ( RPCParameters ) params [ 0 ] ; } return new RPCParameters ( params ) ; } | Package parameters for RPC call . If parameters already packaged simply return the package . |
14,698 | public AuthResult authenticate ( String username , String password , String division ) { ensureConnection ( ) ; if ( isAuthenticated ( ) ) { return new AuthResult ( "0" ) ; } String av = username + ";" + password ; List < String > results = callRPCList ( "RGNETBRP AUTH:" + Constants . VERSION , null , connectionParams ... | Request authentication from the server . |
14,699 | protected void init ( String init ) { String [ ] pcs = StrUtil . split ( init , StrUtil . U , 4 ) ; id = StrUtil . toInt ( pcs [ 0 ] ) ; serverCaps . domainName = pcs [ 1 ] ; serverCaps . siteName = pcs [ 2 ] ; userId = StrUtil . toInt ( pcs [ 3 ] ) ; } | Initializes the broker session with information returned by the server . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.