idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
15,600 | public Future < V > queue ( Callable < V > callable ) { return service . executeAsynchronously ( callable , config ) ; } | Invokes runnable asynchronously with respecting circuit logic and cache logic if configured . |
15,601 | public Environment getEnvironment ( ) { Environment env = ( ( BaseApplication ) this . getApplication ( ) ) . getEnvironment ( ) ; if ( env == null ) env = Environment . getEnvironment ( null ) ; return env ; } | Get this task s environment . |
15,602 | public RemoteSendQueue createRemoteSendQueue ( String strQueueName , String strQueueType ) throws RemoteException { MessageManager messageManager = this . getEnvironment ( ) . getMessageManager ( this . getApplication ( ) , true ) ; BaseMessageSender sender = ( BaseMessageSender ) messageManager . getMessageQueue ( str... | Create the remote send queue . |
15,603 | public RemoteReceiveQueue createRemoteReceiveQueue ( String strQueueName , String strQueueType ) throws RemoteException { MessageManager messageManager = this . getEnvironment ( ) . getMessageManager ( this . getApplication ( ) , true ) ; BaseMessageReceiver receiver = ( BaseMessageReceiver ) messageManager . getMessag... | Create the remote receive queue . |
15,604 | public void processMessageTimeout ( String strTrxID ) { MessageLog recMessageLog = ( MessageLog ) this . getMainRecord ( ) ; BaseMessage message = ( BaseMessage ) recMessageLog . createMessage ( strTrxID ) ; String strMessageError = "Message timeout" ; BaseMessage messageReply = ( BaseMessage ) BaseMessageProcessor . p... | ProcessMessageTimeout Method . |
15,605 | public int setString ( String fieldPtr , boolean bDisplayOption , int iMoveMode ) { if ( this . getField ( ) instanceof PropertiesField ) return ( ( PropertiesField ) this . getField ( ) ) . setProperty ( m_strProperty , fieldPtr , bDisplayOption , iMoveMode ) ; return DBConstants . NORMAL_RETURN ; } | Convert and move string to this field . Set this property in the property field . |
15,606 | @ SuppressWarnings ( "unchecked" ) public < T extends Object > T fetchObject ( Class < T > clazz , String id ) { if ( StringUtils . isEmpty ( id ) ) { return null ; } String json = VistAUtil . getBrokerSession ( ) . callRPC ( "RGSER FETCH" , PREFIX + getAlias ( clazz ) , id ) ; return ( T ) JSONUtil . deserialize ( jso... | Fetch an instance of the domain class from the data store . |
15,607 | @ SuppressWarnings ( "unchecked" ) public < T extends Object > List < T > fetchObjects ( Class < T > clazz , String [ ] ids ) { if ( ids == null || ids . length == 0 ) { return Collections . emptyList ( ) ; } String json = VistAUtil . getBrokerSession ( ) . callRPC ( "RGSER FETCH" , PREFIX + getAlias ( clazz ) , ids ) ... | Fetch multiple instances of the domain class from the data store . |
15,608 | public String getAlias ( Class < ? > clazz ) { String alias = JSONUtil . getAlias ( clazz ) ; if ( alias == null ) { try { Class . forName ( clazz . getName ( ) ) ; } catch ( ClassNotFoundException e ) { throw MiscUtil . toUnchecked ( e ) ; } alias = JSONUtil . getAlias ( clazz ) ; } return alias ; } | Returns the alias for the domain class . A domain class will typically register its alias in a static initializer block . If the initial attempt to retrieve an alias fails this method forces the class loader to load the class to ensure that any static initializers are executed and then tries again . |
15,609 | public void writeFieldInit ( ) { String strClassName ; Record recClassInfo = this . getMainRecord ( ) ; strClassName = recClassInfo . getField ( ClassInfo . CLASS_NAME ) . getString ( ) ; if ( this . readThisMethod ( strClassName ) ) this . writeThisMethod ( CodeType . THICK ) ; else this . writeThisMethod ( CodeType .... | Write the field initialize code |
15,610 | public void writeInitField ( ) { Record recLogicFile = this . getRecord ( LogicFile . LOGIC_FILE_FILE ) ; try { String strClassName ; Record recClassInfo = this . getMainRecord ( ) ; FieldData recFieldData = ( FieldData ) this . getRecord ( FieldData . FIELD_DATA_FILE ) ; strClassName = recClassInfo . getField ( ClassI... | Write the field init code |
15,611 | public void setDeviceId ( byte [ ] deviceId ) { if ( deviceId == null ) { throw new RuntimeException ( "Device ID cannot be null." ) ; } if ( deviceId . length != DEVICE_ID_SIZE ) { throw new RuntimeException ( String . format ( "Device ID must be %d bytes long." , Integer . valueOf ( DEVICE_ID_SIZE ) ) ) ; } this . de... | Sets the device identifier for the transmitter referenced in this sample . |
15,612 | public void setReceiverId ( byte [ ] receiverId ) { if ( receiverId == null ) { throw new RuntimeException ( "Receiver ID cannot be null." ) ; } if ( receiverId . length != DEVICE_ID_SIZE ) { throw new RuntimeException ( String . format ( "Receiver ID must be %d bytes long." , Integer . valueOf ( DEVICE_ID_SIZE ) ) ) ;... | Sets the device identifier for the receiver referenced in this sample . |
15,613 | public static EightyPath toRealPath ( Path path ) { if ( ! ( path instanceof EightyPath ) ) { throw new IllegalArgumentException ( path + " should be EightyPath" ) ; } EightyPath eightyPath = ( EightyPath ) path ; if ( eightyPath . knownReal ( ) ) { return eightyPath ; } return new RealPath ( eightyPath ) . to ( ) ; } | toRealPath follow links |
15,614 | public void init ( BaseField field , ScreenComponent screenField , BaseField fldTarget ) { super . init ( field ) ; m_screenField = screenField ; m_fldTarget = fldTarget ; m_bScreenMove = true ; m_bInitMove = false ; m_bReadMove = false ; if ( screenField == null ) this . lookupSField ( ) ; } | Constructor . This listener only responds to screen moves by default . |
15,615 | public int fieldChanged ( boolean bDisplayOption , int iMoveMode ) { if ( m_screenField == null ) this . lookupSField ( ) ; if ( m_bChangeIfNull != null ) { if ( ( m_bChangeIfNull . booleanValue ( ) ) && ( ! this . getOwner ( ) . isNull ( ) ) ) return DBConstants . NORMAL_RETURN ; if ( ( ! m_bChangeIfNull . booleanValu... | The Field has Changed . Change to focus to the target field . |
15,616 | public Vector < LogMessage > getLogMessages ( ) { final Vector < LogMessage > output = new Vector < LogMessage > ( ) ; for ( final LogMessage msg : messages ) { if ( msg . getType ( ) == LogMessage . Type . DEBUG ) { if ( msg . getDebugLevel ( ) <= debugLevel ) { output . add ( msg ) ; } } else { output . add ( msg ) ;... | Gets the log messages and ignores message that are higher then the debug level |
15,617 | public void refresh ( ) throws IOException { if ( Files . exists ( file ) ) { fine ( "%s exist" , file ) ; writeLock . lock ( ) ; try { finer ( "start update(%s)" , file ) ; update ( file ) ; finer ( "end update(%s)" , file ) ; } finally { writeLock . unlock ( ) ; } FileTime lmt = Files . getLastModifiedTime ( file ) ;... | Call to refresh the file . During the call consumer is called at least once . |
15,618 | private List getResources ( ZipFile file , String root ) { List resourceNames = new ArrayList ( ) ; Enumeration e = file . entries ( ) ; while ( e . hasMoreElements ( ) ) { ZipEntry entry = ( ZipEntry ) e . nextElement ( ) ; String name = entry . getName ( ) ; if ( name . startsWith ( root ) && ! ( name . indexOf ( '/'... | Returns a list of file resources contained in the specified directory within a given Zip d archive file . |
15,619 | public String getMessage ( ) { String message = super . getMessage ( ) ; if ( m_iErrorCode != - 1 ) message = message + " Error code: " + m_iErrorCode ; return message ; } | Returns the detail message string of this throwable . |
15,620 | public static void encodeSingle ( final int input , final byte [ ] output , final int outoff ) { if ( output == null ) { throw new NullPointerException ( "output" ) ; } if ( outoff < 0 ) { throw new IllegalArgumentException ( "outoff(" + outoff + ") < 0" ) ; } if ( outoff >= output . length - 1 ) { throw new IllegalArg... | Encodes a single octet into two hex chars . |
15,621 | public static void encodeSingle ( final byte [ ] input , final int inoff , final byte [ ] output , final int outoff ) { if ( input == null ) { throw new NullPointerException ( "input" ) ; } if ( inoff < 0 ) { throw new IllegalArgumentException ( "inoff(" + inoff + ") < 0" ) ; } if ( inoff >= input . length ) { throw ne... | Encodes a single octet into two nibbles . |
15,622 | public static byte [ ] encodeMultiple ( final byte [ ] input ) { if ( input == null ) { throw new NullPointerException ( "input" ) ; } final byte [ ] output = new byte [ input . length << 1 ] ; encodeMultiple ( input , 0 , output , 0 , input . length ) ; return output ; } | Encodes given sequence of octets into a sequence of nibbles . |
15,623 | public void addTaskProperties ( Task task ) { if ( task == null ) return ; this . put ( TrxMessageHeader . USER_ID , task . getProperty ( DBParams . USER_ID ) ) ; } | Add the task properties that I will need to start up a process somewhere else with this same environment . |
15,624 | public String getText ( ) { String strText = super . getText ( ) ; if ( strText != null ) if ( strText . equals ( m_strDescription ) ) strText = Constants . BLANK ; return strText ; } | Get text from JTextField . This method factors out the description . |
15,625 | public void setText ( String strText ) { if ( ( strText == null ) || ( strText . length ( ) == 0 ) ) { if ( ! m_bInFocus ) { strText = m_strDescription ; this . changeFont ( true ) ; } } else this . changeFont ( false ) ; super . setText ( strText ) ; } | Set this text component to this text string . This method factors out the description . |
15,626 | public void myFocusLost ( ) { m_bInFocus = false ; String strText = super . getText ( ) ; if ( ( strText == null ) || ( strText . length ( ) == 0 ) ) { if ( m_actionListener != null ) this . removeActionListener ( m_actionListener ) ; this . changeFont ( true ) ; super . setText ( m_strDescription ) ; if ( m_actionList... | Gained the focus . Need to set the description back if this component is empty . |
15,627 | public void changeFont ( boolean bDescription ) { if ( m_fontNormal == null ) { m_fontNormal = this . getFont ( ) ; m_fontDesc = m_fontNormal . deriveFont ( Font . ITALIC ) ; m_colorNormal = this . getForeground ( ) ; m_colorDesc = Color . gray ; } if ( bDescription ) { this . setFont ( m_fontDesc ) ; this . setForegro... | Change the font depending of whether you are displaying the description or text . |
15,628 | public static boolean validate ( InputStream in ) throws IOException { final Map < String , AbstractDataMarshaller < ? > > marshallerMap = generateMarshallerMap ( false , Collections . EMPTY_LIST ) ; marshallerMap . putAll ( generateMarshallerMap ( false , DEFAULT_MARSHALLERS ) ) ; final GZIPInputStream gzipInputStream... | explicitly validates the given xdata stream against the embedded checksum if there is no checksum or the checksum does not correspond to the data then false is returned . Otherwise true is returned . |
15,629 | private static DataNode marshalObject ( Map < String , AbstractDataMarshaller < ? > > marshallerMap , Object object ) { final Class < ? > clazz = object . getClass ( ) ; final AbstractDataMarshaller < Object > serializer = ( AbstractDataMarshaller < Object > ) marshallerMap . get ( clazz . getCanonicalName ( ) ) ; if (... | wraps an deSerializedObject using the data marshaller for that given deSerializedObject |
15,630 | private static boolean serializeElement ( Object element , Deque < SerializationFrame > stack , DataOutputStream dOut , Map < String , AbstractDataMarshaller < ? > > marshallerMap , Map < SerializedObject , SerializedObject > serializedObjects , SerializedObject testSerializedObject , boolean ignoreMissingMarshallers )... | processes one element and either serializes it directly to the stream or pushes a corresponding frame to the stack . |
15,631 | private static void serialize ( Map < String , AbstractDataMarshaller < ? > > marshallerMap , DataOutputStream dOut , DataNode primaryNode , boolean ignoreMissingMarshallers , ProgressListener progressListener ) throws IOException { final Map < SerializedObject , SerializedObject > serializedObjects = new HashMap < > (... | actually serializes the data |
15,632 | private static void serializePrimitive ( DataOutputStream dOut , Object primitive ) throws IOException { if ( primitive == null ) { dOut . writeByte ( VAL_NULL ) ; } else { dOut . writeByte ( VAL_ELEMENT ) ; final Class < ? > resolvedObjectClass = primitive . getClass ( ) ; Serializer < Object > serializer = ( Serializ... | serializes a primitive or null |
15,633 | public static void showMessageDialog ( final Component parentComponent , final Object message ) { execute ( new VoidOptionPane ( ) { public void show ( ) { JOptionPane . showMessageDialog ( parentComponent , message ) ; } } ) ; } | Brings up an information - message dialog titled Message . |
15,634 | public JNDIContentRepositoryBuilder withContextProperty ( final String name , final Object value ) { contextProperties . put ( name , value ) ; return this ; } | Adds a new context property to the environment for the JNDI lookup context |
15,635 | public JNDIContentRepositoryBuilder withSecurityPrincipal ( final String principalName , final String credentials ) { contextProperties . put ( Context . SECURITY_PRINCIPAL , principalName ) ; contextProperties . put ( Context . SECURITY_CREDENTIALS , credentials ) ; return this ; } | Sets the context properties for SECURITY_PRINCIPAL and SECURITY_CREDENTIAL to perform the lookup . This method is a convenience for setting the properties SECURITY_PRINCIPAL and SECURITY_CREDENTIAL on the environment . |
15,636 | public void freeRemoteSession ( ) throws RemoteException { try { if ( m_database . getTableCount ( ) == 0 ) m_database . free ( ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } super . freeRemoteSession ( ) ; } | Free the objects . This method is called from the remote client and frees this session . |
15,637 | public boolean fileMatchesRules ( File file ) { try { if ( file . exists ( ) ) { if ( includeFilesContainingText . length == 0 && excludeFilesContainingText . length == 0 ) { return fileMatchesRules ( getComparableFileName ( file ) ) ; } else { return fileMatchesRules ( getComparableFileName ( file ) , FileSupport . ge... | Checks if file matches rules . |
15,638 | public static final FileSystem newFileSystem ( Path path , Map < String , ? > env ) throws IOException { return getDefault ( ) . provider ( ) . newFileSystem ( path , env ) ; } | Constructs a new FileSystem to access the contents of a file as a file system . |
15,639 | public void process ( ) throws CmdLineException { ProcessingContext context = new ProcessingContext ( ) ; for ( String arg : this . args ) { if ( arg != null && ! context . processPendingOptionAction ( arg ) && ! context . processOptionAction ( arg , this . optionActions ) && ! context . processSwitchAction ( arg , thi... | Processes the command line and invoke the correspond actions . |
15,640 | public static final DenseMatrix64F get141Matrix ( int order ) { if ( order < 2 ) { throw new IllegalArgumentException ( "order has to be at least 2 for 1 4 1 matrix" ) ; } double [ ] data = new double [ order * order ] ; for ( int row = 0 ; row < order ; row ++ ) { for ( int col = 0 ; col < order ; col ++ ) { int index... | Creates a 1 4 1 matrix eg . |4 1 0| |1 4 1| |0 1 4| |
15,641 | public double get ( double x , double epsilon ) { Point nearest = getNearest ( x , epsilon ) ; return nearest . getY ( ) ; } | Returns y for x . This is convenient method . Use getNearest to get exact evaluated point . |
15,642 | public static < S > S loadService ( Class < S > serviceInterface , ClassLoader classLoader ) { Iterator < S > services = ServiceLoader . load ( serviceInterface , classLoader ) . iterator ( ) ; if ( services . hasNext ( ) ) { return services . next ( ) ; } try { String serviceDescriptor = getResourceAsString ( "/servic... | Load service of requested interface using given class loader . Throws exception if service implementation not found on run - time . |
15,643 | public static < S > S loadOptionalService ( Class < S > serviceInterface ) { S service = null ; ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( classLoader != null ) { service = loadService ( serviceInterface , classLoader ) ; } if ( service == null ) { service = loadService ( se... | Load service of requested interface returning null if service provider not found . Caller should test returned value and take appropriate actions . |
15,644 | public static Class < ? > [ ] getParameterTypes ( Object ... arguments ) { Class < ? > [ ] types = new Class < ? > [ arguments . length ] ; for ( int i = 0 ; i < arguments . length ; i ++ ) { Object argument = arguments [ i ] ; if ( argument == null ) { types [ i ] = Object . class ; continue ; } if ( ! ( argument inst... | Get method formal parameter types inferred from actual invocation arguments . This utility is a helper for method discovery when have access to the actual invocation argument but not the formal parameter types list declared by method signature . |
15,645 | private static Object invoke ( Object object , Method method , Object ... arguments ) throws Exception { Throwable cause = null ; try { method . setAccessible ( true ) ; return method . invoke ( object instanceof Class < ? > ? null : object , arguments ) ; } catch ( IllegalAccessException e ) { throw new BugError ( e )... | Do the actual reflexive method invocation . |
15,646 | public static String getCallerMethod ( ) { StackTraceElement [ ] stackTrace = Thread . currentThread ( ) . getStackTrace ( ) ; if ( stackTrace . length == 0 ) { return "unknown" ; } final StackTraceElement e = stackTrace [ 0 ] ; return Strings . concat ( e . getClassName ( ) , '#' , e . getMethodName ( ) , ':' , e . ge... | Get source line for the caller method . |
15,647 | public static Field getOptionalField ( Class < ? > clazz , String fieldName ) { try { Field field = clazz . getDeclaredField ( fieldName ) ; field . setAccessible ( true ) ; return field ; } catch ( NoSuchFieldException expectable ) { } catch ( SecurityException e ) { throw new BugError ( e ) ; } return null ; } | Get class field or null if not found . Try to get named class field and returns null if not found ; this method does not throw any exception . |
15,648 | public static < T > T getOptionalFieldValue ( Object object , String fieldName , Class < T > ... fieldType ) { Class < ? > clazz = null ; if ( object instanceof Class < ? > ) { clazz = ( Class < ? > ) object ; object = null ; } else { clazz = object . getClass ( ) ; } return getFieldValue ( object , clazz , fieldName ,... | Get optional field value from instance or class . Retrieve named field value from given instance or class ; if field is missing return null . Note that this method does not throw exceptions . Also if optional desired field type is present and named field is of different type returns null . |
15,649 | public static < T > T getFieldValue ( Object object , Class < ? > clazz , String fieldName ) { return getFieldValue ( object , clazz , fieldName , null , false ) ; } | Get instance field value declared into superclass . Retrieve inherited field value from given instance throwing exception if field is not declared into superclass . |
15,650 | public static void setFieldValue ( Object object , Class < ? > clazz , String fieldName , Object value ) { Field field = getField ( clazz , fieldName ) ; if ( object == null ^ Modifier . isStatic ( field . getModifiers ( ) ) ) { throw new BugError ( "Cannot access static field |%s| from instance |%s|." , fieldName , cl... | Set instance field declared into superclass . Try to set field value throwing exception if field is not declared into superclass ; if field is static object instance should be null . |
15,651 | private static URL getResource ( String name , ClassLoader [ ] classLoaders ) { for ( ClassLoader classLoader : classLoaders ) { URL url = classLoader . getResource ( name ) ; if ( url == null ) { url = classLoader . getResource ( '/' + name ) ; } if ( url != null ) { return url ; } } return null ; } | Get named resource URL from a list of class loaders . Traverses class loaders in given order searching for requested resource . Return first resource found or null if none found . |
15,652 | private static InputStream getResourceAsStream ( String name , ClassLoader [ ] classLoaders ) { for ( ClassLoader classLoader : classLoaders ) { InputStream stream = classLoader . getResourceAsStream ( name ) ; if ( stream == null ) { stream = classLoader . getResourceAsStream ( '/' + name ) ; } if ( stream != null ) {... | Get named resource input stream from a list of class loaders . Traverses class loaders in given order searching for requested resource . Return first resource found or null if none found . |
15,653 | @ SuppressWarnings ( "unchecked" ) public static < T > T newInstance ( String className , Object ... arguments ) { return ( T ) newInstance ( Classes . forName ( className ) , arguments ) ; } | Create a new instance . Handy utility for hidden classes creation . Constructor accepting given arguments if any must exists . |
15,654 | private static NoSuchBeingException missingConstructorException ( Class < ? > clazz , Object ... arguments ) { Type [ ] types = new Type [ arguments . length ] ; for ( int i = 0 ; i < arguments . length ; ++ i ) { types [ i ] = arguments [ i ] . getClass ( ) ; } return new NoSuchBeingException ( "Missing constructor(%s... | Helper for missing constructor exception . |
15,655 | @ SuppressWarnings ( "unchecked" ) public static < T extends List < ? > > Class < T > getListDefaultImplementation ( Type listType ) { return ( Class < T > ) getImplementation ( LISTS , listType ) ; } | Get default implementation for requested list type . |
15,656 | public static Class < ? > getImplementation ( Map < Class < ? > , Class < ? > > implementationsRegistry , Type interfaceType ) { Class < ? > implementation = implementationsRegistry . get ( interfaceType ) ; if ( implementation == null ) { throw new BugError ( "No registered implementation for type |%s|." , interfaceTy... | Lookup implementation into given registry throwing exception if not found . |
15,657 | @ SuppressWarnings ( "unchecked" ) private static < T > T newRegisteredInstance ( Map < Class < ? > , Class < ? > > implementationsRegistry , Type interfaceType ) throws BugError { Class < ? > implementation = getImplementation ( implementationsRegistry , interfaceType ) ; try { return ( T ) implementation . newInstanc... | Lookup implementation for requested interface into given registry and return a new instance of it . |
15,658 | @ SuppressWarnings ( "unchecked" ) public static < T extends Map < ? , ? > > T newMap ( Type type ) { Class < ? > implementation = MAPS . get ( type ) ; if ( implementation == null ) { throw new BugError ( "No registered implementation for map |%s|." , type ) ; } return ( T ) newInstance ( implementation ) ; } | Create new map of given type . |
15,659 | public static Class < ? > forType ( Type type ) { if ( type instanceof Class ) { return ( Class < ? > ) type ; } if ( type instanceof ParameterizedType ) { return forType ( ( ( ParameterizedType ) type ) . getRawType ( ) ) ; } if ( ! ( type instanceof GenericArrayType ) ) { return null ; } Type componentType = ( ( Gene... | Get the underlying class for a type or null if the type is a variable type . |
15,660 | public synchronized boolean removeLock ( Object bookmark , SessionInfo sessionInfo ) { Utility . getLogger ( ) . info ( "Unlock: " + bookmark + ", Session: " + sessionInfo . m_iSessionID + " success: " + sessionInfo . equals ( this . get ( bookmark ) ) ) ; if ( ! sessionInfo . equals ( this . get ( bookmark ) ) ) retur... | Remove this bookmark from the lock list . |
15,661 | public synchronized boolean unlockAll ( SessionInfo sessionInfo ) { Utility . getLogger ( ) . info ( "Unlock all, Session: " + sessionInfo . m_iSessionID ) ; for ( Object bookmark : this . keySet ( ) ) { SessionInfo thisSession = ( SessionInfo ) this . get ( bookmark ) ; if ( sessionInfo . equals ( thisSession ) ) this... | Unlock all the locks for this session . |
15,662 | @ SuppressWarnings ( "unchecked" ) public < T > T proxy ( final Object delegate , Class < ? > [ ] interfaces ) { return ( T ) Proxy . newProxyInstance ( delegate . getClass ( ) . getClassLoader ( ) , interfaces , new ProxyInvocationHandler ( delegate ) ) ; } | Construct a proxy for which each method is invoked by the execution server . |
15,663 | public void printIt ( Record recLayout , PrintWriter out , int iIndents , String strEnd ) { String strName = recLayout . getField ( Layout . NAME ) . toString ( ) ; String strType = recLayout . getField ( Layout . TYPE ) . toString ( ) ; String strValue = recLayout . getField ( Layout . FIELD_VALUE ) . toString ( ) ; S... | PrintIt Method . |
15,664 | public void println ( PrintWriter out , String string , String strDescription , int iIndents , String strEnd ) { while ( iIndents -- > 0 ) out . print ( "\t" ) ; if ( strEnd != null ) if ( ( strDescription != null ) && ( strDescription . length ( ) > 0 ) ) strEnd = strEnd + "\t\t// " + strDescription ; if ( strEnd != n... | Println Method . |
15,665 | public void addService ( TDefinitions descriptionType ) { String interfacens ; String interfacename ; QName qname ; String name ; if ( soapFactory == null ) soapFactory = new org . xmlsoap . schemas . wsdl . soap . ObjectFactory ( ) ; TService service = wsdlFactory . createTService ( ) ; descriptionType . getAnyTopLeve... | AddService Method . |
15,666 | public void addBindingsType ( TDefinitions definitions ) { String interfacens ; String interfacename ; QName qname ; String value ; String name ; if ( soapFactory == null ) soapFactory = new org . xmlsoap . schemas . wsdl . soap . ObjectFactory ( ) ; TBinding binding = wsdlFactory . createTBinding ( ) ; definitions . g... | AddBindingsType Method . |
15,667 | public void addPort ( TDefinitions description ) { TPortType interfaceType = wsdlFactory . createTPortType ( ) ; description . getAnyTopLevelOptionalElement ( ) . add ( interfaceType ) ; String interfaceName = this . getControlProperty ( MessageControl . INTERFACE_NAME ) ; interfaceType . setName ( interfaceName ) ; th... | AddPort Method . |
15,668 | public void addMessageType ( String version , TDefinitions descriptionType , MessageProcessInfo recMessageProcessInfo ) { MessageInfo recMessageInfo = this . getMessageIn ( recMessageProcessInfo ) ; if ( recMessageInfo != null ) { String name = this . fixName ( recMessageInfo . getField ( MessageInfo . DESCRIPTION ) . ... | AddMessageType Method . |
15,669 | public void addMessage ( String version , TDefinitions descriptionType , MessageInfo recMessageInfo ) { TMessage messageType = wsdlFactory . createTMessage ( ) ; descriptionType . getAnyTopLevelOptionalElement ( ) . add ( messageType ) ; String strMessageName = this . fixName ( recMessageInfo . getField ( MessageInfo .... | AddMessage Method . |
15,670 | public boolean isCellEditable ( int iRowIndex , int iColumnIndex ) { FieldList fieldList = this . makeRowCurrent ( iRowIndex , false ) ; if ( fieldList != null ) if ( fieldList . getEditMode ( ) == Constants . EDIT_NONE ) if ( ( m_iLastRecord == RECORD_UNKNOWN ) || ( iRowIndex != m_iLastRecord + 1 ) ) return false ; re... | Is this cell editable . |
15,671 | public void setValueAt ( Object aValue , int iRowIndex , int iColumnIndex ) { try { this . updateIfNewRow ( iRowIndex ) ; boolean bPhysicallyLockRecord = true ; if ( this . getFieldInfo ( iColumnIndex ) == null ) bPhysicallyLockRecord = false ; FieldList fieldList = this . makeRowCurrent ( iRowIndex , bPhysicallyLockRe... | Set the value at this location . |
15,672 | public BaseBuffer cacheCurrentLockedData ( int iRowIndex , FieldList fieldList ) { int iColumnCount = this . getColumnCount ( ) ; if ( ( m_buffCurrentLockedData == null ) || ( m_iCurrentLockedRowIndex != iRowIndex ) ) m_buffCurrentLockedData = new VectorBuffer ( null , BaseBuffer . ALL_FIELDS ) ; m_buffCurrentLockedDat... | Get the array of changed values for the current row . I use a standard field buffer and append all the screen items which are not included in the field . |
15,673 | public void restoreCurrentRecord ( FieldList fieldList ) { m_buffCurrentLockedData . bufferToFields ( fieldList , Constants . DONT_DISPLAY , Constants . READ_MOVE ) ; int iColumnCount = this . getColumnCount ( ) ; for ( int i = 0 ; i < iColumnCount ; i ++ ) { Field field = null ; if ( this . getFieldInfo ( i ) != null ... | Restore this fieldlist with items from the input cache . I use a standard field buffer and append all the screen items which are not included in the field . |
15,674 | public boolean setColumnValue ( int iColumnIndex , Object value , boolean bDisplay , int iMoveMode ) { Convert fieldInfo = this . getFieldInfo ( iColumnIndex ) ; if ( fieldInfo != null ) { Object dataBefore = fieldInfo . getData ( ) ; if ( ! ( value instanceof String ) ) fieldInfo . setData ( value , bDisplay , iMoveMo... | Set the value at the field at the column . Since this is only used by the restore current record method pass dont_display and read_move when you set the data . This is NOT a TableModel override this is my method . |
15,675 | public Object getValueAt ( int iRowIndex , int iColumnIndex ) { int iEditMode = Constants . EDIT_NONE ; try { if ( iRowIndex >= 0 ) { FieldList fieldList = this . makeRowCurrent ( iRowIndex , false ) ; if ( fieldList != null ) iEditMode = fieldList . getEditMode ( ) ; } } catch ( Exception ex ) { ex . printStackTrace (... | Get the value at this location . |
15,676 | public Object getColumnValue ( int iColumnIndex , int iEditMode ) { Convert fieldInfo = this . getFieldInfo ( iColumnIndex ) ; if ( fieldInfo != null ) return fieldInfo . getString ( ) ; return Constants . BLANK ; } | Get the value of the field at the column . This is NOT a TableModel override this is my method . |
15,677 | public void removeTableModelListener ( TableModelListener l ) { try { this . updateIfNewRow ( - 1 ) ; } catch ( DBException ex ) { ex . printStackTrace ( ) ; } super . removeTableModelListener ( l ) ; } | This is called when the model is no longer need by the JTable so update any current record . |
15,678 | public void resetTheModel ( ) { this . setRowCount ( START_ROWS ) ; m_iLastRecord = RECORD_UNKNOWN ; m_iLargestValidRecord = - 1 ; this . setCurrentRow ( - 1 ) ; m_iCurrentLockedRowIndex = - 1 ; this . fireTableChanged ( new TableModelEvent ( this ) ) ; } | The underlying query changed reset the model . |
15,679 | public void updateIfNewRow ( int iRowIndex ) throws DBException { if ( ( m_iCurrentLockedRowIndex != - 1 ) && ( m_iCurrentLockedRowIndex != iRowIndex ) ) if ( m_buffCurrentLockedData != null ) { { FieldList fieldList = this . makeRowCurrent ( m_iCurrentLockedRowIndex , false ) ; if ( this . isRecordChanged ( ) ) { sync... | Update the currently updated record if the row is different from this row . |
15,680 | public void addMouseListenerToHeaderInTable ( JTable table ) { table . setColumnSelectionAllowed ( false ) ; MouseListener mouseListener = new MouseAdapter ( ) { public void mouseClicked ( MouseEvent e ) { if ( e . getSource ( ) instanceof JTableHeader ) { JTableHeader tableHeader = ( JTableHeader ) e . getSource ( ) ;... | There is no - where else to put this . Add a mouse listener to the Table to trigger a table sort when a column heading is clicked in the JTable . |
15,681 | public void setSortedByColumn ( JTableHeader tableHeader , int iViewColumn , boolean bOrder ) { if ( ! ( tableHeader . getDefaultRenderer ( ) instanceof SortableHeaderRenderer ) ) tableHeader . setDefaultRenderer ( new SortableHeaderRenderer ( tableHeader . getDefaultRenderer ( ) ) ) ; ( ( SortableHeaderRenderer ) tabl... | Change the tableheader to display this sort column and order . |
15,682 | public boolean displayError ( Exception ex , Component panel ) { if ( panel != null ) { BaseApplet baseApplet = null ; if ( panel instanceof BaseApplet ) baseApplet = ( BaseApplet ) panel ; else { while ( ( panel = panel . getParent ( ) ) != null ) { if ( panel instanceof org . jbundle . thin . base . screen . JBasePan... | Displayed this error code . |
15,683 | public SessionFactory provide ( ) { logger . trace ( "Creating hibernate session factory." ) ; SessionFactory factory = new MetadataSources ( serviceRegistry ) . buildMetadata ( ) . buildSessionFactory ( ) ; injectEventListeners ( ( ( SessionFactoryImpl ) factory ) . getServiceRegistry ( ) ) ; return factory ; } | Provide a singleton instance of the hibernate session factory . |
15,684 | public void dispose ( final SessionFactory sessionFactory ) { if ( sessionFactory != null && ! sessionFactory . isClosed ( ) ) { logger . info ( "Disposing of hibernate session factory." ) ; sessionFactory . close ( ) ; } } | Dispose of the hibernate session . |
15,685 | private void injectEventListeners ( final ServiceRegistry registry ) { EventListenerRegistry eventRegistry = registry . getService ( EventListenerRegistry . class ) ; List < PostInsertEventListener > postInsertEvents = locator . getAllServices ( PostInsertEventListener . class ) ; for ( PostInsertEventListener piEventL... | This method automatically adds discovered hibernate event listeners into the hibernate service registry . |
15,686 | private void checkDescriptionVersion ( final Issue pIssue ) throws IssueParseException { final Matcher m = DESCRIPTION_VERSION_PATTERN . matcher ( pIssue . getDescription ( ) ) ; final int version ; if ( m . find ( ) ) { version = Integer . parseInt ( m . group ( 1 ) ) ; } else { version = 1 ; } if ( IssueDescriptionUt... | Checks the description version tag . |
15,687 | private String getStacktraceMD5 ( final Issue pIssue ) throws IssueParseException { final int stackCfId = ConfigurationManager . getInstance ( ) . CHILIPROJECT_STACKTRACE_MD5_CF_ID ; final Predicate findStacktraceMD5 = new CustomFieldIdPredicate ( stackCfId ) ; final CustomField field = ( CustomField ) CollectionUtils ... | Extracts the stacktrace MD5 custom field value from the issue . |
15,688 | private String parseStacktrace ( final String pDescription , final String pStacktraceMD5 ) throws IssueParseException { String stacktrace = null ; final String start = "<pre class=\"javastacktrace\">" ; final String qStart = Pattern . quote ( start ) ; final String end = "</pre>" ; final String qEnd = Pattern . quote (... | Extracts the bug stacktrace from the description . |
15,689 | public void init ( ServletConfig config ) throws ServletException { World world ; String str ; try { world = World . create ( ) ; configure ( world , "http" ) ; configure ( world , "https" ) ; str = config . getInitParameter ( "docroot" ) ; docroot = Application . file ( world , str != null ? str : config . getServletC... | creates configuration . |
15,690 | public static final < T > Stream < T > breadthFirst ( T root , Function < ? super T , ? extends Stream < T > > edges ) { return BreadthFirst . stream ( root , edges ) ; } | Returns stream for graph nodes starting with root . Function edges returns stream for each node containing nodes edges . Traversal is in breadth first order . |
15,691 | public static final < T > Stream < T > diGraph ( T root , Function < ? super T , ? extends Stream < T > > edges ) { return DiGraphIterator . stream ( root , edges ) ; } | Returns stream for graph nodes starting with root . Function edges returns stream for each node containing nodes edges . |
15,692 | public User withId ( final long id ) { return new User ( id , username , displayName , slug , email , createTimestamp , url , metadata ) ; } | Creates a user with a new id . |
15,693 | public User withMetadata ( final List < Meta > metadata ) { return new User ( id , username , displayName , slug , email , createTimestamp , url , metadata ) ; } | Creates a user with added metadata . |
15,694 | public static LinkedBindingBuilder < HttpClientObserver > bindNewObserver ( final Binder binder , final Annotation annotation ) { return Multibinder . newSetBinder ( binder , HttpClientObserver . class , annotation ) . addBinding ( ) ; } | Register a HttpClientObserver which observes only requests from a HttpClient with the given Guice binding annotation . |
15,695 | public static int findAvailablePort ( int maxRetries ) { int retries = 0 ; int randomPort ; boolean portAvailable ; do { randomPort = randomPort ( ) ; portAvailable = isPortAvailable ( randomPort ) ; retries ++ ; } while ( retries <= maxRetries && ! portAvailable ) ; assumeTrue ( "no open port found" , portAvailable ) ... | Finds an available port . |
15,696 | public static boolean isPortAvailable ( final int port ) { try ( ServerSocket tcp = new ServerSocket ( port ) ; DatagramSocket udp = new DatagramSocket ( port ) ) { return tcp . isBound ( ) && udp . isBound ( ) ; } catch ( Exception e ) { return false ; } } | Checks if the specified is available as listen port . |
15,697 | public Receiver open ( Receiver receiver ) { this . receiver = receiver ; Runtime rt = Runtime . getRuntime ( ) ; try { proc = rt . exec ( commandArray , null , workingDir ) ; } catch ( IOException e ) { throw new RuntimeException ( "can not start command shell [" + ArraySupport . format ( commandArray , "," ) + "] + i... | Opens permanent shell |
15,698 | public static int execute ( String [ ] commandArray , String [ ] alternativeEnvVars , File workingDir , Receiver outputReceiver ) throws IOException { Runtime rt = Runtime . getRuntime ( ) ; Process proc = null ; try { proc = rt . exec ( commandArray , alternativeEnvVars , workingDir ) ; } catch ( Exception e ) { Syste... | execute particular command |
15,699 | public static void main ( String [ ] args ) { StdIODialog dialog = new StdIODialog ( System . in , System . out , new CommandShell ( new String [ ] { "cmd.exe" } , new File ( "./" ) ) ) ; try { dialog . open ( ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } } | Runs test dialog . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.